From 391c8992d1ecb81414dc2d433aa5c1ec9a18dbd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20M=C3=BChleisen?= Date: Wed, 22 May 2024 09:49:41 +0200 Subject: [PATCH 1/3] update vendored sources to 0.10.3 --- CMakeLists.txt | 4 +- src/duckdb/extension/icu/icu_extension.cpp | 59 +- .../extension/icu/include/icu_extension.hpp | 1 + .../icu/third_party/icu/i18n/basictz.cpp | 10 +- .../extension/json/include/json_common.hpp | 7 +- .../extension/json/include/json_executors.hpp | 10 +- .../extension/json/include/json_extension.hpp | 1 + .../extension/json/include/json_functions.hpp | 4 +- .../json/include/json_serializer.hpp | 4 +- src/duckdb/extension/json/json_common.cpp | 112 +- src/duckdb/extension/json/json_extension.cpp | 8 + src/duckdb/extension/json/json_functions.cpp | 7 +- .../json/json_functions/copy_json.cpp | 33 +- .../json/json_functions/json_create.cpp | 4 +- .../json/json_functions/json_structure.cpp | 31 +- .../json/json_functions/json_transform.cpp | 4 + .../json/json_functions/json_type.cpp | 4 +- .../json/json_functions/read_json.cpp | 25 +- .../json/json_functions/read_json_objects.cpp | 19 +- src/duckdb/extension/json/json_scan.cpp | 32 +- .../extension/parquet/column_reader.cpp | 14 +- .../extension/parquet/column_writer.cpp | 49 +- .../parquet/include/column_writer.hpp | 1 + .../parquet/include/null_column_reader.hpp | 54 + .../parquet/include/parquet_extension.hpp | 1 + .../parquet/include/parquet_reader.hpp | 2 +- .../parquet/include/parquet_writer.hpp | 9 +- .../include/templated_column_reader.hpp | 7 +- .../extension/parquet/parquet_crypto.cpp | 14 +- .../extension/parquet/parquet_extension.cpp | 397 +- .../extension/parquet/parquet_metadata.cpp | 76 +- .../extension/parquet/parquet_reader.cpp | 11 +- .../extension/parquet/parquet_statistics.cpp | 9 +- .../extension/parquet/parquet_writer.cpp | 57 +- .../extension/parquet/serialize_parquet.cpp | 4 +- src/duckdb/src/catalog/catalog.cpp | 58 +- src/duckdb/src/catalog/catalog_entry.cpp | 7 + .../catalog_entry/duck_index_entry.cpp | 12 +- .../catalog_entry/duck_schema_entry.cpp | 78 +- .../catalog_entry/duck_table_entry.cpp | 136 +- .../catalog_entry/index_catalog_entry.cpp | 6 +- .../catalog_entry/macro_catalog_entry.cpp | 4 + .../catalog_entry/schema_catalog_entry.cpp | 7 + .../catalog_entry/sequence_catalog_entry.cpp | 5 +- .../catalog_entry/table_catalog_entry.cpp | 51 +- .../catalog_entry/type_catalog_entry.cpp | 8 +- .../catalog_entry/view_catalog_entry.cpp | 6 +- .../src/catalog/catalog_entry_retriever.cpp | 64 + src/duckdb/src/catalog/catalog_set.cpp | 49 +- .../src/catalog/default/default_functions.cpp | 3 +- .../src/catalog/default/default_views.cpp | 2 +- src/duckdb/src/catalog/dependency_manager.cpp | 138 +- src/duckdb/src/catalog/duck_catalog.cpp | 5 + .../src/common/adbc/nanoarrow/allocator.cpp | 4 +- .../src/common/adbc/nanoarrow/metadata.cpp | 6 +- .../src/common/adbc/nanoarrow/schema.cpp | 13 +- src/duckdb/src/common/allocator.cpp | 8 +- .../src/common/arrow/appender/bool_data.cpp | 1 + .../src/common/arrow/appender/struct_data.cpp | 2 +- .../src/common/arrow/appender/union_data.cpp | 3 +- .../src/common/arrow/arrow_appender.cpp | 12 +- .../src/common/arrow/arrow_converter.cpp | 8 +- src/duckdb/src/common/arrow/arrow_wrapper.cpp | 2 +- src/duckdb/src/common/box_renderer.cpp | 9 +- .../src/common/compressed_file_system.cpp | 18 +- src/duckdb/src/common/enum_util.cpp | 247 +- .../common/enums/logical_operator_type.cpp | 2 + .../common/enums/physical_operator_type.cpp | 2 + src/duckdb/src/common/enums/relation_type.cpp | 2 + .../src/common/enums/statement_type.cpp | 2 + src/duckdb/src/common/error_data.cpp | 12 + .../src/common/exception_format_value.cpp | 1 + src/duckdb/src/common/extra_type_info.cpp | 94 +- src/duckdb/src/common/file_system.cpp | 46 +- src/duckdb/src/common/gzip_file_system.cpp | 52 +- src/duckdb/src/common/hive_partitioning.cpp | 104 +- src/duckdb/src/common/http_state.cpp | 8 +- src/duckdb/src/common/local_file_system.cpp | 41 +- src/duckdb/src/common/multi_file_list.cpp | 285 + src/duckdb/src/common/multi_file_reader.cpp | 192 +- .../src/common/operator/cast_operators.cpp | 252 +- .../src/common/operator/string_cast.cpp | 27 +- src/duckdb/src/common/pipe_file_system.cpp | 5 +- .../src/common/progress_bar/progress_bar.cpp | 2 +- src/duckdb/src/common/random_engine.cpp | 3 +- src/duckdb/src/common/re2_regex.cpp | 10 +- .../common/row_operations/row_aggregate.cpp | 20 +- .../common/row_operations/row_external.cpp | 7 +- .../common/row_operations/row_heap_gather.cpp | 8 +- .../row_operations/row_heap_scatter.cpp | 21 +- .../row_operations/row_radix_scatter.cpp | 2 +- .../serializer/buffered_file_reader.cpp | 8 +- .../serializer/buffered_file_writer.cpp | 17 +- .../src/common/serializer/memory_stream.cpp | 9 +- .../src/common/serializer/serializer.cpp | 2 +- src/duckdb/src/common/sort/comparators.cpp | 2 +- src/duckdb/src/common/sort/merge_sorter.cpp | 4 +- .../src/common/sort/partition_state.cpp | 12 +- src/duckdb/src/common/sort/radix_sort.cpp | 2 +- src/duckdb/src/common/sort/sort_state.cpp | 6 +- src/duckdb/src/common/sort/sorted_block.cpp | 10 +- src/duckdb/src/common/string_util.cpp | 231 +- src/duckdb/src/common/types.cpp | 142 +- src/duckdb/src/common/types/bit.cpp | 2 +- src/duckdb/src/common/types/blob.cpp | 6 +- src/duckdb/src/common/types/cast_helpers.cpp | 197 + .../types/column/column_data_collection.cpp | 26 +- .../column/column_data_collection_segment.cpp | 2 +- .../types/column/partitioned_column_data.cpp | 18 +- src/duckdb/src/common/types/conflict_info.cpp | 2 +- .../src/common/types/conflict_manager.cpp | 2 +- src/duckdb/src/common/types/data_chunk.cpp | 2 +- src/duckdb/src/common/types/date.cpp | 4 +- src/duckdb/src/common/types/decimal.cpp | 24 +- src/duckdb/src/common/types/hash.cpp | 2 +- src/duckdb/src/common/types/hugeint.cpp | 19 +- .../types/row/partitioned_tuple_data.cpp | 8 +- .../types/row/row_data_collection_scanner.cpp | 11 +- .../common/types/row/tuple_data_allocator.cpp | 39 +- .../types/row/tuple_data_collection.cpp | 4 +- .../common/types/row/tuple_data_segment.cpp | 7 + src/duckdb/src/common/types/string_heap.cpp | 4 + src/duckdb/src/common/types/timestamp.cpp | 24 +- src/duckdb/src/common/types/uhugeint.cpp | 2 +- src/duckdb/src/common/types/uuid.cpp | 13 +- src/duckdb/src/common/types/value.cpp | 84 +- src/duckdb/src/common/types/vector.cpp | 167 +- src/duckdb/src/common/types/vector_buffer.cpp | 4 + src/duckdb/src/common/types/vector_cache.cpp | 6 +- .../common/vector_operations/generators.cpp | 20 +- .../vector_operations/is_distinct_from.cpp | 20 + .../vector_operations/null_operations.cpp | 2 +- .../numeric_inplace_operators.cpp | 4 +- .../aggregate/distributive/approx_count.cpp | 2 +- .../aggregate/distributive/arg_min_max.cpp | 19 +- .../aggregate/distributive/bitagg.cpp | 13 +- .../aggregate/distributive/bitstring_agg.cpp | 4 +- .../aggregate/distributive/sum.cpp | 4 +- .../holistic/approximate_quantile.cpp | 2 + .../aggregate/holistic/mode.cpp | 4 +- .../aggregate/holistic/quantile.cpp | 13 +- .../aggregate/holistic/reservoir_quantile.cpp | 22 +- .../src/core_functions/function_list.cpp | 3 +- .../src/core_functions/lambda_functions.cpp | 4 +- .../scalar/array/array_functions.cpp | 5 + .../core_functions/scalar/bit/bitstring.cpp | 8 +- .../scalar/blob/create_sort_key.cpp | 5 +- .../core_functions/scalar/date/date_part.cpp | 4 +- .../src/core_functions/scalar/date/epoch.cpp | 17 + .../core_functions/scalar/date/strftime.cpp | 2 +- .../scalar/date/to_interval.cpp | 19 + .../scalar/debug/vector_type.cpp | 11 +- .../scalar/generic/current_setting.cpp | 5 +- .../scalar/generic/system_functions.cpp | 4 +- .../scalar/list/array_slice.cpp | 51 +- .../scalar/list/list_reduce.cpp | 2 +- .../core_functions/scalar/list/list_sort.cpp | 6 +- .../core_functions/scalar/list/list_value.cpp | 2 +- .../src/core_functions/scalar/list/range.cpp | 4 +- .../src/core_functions/scalar/map/map.cpp | 58 +- .../core_functions/scalar/map/map_concat.cpp | 21 +- .../core_functions/scalar/map/map_entries.cpp | 43 +- .../core_functions/scalar/map/map_extract.cpp | 37 +- .../scalar/map/map_keys_values.cpp | 20 +- .../core_functions/scalar/math/numeric.cpp | 4 +- .../scalar/operators/bitwise.cpp | 4 +- .../core_functions/scalar/random/setseed.cpp | 2 +- .../src/core_functions/scalar/string/bar.cpp | 2 +- .../src/core_functions/scalar/string/chr.cpp | 4 +- .../src/core_functions/scalar/string/hex.cpp | 26 +- .../core_functions/scalar/string/instr.cpp | 2 +- .../src/core_functions/scalar/string/pad.cpp | 16 +- .../core_functions/scalar/string/repeat.cpp | 22 +- .../scalar/string/string_split.cpp | 2 +- .../core_functions/scalar/string/to_base.cpp | 2 +- .../scalar/string/translate.cpp | 8 +- .../src/core_functions/scalar/string/trim.cpp | 22 +- .../core_functions/scalar/string/unicode.cpp | 2 +- src/duckdb/src/execution/adaptive_filter.cpp | 2 +- .../src/execution/aggregate_hashtable.cpp | 25 +- src/duckdb/src/execution/index/art/art.cpp | 12 +- .../src/execution/index/bound_index.cpp | 115 + .../src/execution/index/unbound_index.cpp | 30 + src/duckdb/src/execution/join_hashtable.cpp | 3 +- .../operator/aggregate/aggregate_object.cpp | 2 +- .../aggregate/distinct_aggregate_data.cpp | 2 +- .../aggregate/physical_hash_aggregate.cpp | 6 +- .../aggregate/physical_streaming_window.cpp | 45 +- .../physical_ungrouped_aggregate.cpp | 4 +- .../operator/aggregate/physical_window.cpp | 19 +- .../csv_scanner/buffer_manager/csv_buffer.cpp | 8 +- .../buffer_manager/csv_buffer_manager.cpp | 14 +- .../buffer_manager/csv_file_handle.cpp | 3 +- .../csv_scanner/scanner/base_scanner.cpp | 26 +- .../scanner/column_count_scanner.cpp | 2 +- .../scanner/string_value_scanner.cpp | 572 +- .../csv_scanner/sniffer/csv_sniffer.cpp | 4 +- .../csv_scanner/sniffer/dialect_detection.cpp | 61 +- .../csv_scanner/sniffer/header_detection.cpp | 37 +- .../csv_scanner/sniffer/type_detection.cpp | 255 +- .../table_function/csv_file_scanner.cpp | 49 +- .../table_function/global_csv_state.cpp | 24 +- .../operator/csv_scanner/util/csv_error.cpp | 14 +- .../csv_scanner/util/csv_reader_options.cpp | 53 +- .../helper/physical_buffered_collector.cpp | 2 +- .../operator/helper/physical_execute.cpp | 2 +- .../operator/helper/physical_load.cpp | 26 +- .../helper/physical_reservoir_sample.cpp | 2 +- .../helper/physical_update_extensions.cpp | 57 + .../helper/physical_verify_vector.cpp | 21 +- .../operator/join/physical_asof_join.cpp | 4 +- .../operator/join/physical_hash_join.cpp | 18 +- .../operator/join/physical_iejoin.cpp | 8 +- .../join/physical_left_delim_join.cpp | 2 +- .../join/physical_piecewise_merge_join.cpp | 4 +- .../operator/join/physical_range_join.cpp | 4 +- .../operator/order/physical_order.cpp | 5 +- .../physical_batch_copy_to_file.cpp | 8 +- .../persistent/physical_batch_insert.cpp | 33 +- .../persistent/physical_copy_to_file.cpp | 130 +- .../operator/persistent/physical_delete.cpp | 25 +- .../operator/persistent/physical_export.cpp | 100 +- .../operator/persistent/physical_insert.cpp | 74 +- .../operator/persistent/physical_update.cpp | 43 +- .../operator/projection/physical_unnest.cpp | 3 + .../scan/physical_column_data_scan.cpp | 5 +- .../scan/physical_expression_scan.cpp | 29 +- .../operator/schema/physical_attach.cpp | 2 +- .../schema/physical_create_art_index.cpp | 18 +- .../operator/set/physical_recursive_cte.cpp | 2 +- .../execution/perfect_aggregate_hashtable.cpp | 9 +- .../src/execution/physical_operator.cpp | 4 +- .../physical_plan/plan_column_data_get.cpp | 6 +- .../physical_plan/plan_comparison_join.cpp | 2 +- .../physical_plan/plan_create_table.cpp | 4 +- .../src/execution/physical_plan/plan_cte.cpp | 2 +- .../execution/physical_plan/plan_delete.cpp | 4 +- .../physical_plan/plan_delim_get.cpp | 4 +- .../execution/physical_plan/plan_distinct.cpp | 1 + .../physical_plan/plan_expression_get.cpp | 9 +- .../execution/physical_plan/plan_insert.cpp | 11 +- .../physical_plan/plan_recursive_cte.cpp | 2 +- .../execution/physical_plan/plan_simple.cpp | 4 + .../execution/physical_plan/plan_top_n.cpp | 4 +- .../execution/physical_plan/plan_update.cpp | 6 +- .../execution/physical_plan/plan_window.cpp | 25 +- .../src/execution/physical_plan_generator.cpp | 3 + .../execution/radix_partitioned_hashtable.cpp | 71 +- src/duckdb/src/execution/reservoir_sample.cpp | 73 +- src/duckdb/src/execution/window_executor.cpp | 78 +- .../src/execution/window_segment_tree.cpp | 7 +- .../function/aggregate/distributive/first.cpp | 2 +- src/duckdb/src/function/cast/string_cast.cpp | 6 +- src/duckdb/src/function/cast_rules.cpp | 1 + src/duckdb/src/function/function.cpp | 4 +- src/duckdb/src/function/function_binder.cpp | 13 +- .../src/function/pragma/pragma_functions.cpp | 3 +- .../src/function/pragma/pragma_queries.cpp | 7 +- .../compress_string.cpp | 2 +- .../src/function/scalar/list/list_extract.cpp | 5 +- .../src/function/scalar/list/list_resize.cpp | 2 +- .../src/function/scalar/list/list_select.cpp | 15 +- .../src/function/scalar/list/list_zip.cpp | 4 +- .../src/function/scalar/operators/add.cpp | 28 +- .../src/function/scalar/sequence/nextval.cpp | 125 +- .../src/function/scalar/strftime_format.cpp | 100 +- .../function/scalar/string/caseconvert.cpp | 24 +- .../src/function/scalar/string/contains.cpp | 4 +- .../src/function/scalar/string/length.cpp | 18 +- .../string/regexp/regexp_extract_all.cpp | 4 +- .../function/scalar/string/strip_accents.cpp | 3 +- .../src/function/scalar/string/substring.cpp | 20 +- .../function/scalar/struct/struct_extract.cpp | 4 +- src/duckdb/src/function/scalar_function.cpp | 3 +- src/duckdb/src/function/table/arrow.cpp | 22 +- .../src/function/table/arrow_conversion.cpp | 154 +- src/duckdb/src/function/table/copy_csv.cpp | 122 +- src/duckdb/src/function/table/glob.cpp | 26 +- src/duckdb/src/function/table/read_csv.cpp | 51 +- src/duckdb/src/function/table/read_file.cpp | 8 +- src/duckdb/src/function/table/repeat.cpp | 6 +- src/duckdb/src/function/table/repeat_row.cpp | 2 +- src/duckdb/src/function/table/sniff_csv.cpp | 12 +- .../function/table/system/duckdb_columns.cpp | 6 +- .../table/system/duckdb_constraints.cpp | 47 +- .../table/system/duckdb_databases.cpp | 7 +- .../table/system/duckdb_dependencies.cpp | 4 +- .../table/system/duckdb_extensions.cpp | 54 +- .../table/system/duckdb_functions.cpp | 10 +- .../function/table/system/duckdb_indexes.cpp | 13 +- .../function/table/system/duckdb_memory.cpp | 4 +- .../function/table/system/duckdb_schemas.cpp | 9 +- .../table/system/duckdb_sequences.cpp | 11 +- .../function/table/system/duckdb_tables.cpp | 28 +- .../table/system/duckdb_temporary_files.cpp | 2 +- .../function/table/system/duckdb_types.cpp | 17 +- .../function/table/system/duckdb_views.cpp | 13 +- .../table/system/duckdb_which_secret.cpp | 75 + .../table/system/pragma_database_size.cpp | 8 +- .../table/system/pragma_metadata_info.cpp | 6 +- .../table/system/pragma_storage_info.cpp | 12 +- .../src/function/table/system_functions.cpp | 1 + src/duckdb/src/function/table/table_scan.cpp | 31 +- src/duckdb/src/function/table/unnest.cpp | 2 +- .../function/table/version/pragma_version.cpp | 6 +- src/duckdb/src/function/table_function.cpp | 9 +- src/duckdb/src/include/duckdb.h | 26 +- .../src/include/duckdb/catalog/catalog.hpp | 11 +- .../include/duckdb/catalog/catalog_entry.hpp | 4 + .../catalog_entry/duck_index_entry.hpp | 2 +- .../catalog_entry/duck_schema_entry.hpp | 4 +- .../catalog_entry/duck_table_entry.hpp | 14 +- .../catalog/catalog_entry/function_entry.hpp | 1 + .../catalog_entry/schema_catalog_entry.hpp | 5 +- .../catalog_entry/sequence_catalog_entry.hpp | 7 +- .../catalog_entry/table_catalog_entry.hpp | 7 +- .../catalog_entry/type_catalog_entry.hpp | 2 + .../catalog/catalog_entry_retriever.hpp | 72 + .../duckdb/catalog/catalog_transaction.hpp | 3 + .../src/include/duckdb/catalog/dependency.hpp | 4 + .../duckdb/catalog/dependency_list.hpp | 8 +- .../duckdb/catalog/dependency_manager.hpp | 4 +- .../include/duckdb/catalog/standard_entry.hpp | 2 + .../common/arrow/appender/append_data.hpp | 1 + .../common/arrow/appender/enum_data.hpp | 6 +- .../duckdb/common/arrow/appender/map_data.hpp | 2 +- .../common/arrow/appender/scalar_data.hpp | 15 + .../common/arrow/appender/varchar_data.hpp | 5 +- .../src/include/duckdb/common/bit_utils.hpp | 161 +- .../src/include/duckdb/common/bitpacking.hpp | 8 +- .../src/include/duckdb/common/constants.hpp | 2 + .../duckdb/common/enable_shared_from_this.ipp | 42 + .../src/include/duckdb/common/enum_util.hpp | 46 +- .../duckdb/common/enums/checkpoint_type.hpp | 38 + .../common/enums/logical_operator_type.hpp | 1 + .../common/enums/physical_operator_type.hpp | 1 + .../duckdb/common/enums/relation_type.hpp | 1 + .../duckdb/common/enums/scan_options.hpp | 4 +- .../duckdb/common/enums/scan_vector_type.hpp | 17 + .../duckdb/common/enums/statement_type.hpp | 1 + .../duckdb/common/enums/tableref_type.hpp | 3 +- .../duckdb/common/enums/undo_flags.hpp | 3 +- .../src/include/duckdb/common/exception.hpp | 1 - .../include/duckdb/common/extra_type_info.hpp | 16 +- .../src/include/duckdb/common/file_opener.hpp | 4 + .../src/include/duckdb/common/file_system.hpp | 3 + .../duckdb/common/gzip_file_system.hpp | 3 + .../src/include/duckdb/common/helper.hpp | 23 +- .../duckdb/common/hive_partitioning.hpp | 20 +- .../src/include/duckdb/common/http_state.hpp | 2 +- .../common/insertion_order_preserving_map.hpp | 129 + .../include/duckdb/common/multi_file_list.hpp | 151 + .../duckdb/common/multi_file_reader.hpp | 188 +- .../common/multi_file_reader_options.hpp | 10 +- .../include/duckdb/common/numeric_utils.hpp | 3 + .../include/duckdb/common/operator/add.hpp | 2 + .../operator/decimal_cast_operators.hpp | 233 + .../common/operator/integer_cast_operator.hpp | 9 +- .../duckdb/common/operator/numeric_cast.hpp | 4 +- .../include/duckdb/common/optional_ptr.hpp | 5 + .../duckdb/common/optionally_owned_ptr.hpp | 91 + .../src/include/duckdb/common/platform.h | 7 +- .../src/include/duckdb/common/radix.hpp | 16 +- .../src/include/duckdb/common/re2_regex.hpp | 5 +- .../common/row_operations/row_operations.hpp | 2 + .../common/serializer/binary_deserializer.hpp | 3 +- .../common/serializer/binary_serializer.hpp | 14 +- .../duckdb/common/serializer/deserializer.hpp | 36 + .../serializer/serialization_traits.hpp | 65 + .../duckdb/common/serializer/serializer.hpp | 58 +- .../src/include/duckdb/common/shared_ptr.hpp | 39 +- .../src/include/duckdb/common/shared_ptr.ipp | 268 + .../duckdb/common/sort/duckdb_pdqsort.hpp | 6 +- .../src/include/duckdb/common/string.hpp | 5 +- .../src/include/duckdb/common/string_util.hpp | 18 +- .../src/include/duckdb/common/types.hpp | 16 +- .../src/include/duckdb/common/types/bit.hpp | 2 +- .../duckdb/common/types/cast_helpers.hpp | 258 +- .../include/duckdb/common/types/datetime.hpp | 47 +- .../src/include/duckdb/common/types/hash.hpp | 2 +- .../common/types/row/tuple_data_segment.hpp | 8 +- .../duckdb/common/types/selection_vector.hpp | 2 +- .../duckdb/common/types/string_type.hpp | 2 + .../include/duckdb/common/types/timestamp.hpp | 2 + .../duckdb/common/types/validity_mask.hpp | 2 +- .../src/include/duckdb/common/types/value.hpp | 4 + .../include/duckdb/common/types/vector.hpp | 35 +- .../src/include/duckdb/common/unique_ptr.hpp | 13 +- .../src/include/duckdb/common/vector.hpp | 11 + .../src/include/duckdb/common/vector_size.hpp | 2 +- .../src/include/duckdb/common/weak_ptr.ipp | 117 + .../core_functions/aggregate/sum_helpers.hpp | 6 +- .../core_functions/scalar/date_functions.hpp | 18 + .../duckdb/execution/adaptive_filter.hpp | 1 + .../duckdb/execution/expression_executor.hpp | 2 +- .../duckdb/execution/index/art/art.hpp | 8 +- .../duckdb/execution/index/art/node.hpp | 2 +- .../duckdb/execution/index/bound_index.hpp | 145 + .../duckdb/execution/index/index_type.hpp | 4 +- .../duckdb/execution/index/unbound_index.hpp | 63 + .../duckdb/execution/merge_sort_tree.hpp | 42 +- .../aggregate/physical_streaming_window.hpp | 2 + .../operator/aggregate/physical_window.hpp | 2 + .../operator/csv_scanner/base_scanner.hpp | 13 +- .../csv_scanner/column_count_scanner.hpp | 1 + .../operator/csv_scanner/csv_error.hpp | 12 +- .../csv_scanner/csv_reader_options.hpp | 13 +- .../operator/csv_scanner/csv_sniffer.hpp | 28 +- .../csv_scanner/string_value_scanner.hpp | 110 +- .../helper/physical_update_extensions.hpp | 52 + .../persistent/physical_batch_insert.hpp | 4 +- .../operator/persistent/physical_delete.hpp | 10 +- .../operator/persistent/physical_export.hpp | 1 + .../operator/persistent/physical_insert.hpp | 13 +- .../operator/persistent/physical_update.hpp | 5 +- .../scan/physical_column_data_scan.hpp | 9 +- .../scan/physical_expression_scan.hpp | 8 +- .../execution/operator/set/physical_cte.hpp | 2 +- .../operator/set/physical_recursive_cte.hpp | 2 +- .../execution/physical_plan_generator.hpp | 2 +- .../duckdb/execution/reservoir_sample.hpp | 71 +- .../src/include/duckdb/function/function.hpp | 5 - .../duckdb/function/function_binder.hpp | 9 +- .../duckdb/function/replacement_scan.hpp | 27 +- .../include/duckdb/function/scalar/regexp.hpp | 2 +- .../function/scalar/sequence_functions.hpp | 7 +- .../function/scalar/strftime_format.hpp | 5 + .../function/scalar/string_functions.hpp | 2 +- .../duckdb/function/scalar_function.hpp | 13 + .../include/duckdb/function/table/arrow.hpp | 10 +- .../duckdb/function/table/read_csv.hpp | 3 + .../function/table/system_functions.hpp | 4 + .../duckdb/function/table_function.hpp | 17 +- .../include/duckdb/logging/http_logger.hpp | 81 + .../src/include/duckdb/main/appender.hpp | 4 +- .../include/duckdb/main/attached_database.hpp | 2 +- .../main/buffered_data/buffered_data.hpp | 1 + .../include/duckdb/main/capi/cast/generic.hpp | 4 +- .../src/include/duckdb/main/client_config.hpp | 8 + .../include/duckdb/main/client_context.hpp | 20 +- .../duckdb/main/client_context_state.hpp | 12 +- .../duckdb/main/client_context_wrapper.hpp | 27 + .../src/include/duckdb/main/client_data.hpp | 4 + src/duckdb/src/include/duckdb/main/config.hpp | 39 +- .../duckdb/main/connection_manager.hpp | 24 +- .../src/include/duckdb/main/database.hpp | 45 +- .../src/include/duckdb/main/extension.hpp | 25 + .../include/duckdb/main/extension_entries.hpp | 165 +- .../include/duckdb/main/extension_helper.hpp | 91 +- .../duckdb/main/extension_install_info.hpp | 89 + .../include/duckdb/main/extension_util.hpp | 4 +- .../duckdb/main/external_dependencies.hpp | 50 +- .../duckdb/main/materialized_query_result.hpp | 3 + .../src/include/duckdb/main/relation.hpp | 11 +- .../main/relation/materialized_relation.hpp | 35 + .../duckdb/main/relation/query_relation.hpp | 2 +- .../main/relation/table_function_relation.hpp | 4 +- .../duckdb/main/relation/table_relation.hpp | 2 +- .../duckdb/main/relation/value_relation.hpp | 6 +- .../duckdb/main/relation/view_relation.hpp | 2 +- .../src/include/duckdb/main/settings.hpp | 47 + .../duckdb/optimizer/filter_pushdown.hpp | 8 +- .../optimizer/join_order/cost_model.hpp | 2 +- .../duckdb/optimizer/join_order/join_node.hpp | 23 +- .../join_order/join_order_optimizer.hpp | 51 - .../optimizer/join_order/plan_enumerator.hpp | 27 +- .../join_order/query_graph_manager.hpp | 12 +- .../duckdb/optimizer/matcher/set_matcher.hpp | 3 +- .../duckdb/optimizer/optimizer_extension.hpp | 12 +- .../include/duckdb/optimizer/rule/list.hpp | 1 + .../optimizer/rule/timestamp_comparison.hpp | 30 + .../src/include/duckdb/parallel/event.hpp | 2 +- .../src/include/duckdb/parallel/interrupt.hpp | 1 + .../include/duckdb/parallel/meta_pipeline.hpp | 2 +- .../src/include/duckdb/parallel/pipeline.hpp | 2 +- .../src/include/duckdb/parallel/task.hpp | 2 +- .../include/duckdb/parser/base_expression.hpp | 2 +- .../duckdb/parser/column_definition.hpp | 2 + .../duckdb/parser/parsed_data/alter_info.hpp | 1 + .../alter_scalar_function_info.hpp | 1 + .../parsed_data/alter_table_function_info.hpp | 1 + .../parser/parsed_data/alter_table_info.hpp | 12 + .../duckdb/parser/parsed_data/attach_info.hpp | 1 + .../parsed_data/comment_on_column_info.hpp | 4 +- .../duckdb/parser/parsed_data/copy_info.hpp | 22 +- .../duckdb/parser/parsed_data/create_info.hpp | 8 +- .../parser/parsed_data/create_schema_info.hpp | 33 +- .../parsed_data/create_sequence_info.hpp | 2 + .../parser/parsed_data/create_type_info.hpp | 13 +- .../parser/parsed_data/create_view_info.hpp | 1 + .../duckdb/parser/parsed_data/detach_info.hpp | 1 + .../duckdb/parser/parsed_data/drop_info.hpp | 1 + .../parsed_data/exported_table_data.hpp | 7 +- .../duckdb/parser/parsed_data/load_info.hpp | 11 +- .../duckdb/parser/parsed_data/parse_info.hpp | 8 +- .../duckdb/parser/parsed_data/pragma_info.hpp | 13 +- .../parser/parsed_data/transaction_info.hpp | 2 + .../parsed_data/update_extensions_info.hpp | 36 + .../duckdb/parser/parsed_data/vacuum_info.hpp | 1 + .../duckdb/parser/parser_extension.hpp | 1 + .../src/include/duckdb/parser/query_node.hpp | 4 +- .../include/duckdb/parser/sql_statement.hpp | 5 +- .../parser/statement/alter_statement.hpp | 1 + .../parser/statement/attach_statement.hpp | 1 + .../parser/statement/call_statement.hpp | 1 + .../statement/copy_database_statement.hpp | 3 +- .../parser/statement/copy_statement.hpp | 4 +- .../parser/statement/detach_statement.hpp | 1 + .../parser/statement/drop_statement.hpp | 1 + .../parser/statement/execute_statement.hpp | 1 + .../parser/statement/explain_statement.hpp | 1 + .../parser/statement/export_statement.hpp | 1 + .../parser/statement/extension_statement.hpp | 1 + .../parser/statement/insert_statement.hpp | 1 + .../include/duckdb/parser/statement/list.hpp | 1 + .../parser/statement/load_statement.hpp | 1 + .../statement/logical_plan_statement.hpp | 3 + .../parser/statement/multi_statement.hpp | 1 + .../parser/statement/pragma_statement.hpp | 1 + .../parser/statement/prepare_statement.hpp | 1 + .../parser/statement/relation_statement.hpp | 1 + .../parser/statement/select_statement.hpp | 1 + .../duckdb/parser/statement/set_statement.hpp | 10 +- .../statement/transaction_statement.hpp | 1 + .../statement/update_extensions_statement.hpp | 36 + .../parser/statement/vacuum_statement.hpp | 1 + .../src/include/duckdb/parser/tableref.hpp | 3 + .../parser/tableref/column_data_ref.hpp | 46 + .../include/duckdb/parser/tableref/list.hpp | 1 + .../parser/tableref/table_function_ref.hpp | 4 - .../src/include/duckdb/parser/tokens.hpp | 2 + .../src/include/duckdb/parser/transformer.hpp | 5 + .../include/duckdb/planner/bind_context.hpp | 8 +- .../src/include/duckdb/planner/binder.hpp | 58 +- .../include/duckdb/planner/bound_tokens.hpp | 1 + .../duckdb/planner/expression_binder.hpp | 5 + .../expression_binder/alter_binder.hpp | 13 +- .../expression_binder/having_binder.hpp | 3 +- .../expression_binder/index_binder.hpp | 6 +- .../duckdb/planner/logical_operator.hpp | 1 - .../operator/logical_column_data_get.hpp | 8 +- .../planner/operator/logical_delete.hpp | 2 + .../planner/operator/logical_export.hpp | 7 + .../planner/operator/logical_insert.hpp | 2 + .../duckdb/planner/operator/logical_top_n.hpp | 6 +- .../planner/operator/logical_update.hpp | 2 + .../parsed_data/bound_create_table_info.hpp | 4 - .../include/duckdb/planner/table_binding.hpp | 8 +- .../tableref/bound_column_data_ref.hpp | 30 + .../include/duckdb/planner/tableref/list.hpp | 1 + .../duckdb/storage/buffer/block_handle.hpp | 9 +- .../duckdb/storage/buffer/buffer_pool.hpp | 23 +- .../include/duckdb/storage/buffer_manager.hpp | 18 +- .../storage/checkpoint/row_group_writer.hpp | 17 +- .../storage/checkpoint/table_data_writer.hpp | 2 + .../duckdb/storage/checkpoint_manager.hpp | 39 +- .../storage/compression/alp/algorithm/alp.hpp | 15 +- .../storage/compression/alp/alp_compress.hpp | 4 +- .../storage/compression/alp/alp_constants.hpp | 9 +- .../storage/compression/alp/alp_fetch.hpp | 2 +- .../storage/compression/alp/alp_utils.hpp | 6 +- .../compression/alprd/algorithm/alprd.hpp | 3 +- .../compression/alprd/alprd_analyze.hpp | 8 +- .../compression/alprd/alprd_compress.hpp | 4 +- .../storage/compression/alprd/alprd_fetch.hpp | 2 +- .../chimp/algorithm/bit_reader.hpp | 2 +- .../storage/compression/chimp/chimp_fetch.hpp | 2 +- .../storage/compression/patas/patas_fetch.hpp | 2 +- .../src/include/duckdb/storage/data_table.hpp | 71 +- .../src/include/duckdb/storage/index.hpp | 130 +- .../include/duckdb/storage/object_cache.hpp | 6 +- .../duckdb/storage/optimistic_data_writer.hpp | 2 +- .../duckdb/storage/partial_block_manager.hpp | 6 +- .../storage/standard_buffer_manager.hpp | 31 +- .../include/duckdb/storage/storage_info.hpp | 9 +- .../include/duckdb/storage/storage_lock.hpp | 30 +- .../duckdb/storage/storage_manager.hpp | 35 +- .../duckdb/storage/string_uncompressed.hpp | 5 +- .../duckdb/storage/table/append_state.hpp | 12 + .../storage/table/array_column_data.hpp | 9 +- .../duckdb/storage/table/column_data.hpp | 39 +- .../duckdb/storage/table/column_segment.hpp | 3 +- .../duckdb/storage/table/data_table_info.hpp | 38 +- .../duckdb/storage/table/delete_state.hpp | 23 + .../duckdb/storage/table/list_column_data.hpp | 9 +- .../duckdb/storage/table/row_group.hpp | 17 +- .../storage/table/row_group_collection.hpp | 5 +- .../duckdb/storage/table/scan_state.hpp | 4 + .../duckdb/storage/table/segment_tree.hpp | 10 +- .../storage/table/standard_column_data.hpp | 12 +- .../storage/table/struct_column_data.hpp | 9 +- .../duckdb/storage/table/table_index_list.hpp | 26 +- .../duckdb/storage/table/table_statistics.hpp | 7 +- .../duckdb/storage/table/update_state.hpp | 20 + .../storage/table/validity_column_data.hpp | 1 + .../duckdb/storage/temporary_file_manager.hpp | 24 +- .../duckdb/storage/write_ahead_log.hpp | 15 +- .../duckdb/transaction/duck_transaction.hpp | 23 +- .../transaction/duck_transaction_manager.hpp | 37 +- .../duckdb/transaction/local_storage.hpp | 13 +- .../duckdb/transaction/meta_transaction.hpp | 1 + .../duckdb/transaction/transaction.hpp | 8 + .../duckdb/transaction/undo_buffer.hpp | 10 +- src/duckdb/src/main/appender.cpp | 4 +- src/duckdb/src/main/attached_database.cpp | 8 +- src/duckdb/src/main/capi/appender-c.cpp | 7 +- src/duckdb/src/main/capi/arrow-c.cpp | 8 +- src/duckdb/src/main/capi/helper-c.cpp | 6 +- .../src/main/capi/replacement_scan-c.cpp | 11 +- src/duckdb/src/main/capi/result-c.cpp | 24 +- src/duckdb/src/main/capi/table_function-c.cpp | 2 +- src/duckdb/src/main/client_context.cpp | 55 +- .../src/main/client_context_file_opener.cpp | 31 + .../src/main/client_context_wrapper.cpp | 22 + src/duckdb/src/main/client_data.cpp | 8 +- src/duckdb/src/main/config.cpp | 73 +- src/duckdb/src/main/connection.cpp | 21 +- src/duckdb/src/main/connection_manager.cpp | 32 +- src/duckdb/src/main/database.cpp | 56 +- src/duckdb/src/main/db_instance_cache.cpp | 2 +- src/duckdb/src/main/extension.cpp | 56 + .../src/main/extension/extension_helper.cpp | 413 +- .../src/main/extension/extension_install.cpp | 386 +- .../src/main/extension/extension_load.cpp | 272 +- .../src/main/extension/extension_util.cpp | 10 +- .../src/main/extension_install_info.cpp | 116 + .../src/main/materialized_query_result.cpp | 11 + src/duckdb/src/main/query_profiler.cpp | 2 +- src/duckdb/src/main/relation.cpp | 68 +- .../main/relation/create_view_relation.cpp | 6 + .../main/relation/materialized_relation.cpp | 58 + .../src/main/relation/query_relation.cpp | 21 +- .../src/main/relation/read_csv_relation.cpp | 8 +- .../src/main/relation/table_relation.cpp | 8 +- .../src/main/relation/value_relation.cpp | 4 +- .../src/main/relation/view_relation.cpp | 2 +- .../src/main/relation/write_csv_relation.cpp | 2 +- .../main/relation/write_parquet_relation.cpp | 2 +- src/duckdb/src/main/secret/secret.cpp | 2 +- src/duckdb/src/main/settings/settings.cpp | 148 +- .../optimizer/common_aggregate_optimizer.cpp | 2 +- src/duckdb/src/optimizer/filter_combiner.cpp | 6 +- src/duckdb/src/optimizer/filter_pushdown.cpp | 5 +- .../join_order/cardinality_estimator.cpp | 6 +- .../src/optimizer/join_order/cost_model.cpp | 2 +- .../src/optimizer/join_order/join_node.cpp | 31 +- .../join_order/join_order_optimizer.cpp | 13 +- .../optimizer/join_order/plan_enumerator.cpp | 139 +- .../join_order/query_graph_manager.cpp | 129 +- .../optimizer/join_order/relation_manager.cpp | 6 +- .../join_order/relation_statistics_helper.cpp | 6 +- src/duckdb/src/optimizer/optimizer.cpp | 4 +- .../optimizer/pushdown/pushdown_aggregate.cpp | 4 +- .../pushdown/pushdown_cross_product.cpp | 2 +- .../optimizer/pushdown/pushdown_left_join.cpp | 4 +- .../optimizer/pushdown/pushdown_mark_join.cpp | 12 +- .../pushdown/pushdown_projection.cpp | 2 +- .../pushdown/pushdown_semi_anti_join.cpp | 2 +- .../pushdown/pushdown_set_operation.cpp | 2 +- .../pushdown/pushdown_single_join.cpp | 4 +- .../src/optimizer/remove_duplicate_groups.cpp | 2 +- .../src/optimizer/remove_unused_columns.cpp | 2 +- .../rule/arithmetic_simplification.cpp | 2 +- .../optimizer/rule/case_simplification.cpp | 4 +- .../rule/conjunction_simplification.cpp | 3 +- .../src/optimizer/rule/constant_folding.cpp | 1 + .../src/optimizer/rule/distributivity.cpp | 2 +- .../optimizer/rule/empty_needle_removal.cpp | 1 + .../src/optimizer/rule/enum_comparison.cpp | 1 + .../rule/in_clause_simplification_rule.cpp | 1 + .../rule/ordered_aggregate_optimizer.cpp | 3 +- .../optimizer/rule/timestamp_comparison.cpp | 107 + .../expression/propagate_conjunction.cpp | 2 +- .../expression/propagate_operator.cpp | 8 +- .../statistics/operator/propagate_filter.cpp | 6 +- .../statistics/operator/propagate_get.cpp | 2 +- .../statistics/operator/propagate_join.cpp | 9 +- .../operator/propagate_set_operation.cpp | 3 +- src/duckdb/src/optimizer/topn_optimizer.cpp | 4 +- src/duckdb/src/parallel/executor.cpp | 21 +- src/duckdb/src/parallel/meta_pipeline.cpp | 4 +- src/duckdb/src/parallel/pipeline.cpp | 4 +- src/duckdb/src/parallel/task_scheduler.cpp | 12 +- src/duckdb/src/parser/column_definition.cpp | 1 + .../constraints/foreign_key_constraint.cpp | 16 +- .../src/parser/expression/star_expression.cpp | 4 +- .../alter_scalar_function_info.cpp | 4 + .../parsed_data/alter_table_function_info.cpp | 4 + .../parser/parsed_data/alter_table_info.cpp | 183 + .../src/parser/parsed_data/attach_info.cpp | 23 + .../parsed_data/comment_on_column_info.cpp | 17 +- .../src/parser/parsed_data/copy_info.cpp | 100 + .../parser/parsed_data/create_index_info.cpp | 18 +- .../src/parser/parsed_data/create_info.cpp | 2 + .../parser/parsed_data/create_schema_info.cpp | 40 + .../parsed_data/create_sequence_info.cpp | 22 + .../parser/parsed_data/create_table_info.cpp | 16 +- .../parser/parsed_data/create_type_info.cpp | 51 +- .../parser/parsed_data/create_view_info.cpp | 8 +- .../src/parser/parsed_data/detach_info.cpp | 12 + .../src/parser/parsed_data/drop_info.cpp | 21 + .../src/parser/parsed_data/load_info.cpp | 46 + .../src/parser/parsed_data/parse_info.cpp | 50 + .../src/parser/parsed_data/pragma_info.cpp | 33 + .../parser/parsed_data/transaction_info.cpp | 22 + .../src/parser/parsed_data/vacuum_info.cpp | 20 + .../src/parser/parsed_expression_iterator.cpp | 1 + src/duckdb/src/parser/parser.cpp | 9 +- src/duckdb/src/parser/query_node.cpp | 8 +- .../src/parser/statement/alter_statement.cpp | 4 + .../src/parser/statement/attach_statement.cpp | 4 + .../src/parser/statement/call_statement.cpp | 8 + .../src/parser/statement/copy_statement.cpp | 92 +- .../src/parser/statement/detach_statement.cpp | 4 + .../src/parser/statement/drop_statement.cpp | 4 + .../parser/statement/execute_statement.cpp | 15 + .../parser/statement/explain_statement.cpp | 19 + .../src/parser/statement/export_statement.cpp | 18 + .../parser/statement/extension_statement.cpp | 4 + .../src/parser/statement/load_statement.cpp | 4 + .../src/parser/statement/multi_statement.cpp | 8 + .../src/parser/statement/pragma_statement.cpp | 4 + .../parser/statement/prepare_statement.cpp | 13 + .../parser/statement/relation_statement.cpp | 4 + .../src/parser/statement/set_statement.cpp | 37 +- .../statement/transaction_statement.cpp | 4 + .../statement/update_extensions_statement.cpp | 34 + .../src/parser/statement/vacuum_statement.cpp | 4 + src/duckdb/src/parser/tableref.cpp | 1 + .../src/parser/tableref/column_data_ref.cpp | 81 + .../expression/transform_boolean_test.cpp | 4 +- .../transform/expression/transform_cast.cpp | 2 +- .../expression/transform_interval.cpp | 7 +- .../expression/transform_param_ref.cpp | 2 +- .../transform_positional_reference.cpp | 2 +- .../expression/transform_subquery.cpp | 16 + .../transform/helpers/nodetype_to_string.cpp | 2 + .../transform/helpers/transform_typename.cpp | 160 +- .../statement/transform_checkpoint.cpp | 2 + .../transform/statement/transform_copy.cpp | 2 +- .../transform/statement/transform_load.cpp | 6 +- .../transform/statement/transform_update.cpp | 19 + src/duckdb/src/parser/transformer.cpp | 7 +- src/duckdb/src/planner/bind_context.cpp | 4 +- src/duckdb/src/planner/binder.cpp | 80 +- .../expression/bind_aggregate_expression.cpp | 43 +- .../expression/bind_cast_expression.cpp | 2 +- .../expression/bind_function_expression.cpp | 20 +- .../binder/query_node/bind_select_node.cpp | 2 +- .../planner/binder/query_node/plan_setop.cpp | 37 +- .../binder/query_node/plan_subquery.cpp | 2 - .../planner/binder/statement/bind_attach.cpp | 2 + .../planner/binder/statement/bind_call.cpp | 2 + .../planner/binder/statement/bind_copy.cpp | 10 +- .../binder/statement/bind_copy_database.cpp | 89 +- .../planner/binder/statement/bind_create.cpp | 164 +- .../binder/statement/bind_create_table.cpp | 172 +- .../planner/binder/statement/bind_delete.cpp | 4 + .../planner/binder/statement/bind_detach.cpp | 2 + .../planner/binder/statement/bind_drop.cpp | 2 + .../planner/binder/statement/bind_execute.cpp | 6 +- .../planner/binder/statement/bind_explain.cpp | 2 + .../planner/binder/statement/bind_export.cpp | 19 +- .../binder/statement/bind_extension.cpp | 1 + .../planner/binder/statement/bind_insert.cpp | 6 +- .../planner/binder/statement/bind_load.cpp | 13 + .../binder/statement/bind_logical_plan.cpp | 2 + .../planner/binder/statement/bind_pragma.cpp | 2 + .../planner/binder/statement/bind_prepare.cpp | 1 + .../planner/binder/statement/bind_select.cpp | 1 + .../src/planner/binder/statement/bind_set.cpp | 4 + .../planner/binder/statement/bind_simple.cpp | 10 +- .../planner/binder/statement/bind_update.cpp | 6 +- .../statement/bind_update_extensions.cpp | 28 + .../planner/binder/statement/bind_vacuum.cpp | 2 + .../binder/tableref/bind_basetableref.cpp | 61 +- .../binder/tableref/bind_column_data_ref.cpp | 16 + .../planner/binder/tableref/bind_pivot.cpp | 11 +- .../binder/tableref/bind_table_function.cpp | 54 +- .../binder/tableref/plan_column_data_ref.cpp | 15 + .../src/planner/bound_parameter_map.cpp | 2 +- .../src/planner/bound_result_modifier.cpp | 2 +- .../planner/expression/bound_expression.cpp | 5 +- src/duckdb/src/planner/expression_binder.cpp | 4 + .../expression_binder/alter_binder.cpp | 31 +- .../expression_binder/base_select_binder.cpp | 29 +- .../expression_binder/having_binder.cpp | 53 +- .../expression_binder/index_binder.cpp | 33 + .../expression_binder/order_binder.cpp | 11 +- .../src/planner/expression_iterator.cpp | 4 +- .../src/planner/filter/constant_filter.cpp | 2 +- .../operator/logical_column_data_get.cpp | 18 +- .../src/planner/operator/logical_delete.cpp | 2 + .../src/planner/operator/logical_get.cpp | 5 +- .../src/planner/operator/logical_insert.cpp | 2 + .../src/planner/operator/logical_top_n.cpp | 2 +- .../src/planner/operator/logical_update.cpp | 2 + src/duckdb/src/planner/planner.cpp | 44 +- .../subquery/flatten_dependent_join.cpp | 43 +- src/duckdb/src/planner/table_binding.cpp | 2 +- src/duckdb/src/storage/arena_allocator.cpp | 8 +- .../src/storage/buffer/block_handle.cpp | 6 +- .../src/storage/buffer/block_manager.cpp | 2 +- src/duckdb/src/storage/buffer/buffer_pool.cpp | 105 +- .../buffer/buffer_pool_reservation.cpp | 4 +- src/duckdb/src/storage/buffer_manager.cpp | 8 +- .../storage/checkpoint/row_group_writer.cpp | 9 + .../storage/checkpoint/table_data_writer.cpp | 9 +- src/duckdb/src/storage/checkpoint_manager.cpp | 172 +- .../src/storage/compression/bitpacking.cpp | 32 +- .../compression/dictionary_compression.cpp | 16 +- .../compression/fixed_size_uncompressed.cpp | 2 +- src/duckdb/src/storage/compression/fsst.cpp | 18 +- src/duckdb/src/storage/compression/rle.cpp | 2 +- .../compression/string_uncompressed.cpp | 9 +- .../compression/validity_uncompressed.cpp | 2 +- src/duckdb/src/storage/data_table.cpp | 355 +- src/duckdb/src/storage/index.cpp | 108 +- src/duckdb/src/storage/local_storage.cpp | 88 +- .../src/storage/metadata/metadata_manager.cpp | 4 +- .../src/storage/metadata/metadata_writer.cpp | 2 +- .../src/storage/optimistic_data_writer.cpp | 20 +- .../src/storage/partial_block_manager.cpp | 12 +- .../serialization/serialize_create_info.cpp | 8 + .../serialization/serialize_dependency.cpp | 49 + .../serialize_extension_install_info.cpp | 28 + .../serialize_logical_operator.cpp | 7 +- .../storage/serialization/serialize_nodes.cpp | 80 +- .../serialization/serialize_parse_info.cpp | 21 + .../serialization/serialize_tableref.cpp | 16 + .../storage/serialization/serialize_types.cpp | 7 +- .../src/storage/single_file_block_manager.cpp | 41 +- .../src/storage/standard_buffer_manager.cpp | 108 +- .../storage/statistics/column_statistics.cpp | 6 +- .../statistics/distinct_statistics.cpp | 2 +- src/duckdb/src/storage/storage_info.cpp | 90 +- src/duckdb/src/storage/storage_lock.cpp | 94 +- src/duckdb/src/storage/storage_manager.cpp | 99 +- .../src/storage/table/array_column_data.cpp | 25 +- src/duckdb/src/storage/table/column_data.cpp | 117 +- .../table/column_data_checkpointer.cpp | 2 +- .../src/storage/table/column_segment.cpp | 11 +- .../src/storage/table/list_column_data.cpp | 29 +- src/duckdb/src/storage/table/row_group.cpp | 61 +- .../storage/table/row_group_collection.cpp | 90 +- .../src/storage/table/row_version_manager.cpp | 4 +- .../storage/table/standard_column_data.cpp | 44 +- .../src/storage/table/struct_column_data.cpp | 39 +- .../src/storage/table/table_statistics.cpp | 35 +- .../src/storage/table/update_segment.cpp | 12 +- .../storage/table/validity_column_data.cpp | 5 + src/duckdb/src/storage/table_index_list.cpp | 111 +- .../src/storage/temporary_file_manager.cpp | 128 +- .../src/storage/temporary_memory_manager.cpp | 8 +- src/duckdb/src/storage/wal_replay.cpp | 49 +- src/duckdb/src/storage/write_ahead_log.cpp | 64 +- src/duckdb/src/transaction/cleanup_state.cpp | 11 +- src/duckdb/src/transaction/commit_state.cpp | 25 +- .../src/transaction/duck_transaction.cpp | 75 +- .../transaction/duck_transaction_manager.cpp | 275 +- .../src/transaction/meta_transaction.cpp | 20 +- src/duckdb/src/transaction/rollback_state.cpp | 2 + src/duckdb/src/transaction/transaction.cpp | 14 +- src/duckdb/src/transaction/undo_buffer.cpp | 54 +- .../concurrentqueue/concurrentqueue.h | 10 +- src/duckdb/third_party/fsst/fsst.h | 2 +- .../jaro_winkler/details/common.hpp | 18 +- .../jaro_winkler/details/intrinsics.hpp | 2 +- .../jaro_winkler/details/jaro_impl.hpp | 36 +- .../libpg_query/include/nodes/nodes.hpp | 1 + .../libpg_query/include/nodes/parsenodes.hpp | 12 + .../libpg_query/include/parser/gram.hpp | 1587 +- .../libpg_query/include/parser/kwlist.hpp | 3 + .../libpg_query/include/utils/datetime.hpp | 1 + .../third_party/libpg_query/pg_functions.cpp | 19 +- .../libpg_query/src_backend_parser_gram.cpp | 47369 ++++++++-------- .../mbedtls/library/constant_time.cpp | 2 +- .../third_party/parquet/parquet_types.cpp | 3 + .../third_party/parquet/parquet_types.h | 3 +- src/duckdb/third_party/re2/re2/compile.cc | 4 +- src/duckdb/third_party/re2/re2/dfa.cc | 11 +- src/duckdb/third_party/re2/re2/onepass.cc | 7 +- src/duckdb/third_party/re2/re2/prog.cc | 20 +- src/duckdb/third_party/re2/re2/prog.h | 16 +- src/duckdb/third_party/tdigest/t_digest.hpp | 12 +- .../third_party/utf8proc/include/utf8proc.hpp | 2 +- .../third_party/yyjson/include/yyjson.hpp | 7930 +++ src/duckdb/third_party/yyjson/yyjson.cpp | 9490 ++++ src/duckdb/ub_src_catalog.cpp | 2 + src/duckdb/ub_src_common.cpp | 2 + src/duckdb/ub_src_execution_index.cpp | 4 +- .../ub_src_execution_operator_helper.cpp | 2 + src/duckdb/ub_src_function_table_system.cpp | 2 + src/duckdb/ub_src_main.cpp | 4 + src/duckdb/ub_src_main_relation.cpp | 2 + src/duckdb/ub_src_optimizer.cpp | 16 +- src/duckdb/ub_src_optimizer_join_order.cpp | 2 - src/duckdb/ub_src_optimizer_rule.cpp | 6 +- src/duckdb/ub_src_parser_parsed_data.cpp | 10 + src/duckdb/ub_src_parser_statement.cpp | 2 + src/duckdb/ub_src_parser_tableref.cpp | 2 + .../ub_src_planner_binder_statement.cpp | 2 + src/duckdb/ub_src_planner_binder_tableref.cpp | 4 + src/duckdb/ub_src_storage_serialization.cpp | 4 + 904 files changed, 57700 insertions(+), 31028 deletions(-) create mode 100644 src/duckdb/extension/parquet/include/null_column_reader.hpp create mode 100644 src/duckdb/src/catalog/catalog_entry_retriever.cpp create mode 100644 src/duckdb/src/common/multi_file_list.cpp create mode 100644 src/duckdb/src/execution/index/bound_index.cpp create mode 100644 src/duckdb/src/execution/index/unbound_index.cpp create mode 100644 src/duckdb/src/execution/operator/helper/physical_update_extensions.cpp create mode 100644 src/duckdb/src/function/table/system/duckdb_which_secret.cpp create mode 100644 src/duckdb/src/include/duckdb/catalog/catalog_entry_retriever.hpp create mode 100644 src/duckdb/src/include/duckdb/common/enable_shared_from_this.ipp create mode 100644 src/duckdb/src/include/duckdb/common/enums/checkpoint_type.hpp create mode 100644 src/duckdb/src/include/duckdb/common/enums/scan_vector_type.hpp create mode 100644 src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp create mode 100644 src/duckdb/src/include/duckdb/common/multi_file_list.hpp create mode 100644 src/duckdb/src/include/duckdb/common/optionally_owned_ptr.hpp create mode 100644 src/duckdb/src/include/duckdb/common/shared_ptr.ipp create mode 100644 src/duckdb/src/include/duckdb/common/weak_ptr.ipp create mode 100644 src/duckdb/src/include/duckdb/execution/index/bound_index.hpp create mode 100644 src/duckdb/src/include/duckdb/execution/index/unbound_index.hpp create mode 100644 src/duckdb/src/include/duckdb/execution/operator/helper/physical_update_extensions.hpp create mode 100644 src/duckdb/src/include/duckdb/logging/http_logger.hpp create mode 100644 src/duckdb/src/include/duckdb/main/client_context_wrapper.hpp create mode 100644 src/duckdb/src/include/duckdb/main/extension_install_info.hpp create mode 100644 src/duckdb/src/include/duckdb/main/relation/materialized_relation.hpp create mode 100644 src/duckdb/src/include/duckdb/optimizer/rule/timestamp_comparison.hpp create mode 100644 src/duckdb/src/include/duckdb/parser/parsed_data/update_extensions_info.hpp create mode 100644 src/duckdb/src/include/duckdb/parser/statement/update_extensions_statement.hpp create mode 100644 src/duckdb/src/include/duckdb/parser/tableref/column_data_ref.hpp create mode 100644 src/duckdb/src/include/duckdb/planner/tableref/bound_column_data_ref.hpp create mode 100644 src/duckdb/src/include/duckdb/storage/table/delete_state.hpp create mode 100644 src/duckdb/src/include/duckdb/storage/table/update_state.hpp create mode 100644 src/duckdb/src/main/client_context_wrapper.cpp create mode 100644 src/duckdb/src/main/extension_install_info.cpp create mode 100644 src/duckdb/src/main/relation/materialized_relation.cpp create mode 100644 src/duckdb/src/optimizer/rule/timestamp_comparison.cpp create mode 100644 src/duckdb/src/parser/parsed_data/copy_info.cpp create mode 100644 src/duckdb/src/parser/parsed_data/create_schema_info.cpp create mode 100644 src/duckdb/src/parser/parsed_data/load_info.cpp create mode 100644 src/duckdb/src/parser/parsed_data/parse_info.cpp create mode 100644 src/duckdb/src/parser/parsed_data/pragma_info.cpp create mode 100644 src/duckdb/src/parser/statement/update_extensions_statement.cpp create mode 100644 src/duckdb/src/parser/tableref/column_data_ref.cpp create mode 100644 src/duckdb/src/planner/binder/statement/bind_update_extensions.cpp create mode 100644 src/duckdb/src/planner/binder/tableref/bind_column_data_ref.cpp create mode 100644 src/duckdb/src/planner/binder/tableref/plan_column_data_ref.cpp create mode 100644 src/duckdb/src/storage/serialization/serialize_dependency.cpp create mode 100644 src/duckdb/src/storage/serialization/serialize_extension_install_info.cpp create mode 100644 src/duckdb/third_party/yyjson/include/yyjson.hpp create mode 100644 src/duckdb/third_party/yyjson/yyjson.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index eeae51a3..d47f2fbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,12 +19,12 @@ project(DuckDBJava) include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2}) -include_directories(src/duckdb/src/include src/duckdb/third_party/concurrentqueue src/duckdb/third_party/fast_float src/duckdb/third_party/fastpforlib src/duckdb/third_party/fmt/include src/duckdb/third_party/fsst src/duckdb/third_party/httplib src/duckdb/third_party/hyperloglog src/duckdb/third_party/jaro_winkler src/duckdb/third_party/jaro_winkler/details src/duckdb/third_party/libpg_query src/duckdb/third_party/libpg_query/include src/duckdb/third_party/lz4 src/duckdb/third_party/mbedtls src/duckdb/third_party/mbedtls/include src/duckdb/third_party/mbedtls/library src/duckdb/third_party/miniz src/duckdb/third_party/pcg src/duckdb/third_party/re2 src/duckdb/third_party/skiplist src/duckdb/third_party/tdigest src/duckdb/third_party/utf8proc src/duckdb/third_party/utf8proc/include src/duckdb/extension/parquet/include src/duckdb/third_party/parquet src/duckdb/third_party/thrift src/duckdb/third_party/lz4 src/duckdb/third_party/snappy src/duckdb/third_party/zstd/include src/duckdb/third_party/mbedtls src/duckdb/third_party/mbedtls/include src/duckdb/extension/icu/include src/duckdb/extension/icu/third_party/icu/common src/duckdb/extension/icu/third_party/icu/i18n src/duckdb/extension/json/include src/duckdb/extension/json/yyjson/include) +include_directories(src/duckdb/src/include src/duckdb/third_party/concurrentqueue src/duckdb/third_party/fast_float src/duckdb/third_party/fastpforlib src/duckdb/third_party/fmt/include src/duckdb/third_party/fsst src/duckdb/third_party/httplib src/duckdb/third_party/hyperloglog src/duckdb/third_party/jaro_winkler src/duckdb/third_party/jaro_winkler/details src/duckdb/third_party/libpg_query src/duckdb/third_party/libpg_query/include src/duckdb/third_party/lz4 src/duckdb/third_party/mbedtls src/duckdb/third_party/mbedtls/include src/duckdb/third_party/mbedtls/library src/duckdb/third_party/miniz src/duckdb/third_party/pcg src/duckdb/third_party/re2 src/duckdb/third_party/skiplist src/duckdb/third_party/tdigest src/duckdb/third_party/utf8proc src/duckdb/third_party/utf8proc/include src/duckdb/third_party/yyjson/include src/duckdb/extension/parquet/include src/duckdb/third_party/parquet src/duckdb/third_party/thrift src/duckdb/third_party/lz4 src/duckdb/third_party/snappy src/duckdb/third_party/zstd/include src/duckdb/third_party/mbedtls src/duckdb/third_party/mbedtls/include src/duckdb/extension/icu/include src/duckdb/extension/icu/third_party/icu/common src/duckdb/extension/icu/third_party/icu/i18n src/duckdb/extension/json/include) add_definitions(-DDUCKDB_EXTENSION_PARQUET_LINKED -DDUCKDB_EXTENSION_ICU_LINKED -DDUCKDB_EXTENSION_JSON_LINKED) file(GLOB_RECURSE JAVA_SRC_FILES src/main/java/org/duckdb/*.java) file(GLOB_RECURSE JAVA_TEST_FILES src/test/java/org/duckdb/*.java) -set(DUCKDB_SRC_FILES src/duckdb/ub_src_catalog.cpp src/duckdb/ub_src_catalog_catalog_entry.cpp src/duckdb/ub_src_catalog_catalog_entry_dependency.cpp src/duckdb/ub_src_catalog_default.cpp src/duckdb/ub_src_common_adbc.cpp src/duckdb/ub_src_common_adbc_nanoarrow.cpp src/duckdb/ub_src_common.cpp src/duckdb/ub_src_common_arrow_appender.cpp src/duckdb/ub_src_common_arrow.cpp src/duckdb/ub_src_common_crypto.cpp src/duckdb/ub_src_common_enums.cpp src/duckdb/ub_src_common_exception.cpp src/duckdb/ub_src_common_operator.cpp src/duckdb/ub_src_common_progress_bar.cpp src/duckdb/ub_src_common_row_operations.cpp src/duckdb/ub_src_common_serializer.cpp src/duckdb/ub_src_common_sort.cpp src/duckdb/ub_src_common_types.cpp src/duckdb/ub_src_common_types_column.cpp src/duckdb/ub_src_common_types_row.cpp src/duckdb/ub_src_common_value_operations.cpp src/duckdb/src/common/vector_operations/boolean_operators.cpp src/duckdb/src/common/vector_operations/comparison_operators.cpp src/duckdb/src/common/vector_operations/generators.cpp src/duckdb/src/common/vector_operations/is_distinct_from.cpp src/duckdb/src/common/vector_operations/null_operations.cpp src/duckdb/src/common/vector_operations/numeric_inplace_operators.cpp src/duckdb/src/common/vector_operations/vector_cast.cpp src/duckdb/src/common/vector_operations/vector_copy.cpp src/duckdb/src/common/vector_operations/vector_hash.cpp src/duckdb/src/common/vector_operations/vector_storage.cpp src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp src/duckdb/ub_src_core_functions_aggregate_distributive.cpp src/duckdb/ub_src_core_functions_aggregate_holistic.cpp src/duckdb/ub_src_core_functions_aggregate_nested.cpp src/duckdb/ub_src_core_functions_aggregate_regression.cpp src/duckdb/ub_src_core_functions.cpp src/duckdb/ub_src_core_functions_scalar_array.cpp src/duckdb/ub_src_core_functions_scalar_bit.cpp src/duckdb/ub_src_core_functions_scalar_blob.cpp src/duckdb/ub_src_core_functions_scalar_date.cpp src/duckdb/ub_src_core_functions_scalar_debug.cpp src/duckdb/ub_src_core_functions_scalar_enum.cpp src/duckdb/ub_src_core_functions_scalar_generic.cpp src/duckdb/ub_src_core_functions_scalar_list.cpp src/duckdb/ub_src_core_functions_scalar_map.cpp src/duckdb/ub_src_core_functions_scalar_math.cpp src/duckdb/ub_src_core_functions_scalar_operators.cpp src/duckdb/ub_src_core_functions_scalar_random.cpp src/duckdb/ub_src_core_functions_scalar_secret.cpp src/duckdb/ub_src_core_functions_scalar_string.cpp src/duckdb/ub_src_core_functions_scalar_struct.cpp src/duckdb/ub_src_core_functions_scalar_union.cpp src/duckdb/ub_src_execution.cpp src/duckdb/ub_src_execution_expression_executor.cpp src/duckdb/ub_src_execution_index_art.cpp src/duckdb/ub_src_execution_index.cpp src/duckdb/ub_src_execution_nested_loop_join.cpp src/duckdb/ub_src_execution_operator_aggregate.cpp src/duckdb/ub_src_execution_operator_csv_scanner_buffer_manager.cpp src/duckdb/ub_src_execution_operator_csv_scanner_scanner.cpp src/duckdb/ub_src_execution_operator_csv_scanner_sniffer.cpp src/duckdb/ub_src_execution_operator_csv_scanner_state_machine.cpp src/duckdb/ub_src_execution_operator_csv_scanner_table_function.cpp src/duckdb/ub_src_execution_operator_csv_scanner_util.cpp src/duckdb/ub_src_execution_operator_filter.cpp src/duckdb/ub_src_execution_operator_helper.cpp src/duckdb/ub_src_execution_operator_join.cpp src/duckdb/ub_src_execution_operator_order.cpp src/duckdb/ub_src_execution_operator_persistent.cpp src/duckdb/ub_src_execution_operator_projection.cpp src/duckdb/ub_src_execution_operator_scan.cpp src/duckdb/ub_src_execution_operator_schema.cpp src/duckdb/ub_src_execution_operator_set.cpp src/duckdb/ub_src_execution_physical_plan.cpp src/duckdb/ub_src_function_aggregate_distributive.cpp src/duckdb/ub_src_function_aggregate.cpp src/duckdb/ub_src_function.cpp src/duckdb/ub_src_function_cast.cpp src/duckdb/ub_src_function_cast_union.cpp src/duckdb/ub_src_function_pragma.cpp src/duckdb/ub_src_function_scalar_compressed_materialization.cpp src/duckdb/ub_src_function_scalar.cpp src/duckdb/ub_src_function_scalar_generic.cpp src/duckdb/ub_src_function_scalar_list.cpp src/duckdb/ub_src_function_scalar_operators.cpp src/duckdb/ub_src_function_scalar_sequence.cpp src/duckdb/ub_src_function_scalar_string.cpp src/duckdb/ub_src_function_scalar_string_regexp.cpp src/duckdb/ub_src_function_scalar_struct.cpp src/duckdb/ub_src_function_scalar_system.cpp src/duckdb/ub_src_function_table_arrow.cpp src/duckdb/ub_src_function_table.cpp src/duckdb/ub_src_function_table_system.cpp src/duckdb/ub_src_function_table_version.cpp src/duckdb/ub_src_main.cpp src/duckdb/ub_src_main_buffered_data.cpp src/duckdb/ub_src_main_capi.cpp src/duckdb/ub_src_main_capi_cast.cpp src/duckdb/ub_src_main_chunk_scan_state.cpp src/duckdb/ub_src_main_extension.cpp src/duckdb/ub_src_main_relation.cpp src/duckdb/ub_src_main_secret.cpp src/duckdb/ub_src_main_settings.cpp src/duckdb/ub_src_optimizer.cpp src/duckdb/ub_src_optimizer_compressed_materialization.cpp src/duckdb/ub_src_optimizer_join_order.cpp src/duckdb/ub_src_optimizer_matcher.cpp src/duckdb/ub_src_optimizer_pullup.cpp src/duckdb/ub_src_optimizer_pushdown.cpp src/duckdb/ub_src_optimizer_rule.cpp src/duckdb/ub_src_optimizer_statistics_expression.cpp src/duckdb/ub_src_optimizer_statistics_operator.cpp src/duckdb/ub_src_parallel.cpp src/duckdb/ub_src_parser.cpp src/duckdb/ub_src_parser_constraints.cpp src/duckdb/ub_src_parser_expression.cpp src/duckdb/ub_src_parser_parsed_data.cpp src/duckdb/ub_src_parser_query_node.cpp src/duckdb/ub_src_parser_statement.cpp src/duckdb/ub_src_parser_tableref.cpp src/duckdb/ub_src_parser_transform_constraint.cpp src/duckdb/ub_src_parser_transform_expression.cpp src/duckdb/ub_src_parser_transform_helpers.cpp src/duckdb/ub_src_parser_transform_statement.cpp src/duckdb/ub_src_parser_transform_tableref.cpp src/duckdb/ub_src_planner.cpp src/duckdb/ub_src_planner_binder_expression.cpp src/duckdb/ub_src_planner_binder_query_node.cpp src/duckdb/ub_src_planner_binder_statement.cpp src/duckdb/ub_src_planner_binder_tableref.cpp src/duckdb/ub_src_planner_expression.cpp src/duckdb/ub_src_planner_expression_binder.cpp src/duckdb/ub_src_planner_filter.cpp src/duckdb/ub_src_planner_operator.cpp src/duckdb/ub_src_planner_subquery.cpp src/duckdb/ub_src_storage.cpp src/duckdb/ub_src_storage_buffer.cpp src/duckdb/ub_src_storage_checkpoint.cpp src/duckdb/ub_src_storage_compression_alp.cpp src/duckdb/ub_src_storage_compression.cpp src/duckdb/ub_src_storage_compression_chimp.cpp src/duckdb/ub_src_storage_metadata.cpp src/duckdb/ub_src_storage_serialization.cpp src/duckdb/ub_src_storage_statistics.cpp src/duckdb/ub_src_storage_table.cpp src/duckdb/ub_src_transaction.cpp src/duckdb/src/verification/copied_statement_verifier.cpp src/duckdb/src/verification/deserialized_statement_verifier.cpp src/duckdb/src/verification/external_statement_verifier.cpp src/duckdb/src/verification/fetch_row_verifier.cpp src/duckdb/src/verification/no_operator_caching_verifier.cpp src/duckdb/src/verification/parsed_statement_verifier.cpp src/duckdb/src/verification/prepared_statement_verifier.cpp src/duckdb/src/verification/statement_verifier.cpp src/duckdb/src/verification/unoptimized_statement_verifier.cpp src/duckdb/third_party/fmt/format.cc src/duckdb/third_party/fsst/libfsst.cpp src/duckdb/third_party/miniz/miniz.cpp src/duckdb/third_party/re2/re2/bitmap256.cc src/duckdb/third_party/re2/re2/bitstate.cc src/duckdb/third_party/re2/re2/compile.cc src/duckdb/third_party/re2/re2/dfa.cc src/duckdb/third_party/re2/re2/filtered_re2.cc src/duckdb/third_party/re2/re2/mimics_pcre.cc src/duckdb/third_party/re2/re2/nfa.cc src/duckdb/third_party/re2/re2/onepass.cc src/duckdb/third_party/re2/re2/parse.cc src/duckdb/third_party/re2/re2/perl_groups.cc src/duckdb/third_party/re2/re2/prefilter.cc src/duckdb/third_party/re2/re2/prefilter_tree.cc src/duckdb/third_party/re2/re2/prog.cc src/duckdb/third_party/re2/re2/re2.cc src/duckdb/third_party/re2/re2/regexp.cc src/duckdb/third_party/re2/re2/set.cc src/duckdb/third_party/re2/re2/simplify.cc src/duckdb/third_party/re2/re2/stringpiece.cc src/duckdb/third_party/re2/re2/tostring.cc src/duckdb/third_party/re2/re2/unicode_casefold.cc src/duckdb/third_party/re2/re2/unicode_groups.cc src/duckdb/third_party/re2/util/rune.cc src/duckdb/third_party/re2/util/strutil.cc src/duckdb/third_party/hyperloglog/hyperloglog.cpp src/duckdb/third_party/hyperloglog/sds.cpp src/duckdb/third_party/skiplist/SkipList.cpp src/duckdb/third_party/fastpforlib/bitpacking.cpp src/duckdb/third_party/utf8proc/utf8proc.cpp src/duckdb/third_party/utf8proc/utf8proc_wrapper.cpp src/duckdb/third_party/libpg_query/pg_functions.cpp src/duckdb/third_party/libpg_query/postgres_parser.cpp src/duckdb/third_party/libpg_query/src_backend_nodes_list.cpp src/duckdb/third_party/libpg_query/src_backend_nodes_makefuncs.cpp src/duckdb/third_party/libpg_query/src_backend_nodes_value.cpp src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp src/duckdb/third_party/libpg_query/src_backend_parser_parser.cpp src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp src/duckdb/third_party/libpg_query/src_backend_parser_scansup.cpp src/duckdb/third_party/libpg_query/src_common_keywords.cpp src/duckdb/third_party/mbedtls/library/aes.cpp src/duckdb/third_party/mbedtls/library/aria.cpp src/duckdb/third_party/mbedtls/library/asn1parse.cpp src/duckdb/third_party/mbedtls/library/base64.cpp src/duckdb/third_party/mbedtls/library/bignum.cpp src/duckdb/third_party/mbedtls/library/camellia.cpp src/duckdb/third_party/mbedtls/library/cipher.cpp src/duckdb/third_party/mbedtls/library/cipher_wrap.cpp src/duckdb/third_party/mbedtls/library/constant_time.cpp src/duckdb/third_party/mbedtls/library/entropy.cpp src/duckdb/third_party/mbedtls/library/entropy_poll.cpp src/duckdb/third_party/mbedtls/library/gcm.cpp src/duckdb/third_party/mbedtls/library/md.cpp src/duckdb/third_party/mbedtls/library/oid.cpp src/duckdb/third_party/mbedtls/library/pem.cpp src/duckdb/third_party/mbedtls/library/pk.cpp src/duckdb/third_party/mbedtls/library/pk_wrap.cpp src/duckdb/third_party/mbedtls/library/pkparse.cpp src/duckdb/third_party/mbedtls/library/platform_util.cpp src/duckdb/third_party/mbedtls/library/rsa.cpp src/duckdb/third_party/mbedtls/library/rsa_alt_helpers.cpp src/duckdb/third_party/mbedtls/library/sha1.cpp src/duckdb/third_party/mbedtls/library/sha256.cpp src/duckdb/third_party/mbedtls/library/sha512.cpp src/duckdb/third_party/mbedtls/mbedtls_wrapper.cpp src/duckdb/extension/parquet/column_reader.cpp src/duckdb/extension/parquet/column_writer.cpp src/duckdb/extension/parquet/parquet_crypto.cpp src/duckdb/extension/parquet/parquet_extension.cpp src/duckdb/extension/parquet/parquet_metadata.cpp src/duckdb/extension/parquet/parquet_reader.cpp src/duckdb/extension/parquet/parquet_statistics.cpp src/duckdb/extension/parquet/parquet_timestamp.cpp src/duckdb/extension/parquet/parquet_writer.cpp src/duckdb/extension/parquet/serialize_parquet.cpp src/duckdb/extension/parquet/zstd_file_system.cpp src/duckdb/third_party/parquet/parquet_constants.cpp src/duckdb/third_party/parquet/parquet_types.cpp src/duckdb/third_party/thrift/thrift/protocol/TProtocol.cpp src/duckdb/third_party/thrift/thrift/transport/TTransportException.cpp src/duckdb/third_party/thrift/thrift/transport/TBufferTransports.cpp src/duckdb/third_party/snappy/snappy.cc src/duckdb/third_party/snappy/snappy-sinksource.cc src/duckdb/third_party/zstd/decompress/zstd_ddict.cpp src/duckdb/third_party/zstd/decompress/huf_decompress.cpp src/duckdb/third_party/zstd/decompress/zstd_decompress.cpp src/duckdb/third_party/zstd/decompress/zstd_decompress_block.cpp src/duckdb/third_party/zstd/common/entropy_common.cpp src/duckdb/third_party/zstd/common/fse_decompress.cpp src/duckdb/third_party/zstd/common/zstd_common.cpp src/duckdb/third_party/zstd/common/error_private.cpp src/duckdb/third_party/zstd/common/xxhash.cpp src/duckdb/third_party/zstd/compress/fse_compress.cpp src/duckdb/third_party/zstd/compress/hist.cpp src/duckdb/third_party/zstd/compress/huf_compress.cpp src/duckdb/third_party/zstd/compress/zstd_compress.cpp src/duckdb/third_party/zstd/compress/zstd_compress_literals.cpp src/duckdb/third_party/zstd/compress/zstd_compress_sequences.cpp src/duckdb/third_party/zstd/compress/zstd_compress_superblock.cpp src/duckdb/third_party/zstd/compress/zstd_double_fast.cpp src/duckdb/third_party/zstd/compress/zstd_fast.cpp src/duckdb/third_party/zstd/compress/zstd_lazy.cpp src/duckdb/third_party/zstd/compress/zstd_ldm.cpp src/duckdb/third_party/zstd/compress/zstd_opt.cpp src/duckdb/third_party/lz4/lz4.cpp src/duckdb/extension/icu/./icu-table-range.cpp src/duckdb/extension/icu/./icu-makedate.cpp src/duckdb/extension/icu/./icu-list-range.cpp src/duckdb/extension/icu/./icu-timebucket.cpp src/duckdb/extension/icu/./icu-timezone.cpp src/duckdb/extension/icu/./icu-dateadd.cpp src/duckdb/extension/icu/./icu-datetrunc.cpp src/duckdb/extension/icu/./icu-datesub.cpp src/duckdb/extension/icu/./icu_extension.cpp src/duckdb/extension/icu/./icu-strptime.cpp src/duckdb/extension/icu/./icu-datefunc.cpp src/duckdb/extension/icu/./icu-datepart.cpp src/duckdb/ub_extension_icu_third_party_icu_common.cpp src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp src/duckdb/extension/icu/third_party/icu/stubdata/stubdata.cpp src/duckdb/extension/json/buffered_json_reader.cpp src/duckdb/extension/json/json_enums.cpp src/duckdb/extension/json/json_extension.cpp src/duckdb/extension/json/json_common.cpp src/duckdb/extension/json/json_functions.cpp src/duckdb/extension/json/json_scan.cpp src/duckdb/extension/json/json_serializer.cpp src/duckdb/extension/json/json_deserializer.cpp src/duckdb/extension/json/serialize_json.cpp src/duckdb/ub_extension_json_json_functions.cpp src/duckdb/extension/json/yyjson/yyjson.cpp) +set(DUCKDB_SRC_FILES src/duckdb/ub_src_catalog.cpp src/duckdb/ub_src_catalog_catalog_entry.cpp src/duckdb/ub_src_catalog_catalog_entry_dependency.cpp src/duckdb/ub_src_catalog_default.cpp src/duckdb/ub_src_common_adbc.cpp src/duckdb/ub_src_common_adbc_nanoarrow.cpp src/duckdb/ub_src_common.cpp src/duckdb/ub_src_common_arrow_appender.cpp src/duckdb/ub_src_common_arrow.cpp src/duckdb/ub_src_common_crypto.cpp src/duckdb/ub_src_common_enums.cpp src/duckdb/ub_src_common_exception.cpp src/duckdb/ub_src_common_operator.cpp src/duckdb/ub_src_common_progress_bar.cpp src/duckdb/ub_src_common_row_operations.cpp src/duckdb/ub_src_common_serializer.cpp src/duckdb/ub_src_common_sort.cpp src/duckdb/ub_src_common_types.cpp src/duckdb/ub_src_common_types_column.cpp src/duckdb/ub_src_common_types_row.cpp src/duckdb/ub_src_common_value_operations.cpp src/duckdb/src/common/vector_operations/boolean_operators.cpp src/duckdb/src/common/vector_operations/comparison_operators.cpp src/duckdb/src/common/vector_operations/generators.cpp src/duckdb/src/common/vector_operations/is_distinct_from.cpp src/duckdb/src/common/vector_operations/null_operations.cpp src/duckdb/src/common/vector_operations/numeric_inplace_operators.cpp src/duckdb/src/common/vector_operations/vector_cast.cpp src/duckdb/src/common/vector_operations/vector_copy.cpp src/duckdb/src/common/vector_operations/vector_hash.cpp src/duckdb/src/common/vector_operations/vector_storage.cpp src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp src/duckdb/ub_src_core_functions_aggregate_distributive.cpp src/duckdb/ub_src_core_functions_aggregate_holistic.cpp src/duckdb/ub_src_core_functions_aggregate_nested.cpp src/duckdb/ub_src_core_functions_aggregate_regression.cpp src/duckdb/ub_src_core_functions.cpp src/duckdb/ub_src_core_functions_scalar_array.cpp src/duckdb/ub_src_core_functions_scalar_bit.cpp src/duckdb/ub_src_core_functions_scalar_blob.cpp src/duckdb/ub_src_core_functions_scalar_date.cpp src/duckdb/ub_src_core_functions_scalar_debug.cpp src/duckdb/ub_src_core_functions_scalar_enum.cpp src/duckdb/ub_src_core_functions_scalar_generic.cpp src/duckdb/ub_src_core_functions_scalar_list.cpp src/duckdb/ub_src_core_functions_scalar_map.cpp src/duckdb/ub_src_core_functions_scalar_math.cpp src/duckdb/ub_src_core_functions_scalar_operators.cpp src/duckdb/ub_src_core_functions_scalar_random.cpp src/duckdb/ub_src_core_functions_scalar_string.cpp src/duckdb/ub_src_core_functions_scalar_struct.cpp src/duckdb/ub_src_core_functions_scalar_union.cpp src/duckdb/ub_src_execution.cpp src/duckdb/ub_src_execution_expression_executor.cpp src/duckdb/ub_src_execution_index_art.cpp src/duckdb/ub_src_execution_index.cpp src/duckdb/ub_src_execution_nested_loop_join.cpp src/duckdb/ub_src_execution_operator_aggregate.cpp src/duckdb/ub_src_execution_operator_csv_scanner_buffer_manager.cpp src/duckdb/ub_src_execution_operator_csv_scanner_scanner.cpp src/duckdb/ub_src_execution_operator_csv_scanner_sniffer.cpp src/duckdb/ub_src_execution_operator_csv_scanner_state_machine.cpp src/duckdb/ub_src_execution_operator_csv_scanner_table_function.cpp src/duckdb/ub_src_execution_operator_csv_scanner_util.cpp src/duckdb/ub_src_execution_operator_filter.cpp src/duckdb/ub_src_execution_operator_helper.cpp src/duckdb/ub_src_execution_operator_join.cpp src/duckdb/ub_src_execution_operator_order.cpp src/duckdb/ub_src_execution_operator_persistent.cpp src/duckdb/ub_src_execution_operator_projection.cpp src/duckdb/ub_src_execution_operator_scan.cpp src/duckdb/ub_src_execution_operator_schema.cpp src/duckdb/ub_src_execution_operator_set.cpp src/duckdb/ub_src_execution_physical_plan.cpp src/duckdb/ub_src_function_aggregate_distributive.cpp src/duckdb/ub_src_function_aggregate.cpp src/duckdb/ub_src_function.cpp src/duckdb/ub_src_function_cast.cpp src/duckdb/ub_src_function_cast_union.cpp src/duckdb/ub_src_function_pragma.cpp src/duckdb/ub_src_function_scalar_compressed_materialization.cpp src/duckdb/ub_src_function_scalar.cpp src/duckdb/ub_src_function_scalar_generic.cpp src/duckdb/ub_src_function_scalar_list.cpp src/duckdb/ub_src_function_scalar_operators.cpp src/duckdb/ub_src_function_scalar_sequence.cpp src/duckdb/ub_src_function_scalar_string.cpp src/duckdb/ub_src_function_scalar_string_regexp.cpp src/duckdb/ub_src_function_scalar_struct.cpp src/duckdb/ub_src_function_scalar_system.cpp src/duckdb/ub_src_function_table_arrow.cpp src/duckdb/ub_src_function_table.cpp src/duckdb/ub_src_function_table_system.cpp src/duckdb/ub_src_function_table_version.cpp src/duckdb/ub_src_main.cpp src/duckdb/ub_src_main_buffered_data.cpp src/duckdb/ub_src_main_capi.cpp src/duckdb/ub_src_main_capi_cast.cpp src/duckdb/ub_src_main_chunk_scan_state.cpp src/duckdb/ub_src_main_extension.cpp src/duckdb/ub_src_main_relation.cpp src/duckdb/ub_src_main_secret.cpp src/duckdb/ub_src_main_settings.cpp src/duckdb/ub_src_optimizer.cpp src/duckdb/ub_src_optimizer_compressed_materialization.cpp src/duckdb/ub_src_optimizer_join_order.cpp src/duckdb/ub_src_optimizer_matcher.cpp src/duckdb/ub_src_optimizer_pullup.cpp src/duckdb/ub_src_optimizer_pushdown.cpp src/duckdb/ub_src_optimizer_rule.cpp src/duckdb/ub_src_optimizer_statistics_expression.cpp src/duckdb/ub_src_optimizer_statistics_operator.cpp src/duckdb/ub_src_parallel.cpp src/duckdb/ub_src_parser.cpp src/duckdb/ub_src_parser_constraints.cpp src/duckdb/ub_src_parser_expression.cpp src/duckdb/ub_src_parser_parsed_data.cpp src/duckdb/ub_src_parser_query_node.cpp src/duckdb/ub_src_parser_statement.cpp src/duckdb/ub_src_parser_tableref.cpp src/duckdb/ub_src_parser_transform_constraint.cpp src/duckdb/ub_src_parser_transform_expression.cpp src/duckdb/ub_src_parser_transform_helpers.cpp src/duckdb/ub_src_parser_transform_statement.cpp src/duckdb/ub_src_parser_transform_tableref.cpp src/duckdb/ub_src_planner.cpp src/duckdb/ub_src_planner_binder_expression.cpp src/duckdb/ub_src_planner_binder_query_node.cpp src/duckdb/ub_src_planner_binder_statement.cpp src/duckdb/ub_src_planner_binder_tableref.cpp src/duckdb/ub_src_planner_expression.cpp src/duckdb/ub_src_planner_expression_binder.cpp src/duckdb/ub_src_planner_filter.cpp src/duckdb/ub_src_planner_operator.cpp src/duckdb/ub_src_planner_subquery.cpp src/duckdb/ub_src_storage.cpp src/duckdb/ub_src_storage_buffer.cpp src/duckdb/ub_src_storage_checkpoint.cpp src/duckdb/ub_src_storage_compression_alp.cpp src/duckdb/ub_src_storage_compression.cpp src/duckdb/ub_src_storage_compression_chimp.cpp src/duckdb/ub_src_storage_metadata.cpp src/duckdb/ub_src_storage_serialization.cpp src/duckdb/ub_src_storage_statistics.cpp src/duckdb/ub_src_storage_table.cpp src/duckdb/ub_src_transaction.cpp src/duckdb/src/verification/copied_statement_verifier.cpp src/duckdb/src/verification/deserialized_statement_verifier.cpp src/duckdb/src/verification/external_statement_verifier.cpp src/duckdb/src/verification/fetch_row_verifier.cpp src/duckdb/src/verification/no_operator_caching_verifier.cpp src/duckdb/src/verification/parsed_statement_verifier.cpp src/duckdb/src/verification/prepared_statement_verifier.cpp src/duckdb/src/verification/statement_verifier.cpp src/duckdb/src/verification/unoptimized_statement_verifier.cpp src/duckdb/third_party/fmt/format.cc src/duckdb/third_party/fsst/libfsst.cpp src/duckdb/third_party/miniz/miniz.cpp src/duckdb/third_party/re2/re2/bitmap256.cc src/duckdb/third_party/re2/re2/bitstate.cc src/duckdb/third_party/re2/re2/compile.cc src/duckdb/third_party/re2/re2/dfa.cc src/duckdb/third_party/re2/re2/filtered_re2.cc src/duckdb/third_party/re2/re2/mimics_pcre.cc src/duckdb/third_party/re2/re2/nfa.cc src/duckdb/third_party/re2/re2/onepass.cc src/duckdb/third_party/re2/re2/parse.cc src/duckdb/third_party/re2/re2/perl_groups.cc src/duckdb/third_party/re2/re2/prefilter.cc src/duckdb/third_party/re2/re2/prefilter_tree.cc src/duckdb/third_party/re2/re2/prog.cc src/duckdb/third_party/re2/re2/re2.cc src/duckdb/third_party/re2/re2/regexp.cc src/duckdb/third_party/re2/re2/set.cc src/duckdb/third_party/re2/re2/simplify.cc src/duckdb/third_party/re2/re2/stringpiece.cc src/duckdb/third_party/re2/re2/tostring.cc src/duckdb/third_party/re2/re2/unicode_casefold.cc src/duckdb/third_party/re2/re2/unicode_groups.cc src/duckdb/third_party/re2/util/rune.cc src/duckdb/third_party/re2/util/strutil.cc src/duckdb/third_party/hyperloglog/hyperloglog.cpp src/duckdb/third_party/hyperloglog/sds.cpp src/duckdb/third_party/skiplist/SkipList.cpp src/duckdb/third_party/fastpforlib/bitpacking.cpp src/duckdb/third_party/utf8proc/utf8proc.cpp src/duckdb/third_party/utf8proc/utf8proc_wrapper.cpp src/duckdb/third_party/libpg_query/pg_functions.cpp src/duckdb/third_party/libpg_query/postgres_parser.cpp src/duckdb/third_party/libpg_query/src_backend_nodes_list.cpp src/duckdb/third_party/libpg_query/src_backend_nodes_makefuncs.cpp src/duckdb/third_party/libpg_query/src_backend_nodes_value.cpp src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp src/duckdb/third_party/libpg_query/src_backend_parser_parser.cpp src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp src/duckdb/third_party/libpg_query/src_backend_parser_scansup.cpp src/duckdb/third_party/libpg_query/src_common_keywords.cpp src/duckdb/third_party/mbedtls/library/aes.cpp src/duckdb/third_party/mbedtls/library/aria.cpp src/duckdb/third_party/mbedtls/library/asn1parse.cpp src/duckdb/third_party/mbedtls/library/base64.cpp src/duckdb/third_party/mbedtls/library/bignum.cpp src/duckdb/third_party/mbedtls/library/camellia.cpp src/duckdb/third_party/mbedtls/library/cipher.cpp src/duckdb/third_party/mbedtls/library/cipher_wrap.cpp src/duckdb/third_party/mbedtls/library/constant_time.cpp src/duckdb/third_party/mbedtls/library/entropy.cpp src/duckdb/third_party/mbedtls/library/entropy_poll.cpp src/duckdb/third_party/mbedtls/library/gcm.cpp src/duckdb/third_party/mbedtls/library/md.cpp src/duckdb/third_party/mbedtls/library/oid.cpp src/duckdb/third_party/mbedtls/library/pem.cpp src/duckdb/third_party/mbedtls/library/pk.cpp src/duckdb/third_party/mbedtls/library/pk_wrap.cpp src/duckdb/third_party/mbedtls/library/pkparse.cpp src/duckdb/third_party/mbedtls/library/platform_util.cpp src/duckdb/third_party/mbedtls/library/rsa.cpp src/duckdb/third_party/mbedtls/library/rsa_alt_helpers.cpp src/duckdb/third_party/mbedtls/library/sha1.cpp src/duckdb/third_party/mbedtls/library/sha256.cpp src/duckdb/third_party/mbedtls/library/sha512.cpp src/duckdb/third_party/mbedtls/mbedtls_wrapper.cpp src/duckdb/third_party/yyjson/yyjson.cpp src/duckdb/extension/parquet/column_reader.cpp src/duckdb/extension/parquet/column_writer.cpp src/duckdb/extension/parquet/parquet_crypto.cpp src/duckdb/extension/parquet/parquet_extension.cpp src/duckdb/extension/parquet/parquet_metadata.cpp src/duckdb/extension/parquet/parquet_reader.cpp src/duckdb/extension/parquet/parquet_statistics.cpp src/duckdb/extension/parquet/parquet_timestamp.cpp src/duckdb/extension/parquet/parquet_writer.cpp src/duckdb/extension/parquet/serialize_parquet.cpp src/duckdb/extension/parquet/zstd_file_system.cpp src/duckdb/third_party/parquet/parquet_constants.cpp src/duckdb/third_party/parquet/parquet_types.cpp src/duckdb/third_party/thrift/thrift/protocol/TProtocol.cpp src/duckdb/third_party/thrift/thrift/transport/TTransportException.cpp src/duckdb/third_party/thrift/thrift/transport/TBufferTransports.cpp src/duckdb/third_party/snappy/snappy.cc src/duckdb/third_party/snappy/snappy-sinksource.cc src/duckdb/third_party/zstd/decompress/zstd_ddict.cpp src/duckdb/third_party/zstd/decompress/huf_decompress.cpp src/duckdb/third_party/zstd/decompress/zstd_decompress.cpp src/duckdb/third_party/zstd/decompress/zstd_decompress_block.cpp src/duckdb/third_party/zstd/common/entropy_common.cpp src/duckdb/third_party/zstd/common/fse_decompress.cpp src/duckdb/third_party/zstd/common/zstd_common.cpp src/duckdb/third_party/zstd/common/error_private.cpp src/duckdb/third_party/zstd/common/xxhash.cpp src/duckdb/third_party/zstd/compress/fse_compress.cpp src/duckdb/third_party/zstd/compress/hist.cpp src/duckdb/third_party/zstd/compress/huf_compress.cpp src/duckdb/third_party/zstd/compress/zstd_compress.cpp src/duckdb/third_party/zstd/compress/zstd_compress_literals.cpp src/duckdb/third_party/zstd/compress/zstd_compress_sequences.cpp src/duckdb/third_party/zstd/compress/zstd_compress_superblock.cpp src/duckdb/third_party/zstd/compress/zstd_double_fast.cpp src/duckdb/third_party/zstd/compress/zstd_fast.cpp src/duckdb/third_party/zstd/compress/zstd_lazy.cpp src/duckdb/third_party/zstd/compress/zstd_ldm.cpp src/duckdb/third_party/zstd/compress/zstd_opt.cpp src/duckdb/third_party/lz4/lz4.cpp src/duckdb/extension/icu/./icu-table-range.cpp src/duckdb/extension/icu/./icu-makedate.cpp src/duckdb/extension/icu/./icu-list-range.cpp src/duckdb/extension/icu/./icu-timebucket.cpp src/duckdb/extension/icu/./icu-timezone.cpp src/duckdb/extension/icu/./icu-dateadd.cpp src/duckdb/extension/icu/./icu-datetrunc.cpp src/duckdb/extension/icu/./icu-datesub.cpp src/duckdb/extension/icu/./icu_extension.cpp src/duckdb/extension/icu/./icu-strptime.cpp src/duckdb/extension/icu/./icu-datefunc.cpp src/duckdb/extension/icu/./icu-datepart.cpp src/duckdb/ub_extension_icu_third_party_icu_common.cpp src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp src/duckdb/extension/icu/third_party/icu/stubdata/stubdata.cpp src/duckdb/extension/json/buffered_json_reader.cpp src/duckdb/extension/json/json_enums.cpp src/duckdb/extension/json/json_extension.cpp src/duckdb/extension/json/json_common.cpp src/duckdb/extension/json/json_functions.cpp src/duckdb/extension/json/json_scan.cpp src/duckdb/extension/json/json_serializer.cpp src/duckdb/extension/json/json_deserializer.cpp src/duckdb/extension/json/serialize_json.cpp src/duckdb/ub_extension_json_json_functions.cpp) set(CMAKE_JAVA_COMPILE_FLAGS -source 1.8 -target 1.8 -encoding utf-8) diff --git a/src/duckdb/extension/icu/icu_extension.cpp b/src/duckdb/extension/icu/icu_extension.cpp index bf09f4e1..46efa60b 100644 --- a/src/duckdb/extension/icu/icu_extension.cpp +++ b/src/duckdb/extension/icu/icu_extension.cpp @@ -62,8 +62,35 @@ struct IcuBindData : public FunctionData { auto &other = other_p.Cast(); return language == other.language && country == other.country; } + + static void Serialize(Serializer &serializer, const optional_ptr bind_data_p, + const ScalarFunction &function) { + auto &bind_data = bind_data_p->Cast(); + serializer.WriteProperty(100, "language", bind_data.language); + serializer.WriteProperty(101, "country", bind_data.country); + } + + static unique_ptr Deserialize(Deserializer &deserializer, ScalarFunction &function) { + string language; + string country; + deserializer.ReadProperty(100, "language", language); + deserializer.ReadProperty(101, "country", country); + + return make_uniq(language, country); + } + + static const string FUNCTION_PREFIX; + + static string EncodeFunctionName(const string &collation) { + return FUNCTION_PREFIX + collation; + } + static string DecodeFunctionName(const string &fname) { + return fname.substr(FUNCTION_PREFIX.size()); + } }; +const string IcuBindData::FUNCTION_PREFIX = "icu_collate_"; + static int32_t ICUGetSortKey(icu::Collator &collator, string_t input, duckdb::unique_ptr &buffer, int32_t &buffer_size) { icu::UnicodeString unicode_string = @@ -108,7 +135,9 @@ static void ICUCollateFunction(DataChunk &args, ExpressionState &state, Vector & static duckdb::unique_ptr ICUCollateBind(ClientContext &context, ScalarFunction &bound_function, vector> &arguments) { - auto splits = StringUtil::Split(bound_function.name, "_"); + + const auto collation = IcuBindData::DecodeFunctionName(bound_function.name); + auto splits = StringUtil::Split(collation, "_"); if (splits.size() == 1) { return make_uniq(splits[0], ""); } else if (splits.size() == 2) { @@ -137,19 +166,11 @@ static duckdb::unique_ptr ICUSortKeyBind(ClientContext &context, S } } -static void ICUCollateSerialize(Serializer &serializer, const optional_ptr bind_data, - const ScalarFunction &function) { - throw NotImplementedException("FIXME: serialize icu-collate"); -} - -static duckdb::unique_ptr ICUCollateDeserialize(Deserializer &deserializer, ScalarFunction &function) { - throw NotImplementedException("FIXME: serialize icu-collate"); -} - -static ScalarFunction GetICUFunction(const string &collation) { - ScalarFunction result(collation, {LogicalType::VARCHAR}, LogicalType::VARCHAR, ICUCollateFunction, ICUCollateBind); - result.serialize = ICUCollateSerialize; - result.deserialize = ICUCollateDeserialize; +static ScalarFunction GetICUCollateFunction(const string &collation) { + string fname = IcuBindData::EncodeFunctionName(collation); + ScalarFunction result(fname, {LogicalType::VARCHAR}, LogicalType::VARCHAR, ICUCollateFunction, ICUCollateBind); + result.serialize = IcuBindData::Serialize; + result.deserialize = IcuBindData::Deserialize; return result; } @@ -238,7 +259,7 @@ static void LoadInternal(DuckDB &ddb) { } collation = StringUtil::Lower(collation); - CreateCollationInfo info(collation, GetICUFunction(collation), false, false); + CreateCollationInfo info(collation, GetICUCollateFunction(collation), false, false); ExtensionUtil::RegisterCollation(db, info); } ScalarFunction sort_key("icu_sort_key", {LogicalType::VARCHAR, LogicalType::VARCHAR}, LogicalType::VARCHAR, @@ -283,6 +304,14 @@ std::string IcuExtension::Name() { return "icu"; } +std::string IcuExtension::Version() const { +#ifdef EXT_VERSION_ICU + return EXT_VERSION_ICU; +#else + return ""; +#endif +} + } // namespace duckdb extern "C" { diff --git a/src/duckdb/extension/icu/include/icu_extension.hpp b/src/duckdb/extension/icu/include/icu_extension.hpp index e1127e93..9577a470 100644 --- a/src/duckdb/extension/icu/include/icu_extension.hpp +++ b/src/duckdb/extension/icu/include/icu_extension.hpp @@ -16,6 +16,7 @@ class IcuExtension : public Extension { public: void Load(DuckDB &db) override; std::string Name() override; + std::string Version() const override; }; } // namespace duckdb diff --git a/src/duckdb/extension/icu/third_party/icu/i18n/basictz.cpp b/src/duckdb/extension/icu/third_party/icu/i18n/basictz.cpp index 54ee5a1a..4ad55f47 100644 --- a/src/duckdb/extension/icu/third_party/icu/i18n/basictz.cpp +++ b/src/duckdb/extension/icu/third_party/icu/i18n/basictz.cpp @@ -63,7 +63,7 @@ BasicTimeZone::hasEquivalentTransitions(const BasicTimeZone& tz, UDate start, UD } else { if (raw1 != raw2 || dst1 != dst2) { return FALSE; - } + } } // Check transitions in the range UDate time = start; @@ -159,7 +159,7 @@ BasicTimeZone::getSimpleRulesNear(UDate date, InitialTimeZoneRule*& initial, if (((tr.getFrom()->getDSTSavings() == 0 && tr.getTo()->getDSTSavings() != 0) || (tr.getFrom()->getDSTSavings() != 0 && tr.getTo()->getDSTSavings() == 0)) && (date + MILLIS_PER_YEAR > nextTransitionTime)) { - + int32_t year, month, dom, dow, doy, mid; UDate d; @@ -375,13 +375,13 @@ BasicTimeZone::getTimeZoneRulesAfter(UDate start, InitialTimeZoneRule*& initial, UDate updatedTime = tzt.getTime(); if (updatedTime == time) { // Can get here if rules for start & end of daylight time have exactly - // the same time. + // the same time. // TODO: fix getNextTransition() to prevent it? status = U_INVALID_STATE_ERROR; goto error; } time = updatedTime; - + const TimeZoneRule *toRule = tzt.getTo(); for (i = 0; i < ruleCount; i++) { r = (TimeZoneRule*)orgRules->elementAt(i); @@ -408,7 +408,7 @@ BasicTimeZone::getTimeZoneRulesAfter(UDate start, InitialTimeZoneRule*& initial, if (!avail) { break; } - if (*(tzt0.getTo()) == *tar) { + if (*tar == *(tzt0.getTo())) { break; } t = tzt0.getTime(); diff --git a/src/duckdb/extension/json/include/json_common.hpp b/src/duckdb/extension/json/include/json_common.hpp index 1e7da02f..bcc8d7c2 100644 --- a/src/duckdb/extension/json/include/json_common.hpp +++ b/src/duckdb/extension/json/include/json_common.hpp @@ -14,6 +14,8 @@ #include "duckdb/planner/expression/bound_function_expression.hpp" #include "yyjson.hpp" +using namespace duckdb_yyjson; // NOLINT + namespace duckdb { //! JSON allocator is a custom allocator for yyjson that prevents many tiny allocations @@ -108,6 +110,7 @@ struct JSONCommon { switch (yyjson_get_tag(val)) { case YYJSON_TYPE_NULL | YYJSON_SUBTYPE_NONE: return JSONCommon::TYPE_STRING_NULL; + case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NOESC: case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NONE: return JSONCommon::TYPE_STRING_VARCHAR; case YYJSON_TYPE_ARR | YYJSON_SUBTYPE_NONE: @@ -136,6 +139,7 @@ struct JSONCommon { switch (yyjson_get_tag(val)) { case YYJSON_TYPE_NULL | YYJSON_SUBTYPE_NONE: return LogicalTypeId::SQLNULL; + case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NOESC: case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NONE: return LogicalTypeId::VARCHAR; case YYJSON_TYPE_ARR | YYJSON_SUBTYPE_NONE: @@ -286,7 +290,8 @@ struct JSONCommon { private: //! Get JSON pointer (/field/index/... syntax) static inline yyjson_val *GetPointer(yyjson_val *val, const char *ptr, const idx_t &len) { - return len == 1 ? val : unsafe_yyjson_get_pointer(val, ptr, len); + yyjson_ptr_err err; + return len == 1 ? val : unsafe_yyjson_ptr_getx(val, ptr, len, &err); } //! Get JSON path ($.field[index]... syntax) static yyjson_val *GetPath(yyjson_val *val, const char *ptr, const idx_t &len); diff --git a/src/duckdb/extension/json/include/json_executors.hpp b/src/duckdb/extension/json/include/json_executors.hpp index 334170ee..78da4526 100644 --- a/src/duckdb/extension/json/include/json_executors.hpp +++ b/src/duckdb/extension/json/include/json_executors.hpp @@ -30,7 +30,7 @@ struct JSONExecutors { } //! Two-argument JSON read function (with path query), i.e. json_type('[1, 2, 3]', '$[0]') - template + template static void BinaryExecute(DataChunk &args, ExpressionState &state, Vector &result, std::function fun) { auto &func_expr = state.expr.Cast(); @@ -48,7 +48,7 @@ struct JSONExecutors { auto doc = JSONCommon::ReadDocument(input, JSONCommon::READ_FLAG, lstate.json_allocator.GetYYAlc()); auto val = JSONCommon::GetUnsafe(doc->root, ptr, len); - if (!val || unsafe_yyjson_is_null(val)) { + if (!val || (NULL_IF_NULL && unsafe_yyjson_is_null(val))) { mask.SetInvalid(idx); return T {}; } else { @@ -76,7 +76,7 @@ struct JSONExecutors { for (idx_t i = 0; i < vals.size(); i++) { auto &val = vals[i]; D_ASSERT(val != nullptr); // Wildcard extract shouldn't give back nullptrs - if (unsafe_yyjson_is_null(val)) { + if (NULL_IF_NULL && unsafe_yyjson_is_null(val)) { child_validity.SetInvalid(current_size + i); } else { child_vals[current_size + i] = fun(val, alc, result); @@ -109,7 +109,7 @@ struct JSONExecutors { } //! JSON read function with list of path queries, i.e. json_type('[1, 2, 3]', ['$[0]', '$[1]']) - template + template static void ExecuteMany(DataChunk &args, ExpressionState &state, Vector &result, std::function fun) { auto &func_expr = state.expr.Cast(); @@ -148,7 +148,7 @@ struct JSONExecutors { for (idx_t path_i = 0; path_i < num_paths; path_i++) { auto child_idx = offset + path_i; val = JSONCommon::GetUnsafe(doc->root, info.ptrs[path_i], info.lens[path_i]); - if (!val || unsafe_yyjson_is_null(val)) { + if (!val || (NULL_IF_NULL && unsafe_yyjson_is_null(val))) { child_validity.SetInvalid(child_idx); } else { child_data[child_idx] = fun(val, alc, child); diff --git a/src/duckdb/extension/json/include/json_extension.hpp b/src/duckdb/extension/json/include/json_extension.hpp index f5b9a2e4..421fb6f6 100644 --- a/src/duckdb/extension/json/include/json_extension.hpp +++ b/src/duckdb/extension/json/include/json_extension.hpp @@ -16,6 +16,7 @@ class JsonExtension : public Extension { public: void Load(DuckDB &db) override; std::string Name() override; + std::string Version() const override; }; } // namespace duckdb diff --git a/src/duckdb/extension/json/include/json_functions.hpp b/src/duckdb/extension/json/include/json_functions.hpp index 4f7f26b2..51fae296 100644 --- a/src/duckdb/extension/json/include/json_functions.hpp +++ b/src/duckdb/extension/json/include/json_functions.hpp @@ -70,8 +70,8 @@ class JSONFunctions { static vector GetScalarFunctions(); static vector GetPragmaFunctions(); static vector GetTableFunctions(); - static unique_ptr ReadJSONReplacement(ClientContext &context, const string &table_name, - ReplacementScanData *data); + static unique_ptr ReadJSONReplacement(ClientContext &context, ReplacementScanInput &input, + optional_ptr data); static TableFunction GetReadJSONTableFunction(shared_ptr function_info); static CopyFunction GetJSONCopyFunction(); static void RegisterSimpleCastFunctions(CastFunctionSet &casts); diff --git a/src/duckdb/extension/json/include/json_serializer.hpp b/src/duckdb/extension/json/include/json_serializer.hpp index d8f80a50..aa17f3ff 100644 --- a/src/duckdb/extension/json/include/json_serializer.hpp +++ b/src/duckdb/extension/json/include/json_serializer.hpp @@ -27,8 +27,8 @@ struct JsonSerializer : Serializer { public: explicit JsonSerializer(yyjson_mut_doc *doc, bool skip_if_null, bool skip_if_empty, bool skip_if_default) : doc(doc), stack({yyjson_mut_obj(doc)}), skip_if_null(skip_if_null), skip_if_empty(skip_if_empty) { - serialize_enum_as_string = true; - serialize_default_values = !skip_if_default; + options.serialize_enum_as_string = true; + options.serialize_default_values = !skip_if_default; } template diff --git a/src/duckdb/extension/json/json_common.cpp b/src/duckdb/extension/json/json_common.cpp index 65e5ba72..edb961e2 100644 --- a/src/duckdb/extension/json/json_common.cpp +++ b/src/duckdb/extension/json/json_common.cpp @@ -1,4 +1,5 @@ #include "json_common.hpp" + #include "duckdb/common/exception/binder_exception.hpp" namespace duckdb { @@ -31,16 +32,58 @@ string ThrowPathError(const char *ptr, const char *end, const bool binder) { } } -static inline idx_t ReadString(const char *ptr, const char *const end, const bool escaped) { +struct JSONKeyReadResult { +public: + static inline JSONKeyReadResult Empty() { + return {idx_t(0), string()}; + } + + static inline JSONKeyReadResult WildCard() { + return {1, "*"}; + } + + inline bool IsValid() { + return chars_read != 0; + } + + inline bool IsWildCard() { + return key == "*"; + } + +public: + idx_t chars_read; + string key; +}; + +static inline JSONKeyReadResult ReadString(const char *ptr, const char *const end, const bool escaped) { const char *const before = ptr; if (escaped) { + auto key = make_unsafe_uniq_array(end - ptr); + idx_t key_len = 0; + + bool backslash = false; while (ptr != end) { - if (*ptr == '"') { - break; + if (backslash) { + if (*ptr != '"' && *ptr != '\\') { + key[key_len++] = '\\'; + } + backslash = false; + } else { + if (*ptr == '"') { + break; + } else if (*ptr == '\\') { + backslash = true; + ptr++; + continue; + } } - ptr++; + key[key_len++] = *ptr++; + } + if (ptr == end || backslash) { + return JSONKeyReadResult::Empty(); + } else { + return {idx_t(ptr - before), string(key.get(), key_len)}; } - return ptr == end ? 0 : ptr - before; } else { while (ptr != end) { if (*ptr == '.' || *ptr == '[') { @@ -48,7 +91,7 @@ static inline idx_t ReadString(const char *ptr, const char *const end, const boo } ptr++; } - return ptr - before; + return {idx_t(ptr - before), string(before, ptr - before)}; } } @@ -79,28 +122,24 @@ static inline idx_t ReadInteger(const char *ptr, const char *const end, idx_t &i return idx >= (idx_t)IDX_T_MAX ? 0 : ptr - before; } -static inline bool ReadKey(const char *&ptr, const char *const end, const char *&key_ptr, idx_t &key_len) { +static inline JSONKeyReadResult ReadKey(const char *ptr, const char *const end) { D_ASSERT(ptr != end); if (*ptr == '*') { // Wildcard - ptr++; - key_len = DConstants::INVALID_INDEX; - return true; + return JSONKeyReadResult::WildCard(); } bool escaped = false; if (*ptr == '"') { ptr++; // Skip past opening '"' escaped = true; } - key_ptr = ptr; - key_len = ReadString(ptr, end, escaped); - if (key_len == 0) { - return false; + auto result = ReadString(ptr, end, escaped); + if (!result.IsValid()) { + return result; } - ptr += key_len; if (escaped) { - ptr++; // Skip past closing '"' + result.chars_read += 2; // Account for surrounding quotes } - return true; + return result; } static inline bool ReadArrayIndex(const char *&ptr, const char *const end, idx_t &array_index, bool &from_back) { @@ -155,14 +194,13 @@ JSONPathType JSONCommon::ValidatePath(const char *ptr, const idx_t &len, const b } switch (c) { case '.': { // Object field - const char *key_ptr; - idx_t key_len; - if (!ReadKey(ptr, end, key_ptr, key_len)) { + auto key = ReadKey(ptr, end); + if (!key.IsValid()) { ThrowPathError(ptr, end, binder); - } - if (key_len == DConstants::INVALID_INDEX) { + } else if (key.IsWildCard()) { path_type = JSONPathType::WILDCARD; } + ptr += key.chars_read; break; } case '[': { // Array index @@ -195,16 +233,10 @@ yyjson_val *JSONCommon::GetPath(yyjson_val *val, const char *ptr, const idx_t &l if (!unsafe_yyjson_is_obj(val)) { return nullptr; } - const char *key_ptr; - idx_t key_len; -#ifdef DEBUG - bool success = -#endif - ReadKey(ptr, end, key_ptr, key_len); -#ifdef DEBUG - D_ASSERT(success); -#endif - val = yyjson_obj_getn(val, key_ptr, key_len); + auto key_result = ReadKey(ptr, end); + D_ASSERT(key_result.IsValid()); + ptr += key_result.chars_read; + val = yyjson_obj_getn(val, key_result.key.c_str(), key_result.key.size()); break; } case '[': { // Array index @@ -243,16 +275,10 @@ void GetWildcardPathInternal(yyjson_val *val, const char *ptr, const char *const if (!unsafe_yyjson_is_obj(val)) { return; } - const char *key_ptr; - idx_t key_len; -#ifdef DEBUG - bool success = -#endif - ReadKey(ptr, end, key_ptr, key_len); -#ifdef DEBUG - D_ASSERT(success); -#endif - if (key_len == DConstants::INVALID_INDEX) { // Wildcard + auto key_result = ReadKey(ptr, end); + D_ASSERT(key_result.IsValid()); + ptr += key_result.chars_read; + if (key_result.IsWildCard()) { // Wildcard size_t idx, max; yyjson_val *key, *obj_val; yyjson_obj_foreach(val, idx, max, key, obj_val) { @@ -260,7 +286,7 @@ void GetWildcardPathInternal(yyjson_val *val, const char *ptr, const char *const } return; } - val = yyjson_obj_getn(val, key_ptr, key_len); + val = yyjson_obj_getn(val, key_result.key.c_str(), key_result.key.size()); break; } case '[': { // Array index diff --git a/src/duckdb/extension/json/json_extension.cpp b/src/duckdb/extension/json/json_extension.cpp index 88671d30..07bba320 100644 --- a/src/duckdb/extension/json/json_extension.cpp +++ b/src/duckdb/extension/json/json_extension.cpp @@ -68,6 +68,14 @@ std::string JsonExtension::Name() { return "json"; } +std::string JsonExtension::Version() const { +#ifdef EXT_VERSION_JSON + return EXT_VERSION_JSON; +#else + return ""; +#endif +} + } // namespace duckdb extern "C" { diff --git a/src/duckdb/extension/json/json_functions.cpp b/src/duckdb/extension/json/json_functions.cpp index e8241d6e..a4c818bc 100644 --- a/src/duckdb/extension/json/json_functions.cpp +++ b/src/duckdb/extension/json/json_functions.cpp @@ -16,7 +16,7 @@ using JSONPathType = JSONCommon::JSONPathType; static JSONPathType CheckPath(const Value &path_val, string &path, size_t &len) { if (path_val.IsNull()) { - throw InternalException("JSON path cannot be NULL"); + throw BinderException("JSON path cannot be NULL"); } const auto path_str_val = path_val.DefaultCastAs(LogicalType::VARCHAR); auto path_str = path_str_val.GetValueUnsafe(); @@ -194,8 +194,9 @@ vector JSONFunctions::GetTableFunctions() { return functions; } -unique_ptr JSONFunctions::ReadJSONReplacement(ClientContext &context, const string &table_name, - ReplacementScanData *data) { +unique_ptr JSONFunctions::ReadJSONReplacement(ClientContext &context, ReplacementScanInput &input, + optional_ptr data) { + auto &table_name = input.table_name; if (!ReplacementScan::CanReplace(table_name, {"json", "jsonl", "ndjson"})) { return nullptr; } diff --git a/src/duckdb/extension/json/json_functions/copy_json.cpp b/src/duckdb/extension/json/json_functions/copy_json.cpp index dd26e6d0..d6cdb847 100644 --- a/src/duckdb/extension/json/json_functions/copy_json.cpp +++ b/src/duckdb/extension/json/json_functions/copy_json.cpp @@ -5,6 +5,7 @@ #include "duckdb/parser/query_node/select_node.hpp" #include "duckdb/parser/tableref/subqueryref.hpp" #include "duckdb/planner/binder.hpp" +#include "duckdb/common/helper.hpp" #include "json_functions.hpp" #include "json_scan.hpp" #include "json_transform.hpp" @@ -18,14 +19,14 @@ static void ThrowJSONCopyParameterException(const string &loption) { static BoundStatement CopyToJSONPlan(Binder &binder, CopyStatement &stmt) { auto stmt_copy = stmt.Copy(); auto © = stmt_copy->Cast(); - auto &info = *copy.info; + auto &copied_info = *copy.info; // Parse the options, creating options for the CSV writer while doing so string date_format; string timestamp_format; // We insert the JSON file extension here so it works properly with PER_THREAD_OUTPUT/FILE_SIZE_BYTES etc. case_insensitive_map_t> csv_copy_options {{"file_extension", {"json"}}}; - for (const auto &kv : info.options) { + for (const auto &kv : copied_info.options) { const auto &loption = StringUtil::Lower(kv.first); if (loption == "dateformat" || loption == "date_format") { if (kv.second.size() != 1) { @@ -57,16 +58,17 @@ static BoundStatement CopyToJSONPlan(Binder &binder, CopyStatement &stmt) { } // Bind the select statement of the original to resolve the types - auto dummy_binder = Binder::CreateBinder(binder.context, &binder, true); - auto bound_original = dummy_binder->Bind(*stmt.select_statement); + auto dummy_binder = Binder::CreateBinder(binder.context, &binder); + auto bound_original = dummy_binder->Bind(*stmt.info->select_statement); // Create new SelectNode with the original SelectNode as a subquery in the FROM clause auto select_stmt = make_uniq(); - select_stmt->node = std::move(copy.select_statement); + select_stmt->node = std::move(copied_info.select_statement); auto subquery_ref = make_uniq(std::move(select_stmt)); - copy.select_statement = make_uniq_base(); - auto &new_select_node = copy.select_statement->Cast(); - new_select_node.from_table = std::move(subquery_ref); + + copied_info.select_statement = make_uniq_base(); + auto &select_node = copied_info.select_statement->Cast(); + select_node.from_table = std::move(subquery_ref); // Create new select list vector> select_list; @@ -94,18 +96,17 @@ static BoundStatement CopyToJSONPlan(Binder &binder, CopyStatement &stmt) { } // Now create the struct_pack/to_json to create a JSON object per row - auto &select_node = copy.select_statement->Cast(); vector> struct_pack_child; struct_pack_child.emplace_back(make_uniq("struct_pack", std::move(select_list))); select_node.select_list.emplace_back(make_uniq("to_json", std::move(struct_pack_child))); // Now we can just use the CSV writer - info.format = "csv"; - info.options = std::move(csv_copy_options); - info.options["quote"] = {""}; - info.options["escape"] = {""}; - info.options["delimiter"] = {"\n"}; - info.options["header"] = {{0}}; + copied_info.format = "csv"; + copied_info.options = std::move(csv_copy_options); + copied_info.options["quote"] = {""}; + copied_info.options["escape"] = {""}; + copied_info.options["delimiter"] = {"\n"}; + copied_info.options["header"] = {{0}}; return binder.Bind(*stmt_copy); } @@ -184,7 +185,7 @@ CopyFunction JSONFunctions::GetJSONCopyFunction() { function.plan = CopyToJSONPlan; function.copy_from_bind = CopyFromJSONBind; - function.copy_from_function = JSONFunctions::GetReadJSONTableFunction(make_shared( + function.copy_from_function = JSONFunctions::GetReadJSONTableFunction(make_shared_ptr( JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED, JSONRecordType::RECORDS, false)); return function; diff --git a/src/duckdb/extension/json/json_functions/json_create.cpp b/src/duckdb/extension/json/json_functions/json_create.cpp index 2167ae90..a903cb99 100644 --- a/src/duckdb/extension/json/json_functions/json_create.cpp +++ b/src/duckdb/extension/json/json_functions/json_create.cpp @@ -313,8 +313,10 @@ static void CreateValuesMap(const StructNames &names, yyjson_mut_doc *doc, yyjso // Create nested keys auto &map_key_v = MapVector::GetKeys(value_v); auto map_key_count = ListVector::GetListSize(value_v); + Vector map_keys_string(LogicalType::VARCHAR, map_key_count); + VectorOperations::DefaultCast(map_key_v, map_keys_string, map_key_count); auto nested_keys = JSONCommon::AllocateArray(doc, map_key_count); - TemplatedCreateValues(doc, nested_keys, map_key_v, map_key_count); + TemplatedCreateValues(doc, nested_keys, map_keys_string, map_key_count); // Create nested values auto &map_val_v = MapVector::GetValues(value_v); auto map_val_count = ListVector::GetListSize(value_v); diff --git a/src/duckdb/extension/json/json_functions/json_structure.cpp b/src/duckdb/extension/json/json_functions/json_structure.cpp index 0fd574f8..e6fb3456 100644 --- a/src/duckdb/extension/json/json_functions/json_structure.cpp +++ b/src/duckdb/extension/json/json_functions/json_structure.cpp @@ -388,22 +388,28 @@ static inline void ExtractStructureObject(yyjson_val *obj, JSONStructureNode &no auto &description = node.GetOrCreateDescription(LogicalTypeId::STRUCT); // Keep track of keys so we can detect duplicates - case_insensitive_set_t obj_keys; + unordered_set obj_keys; + case_insensitive_set_t ci_obj_keys; size_t idx, max; yyjson_val *key, *val; yyjson_obj_foreach(obj, idx, max, key, val) { - auto key_ptr = unsafe_yyjson_get_str(key); - auto key_len = unsafe_yyjson_get_len(key); - auto insert_result = obj_keys.insert(string(key_ptr, key_len)); - if (!ignore_errors && !insert_result.second) { - JSONCommon::ThrowValFormatError("Duplicate key \"" + string(key_ptr, key_len) + "\" in object %s", obj); + const string obj_key(unsafe_yyjson_get_str(key), unsafe_yyjson_get_len(key)); + auto insert_result = obj_keys.insert(obj_key); + if (!ignore_errors && !insert_result.second) { // Exact match + JSONCommon::ThrowValFormatError("Duplicate key \"" + obj_key + "\" in object %s", obj); + } + insert_result = ci_obj_keys.insert(obj_key); + if (!ignore_errors && !insert_result.second) { // Case-insensitive match + JSONCommon::ThrowValFormatError("Duplicate key (different case) \"" + obj_key + "\" and \"" + + *insert_result.first + "\" in object %s", + obj); } description.GetOrCreateChild(key, val, ignore_errors); } } -static inline void ExtractStructureVal(yyjson_val *val, JSONStructureNode &node, const bool ignore_errors) { +static inline void ExtractStructureVal(yyjson_val *val, JSONStructureNode &node) { D_ASSERT(!yyjson_is_arr(val) && !yyjson_is_obj(val)); node.GetOrCreateDescription(JSONCommon::ValTypeToLogicalTypeId(val)); } @@ -416,7 +422,7 @@ void JSONStructure::ExtractStructure(yyjson_val *val, JSONStructureNode &node, c case YYJSON_TYPE_OBJ | YYJSON_SUBTYPE_NONE: return ExtractStructureObject(val, node, ignore_errors); default: - return ExtractStructureVal(val, node, ignore_errors); + return ExtractStructureVal(val, node); } } @@ -475,9 +481,9 @@ static inline yyjson_mut_val *ConvertStructure(const JSONStructureNode &node, yy } } -static inline string_t JSONStructureFunction(yyjson_val *val, yyjson_alc *alc, Vector &result) { +static inline string_t JSONStructureFunction(yyjson_val *val, yyjson_alc *alc, Vector &) { return JSONCommon::WriteVal( - ConvertStructure(ExtractStructureInternal(val, false), yyjson_mut_doc_new(alc)), alc); + ConvertStructure(ExtractStructureInternal(val, true), yyjson_mut_doc_new(alc)), alc); } static void StructureFunction(DataChunk &args, ExpressionState &state, Vector &result) { @@ -497,8 +503,7 @@ ScalarFunctionSet JSONFunctions::GetStructureFunction() { } static LogicalType StructureToTypeArray(ClientContext &context, const JSONStructureNode &node, const idx_t max_depth, - const double field_appearance_threshold, idx_t depth, - const idx_t sample_count) { + const double field_appearance_threshold, idx_t depth) { D_ASSERT(node.descriptions.size() == 1 && node.descriptions[0].type == LogicalTypeId::LIST); const auto &desc = node.descriptions[0]; D_ASSERT(desc.children.size() == 1); @@ -565,7 +570,7 @@ LogicalType JSONStructure::StructureToType(ClientContext &context, const JSONStr D_ASSERT(desc.type != LogicalTypeId::INVALID); switch (desc.type) { case LogicalTypeId::LIST: - return StructureToTypeArray(context, node, max_depth, field_appearance_threshold, depth, sample_count); + return StructureToTypeArray(context, node, max_depth, field_appearance_threshold, depth); case LogicalTypeId::STRUCT: return StructureToTypeObject(context, node, max_depth, field_appearance_threshold, depth, sample_count); case LogicalTypeId::VARCHAR: diff --git a/src/duckdb/extension/json/json_functions/json_transform.cpp b/src/duckdb/extension/json/json_functions/json_transform.cpp index 7aa0345b..e6b724f4 100644 --- a/src/duckdb/extension/json/json_functions/json_transform.cpp +++ b/src/duckdb/extension/json/json_functions/json_transform.cpp @@ -59,6 +59,7 @@ static LogicalType StructureStringToType(yyjson_val *val, ClientContext &context return StructureStringToTypeArray(val, context); case YYJSON_TYPE_OBJ | YYJSON_SUBTYPE_NONE: return StructureToTypeObject(val, context); + case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NOESC: case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NONE: return TransformStringToLogicalType(unsafe_yyjson_get_str(val), context); default: @@ -99,6 +100,7 @@ static inline bool GetValueNumerical(yyjson_val *val, T &result, JSONTransformOp D_ASSERT(unsafe_yyjson_get_tag(val) != (YYJSON_TYPE_NULL | YYJSON_SUBTYPE_NONE)); bool success; switch (unsafe_yyjson_get_tag(val)) { + case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NOESC: case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NONE: success = OP::template Operation(GetString(val), result, options.strict_cast); break; @@ -134,6 +136,7 @@ static inline bool GetValueDecimal(yyjson_val *val, T &result, uint8_t w, uint8_ D_ASSERT(unsafe_yyjson_get_tag(val) != (YYJSON_TYPE_NULL | YYJSON_SUBTYPE_NONE)); bool success; switch (unsafe_yyjson_get_tag(val)) { + case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NOESC: case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NONE: success = OP::template Operation(GetString(val), result, options.parameters, w, s); break; @@ -167,6 +170,7 @@ static inline bool GetValueDecimal(yyjson_val *val, T &result, uint8_t w, uint8_ static inline bool GetValueString(yyjson_val *val, yyjson_alc *alc, string_t &result, Vector &vector) { D_ASSERT(unsafe_yyjson_get_tag(val) != (YYJSON_TYPE_NULL | YYJSON_SUBTYPE_NONE)); switch (unsafe_yyjson_get_tag(val)) { + case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NOESC: case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NONE: result = string_t(unsafe_yyjson_get_str(val), unsafe_yyjson_get_len(val)); return true; diff --git a/src/duckdb/extension/json/json_functions/json_type.cpp b/src/duckdb/extension/json/json_functions/json_type.cpp index b1e9dbcc..8f3fb3ad 100644 --- a/src/duckdb/extension/json/json_functions/json_type.cpp +++ b/src/duckdb/extension/json/json_functions/json_type.cpp @@ -11,11 +11,11 @@ static void UnaryTypeFunction(DataChunk &args, ExpressionState &state, Vector &r } static void BinaryTypeFunction(DataChunk &args, ExpressionState &state, Vector &result) { - JSONExecutors::BinaryExecute(args, state, result, GetType); + JSONExecutors::BinaryExecute(args, state, result, GetType); } static void ManyTypeFunction(DataChunk &args, ExpressionState &state, Vector &result) { - JSONExecutors::ExecuteMany(args, state, result, GetType); + JSONExecutors::ExecuteMany(args, state, result, GetType); } static void GetTypeFunctionsInternal(ScalarFunctionSet &set, const LogicalType &input_type) { diff --git a/src/duckdb/extension/json/json_functions/read_json.cpp b/src/duckdb/extension/json/json_functions/read_json.cpp index 3640e0a7..9dc6bfde 100644 --- a/src/duckdb/extension/json/json_functions/read_json.cpp +++ b/src/duckdb/extension/json/json_functions/read_json.cpp @@ -3,6 +3,7 @@ #include "json_scan.hpp" #include "json_structure.hpp" #include "json_transform.hpp" +#include "duckdb/common/helper.hpp" namespace duckdb { @@ -276,8 +277,10 @@ unique_ptr ReadJSONBind(ClientContext &context, TableFunctionBindI D_ASSERT(return_types.size() == names.size()); } - bind_data->reader_bind = - MultiFileReader::BindOptions(bind_data->options.file_options, bind_data->files, return_types, names); + SimpleMultiFileList file_list(std::move(bind_data->files)); + MultiFileReader().BindOptions(bind_data->options.file_options, file_list, return_types, names, + bind_data->reader_bind); + bind_data->files = file_list.GetAllFiles(); auto &transform_options = bind_data->transform_options; transform_options.strict_cast = !bind_data->ignore_errors; @@ -344,7 +347,7 @@ static void ReadJSONFunction(ClientContext &context, TableFunctionInput &data_p, } if (output.size() != 0) { - MultiFileReader::FinalizeChunk(gstate.bind_data.reader_bind, lstate.GetReaderData(), output); + MultiFileReader().FinalizeChunk(context, gstate.bind_data.reader_bind, lstate.GetReaderData(), output, nullptr); } } @@ -381,26 +384,26 @@ TableFunctionSet CreateJSONFunctionInfo(string name, shared_ptr in } TableFunctionSet JSONFunctions::GetReadJSONFunction() { - auto info = - make_shared(JSONScanType::READ_JSON, JSONFormat::AUTO_DETECT, JSONRecordType::AUTO_DETECT, true); + auto info = make_shared_ptr(JSONScanType::READ_JSON, JSONFormat::AUTO_DETECT, + JSONRecordType::AUTO_DETECT, true); return CreateJSONFunctionInfo("read_json", std::move(info)); } TableFunctionSet JSONFunctions::GetReadNDJSONFunction() { - auto info = make_shared(JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED, - JSONRecordType::AUTO_DETECT, true); + auto info = make_shared_ptr(JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED, + JSONRecordType::AUTO_DETECT, true); return CreateJSONFunctionInfo("read_ndjson", std::move(info)); } TableFunctionSet JSONFunctions::GetReadJSONAutoFunction() { - auto info = - make_shared(JSONScanType::READ_JSON, JSONFormat::AUTO_DETECT, JSONRecordType::AUTO_DETECT, true); + auto info = make_shared_ptr(JSONScanType::READ_JSON, JSONFormat::AUTO_DETECT, + JSONRecordType::AUTO_DETECT, true); return CreateJSONFunctionInfo("read_json_auto", std::move(info)); } TableFunctionSet JSONFunctions::GetReadNDJSONAutoFunction() { - auto info = make_shared(JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED, - JSONRecordType::AUTO_DETECT, true); + auto info = make_shared_ptr(JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED, + JSONRecordType::AUTO_DETECT, true); return CreateJSONFunctionInfo("read_ndjson_auto", std::move(info)); } diff --git a/src/duckdb/extension/json/json_functions/read_json_objects.cpp b/src/duckdb/extension/json/json_functions/read_json_objects.cpp index 197a6a34..46d4e798 100644 --- a/src/duckdb/extension/json/json_functions/read_json_objects.cpp +++ b/src/duckdb/extension/json/json_functions/read_json_objects.cpp @@ -1,6 +1,7 @@ #include "json_common.hpp" #include "json_functions.hpp" #include "json_scan.hpp" +#include "duckdb/common/helper.hpp" namespace duckdb { @@ -13,8 +14,10 @@ unique_ptr ReadJSONObjectsBind(ClientContext &context, TableFuncti return_types.push_back(LogicalType::JSON()); names.emplace_back("json"); - bind_data->reader_bind = - MultiFileReader::BindOptions(bind_data->options.file_options, bind_data->files, return_types, names); + SimpleMultiFileList file_list(std::move(bind_data->files)); + MultiFileReader().BindOptions(bind_data->options.file_options, file_list, return_types, names, + bind_data->reader_bind); + bind_data->files = file_list.GetAllFiles(); return std::move(bind_data); } @@ -44,7 +47,7 @@ static void ReadJSONObjectsFunction(ClientContext &context, TableFunctionInput & output.SetCardinality(count); if (output.size() != 0) { - MultiFileReader::FinalizeChunk(gstate.bind_data.reader_bind, lstate.GetReaderData(), output); + MultiFileReader().FinalizeChunk(context, gstate.bind_data.reader_bind, lstate.GetReaderData(), output, nullptr); } } @@ -61,7 +64,7 @@ TableFunction GetReadJSONObjectsTableFunction(bool list_parameter, shared_ptr(JSONScanType::READ_JSON_OBJECTS, JSONFormat::ARRAY, JSONRecordType::RECORDS); + make_shared_ptr(JSONScanType::READ_JSON_OBJECTS, JSONFormat::ARRAY, JSONRecordType::RECORDS); function_set.AddFunction(GetReadJSONObjectsTableFunction(false, function_info)); function_set.AddFunction(GetReadJSONObjectsTableFunction(true, function_info)); return function_set; @@ -69,8 +72,8 @@ TableFunctionSet JSONFunctions::GetReadJSONObjectsFunction() { TableFunctionSet JSONFunctions::GetReadNDJSONObjectsFunction() { TableFunctionSet function_set("read_ndjson_objects"); - auto function_info = make_shared(JSONScanType::READ_JSON_OBJECTS, JSONFormat::NEWLINE_DELIMITED, - JSONRecordType::RECORDS); + auto function_info = make_shared_ptr(JSONScanType::READ_JSON_OBJECTS, JSONFormat::NEWLINE_DELIMITED, + JSONRecordType::RECORDS); function_set.AddFunction(GetReadJSONObjectsTableFunction(false, function_info)); function_set.AddFunction(GetReadJSONObjectsTableFunction(true, function_info)); return function_set; @@ -78,8 +81,8 @@ TableFunctionSet JSONFunctions::GetReadNDJSONObjectsFunction() { TableFunctionSet JSONFunctions::GetReadJSONObjectsAutoFunction() { TableFunctionSet function_set("read_json_objects_auto"); - auto function_info = - make_shared(JSONScanType::READ_JSON_OBJECTS, JSONFormat::AUTO_DETECT, JSONRecordType::RECORDS); + auto function_info = make_shared_ptr(JSONScanType::READ_JSON_OBJECTS, JSONFormat::AUTO_DETECT, + JSONRecordType::RECORDS); function_set.AddFunction(GetReadJSONObjectsTableFunction(false, function_info)); function_set.AddFunction(GetReadJSONObjectsTableFunction(true, function_info)); return function_set; diff --git a/src/duckdb/extension/json/json_scan.cpp b/src/duckdb/extension/json/json_scan.cpp index b6989b6b..f406e162 100644 --- a/src/duckdb/extension/json/json_scan.cpp +++ b/src/duckdb/extension/json/json_scan.cpp @@ -29,7 +29,7 @@ void JSONScanData::Bind(ClientContext &context, TableFunctionBindInput &input) { auto_detect = info.auto_detect; for (auto &kv : input.named_parameters) { - if (MultiFileReader::ParseOption(kv.first, kv.second, options.file_options, context)) { + if (MultiFileReader().ParseOption(kv.first, kv.second, options.file_options, context)) { continue; } auto loption = StringUtil::Lower(kv.first); @@ -60,8 +60,12 @@ void JSONScanData::Bind(ClientContext &context, TableFunctionBindInput &input) { } } - files = MultiFileReader::GetFileList(context, input.inputs[0], "JSON"); - options.file_options.AutoDetectHivePartitioning(files, context); + auto multi_file_reader = MultiFileReader::Create(input.table_function); + auto file_list = multi_file_reader->CreateFileList(context, input.inputs[0]); + options.file_options.AutoDetectHivePartitioning(*file_list, context); + + // TODO: store the MultiFilelist instead + files = file_list->GetAllFiles(); InitializeReaders(context); } @@ -201,9 +205,9 @@ unique_ptr JSONGlobalTableFunctionState::Init(ClientCo vector dummy_types(input.column_ids.size(), LogicalType::ANY); for (auto &reader : gstate.json_readers) { - MultiFileReader::FinalizeBind(reader->GetOptions().file_options, gstate.bind_data.reader_bind, - reader->GetFileName(), gstate.names, dummy_types, bind_data.names, - input.column_ids, reader->reader_data, context); + MultiFileReader().FinalizeBind(reader->GetOptions().file_options, gstate.bind_data.reader_bind, + reader->GetFileName(), gstate.names, dummy_types, bind_data.names, + input.column_ids, reader->reader_data, context, nullptr); } return std::move(result); @@ -973,10 +977,16 @@ unique_ptr JSONScan::Cardinality(ClientContext &, const Function void JSONScan::ComplexFilterPushdown(ClientContext &context, LogicalGet &get, FunctionData *bind_data_p, vector> &filters) { auto &data = bind_data_p->Cast(); - auto reset_reader = - MultiFileReader::ComplexFilterPushdown(context, data.files, data.options.file_options, get, filters); - if (reset_reader) { - MultiFileReader::PruneReaders(data); + + SimpleMultiFileList file_list(std::move(data.files)); + + auto filtered_list = + MultiFileReader().ComplexFilterPushdown(context, file_list, data.options.file_options, get, filters); + if (filtered_list) { + MultiFileReader().PruneReaders(data, *filtered_list); + data.files = filtered_list->GetAllFiles(); + } else { + data.files = file_list.GetAllFiles(); } } @@ -995,7 +1005,7 @@ unique_ptr JSONScan::Deserialize(Deserializer &deserializer, Table } void JSONScan::TableFunctionDefaults(TableFunction &table_function) { - MultiFileReader::AddParameters(table_function); + MultiFileReader().AddParameters(table_function); table_function.named_parameters["maximum_object_size"] = LogicalType::UINTEGER; table_function.named_parameters["ignore_errors"] = LogicalType::BOOLEAN; diff --git a/src/duckdb/extension/parquet/column_reader.cpp b/src/duckdb/extension/parquet/column_reader.cpp index b21d85fd..08471fdf 100644 --- a/src/duckdb/extension/parquet/column_reader.cpp +++ b/src/duckdb/extension/parquet/column_reader.cpp @@ -12,6 +12,7 @@ #include "row_number_column_reader.hpp" #include "snappy.h" #include "string_column_reader.hpp" +#include "null_column_reader.hpp" #include "struct_column_reader.hpp" #include "templated_column_reader.hpp" #include "utf8proc_wrapper.hpp" @@ -19,6 +20,7 @@ #include "lz4.hpp" #ifndef DUCKDB_AMALGAMATION +#include "duckdb/common/helper.hpp" #include "duckdb/common/types/bit.hpp" #include "duckdb/common/types/blob.hpp" #endif @@ -303,7 +305,7 @@ void ColumnReader::PreparePageV2(PageHeader &page_hdr) { void ColumnReader::AllocateBlock(idx_t size) { if (!block) { - block = make_shared(GetAllocator(), size); + block = make_shared_ptr(GetAllocator(), size); } else { block->resize(GetAllocator(), size); } @@ -515,7 +517,7 @@ idx_t ColumnReader::Read(uint64_t num_values, parquet_filter_t &filter, data_ptr result); } else if (dbp_decoder) { // TODO keep this in the state - auto read_buf = make_shared(); + auto read_buf = make_shared_ptr(); switch (schema.type) { case duckdb_parquet::format::Type::INT32: @@ -536,7 +538,7 @@ idx_t ColumnReader::Read(uint64_t num_values, parquet_filter_t &filter, data_ptr } else if (rle_decoder) { // RLE encoding for boolean D_ASSERT(type.id() == LogicalTypeId::BOOLEAN); - auto read_buf = make_shared(); + auto read_buf = make_shared_ptr(); read_buf->resize(reader.allocator, sizeof(bool) * (read_now - null_count)); rle_decoder->GetBatch(read_buf->ptr, read_now - null_count); PlainTemplated>(read_buf, define_out, read_now, filter, @@ -545,7 +547,7 @@ idx_t ColumnReader::Read(uint64_t num_values, parquet_filter_t &filter, data_ptr // DELTA_BYTE_ARRAY or DELTA_LENGTH_BYTE_ARRAY DeltaByteArray(define_out, read_now, filter, result_offset, result); } else if (bss_decoder) { - auto read_buf = make_shared(); + auto read_buf = make_shared_ptr(); switch (schema.type) { case duckdb_parquet::format::Type::FLOAT: @@ -661,7 +663,7 @@ void StringColumnReader::Dictionary(shared_ptr data, idx_t num static shared_ptr ReadDbpData(Allocator &allocator, ResizeableBuffer &buffer, idx_t &value_count) { auto decoder = make_uniq(buffer.ptr, buffer.len); value_count = decoder->TotalValues(); - auto result = make_shared(); + auto result = make_shared_ptr(); result->resize(allocator, sizeof(uint32_t) * value_count); decoder->GetBatch(result->ptr, value_count); decoder->Finalize(); @@ -1533,6 +1535,8 @@ unique_ptr ColumnReader::CreateReader(ParquetReader &reader, const return make_uniq(reader, type_p, schema_p, file_idx_p, max_define, max_repeat); case LogicalTypeId::INTERVAL: return make_uniq(reader, type_p, schema_p, file_idx_p, max_define, max_repeat); + case LogicalTypeId::SQLNULL: + return make_uniq(reader, type_p, schema_p, file_idx_p, max_define, max_repeat); default: break; } diff --git a/src/duckdb/extension/parquet/column_writer.cpp b/src/duckdb/extension/parquet/column_writer.cpp index 89755048..11ded115 100644 --- a/src/duckdb/extension/parquet/column_writer.cpp +++ b/src/duckdb/extension/parquet/column_writer.cpp @@ -69,6 +69,10 @@ static uint8_t GetVarintSize(uint32_t val) { ColumnWriterStatistics::~ColumnWriterStatistics() { } +bool ColumnWriterStatistics::HasStats() { + return false; +} + string ColumnWriterStatistics::GetMin() { return string(); } @@ -221,11 +225,16 @@ void ColumnWriter::CompressPage(MemoryStream &temp_writer, size_t &compressed_si break; } case CompressionCodec::ZSTD: { + auto configured_compression = writer.CompressionLevel(); + int compress_level = ZSTD_CLEVEL_DEFAULT; + if (configured_compression.IsValid()) { + compress_level = static_cast(configured_compression.GetIndex()); + } compressed_size = duckdb_zstd::ZSTD_compressBound(temp_writer.GetPosition()); compressed_buf = unique_ptr(new data_t[compressed_size]); - compressed_size = duckdb_zstd::ZSTD_compress((void *)compressed_buf.get(), compressed_size, - (const void *)temp_writer.GetData(), temp_writer.GetPosition(), - ZSTD_CLEVEL_DEFAULT); + compressed_size = + duckdb_zstd::ZSTD_compress((void *)compressed_buf.get(), compressed_size, + (const void *)temp_writer.GetData(), temp_writer.GetPosition(), compress_level); compressed_data = compressed_buf.get(); break; } @@ -480,7 +489,7 @@ void BasicColumnWriter::BeginWrite(ColumnWriterState &state_p) { auto &page_info = state.page_info[page_idx]; if (page_info.row_count == 0) { D_ASSERT(page_idx + 1 == state.page_info.size()); - state.page_info.erase(state.page_info.begin() + page_idx); + state.page_info.erase_at(page_idx); break; } PageWriteInformation write_info; @@ -585,7 +594,7 @@ void BasicColumnWriter::FlushPage(BasicColumnWriterState &state) { D_ASSERT(hdr.compressed_page_size > 0); if (write_info.compressed_buf) { - // if the data has been compressed, we no longer need the compressed data + // if the data has been compressed, we no longer need the uncompressed data D_ASSERT(write_info.compressed_buf.get() == write_info.compressed_data); write_info.temp_writer.reset(); } @@ -646,15 +655,12 @@ void BasicColumnWriter::SetParquetStatistics(BasicColumnWriterState &state, column_chunk.meta_data.statistics.__isset.max = true; column_chunk.meta_data.__isset.statistics = true; } - auto min_value = state.stats_state->GetMinValue(); - if (!min_value.empty()) { - column_chunk.meta_data.statistics.min_value = std::move(min_value); + if (state.stats_state->HasStats()) { + column_chunk.meta_data.statistics.min_value = state.stats_state->GetMinValue(); column_chunk.meta_data.statistics.__isset.min_value = true; column_chunk.meta_data.__isset.statistics = true; - } - auto max_value = state.stats_state->GetMaxValue(); - if (!max_value.empty()) { - column_chunk.meta_data.statistics.max_value = std::move(max_value); + + column_chunk.meta_data.statistics.max_value = state.stats_state->GetMaxValue(); column_chunk.meta_data.statistics.__isset.max_value = true; column_chunk.meta_data.__isset.statistics = true; } @@ -681,18 +687,24 @@ void BasicColumnWriter::FinalizeWrite(ColumnWriterState &state_p) { if (HasDictionary(state)) { column_chunk.meta_data.statistics.distinct_count = DictionarySize(state); column_chunk.meta_data.statistics.__isset.distinct_count = true; - column_chunk.meta_data.dictionary_page_offset = start_offset; + column_chunk.meta_data.dictionary_page_offset = column_writer.GetTotalWritten(); column_chunk.meta_data.__isset.dictionary_page_offset = true; FlushDictionary(state, state.stats_state.get()); } // record the start position of the pages for this column - column_chunk.meta_data.data_page_offset = column_writer.GetTotalWritten(); + column_chunk.meta_data.data_page_offset = 0; SetParquetStatistics(state, column_chunk); // write the individual pages to disk idx_t total_uncompressed_size = 0; for (auto &write_info : state.write_info) { + // set the data page offset whenever we see the *first* data page + if (column_chunk.meta_data.data_page_offset == 0 && (write_info.page_header.type == PageType::DATA_PAGE || + write_info.page_header.type == PageType::DATA_PAGE_V2)) { + column_chunk.meta_data.data_page_offset = column_writer.GetTotalWritten(); + ; + } D_ASSERT(write_info.page_header.uncompressed_page_size > 0); auto header_start_offset = column_writer.GetTotalWritten(); writer.Write(write_info.page_header); @@ -756,7 +768,7 @@ class NumericStatisticsState : public ColumnWriterStatistics { T max; public: - bool HasStats() { + bool HasStats() override { return min <= max; } @@ -902,7 +914,7 @@ class BooleanStatisticsState : public ColumnWriterStatistics { bool max; public: - bool HasStats() { + bool HasStats() override { return !(min && !max); } @@ -1024,7 +1036,7 @@ class FixedDecimalStatistics : public ColumnWriterStatistics { return string(const_char_ptr_cast(buffer), 16); } - bool HasStats() { + bool HasStats() override { return min <= max; } @@ -1190,7 +1202,7 @@ class StringStatisticsState : public ColumnWriterStatistics { string max; public: - bool HasStats() { + bool HasStats() override { return has_stats; } @@ -1205,6 +1217,7 @@ class StringStatisticsState : public ColumnWriterStatistics { // ideally we avoid placing several mega or giga-byte long strings there // we put a threshold of 10KB, if we see strings that exceed this threshold we avoid gathering stats values_too_big = true; + has_stats = false; min = string(); max = string(); return; diff --git a/src/duckdb/extension/parquet/include/column_writer.hpp b/src/duckdb/extension/parquet/include/column_writer.hpp index edd67bce..3b92a53b 100644 --- a/src/duckdb/extension/parquet/include/column_writer.hpp +++ b/src/duckdb/extension/parquet/include/column_writer.hpp @@ -44,6 +44,7 @@ class ColumnWriterStatistics { public: virtual ~ColumnWriterStatistics(); + virtual bool HasStats(); virtual string GetMin(); virtual string GetMax(); virtual string GetMinValue(); diff --git a/src/duckdb/extension/parquet/include/null_column_reader.hpp b/src/duckdb/extension/parquet/include/null_column_reader.hpp new file mode 100644 index 00000000..567efee3 --- /dev/null +++ b/src/duckdb/extension/parquet/include/null_column_reader.hpp @@ -0,0 +1,54 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// null_column_reader.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "column_reader.hpp" +#include "duckdb/common/helper.hpp" + +namespace duckdb { + +class NullColumnReader : public ColumnReader { +public: + static constexpr const PhysicalType TYPE = PhysicalType::INVALID; + +public: + NullColumnReader(ParquetReader &reader, LogicalType type_p, const SchemaElement &schema_p, idx_t schema_idx_p, + idx_t max_define_p, idx_t max_repeat_p) + : ColumnReader(reader, std::move(type_p), schema_p, schema_idx_p, max_define_p, max_repeat_p) {}; + + shared_ptr dict; + +public: + void Dictionary(shared_ptr data, idx_t num_entries) override { + dict = std::move(data); + } + + void Offsets(uint32_t *offsets, uint8_t *defines, uint64_t num_values, parquet_filter_t &filter, + idx_t result_offset, Vector &result) override { + auto &result_mask = FlatVector::Validity(result); + + for (idx_t row_idx = 0; row_idx < num_values; row_idx++) { + result_mask.SetInvalid(row_idx + result_offset); + } + } + + void Plain(shared_ptr plain_data, uint8_t *defines, uint64_t num_values, parquet_filter_t &filter, + idx_t result_offset, Vector &result) override { + (void)defines; + (void)plain_data; + (void)filter; + + auto &result_mask = FlatVector::Validity(result); + for (idx_t row_idx = 0; row_idx < num_values; row_idx++) { + result_mask.SetInvalid(row_idx + result_offset); + } + } +}; + +} // namespace duckdb diff --git a/src/duckdb/extension/parquet/include/parquet_extension.hpp b/src/duckdb/extension/parquet/include/parquet_extension.hpp index d24eeb6a..702adb38 100644 --- a/src/duckdb/extension/parquet/include/parquet_extension.hpp +++ b/src/duckdb/extension/parquet/include/parquet_extension.hpp @@ -8,6 +8,7 @@ class ParquetExtension : public Extension { public: void Load(DuckDB &db) override; std::string Name() override; + std::string Version() const override; }; } // namespace duckdb diff --git a/src/duckdb/extension/parquet/include/parquet_reader.hpp b/src/duckdb/extension/parquet/include/parquet_reader.hpp index 33937493..6e65d46d 100644 --- a/src/duckdb/extension/parquet/include/parquet_reader.hpp +++ b/src/duckdb/extension/parquet/include/parquet_reader.hpp @@ -53,7 +53,7 @@ struct ParquetReaderScanState { idx_t group_offset; unique_ptr file_handle; unique_ptr root_reader; - unique_ptr thrift_file_proto; + std::unique_ptr thrift_file_proto; bool finished; SelectionVector sel; diff --git a/src/duckdb/extension/parquet/include/parquet_writer.hpp b/src/duckdb/extension/parquet/include/parquet_writer.hpp index dda602eb..137a946c 100644 --- a/src/duckdb/extension/parquet/include/parquet_writer.hpp +++ b/src/duckdb/extension/parquet/include/parquet_writer.hpp @@ -64,7 +64,8 @@ class ParquetWriter { ParquetWriter(FileSystem &fs, string file_name, vector types, vector names, duckdb_parquet::format::CompressionCodec::type codec, ChildFieldIDs field_ids, const vector> &kv_metadata, - shared_ptr encryption_config, double dictionary_compression_ratio_threshold); + shared_ptr encryption_config, double dictionary_compression_ratio_threshold, + optional_idx compression_level); public: void PrepareRowGroup(ColumnDataCollection &buffer, PreparedRowGroup &result); @@ -94,6 +95,9 @@ class ParquetWriter { double DictionaryCompressionRatioThreshold() const { return dictionary_compression_ratio_threshold; } + optional_idx CompressionLevel() const { + return compression_level; + } static CopyTypeSupport TypeIsSupported(const LogicalType &type); @@ -110,9 +114,10 @@ class ParquetWriter { ChildFieldIDs field_ids; shared_ptr encryption_config; double dictionary_compression_ratio_threshold; + optional_idx compression_level; unique_ptr writer; - shared_ptr protocol; + std::shared_ptr protocol; duckdb_parquet::format::FileMetaData file_meta_data; std::mutex lock; diff --git a/src/duckdb/extension/parquet/include/templated_column_reader.hpp b/src/duckdb/extension/parquet/include/templated_column_reader.hpp index 59a1c13c..b98371c6 100644 --- a/src/duckdb/extension/parquet/include/templated_column_reader.hpp +++ b/src/duckdb/extension/parquet/include/templated_column_reader.hpp @@ -9,6 +9,7 @@ #pragma once #include "column_reader.hpp" +#include "duckdb/common/helper.hpp" namespace duckdb { @@ -43,7 +44,7 @@ class TemplatedColumnReader : public ColumnReader { public: void AllocateDict(idx_t size) { if (!dict) { - dict = make_shared(GetAllocator(), size); + dict = make_shared_ptr(GetAllocator(), size); } else { dict->resize(GetAllocator(), size); } @@ -55,6 +56,10 @@ class TemplatedColumnReader : public ColumnReader { void Offsets(uint32_t *offsets, uint8_t *defines, uint64_t num_values, parquet_filter_t &filter, idx_t result_offset, Vector &result) override { + if (!dict) { + throw IOException( + "Parquet file is likely corrupted, cannot have dictionary offsets without seeing a dictionary first."); + } auto result_ptr = FlatVector::GetData(result); auto &result_mask = FlatVector::Validity(result); diff --git a/src/duckdb/extension/parquet/parquet_crypto.cpp b/src/duckdb/extension/parquet/parquet_crypto.cpp index 6982d366..d6bb7f1b 100644 --- a/src/duckdb/extension/parquet/parquet_crypto.cpp +++ b/src/duckdb/extension/parquet/parquet_crypto.cpp @@ -4,6 +4,7 @@ #include "thrift_tools.hpp" #ifndef DUCKDB_AMALGAMATION +#include "duckdb/common/helper.hpp" #include "duckdb/common/common.hpp" #include "duckdb/storage/arena_allocator.hpp" #endif @@ -13,7 +14,7 @@ namespace duckdb { ParquetKeys &ParquetKeys::Get(ClientContext &context) { auto &cache = ObjectCache::GetObjectCache(context); if (!cache.Get(ParquetKeys::ObjectType())) { - cache.Put(ParquetKeys::ObjectType(), make_shared()); + cache.Put(ParquetKeys::ObjectType(), make_shared_ptr()); } return *cache.Get(ParquetKeys::ObjectType()); } @@ -300,13 +301,14 @@ class SimpleReadTransport : public TTransport { uint32_t ParquetCrypto::Read(TBase &object, TProtocol &iprot, const string &key) { // Create decryption protocol TCompactProtocolFactoryT tproto_factory; - auto dprot = tproto_factory.getProtocol(make_shared(iprot, key)); + auto dprot = tproto_factory.getProtocol(std::make_shared(iprot, key)); auto &dtrans = reinterpret_cast(*dprot->getTransport()); // We have to read the whole thing otherwise thrift throws an error before we realize we're decryption is wrong auto all = dtrans.ReadAll(); TCompactProtocolFactoryT tsimple_proto_factory; - auto simple_prot = tsimple_proto_factory.getProtocol(make_shared(all.get(), all.GetSize())); + auto simple_prot = + tsimple_proto_factory.getProtocol(std::make_shared(all.get(), all.GetSize())); // Read the object object.read(simple_prot.get()); @@ -317,7 +319,7 @@ uint32_t ParquetCrypto::Read(TBase &object, TProtocol &iprot, const string &key) uint32_t ParquetCrypto::Write(const TBase &object, TProtocol &oprot, const string &key) { // Create encryption protocol TCompactProtocolFactoryT tproto_factory; - auto eprot = tproto_factory.getProtocol(make_shared(oprot, key)); + auto eprot = tproto_factory.getProtocol(std::make_shared(oprot, key)); auto &etrans = reinterpret_cast(*eprot->getTransport()); // Write the object in memory @@ -331,7 +333,7 @@ uint32_t ParquetCrypto::ReadData(TProtocol &iprot, const data_ptr_t buffer, cons const string &key) { // Create decryption protocol TCompactProtocolFactoryT tproto_factory; - auto dprot = tproto_factory.getProtocol(make_shared(iprot, key)); + auto dprot = tproto_factory.getProtocol(std::make_shared(iprot, key)); auto &dtrans = reinterpret_cast(*dprot->getTransport()); // Read buffer @@ -346,7 +348,7 @@ uint32_t ParquetCrypto::WriteData(TProtocol &oprot, const const_data_ptr_t buffe // FIXME: we know the size upfront so we could do a streaming write instead of this // Create encryption protocol TCompactProtocolFactoryT tproto_factory; - auto eprot = tproto_factory.getProtocol(make_shared(oprot, key)); + auto eprot = tproto_factory.getProtocol(std::make_shared(oprot, key)); auto &etrans = reinterpret_cast(*eprot->getTransport()); // Write the data in memory diff --git a/src/duckdb/extension/parquet/parquet_extension.cpp b/src/duckdb/extension/parquet/parquet_extension.cpp index 0882f6da..dd61f971 100644 --- a/src/duckdb/extension/parquet/parquet_extension.cpp +++ b/src/duckdb/extension/parquet/parquet_extension.cpp @@ -17,6 +17,7 @@ #include #include #ifndef DUCKDB_AMALGAMATION +#include "duckdb/common/helper.hpp" #include "duckdb/catalog/catalog.hpp" #include "duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp" #include "duckdb/common/constants.hpp" @@ -44,8 +45,10 @@ namespace duckdb { struct ParquetReadBindData : public TableFunctionData { + shared_ptr file_list; + unique_ptr multi_file_reader; + shared_ptr initial_reader; - vector files; atomic chunk_count; vector names; vector types; @@ -58,6 +61,7 @@ struct ParquetReadBindData : public TableFunctionData { idx_t initial_file_cardinality; idx_t initial_file_row_groups; ParquetOptions parquet_options; + MultiFileReaderBindData reader_bind; void Initialize(shared_ptr reader) { @@ -74,23 +78,45 @@ struct ParquetReadLocalState : public LocalTableFunctionState { bool is_parallel; idx_t batch_index; idx_t file_index; - //! The DataChunk containing all read columns (even filter columns that are immediately removed) + //! The DataChunk containing all read columns (even columns that are immediately removed) DataChunk all_columns; }; enum class ParquetFileState : uint8_t { UNOPENED, OPENING, OPEN, CLOSED }; +struct ParquetFileReaderData { + // Create data for an unopened file + explicit ParquetFileReaderData(const string &file_to_be_opened) + : reader(nullptr), file_state(ParquetFileState::UNOPENED), file_mutex(make_uniq()), + file_to_be_opened(file_to_be_opened) { + } + // Create data for an existing reader + explicit ParquetFileReaderData(shared_ptr reader_p) + : reader(std::move(reader_p)), file_state(ParquetFileState::OPEN), file_mutex(make_uniq()) { + } + + //! Currently opened reader for the file + shared_ptr reader; + //! Flag to indicate the file is being opened + ParquetFileState file_state; + //! Mutexes to wait for the file when it is being opened + unique_ptr file_mutex; + + //! (only set when file_state is UNOPENED) the file to be opened + string file_to_be_opened; +}; + struct ParquetReadGlobalState : public GlobalTableFunctionState { + //! The scan over the file_list + MultiFileListScanData file_list_scan; + + unique_ptr multi_file_reader_state; + mutex lock; - //! The initial reader from the bind phase - shared_ptr initial_reader; - //! Currently opened readers - vector> readers; - //! Flag to indicate a file is being opened - vector file_states; - //! Mutexes to wait for a file that is currently being opened - unique_ptr file_mutexes; + //! The current set of parquet readers + vector readers; + //! Signal to other threads that a file failed to open, letting every thread abort. bool error_opening_file = false; @@ -111,7 +137,7 @@ struct ParquetReadGlobalState : public GlobalTableFunctionState { return max_threads; } - bool CanRemoveFilterColumns() const { + bool CanRemoveColumns() const { return !projection_ids.empty(); } }; @@ -134,6 +160,8 @@ struct ParquetWriteBindData : public TableFunctionData { double dictionary_compression_ratio_threshold = 1.0; ChildFieldIDs field_ids; + //! The compression level, higher value is more + optional_idx compression_level; }; struct ParquetWriteGlobalState : public GlobalFunctionData { @@ -153,10 +181,12 @@ struct ParquetWriteLocalState : public LocalFunctionData { BindInfo ParquetGetBindInfo(const optional_ptr bind_data) { auto bind_info = BindInfo(ScanType::PARQUET); auto &parquet_bind = bind_data->Cast(); + vector file_path; - for (auto &path : parquet_bind.files) { - file_path.emplace_back(path); + for (const auto &file : parquet_bind.file_list->Files()) { + file_path.emplace_back(file); } + // LCOV_EXCL_START bind_info.InsertOption("file_path", Value::LIST(LogicalType::VARCHAR, file_path)); bind_info.InsertOption("binary_as_string", Value::BOOLEAN(parquet_bind.parquet_options.binary_as_string)); @@ -166,9 +196,26 @@ BindInfo ParquetGetBindInfo(const optional_ptr bind_data) { return bind_info; } +static void ParseFileRowNumberOption(MultiFileReaderBindData &bind_data, ParquetOptions &options, + vector &return_types, vector &names) { + if (options.file_row_number) { + if (StringUtil::CIFind(names, "file_row_number") != DConstants::INVALID_INDEX) { + throw BinderException( + "Using file_row_number option on file with column named file_row_number is not supported"); + } + + bind_data.file_row_number_idx = names.size(); + return_types.emplace_back(LogicalType::BIGINT); + names.emplace_back("file_row_number"); + } +} + static MultiFileReaderBindData BindSchema(ClientContext &context, vector &return_types, vector &names, ParquetReadBindData &result, ParquetOptions &options) { D_ASSERT(!options.schema.empty()); + + options.file_options.AutoDetectHivePartitioning(*result.file_list, context); + auto &file_options = options.file_options; if (file_options.union_by_name || file_options.hive_partitioning) { throw BinderException("Parquet schema cannot be combined with union_by_name=true or hive_partitioning=true"); @@ -184,45 +231,42 @@ static MultiFileReaderBindData BindSchema(ClientContext &context, vectorBindOptions(options.file_options, *result.file_list, schema_col_types, schema_col_names, + bind_data); names = schema_col_names; return_types = schema_col_types; D_ASSERT(names.size() == return_types.size()); - if (options.file_row_number) { - if (std::find(names.begin(), names.end(), "file_row_number") != names.end()) { - throw BinderException( - "Using file_row_number option on file with column named file_row_number is not supported"); - } - - bind_data.file_row_number_idx = names.size(); - return_types.emplace_back(LogicalType::BIGINT); - names.emplace_back("file_row_number"); - } + ParseFileRowNumberOption(bind_data, options, return_types, names); return bind_data; } static void InitializeParquetReader(ParquetReader &reader, const ParquetReadBindData &bind_data, const vector &global_column_ids, - optional_ptr table_filters, ClientContext &context) { + optional_ptr table_filters, ClientContext &context, + optional_idx file_idx, optional_ptr reader_state) { auto &parquet_options = bind_data.parquet_options; auto &reader_data = reader.reader_data; + + // Mark the file in the file list we are scanning here + reader_data.file_list_idx = file_idx; + if (bind_data.parquet_options.schema.empty()) { - MultiFileReader::InitializeReader(reader, parquet_options.file_options, bind_data.reader_bind, bind_data.types, - bind_data.names, global_column_ids, table_filters, bind_data.files[0], - context); + bind_data.multi_file_reader->InitializeReader( + reader, parquet_options.file_options, bind_data.reader_bind, bind_data.types, bind_data.names, + global_column_ids, table_filters, bind_data.file_list->GetFirstFile(), context, reader_state); return; } // a fixed schema was supplied, initialize the MultiFileReader settings here so we can read using the schema // this deals with hive partitioning and filename=true - MultiFileReader::FinalizeBind(parquet_options.file_options, bind_data.reader_bind, reader.GetFileName(), - reader.GetNames(), bind_data.types, bind_data.names, global_column_ids, reader_data, - context); + bind_data.multi_file_reader->FinalizeBind(parquet_options.file_options, bind_data.reader_bind, reader.GetFileName(), + reader.GetNames(), bind_data.types, bind_data.names, global_column_ids, + reader_data, context, reader_state); // create a mapping from field id to column index in file unordered_map field_id_to_column_index; @@ -281,7 +325,7 @@ static void InitializeParquetReader(ParquetReader &reader, const ParquetReadBind reader_data.empty_columns = reader_data.column_ids.empty(); // Finally, initialize the filters - MultiFileReader::CreateFilterMap(bind_data.types, table_filters, reader_data); + bind_data.multi_file_reader->CreateFilterMap(bind_data.types, table_filters, reader_data, reader_state); reader_data.filters = table_filters; } @@ -314,7 +358,6 @@ class ParquetScanFunction { {"type", LogicalType::VARCHAR}, {"default_value", LogicalType::VARCHAR}}})); table_function.named_parameters["encryption_config"] = LogicalTypeId::ANY; - MultiFileReader::AddParameters(table_function); table_function.get_batch_index = ParquetScanGetBatchIndex; table_function.serialize = ParquetScanSerialize; table_function.deserialize = ParquetScanDeserialize; @@ -323,6 +366,9 @@ class ParquetScanFunction { table_function.filter_pushdown = true; table_function.filter_prune = true; table_function.pushdown_complex_filter = ParquetComplexFilterPushdown; + + MultiFileReader::AddParameters(table_function); + return MultiFileReader::CreateFunctionSet(table_function); } @@ -352,8 +398,13 @@ class ParquetScanFunction { } } - auto files = MultiFileReader::GetFileList(context, Value(info.file_path), "Parquet"); - return ParquetScanBindInternal(context, std::move(files), expected_types, expected_names, parquet_options); + // TODO: Allow overriding the MultiFileReader for COPY FROM? + auto multi_file_reader = MultiFileReader::CreateDefault("ParquetCopy"); + vector paths = {info.file_path}; + auto file_list = multi_file_reader->CreateFileList(context, paths); + + return ParquetScanBindInternal(context, std::move(multi_file_reader), std::move(file_list), expected_types, + expected_names, parquet_options); } static unique_ptr ParquetScanStats(ClientContext &context, const FunctionData *bind_data_p, @@ -367,7 +418,8 @@ class ParquetScanFunction { // NOTE: we do not want to parse the Parquet metadata for the sole purpose of getting column statistics auto &config = DBConfig::GetConfig(context); - if (bind_data.files.size() < 2) { + + if (bind_data.file_list->GetExpandResult() != FileExpandResult::MULTIPLE_FILES) { if (bind_data.initial_reader) { // most common path, scanning single parquet file return bind_data.initial_reader->ReadStatistics(bind_data.names[column_index]); @@ -384,8 +436,7 @@ class ParquetScanFunction { // enabled at all) FileSystem &fs = FileSystem::GetFileSystem(context); - for (idx_t file_idx = 0; file_idx < bind_data.files.size(); file_idx++) { - auto &file_name = bind_data.files[file_idx]; + for (const auto &file_name : bind_data.file_list->Files()) { auto metadata = cache.Get(file_name); if (!metadata) { // missing metadata entry in cache, no usable stats @@ -422,17 +473,33 @@ class ParquetScanFunction { return nullptr; } - static unique_ptr ParquetScanBindInternal(ClientContext &context, vector files, + static unique_ptr ParquetScanBindInternal(ClientContext &context, + unique_ptr multi_file_reader, + unique_ptr file_list, vector &return_types, vector &names, ParquetOptions parquet_options) { auto result = make_uniq(); - result->files = std::move(files); - if (parquet_options.schema.empty()) { - result->reader_bind = MultiFileReader::BindReader(context, result->types, result->names, - *result, parquet_options); - } else { - // a schema was supplied + result->multi_file_reader = std::move(multi_file_reader); + result->file_list = std::move(file_list); + + bool bound_on_first_file = true; + if (result->multi_file_reader->Bind(parquet_options.file_options, *result->file_list, result->types, + result->names, result->reader_bind)) { + result->multi_file_reader->BindOptions(parquet_options.file_options, *result->file_list, result->types, + result->names, result->reader_bind); + // Enable the parquet file_row_number on the parquet options if the file_row_number_idx was set + if (result->reader_bind.file_row_number_idx != DConstants::INVALID_INDEX) { + parquet_options.file_row_number = true; + } + bound_on_first_file = false; + } else if (!parquet_options.schema.empty()) { + // A schema was supplied: use the schema for binding result->reader_bind = BindSchema(context, result->types, result->names, *result, parquet_options); + } else { + parquet_options.file_options.AutoDetectHivePartitioning(*result->file_list, context); + // Default bind + result->reader_bind = result->multi_file_reader->BindReader( + context, result->types, result->names, *result->file_list, *result, parquet_options); } if (return_types.empty()) { @@ -441,9 +508,11 @@ class ParquetScanFunction { names = result->names; } else { if (return_types.size() != result->types.size()) { + auto file_string = bound_on_first_file ? result->file_list->GetFirstFile() + : StringUtil::Join(result->file_list->GetPaths(), ","); throw std::runtime_error(StringUtil::Format( - "Failed to read file \"%s\" - column count mismatch: expected %d columns but found %d", - result->files[0], return_types.size(), result->types.size())); + "Failed to read file(s) \"%s\" - column count mismatch: expected %d columns but found %d", + file_string, return_types.size(), result->types.size())); } // expected types - overwrite the types we want to read instead result->types = return_types; @@ -454,11 +523,12 @@ class ParquetScanFunction { static unique_ptr ParquetScanBind(ClientContext &context, TableFunctionBindInput &input, vector &return_types, vector &names) { - auto files = MultiFileReader::GetFileList(context, input.inputs[0], "Parquet"); + auto multi_file_reader = MultiFileReader::Create(input.table_function); + ParquetOptions parquet_options(context); for (auto &kv : input.named_parameters) { auto loption = StringUtil::Lower(kv.first); - if (MultiFileReader::ParseOption(kv.first, kv.second, parquet_options.file_options, context)) { + if (multi_file_reader->ParseOption(kv.first, kv.second, parquet_options.file_options, context)) { continue; } if (loption == "binary_as_string") { @@ -484,23 +554,27 @@ class ParquetScanFunction { parquet_options.encryption_config = ParquetEncryptionConfig::Create(context, kv.second); } } - parquet_options.file_options.AutoDetectHivePartitioning(files, context); - return ParquetScanBindInternal(context, std::move(files), return_types, names, parquet_options); + + auto file_list = multi_file_reader->CreateFileList(context, input.inputs[0]); + return ParquetScanBindInternal(context, std::move(multi_file_reader), std::move(file_list), return_types, names, + parquet_options); } static double ParquetProgress(ClientContext &context, const FunctionData *bind_data_p, const GlobalTableFunctionState *global_state) { auto &bind_data = bind_data_p->Cast(); auto &gstate = global_state->Cast(); - if (bind_data.files.empty()) { + + auto total_count = bind_data.file_list->GetTotalFileCount(); + if (total_count == 0) { return 100.0; } if (bind_data.initial_file_cardinality == 0) { - return (100.0 * (gstate.file_index + 1)) / bind_data.files.size(); + return (100.0 * (gstate.file_index + 1)) / total_count; } auto percentage = MinValue( 100.0, (bind_data.chunk_count * STANDARD_VECTOR_SIZE * 100.0 / bind_data.initial_file_cardinality)); - return (percentage + 100.0 * gstate.file_index) / bind_data.files.size(); + return (percentage + 100.0 * gstate.file_index) / total_count; } static unique_ptr @@ -511,7 +585,8 @@ class ParquetScanFunction { auto result = make_uniq(); result->is_parallel = true; result->batch_index = 0; - if (input.CanRemoveFilterColumns()) { + + if (gstate.CanRemoveColumns()) { result->all_columns.Initialize(context.client, gstate.scanned_types); } if (!ParquetParallelStateNext(context.client, bind_data, *result, gstate)) { @@ -524,35 +599,46 @@ class ParquetScanFunction { TableFunctionInitInput &input) { auto &bind_data = input.bind_data->CastNoConst(); auto result = make_uniq(); - - result->file_states = vector(bind_data.files.size(), ParquetFileState::UNOPENED); - result->file_mutexes = unique_ptr(new mutex[bind_data.files.size()]); - if (bind_data.files.empty()) { - result->initial_reader = nullptr; - } else { - result->readers = std::move(bind_data.union_readers); - if (result->readers.size() != bind_data.files.size()) { - result->readers = vector>(bind_data.files.size(), nullptr); - } else { - std::fill(result->file_states.begin(), result->file_states.end(), ParquetFileState::OPEN); + bind_data.file_list->InitializeScan(result->file_list_scan); + + result->multi_file_reader_state = bind_data.multi_file_reader->InitializeGlobalState( + context, bind_data.parquet_options.file_options, bind_data.reader_bind, *bind_data.file_list, + bind_data.types, bind_data.names, input.column_ids); + if (bind_data.file_list->IsEmpty()) { + result->readers = {}; + } else if (!bind_data.union_readers.empty()) { + // TODO: confirm we are not changing behaviour by modifying the order here? + for (auto &reader : bind_data.union_readers) { + if (!reader) { + break; + } + result->readers.push_back(ParquetFileReaderData(std::move(reader))); } - if (bind_data.initial_reader) { - result->initial_reader = std::move(bind_data.initial_reader); - result->readers[0] = result->initial_reader; - } else if (result->readers[0]) { - result->initial_reader = result->readers[0]; - } else { - result->initial_reader = - make_shared(context, bind_data.files[0], bind_data.parquet_options); - result->readers[0] = result->initial_reader; + if (result->readers.size() != bind_data.file_list->GetTotalFileCount()) { + // This case happens with recursive CTEs: the first execution the readers have already + // been moved out of the bind data. + // FIXME: clean up this process and make it more explicit + result->readers = {}; + } + } else if (bind_data.initial_reader) { + // Ensure the initial reader was actually constructed from the first file + if (bind_data.initial_reader->file_name != bind_data.file_list->GetFirstFile()) { + throw InternalException("First file from list ('%s') does not match first reader ('%s')", + bind_data.initial_reader->file_name, bind_data.file_list->GetFirstFile()); } - result->file_states[0] = ParquetFileState::OPEN; + result->readers.emplace_back(std::move(bind_data.initial_reader)); } - for (auto &reader : result->readers) { - if (!reader) { - continue; + + // Ensure all readers are initialized and FileListScan is sync with readers list + for (auto &reader_data : result->readers) { + string file_name; + idx_t file_idx = result->file_list_scan.current_file_idx; + bind_data.file_list->Scan(result->file_list_scan, file_name); + if (file_name != reader_data.reader->file_name) { + throw InternalException("Mismatch in filename order and reader order in parquet scan"); } - InitializeParquetReader(*reader, bind_data, input.column_ids, input.filters, context); + InitializeParquetReader(*reader_data.reader, bind_data, input.column_ids, input.filters, context, file_idx, + result->multi_file_reader_state); } result->column_ids = input.column_ids; @@ -561,7 +647,10 @@ class ParquetScanFunction { result->file_index = 0; result->batch_index = 0; result->max_threads = ParquetScanMaxThreads(context, input.bind_data.get()); - if (input.CanRemoveFilterColumns()) { + + bool require_extra_columns = + result->multi_file_reader_state && result->multi_file_reader_state->RequiresExtraColumns(); + if (input.CanRemoveFilterColumns() || require_extra_columns) { result->projection_ids = input.projection_ids; const auto table_types = bind_data.types; for (const auto &col_idx : input.column_ids) { @@ -572,6 +661,13 @@ class ParquetScanFunction { } } } + + if (require_extra_columns) { + for (const auto &column_type : result->multi_file_reader_state->extra_columns) { + result->scanned_types.push_back(column_type); + } + } + return std::move(result); } @@ -585,7 +681,8 @@ class ParquetScanFunction { static void ParquetScanSerialize(Serializer &serializer, const optional_ptr bind_data_p, const TableFunction &function) { auto &bind_data = bind_data_p->Cast(); - serializer.WriteProperty(100, "files", bind_data.files); + + serializer.WriteProperty(100, "files", bind_data.file_list->GetAllFiles()); serializer.WriteProperty(101, "types", bind_data.types); serializer.WriteProperty(102, "names", bind_data.names); serializer.WriteProperty(103, "parquet_options", bind_data.parquet_options); @@ -597,7 +694,17 @@ class ParquetScanFunction { auto types = deserializer.ReadProperty>(101, "types"); auto names = deserializer.ReadProperty>(102, "names"); auto parquet_options = deserializer.ReadProperty(103, "parquet_options"); - return ParquetScanBindInternal(context, files, types, names, parquet_options); + + vector file_path; + for (auto &path : files) { + file_path.emplace_back(path); + } + + auto multi_file_reader = MultiFileReader::Create(function); + auto file_list = multi_file_reader->CreateFileList(context, Value::LIST(LogicalType::VARCHAR, file_path), + FileGlobOptions::DISALLOW_EMPTY); + return ParquetScanBindInternal(context, std::move(multi_file_reader), std::move(file_list), types, names, + parquet_options); } static void ParquetScanImplementation(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) { @@ -609,14 +716,16 @@ class ParquetScanFunction { auto &bind_data = data_p.bind_data->CastNoConst(); do { - if (gstate.CanRemoveFilterColumns()) { + if (gstate.CanRemoveColumns()) { data.all_columns.Reset(); data.reader->Scan(data.scan_state, data.all_columns); - MultiFileReader::FinalizeChunk(bind_data.reader_bind, data.reader->reader_data, data.all_columns); + bind_data.multi_file_reader->FinalizeChunk(context, bind_data.reader_bind, data.reader->reader_data, + data.all_columns, gstate.multi_file_reader_state); output.ReferenceColumns(data.all_columns, gstate.projection_ids); } else { data.reader->Scan(data.scan_state, output); - MultiFileReader::FinalizeChunk(bind_data.reader_bind, data.reader->reader_data, output); + bind_data.multi_file_reader->FinalizeChunk(context, bind_data.reader_bind, data.reader->reader_data, + output, gstate.multi_file_reader_state); } bind_data.chunk_count++; @@ -631,17 +740,33 @@ class ParquetScanFunction { static unique_ptr ParquetCardinality(ClientContext &context, const FunctionData *bind_data) { auto &data = bind_data->Cast(); - return make_uniq(data.initial_file_cardinality * data.files.size()); + return make_uniq(data.initial_file_cardinality * data.file_list->GetTotalFileCount()); } static idx_t ParquetScanMaxThreads(ClientContext &context, const FunctionData *bind_data) { auto &data = bind_data->Cast(); - if (data.files.size() > 1) { + + if (data.file_list->GetExpandResult() == FileExpandResult::MULTIPLE_FILES) { return TaskScheduler::GetScheduler(context).NumberOfThreads(); } + return MaxValue(data.initial_file_row_groups, (idx_t)1); } + // Queries the metadataprovider for another file to scan, updating the files/reader lists in the process. + // Returns true if resized + static bool ResizeFiles(const ParquetReadBindData &bind_data, ParquetReadGlobalState ¶llel_state) { + string scanned_file; + if (!bind_data.file_list->Scan(parallel_state.file_list_scan, scanned_file)) { + return false; + } + + // Push the file in the reader data, to be opened later + parallel_state.readers.emplace_back(scanned_file); + + return true; + } + // This function looks for the next available row group. If not available, it will open files from bind_data.files // until there is a row group available for scanning or the files runs out static bool ParquetParallelStateNext(ClientContext &context, const ParquetReadBindData &bind_data, @@ -653,17 +778,15 @@ class ParquetScanFunction { return false; } - if (parallel_state.file_index >= parallel_state.readers.size()) { + if (parallel_state.file_index >= parallel_state.readers.size() && !ResizeFiles(bind_data, parallel_state)) { return false; } - D_ASSERT(parallel_state.initial_reader); - - if (parallel_state.file_states[parallel_state.file_index] == ParquetFileState::OPEN) { - if (parallel_state.row_group_index < - parallel_state.readers[parallel_state.file_index]->NumRowGroups()) { + auto ¤t_reader_data = parallel_state.readers[parallel_state.file_index]; + if (current_reader_data.file_state == ParquetFileState::OPEN) { + if (parallel_state.row_group_index < current_reader_data.reader->NumRowGroups()) { // The current reader has rowgroups left to be scanned - scan_data.reader = parallel_state.readers[parallel_state.file_index]; + scan_data.reader = current_reader_data.reader; vector group_indexes {parallel_state.row_group_index}; scan_data.reader->InitializeScan(scan_data.scan_state, group_indexes); scan_data.batch_index = parallel_state.batch_index++; @@ -672,16 +795,13 @@ class ParquetScanFunction { return true; } else { // Close current file - parallel_state.file_states[parallel_state.file_index] = ParquetFileState::CLOSED; - parallel_state.readers[parallel_state.file_index] = nullptr; + current_reader_data.file_state = ParquetFileState::CLOSED; + current_reader_data.reader = nullptr; // Set state to the next file parallel_state.file_index++; parallel_state.row_group_index = 0; - if (parallel_state.file_index >= bind_data.files.size()) { - return false; - } continue; } } @@ -691,7 +811,7 @@ class ParquetScanFunction { } // Check if the current file is being opened, in that case we need to wait for it. - if (parallel_state.file_states[parallel_state.file_index] == ParquetFileState::OPENING) { + if (parallel_state.readers[parallel_state.file_index].file_state == ParquetFileState::OPENING) { WaitForFile(parallel_state.file_index, parallel_state, parallel_lock); } } @@ -701,10 +821,12 @@ class ParquetScanFunction { vector> &filters) { auto &data = bind_data_p->Cast(); - auto reset_reader = MultiFileReader::ComplexFilterPushdown(context, data.files, - data.parquet_options.file_options, get, filters); - if (reset_reader) { - MultiFileReader::PruneReaders(data); + auto new_list = data.multi_file_reader->ComplexFilterPushdown(context, *data.file_list, + data.parquet_options.file_options, get, filters); + + if (new_list) { + data.file_list = std::move(new_list); + MultiFileReader::PruneReaders(data, *data.file_list); } } @@ -712,9 +834,14 @@ class ParquetScanFunction { static void WaitForFile(idx_t file_index, ParquetReadGlobalState ¶llel_state, unique_lock ¶llel_lock) { while (true) { - // To get the file lock, we first need to release the parallel_lock to prevent deadlocking + + // Get pointer to file mutex before unlocking + auto &file_mutex = *parallel_state.readers[file_index].file_mutex; + + // To get the file lock, we first need to release the parallel_lock to prevent deadlocking. Note that this + // requires getting the ref to the file mutex pointer with the lock stil held: readers get be resized parallel_lock.unlock(); - unique_lock current_file_lock(parallel_state.file_mutexes[file_index]); + unique_lock current_file_lock(file_mutex); parallel_lock.lock(); // Here we have both locks which means we can stop waiting if: @@ -722,7 +849,7 @@ class ParquetScanFunction { // - the thread opening the file has failed // - the file was somehow scanned till the end while we were waiting if (parallel_state.file_index >= parallel_state.readers.size() || - parallel_state.file_states[parallel_state.file_index] != ParquetFileState::OPENING || + parallel_state.readers[parallel_state.file_index].file_state != ParquetFileState::OPENING || parallel_state.error_opening_file) { return; } @@ -734,24 +861,29 @@ class ParquetScanFunction { ParquetReadLocalState &scan_data, ParquetReadGlobalState ¶llel_state, unique_lock ¶llel_lock) { const auto num_threads = TaskScheduler::GetScheduler(context).NumberOfThreads(); - const auto file_index_limit = MinValue(parallel_state.file_index + num_threads, bind_data.files.size()); + + const auto file_index_limit = + MinValue(parallel_state.file_index + num_threads, parallel_state.readers.size()); + for (idx_t i = parallel_state.file_index; i < file_index_limit; i++) { - if (parallel_state.file_states[i] == ParquetFileState::UNOPENED) { - string file = bind_data.files[i]; - parallel_state.file_states[i] = ParquetFileState::OPENING; - auto pq_options = parallel_state.initial_reader->parquet_options; + if (parallel_state.readers[i].file_state == ParquetFileState::UNOPENED) { + auto ¤t_reader_data = parallel_state.readers[i]; + current_reader_data.file_state = ParquetFileState::OPENING; + auto pq_options = bind_data.parquet_options; + + // Get pointer to file mutex before unlocking + auto ¤t_file_lock = *current_reader_data.file_mutex; // Now we switch which lock we are holding, instead of locking the global state, we grab the lock on // the file we are opening. This file lock allows threads to wait for a file to be opened. parallel_lock.unlock(); - - unique_lock file_lock(parallel_state.file_mutexes[i]); + unique_lock file_lock(current_file_lock); shared_ptr reader; try { - reader = make_shared(context, file, pq_options); + reader = make_shared_ptr(context, current_reader_data.file_to_be_opened, pq_options); InitializeParquetReader(*reader, bind_data, parallel_state.column_ids, parallel_state.filters, - context); + context, i, parallel_state.multi_file_reader_state); } catch (...) { parallel_lock.lock(); parallel_state.error_opening_file = true; @@ -760,8 +892,8 @@ class ParquetScanFunction { // Now re-lock the state and add the reader parallel_lock.lock(); - parallel_state.readers[i] = reader; - parallel_state.file_states[i] = ParquetFileState::OPEN; + current_reader_data.reader = reader; + current_reader_data.file_state = ParquetFileState::OPEN; return true; } @@ -1004,6 +1136,8 @@ unique_ptr ParquetWriteBind(ClientContext &context, CopyFunctionBi "dictionary compression"); } bind_data->dictionary_compression_ratio_threshold = val; + } else if (loption == "compression_level") { + bind_data->compression_level = option.second[0].GetValue(); } else { throw NotImplementedException("Unrecognized option for PARQUET: %s", option.first.c_str()); } @@ -1029,10 +1163,10 @@ unique_ptr ParquetWriteInitializeGlobal(ClientContext &conte auto &parquet_bind = bind_data.Cast(); auto &fs = FileSystem::GetFileSystem(context); - global_state->writer = - make_uniq(fs, file_path, parquet_bind.sql_types, parquet_bind.column_names, parquet_bind.codec, - parquet_bind.field_ids.Copy(), parquet_bind.kv_metadata, - parquet_bind.encryption_config, parquet_bind.dictionary_compression_ratio_threshold); + global_state->writer = make_uniq( + fs, file_path, parquet_bind.sql_types, parquet_bind.column_names, parquet_bind.codec, + parquet_bind.field_ids.Copy(), parquet_bind.kv_metadata, parquet_bind.encryption_config, + parquet_bind.dictionary_compression_ratio_threshold, parquet_bind.compression_level); return std::move(global_state); } @@ -1153,6 +1287,7 @@ static void ParquetCopySerialize(Serializer &serializer, const FunctionData &bin bind_data.encryption_config, nullptr); serializer.WriteProperty(108, "dictionary_compression_ratio_threshold", bind_data.dictionary_compression_ratio_threshold); + serializer.WritePropertyWithDefault(109, "compression_level", bind_data.compression_level); } static unique_ptr ParquetCopyDeserialize(Deserializer &deserializer, CopyFunction &function) { @@ -1168,6 +1303,7 @@ static unique_ptr ParquetCopyDeserialize(Deserializer &deserialize data->encryption_config, nullptr); deserializer.ReadPropertyWithDefault(108, "dictionary_compression_ratio_threshold", data->dictionary_compression_ratio_threshold, 1.0); + deserializer.ReadPropertyWithDefault(109, "compression_level", data->compression_level); return std::move(data); } // LCOV_EXCL_STOP @@ -1229,8 +1365,9 @@ idx_t ParquetWriteFileSize(GlobalFunctionData &gstate) { //===--------------------------------------------------------------------===// // Scan Replacement //===--------------------------------------------------------------------===// -unique_ptr ParquetScanReplacement(ClientContext &context, const string &table_name, - ReplacementScanData *data) { +unique_ptr ParquetScanReplacement(ClientContext &context, ReplacementScanInput &input, + optional_ptr data) { + auto &table_name = input.table_name; if (!ReplacementScan::CanReplace(table_name, {"parquet"})) { return nullptr; } @@ -1310,6 +1447,14 @@ std::string ParquetExtension::Name() { return "parquet"; } +std::string ParquetExtension::Version() const { +#ifdef EXT_VERSION_PARQUET + return EXT_VERSION_PARQUET; +#else + return ""; +#endif +} + } // namespace duckdb #ifdef DUCKDB_BUILD_LOADABLE_EXTENSION diff --git a/src/duckdb/extension/parquet/parquet_metadata.cpp b/src/duckdb/extension/parquet/parquet_metadata.cpp index 811b31aa..72b16fae 100644 --- a/src/duckdb/extension/parquet/parquet_metadata.cpp +++ b/src/duckdb/extension/parquet/parquet_metadata.cpp @@ -15,13 +15,8 @@ namespace duckdb { struct ParquetMetaDataBindData : public TableFunctionData { vector return_types; - vector files; - -public: - bool Equals(const FunctionData &other_p) const override { - auto &other = other_p.Cast(); - return other.return_types == return_types && files == other.files; - } + unique_ptr file_list; + unique_ptr multi_file_reader; }; enum class ParquetMetadataOperatorType : uint8_t { META_DATA, SCHEMA, KEY_VALUE_META_DATA, FILE_META_DATA }; @@ -31,10 +26,12 @@ struct ParquetMetaDataOperatorData : public GlobalTableFunctionState { : collection(context, types) { } - idx_t file_index; ColumnDataCollection collection; ColumnDataScanState scan_state; + MultiFileListScanData file_list_scan; + string current_file; + public: static void BindMetaData(vector &return_types, vector &names); static void BindSchema(vector &return_types, vector &names); @@ -588,33 +585,39 @@ unique_ptr ParquetMetaDataBind(ClientContext &context, TableFuncti auto result = make_uniq(); result->return_types = return_types; - result->files = MultiFileReader::GetFileList(context, input.inputs[0], "Parquet"); + result->multi_file_reader = MultiFileReader::Create(input.table_function); + result->file_list = result->multi_file_reader->CreateFileList(context, input.inputs[0]); return std::move(result); } template unique_ptr ParquetMetaDataInit(ClientContext &context, TableFunctionInitInput &input) { auto &bind_data = input.bind_data->Cast(); - D_ASSERT(!bind_data.files.empty()); auto result = make_uniq(context, bind_data.return_types); + + bind_data.file_list->InitializeScan(result->file_list_scan); + bind_data.file_list->Scan(result->file_list_scan, result->current_file); + + D_ASSERT(!bind_data.file_list->IsEmpty()); + switch (TYPE) { case ParquetMetadataOperatorType::SCHEMA: - result->LoadSchemaData(context, bind_data.return_types, bind_data.files[0]); + result->LoadSchemaData(context, bind_data.return_types, bind_data.file_list->GetFirstFile()); break; case ParquetMetadataOperatorType::META_DATA: - result->LoadRowGroupMetadata(context, bind_data.return_types, bind_data.files[0]); + result->LoadRowGroupMetadata(context, bind_data.return_types, bind_data.file_list->GetFirstFile()); break; case ParquetMetadataOperatorType::KEY_VALUE_META_DATA: - result->LoadKeyValueMetaData(context, bind_data.return_types, bind_data.files[0]); + result->LoadKeyValueMetaData(context, bind_data.return_types, bind_data.file_list->GetFirstFile()); break; case ParquetMetadataOperatorType::FILE_META_DATA: - result->LoadFileMetaData(context, bind_data.return_types, bind_data.files[0]); + result->LoadFileMetaData(context, bind_data.return_types, bind_data.file_list->GetFirstFile()); break; default: throw InternalException("Unsupported ParquetMetadataOperatorType"); } - result->file_index = 0; + return std::move(result); } @@ -625,30 +628,29 @@ void ParquetMetaDataImplementation(ClientContext &context, TableFunctionInput &d while (true) { if (!data.collection.Scan(data.scan_state, output)) { - if (data.file_index + 1 < bind_data.files.size()) { - // load the metadata for the next file - data.file_index++; - switch (TYPE) { - case ParquetMetadataOperatorType::SCHEMA: - data.LoadSchemaData(context, bind_data.return_types, bind_data.files[data.file_index]); - break; - case ParquetMetadataOperatorType::META_DATA: - data.LoadRowGroupMetadata(context, bind_data.return_types, bind_data.files[data.file_index]); - break; - case ParquetMetadataOperatorType::KEY_VALUE_META_DATA: - data.LoadKeyValueMetaData(context, bind_data.return_types, bind_data.files[data.file_index]); - break; - case ParquetMetadataOperatorType::FILE_META_DATA: - data.LoadFileMetaData(context, bind_data.return_types, bind_data.files[data.file_index]); - break; - default: - throw InternalException("Unsupported ParquetMetadataOperatorType"); - } - continue; - } else { - // no files remaining: done + + // Try get next file + if (!bind_data.file_list->Scan(data.file_list_scan, data.current_file)) { return; } + + switch (TYPE) { + case ParquetMetadataOperatorType::SCHEMA: + data.LoadSchemaData(context, bind_data.return_types, data.current_file); + break; + case ParquetMetadataOperatorType::META_DATA: + data.LoadRowGroupMetadata(context, bind_data.return_types, data.current_file); + break; + case ParquetMetadataOperatorType::KEY_VALUE_META_DATA: + data.LoadKeyValueMetaData(context, bind_data.return_types, data.current_file); + break; + case ParquetMetadataOperatorType::FILE_META_DATA: + data.LoadFileMetaData(context, bind_data.return_types, data.current_file); + break; + default: + throw InternalException("Unsupported ParquetMetadataOperatorType"); + } + continue; } if (output.size() != 0) { return; diff --git a/src/duckdb/extension/parquet/parquet_reader.cpp b/src/duckdb/extension/parquet/parquet_reader.cpp index efc16ff0..75017ea3 100644 --- a/src/duckdb/extension/parquet/parquet_reader.cpp +++ b/src/duckdb/extension/parquet/parquet_reader.cpp @@ -19,6 +19,7 @@ #include "duckdb/common/file_system.hpp" #include "duckdb/common/hive_partitioning.hpp" #include "duckdb/common/pair.hpp" +#include "duckdb/common/helper.hpp" #include "duckdb/common/string_util.hpp" #include "duckdb/common/types/date.hpp" #include "duckdb/common/vector_operations/vector_operations.hpp" @@ -49,7 +50,7 @@ using duckdb_parquet::format::Type; static unique_ptr CreateThriftFileProtocol(Allocator &allocator, FileHandle &file_handle, bool prefetch_mode) { - auto transport = make_shared(allocator, file_handle, prefetch_mode); + auto transport = std::make_shared(allocator, file_handle, prefetch_mode); return make_uniq>(std::move(transport)); } @@ -112,7 +113,7 @@ LoadMetadata(Allocator &allocator, FileHandle &file_handle, metadata->read(file_proto.get()); } - return make_shared(std::move(metadata), current_time); + return make_shared_ptr(std::move(metadata), current_time); } LogicalType ParquetReader::DeriveLogicalType(const SchemaElement &s_ele, bool binary_as_string) { @@ -242,12 +243,14 @@ LogicalType ParquetReader::DeriveLogicalType(const SchemaElement &s_ele, bool bi return LogicalType::INTERVAL; case ConvertedType::JSON: return LogicalType::VARCHAR; + case ConvertedType::NULL_TYPE: + return LogicalTypeId::SQLNULL; case ConvertedType::MAP: case ConvertedType::MAP_KEY_VALUE: case ConvertedType::LIST: case ConvertedType::BSON: default: - throw IOException("Unsupported converted type"); + throw IOException("Unsupported converted type (%d)", (int32_t)s_ele.converted_type); } } else { // no converted type set @@ -446,7 +449,7 @@ void ParquetReader::InitializeSchema() { // Add generated constant column for row number if (parquet_options.file_row_number) { - if (std::find(names.begin(), names.end(), "file_row_number") != names.end()) { + if (StringUtil::CIFind(names, "file_row_number") != DConstants::INVALID_INDEX) { throw BinderException( "Using file_row_number option on file with column named file_row_number is not supported"); } diff --git a/src/duckdb/extension/parquet/parquet_statistics.cpp b/src/duckdb/extension/parquet/parquet_statistics.cpp index 351b5938..67074210 100644 --- a/src/duckdb/extension/parquet/parquet_statistics.cpp +++ b/src/duckdb/extension/parquet/parquet_statistics.cpp @@ -48,9 +48,6 @@ static unique_ptr CreateNumericStats(const LogicalType &type, Value ParquetStatisticsUtils::ConvertValue(const LogicalType &type, const duckdb_parquet::format::SchemaElement &schema_ele, const std::string &stats) { - if (stats.empty()) { - return Value(); - } auto stats_data = const_data_ptr_cast(stats.c_str()); switch (type.id()) { case LogicalTypeId::BOOLEAN: { @@ -198,8 +195,12 @@ Value ParquetStatisticsUtils::ConvertValue(const LogicalType &type, } if (schema_ele.__isset.logicalType && schema_ele.logicalType.__isset.TIME) { // logical type - if (schema_ele.logicalType.TIME.unit.__isset.MICROS) { + if (schema_ele.logicalType.TIME.unit.__isset.MILLIS) { + return Value::TIMETZ(ParquetIntToTimeMsTZ(val)); + } else if (schema_ele.logicalType.TIME.unit.__isset.MICROS) { return Value::TIMETZ(ParquetIntToTimeTZ(val)); + } else if (schema_ele.logicalType.TIME.unit.__isset.NANOS) { + return Value::TIMETZ(ParquetIntToTimeNsTZ(val)); } else { throw InternalException("Time With Time Zone logicalType is set but unit is not defined"); } diff --git a/src/duckdb/extension/parquet/parquet_writer.cpp b/src/duckdb/extension/parquet/parquet_writer.cpp index 815d7676..10c33861 100644 --- a/src/duckdb/extension/parquet/parquet_writer.cpp +++ b/src/duckdb/extension/parquet/parquet_writer.cpp @@ -15,6 +15,8 @@ #include "duckdb/main/connection.hpp" #include "duckdb/parser/parsed_data/create_copy_function_info.hpp" #include "duckdb/parser/parsed_data/create_table_function_info.hpp" +#include "duckdb/common/serializer/serializer.hpp" +#include "duckdb/common/serializer/deserializer.hpp" #endif namespace duckdb { @@ -351,7 +353,7 @@ ParquetWriter::ParquetWriter(FileSystem &fs, string file_name_p, vector> &kv_metadata, shared_ptr encryption_config_p, - double dictionary_compression_ratio_threshold_p) + double dictionary_compression_ratio_threshold_p, optional_idx compression_level_p) : file_name(std::move(file_name_p)), sql_types(std::move(types_p)), column_names(std::move(names_p)), codec(codec), field_ids(std::move(field_ids_p)), encryption_config(std::move(encryption_config_p)), dictionary_compression_ratio_threshold(dictionary_compression_ratio_threshold_p) { @@ -368,7 +370,7 @@ ParquetWriter::ParquetWriter(FileSystem &fs, string file_name_p, vectorWriteData(const_data_ptr_cast("PAR1"), 4); } TCompactProtocolFactoryT tproto_factory; - protocol = tproto_factory.getProtocol(make_shared(*writer)); + protocol = tproto_factory.getProtocol(std::make_shared(*writer)); file_meta_data.num_rows = 0; file_meta_data.version = 1; @@ -385,6 +387,19 @@ ParquetWriter::ParquetWriter(FileSystem &fs, string file_name_p, vector 22) { + throw BinderException("Compression level for ZSTD must be between 1 and 22"); + } + break; + default: + throw NotImplementedException("Compression level is only supported for the ZSTD compression codec"); + } + compression_level = level; + } // populate root schema object file_meta_data.schema[0].name = "duckdb_schema"; @@ -468,6 +483,42 @@ void ParquetWriter::PrepareRowGroup(ColumnDataCollection &buffer, PreparedRowGro result.heaps = buffer.GetHeapReferences(); } +// Validation code adapted from Impala +static void ValidateOffsetInFile(const string &filename, idx_t col_idx, idx_t file_length, idx_t offset, + const string &offset_name) { + if (offset < 0 || offset >= file_length) { + throw IOException("File '%s': metadata is corrupt. Column %d has invalid " + "%s (offset=%llu file_size=%llu).", + filename, col_idx, offset_name, offset, file_length); + } +} + +static void ValidateColumnOffsets(const string &filename, idx_t file_length, const ParquetRowGroup &row_group) { + for (idx_t i = 0; i < row_group.columns.size(); ++i) { + const auto &col_chunk = row_group.columns[i]; + ValidateOffsetInFile(filename, i, file_length, col_chunk.meta_data.data_page_offset, "data page offset"); + auto col_start = NumericCast(col_chunk.meta_data.data_page_offset); + // The file format requires that if a dictionary page exists, it be before data pages. + if (col_chunk.meta_data.__isset.dictionary_page_offset) { + ValidateOffsetInFile(filename, i, file_length, col_chunk.meta_data.dictionary_page_offset, + "dictionary page offset"); + if (NumericCast(col_chunk.meta_data.dictionary_page_offset) >= col_start) { + throw IOException("Parquet file '%s': metadata is corrupt. Dictionary " + "page (offset=%llu) must come before any data pages (offset=%llu).", + filename, col_chunk.meta_data.dictionary_page_offset, col_start); + } + col_start = col_chunk.meta_data.dictionary_page_offset; + } + auto col_len = NumericCast(col_chunk.meta_data.total_compressed_size); + auto col_end = col_start + col_len; + if (col_end <= 0 || col_end > file_length) { + throw IOException("Parquet file '%s': metadata is corrupt. Column %llu has " + "invalid column offsets (offset=%llu, size=%llu, file_size=%llu).", + filename, i, col_start, col_len, file_length); + } + } +} + void ParquetWriter::FlushRowGroup(PreparedRowGroup &prepared) { lock_guard glock(lock); auto &row_group = prepared.row_group; @@ -481,6 +532,8 @@ void ParquetWriter::FlushRowGroup(PreparedRowGroup &prepared) { auto write_state = std::move(states[col_idx]); col_writer->FinalizeWrite(*write_state); } + // let's make sure all offsets are ay-okay + ValidateColumnOffsets(file_name, writer->GetTotalWritten(), row_group); // append the row group to the file meta data file_meta_data.row_groups.push_back(row_group); diff --git a/src/duckdb/extension/parquet/serialize_parquet.cpp b/src/duckdb/extension/parquet/serialize_parquet.cpp index b28ff021..cc5d1445 100644 --- a/src/duckdb/extension/parquet/serialize_parquet.cpp +++ b/src/duckdb/extension/parquet/serialize_parquet.cpp @@ -14,12 +14,12 @@ namespace duckdb { void ChildFieldIDs::Serialize(Serializer &serializer) const { - serializer.WritePropertyWithDefault>>(100, "ids", ids); + serializer.WritePropertyWithDefault>(100, "ids", ids.operator*()); } ChildFieldIDs ChildFieldIDs::Deserialize(Deserializer &deserializer) { ChildFieldIDs result; - deserializer.ReadPropertyWithDefault>>(100, "ids", result.ids); + deserializer.ReadPropertyWithDefault>(100, "ids", result.ids.operator*()); return result; } diff --git a/src/duckdb/src/catalog/catalog.cpp b/src/duckdb/src/catalog/catalog.cpp index 775af179..4d334a4d 100644 --- a/src/duckdb/src/catalog/catalog.cpp +++ b/src/duckdb/src/catalog/catalog.cpp @@ -280,14 +280,13 @@ optional_ptr Catalog::CreateCollation(CatalogTransaction transacti // Index //===--------------------------------------------------------------------===// optional_ptr Catalog::CreateIndex(CatalogTransaction transaction, CreateIndexInfo &info) { - auto &context = transaction.GetContext(); - return CreateIndex(context, info); + auto &schema = GetSchema(transaction, info.schema); + auto &table = schema.GetEntry(transaction, CatalogType::TABLE_ENTRY, info.table)->Cast(); + return schema.CreateIndex(transaction, info, table); } optional_ptr Catalog::CreateIndex(ClientContext &context, CreateIndexInfo &info) { - auto &schema = GetSchema(context, info.schema); - auto &table = GetEntry(context, schema.name, info.table); - return schema.CreateIndex(context, info, table); + return CreateIndex(GetCatalogTransaction(context), info); } //===--------------------------------------------------------------------===// @@ -760,19 +759,6 @@ CatalogEntryLookup Catalog::TryLookupEntry(ClientContext &context, CatalogType t return Catalog::TryLookupEntry(context, lookups, type, name, if_not_found, error_context); } -CatalogEntry &Catalog::GetEntry(ClientContext &context, const string &schema, const string &name) { - vector entry_types {CatalogType::TABLE_ENTRY, CatalogType::SEQUENCE_ENTRY}; - - for (auto entry_type : entry_types) { - auto result = GetEntry(context, entry_type, schema, name, OnEntryNotFound::RETURN_NULL); - if (result) { - return *result; - } - } - - throw CatalogException("CatalogElement \"%s.%s\" does not exist!", schema, name); -} - optional_ptr Catalog::GetEntry(ClientContext &context, CatalogType type, const string &schema_name, const string &name, OnEntryNotFound if_not_found, QueryErrorContext error_context) { @@ -840,21 +826,6 @@ optional_ptr Catalog::GetSchema(ClientContext &context, cons return nullptr; } -LogicalType Catalog::GetType(ClientContext &context, const string &schema, const string &name, - OnEntryNotFound if_not_found) { - auto type_entry = GetEntry(context, schema, name, if_not_found); - if (!type_entry) { - return LogicalType::INVALID; - } - return type_entry->user_type; -} - -LogicalType Catalog::GetType(ClientContext &context, const string &catalog_name, const string &schema, - const string &name) { - auto &type_entry = Catalog::GetEntry(context, catalog_name, schema, name); - return type_entry.user_type; -} - vector> Catalog::GetSchemas(ClientContext &context) { vector> schemas; ScanSchemas(context, [&](SchemaCatalogEntry &entry) { schemas.push_back(entry); }); @@ -912,15 +883,24 @@ vector> Catalog::GetAllSchemas(ClientContext &cont return result; } -void Catalog::Alter(ClientContext &context, AlterInfo &info) { +void Catalog::Alter(CatalogTransaction transaction, AlterInfo &info) { ModifyCatalog(); - auto lookup = LookupEntry(context, info.GetCatalogType(), info.schema, info.name, info.if_not_found); - - if (!lookup.Found()) { - return; + if (transaction.HasContext()) { + auto lookup = + LookupEntry(transaction.GetContext(), info.GetCatalogType(), info.schema, info.name, info.if_not_found); + if (!lookup.Found()) { + return; + } + return lookup.schema->Alter(transaction, info); } - return lookup.schema->Alter(context, info); + D_ASSERT(info.if_not_found == OnEntryNotFound::THROW_EXCEPTION); + auto &schema = GetSchema(transaction, info.schema); + return schema.Alter(transaction, info); +} + +void Catalog::Alter(ClientContext &context, AlterInfo &info) { + Alter(GetCatalogTransaction(context), info); } vector Catalog::GetMetadataInfo(ClientContext &context) { diff --git a/src/duckdb/src/catalog/catalog_entry.cpp b/src/duckdb/src/catalog/catalog_entry.cpp index a7ca7265..aa05a866 100644 --- a/src/duckdb/src/catalog/catalog_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry.cpp @@ -26,6 +26,13 @@ unique_ptr CatalogEntry::AlterEntry(ClientContext &context, AlterI throw InternalException("Unsupported alter type for catalog entry!"); } +unique_ptr CatalogEntry::AlterEntry(CatalogTransaction transaction, AlterInfo &info) { + if (!transaction.context) { + throw InternalException("Cannot AlterEntry without client context"); + } + return AlterEntry(*transaction.context, info); +} + void CatalogEntry::UndoAlter(ClientContext &context, AlterInfo &info) { } diff --git a/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp b/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp index 7230179b..b6da4918 100644 --- a/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp @@ -4,15 +4,15 @@ namespace duckdb { -IndexDataTableInfo::IndexDataTableInfo(shared_ptr &info_p, const string &index_name_p) - : info(info_p), index_name(index_name_p) { +IndexDataTableInfo::IndexDataTableInfo(shared_ptr info_p, const string &index_name_p) + : info(std::move(info_p)), index_name(index_name_p) { } IndexDataTableInfo::~IndexDataTableInfo() { if (!info) { return; } - info->indexes.RemoveIndex(index_name); + info->GetIndexes().RemoveIndex(index_name); } DuckIndexEntry::DuckIndexEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateIndexInfo &info) @@ -38,11 +38,11 @@ unique_ptr DuckIndexEntry::Copy(ClientContext &context) const { } string DuckIndexEntry::GetSchemaName() const { - return GetDataTableInfo().schema; + return GetDataTableInfo().GetSchemaName(); } string DuckIndexEntry::GetTableName() const { - return GetDataTableInfo().table; + return GetDataTableInfo().GetTableName(); } DataTableInfo &DuckIndexEntry::GetDataTableInfo() const { @@ -51,7 +51,7 @@ DataTableInfo &DuckIndexEntry::GetDataTableInfo() const { void DuckIndexEntry::CommitDrop() { D_ASSERT(info); - GetDataTableInfo().indexes.CommitDrop(name); + GetDataTableInfo().GetIndexes().CommitDrop(name); } } // namespace duckdb diff --git a/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp b/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp index cbd78d37..b9a3afec 100644 --- a/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp @@ -33,16 +33,16 @@ #include "duckdb/parser/parsed_data/create_type_info.hpp" #include "duckdb/parser/parsed_data/create_view_info.hpp" #include "duckdb/parser/parsed_data/drop_info.hpp" +#include "duckdb/transaction/meta_transaction.hpp" +#include "duckdb/main/attached_database.hpp" namespace duckdb { -static void FindForeignKeyInformation(CatalogEntry &entry, AlterForeignKeyType alter_fk_type, +static void FindForeignKeyInformation(TableCatalogEntry &table, AlterForeignKeyType alter_fk_type, vector> &fk_arrays) { - if (entry.type != CatalogType::TABLE_ENTRY) { - return; - } - auto &table_entry = entry.Cast(); - auto &constraints = table_entry.GetConstraints(); + auto &constraints = table.GetConstraints(); + auto &catalog = table.ParentCatalog(); + auto &name = table.name; for (idx_t i = 0; i < constraints.size(); i++) { auto &cond = constraints[i]; if (cond->type != ConstraintType::FOREIGN_KEY) { @@ -50,9 +50,9 @@ static void FindForeignKeyInformation(CatalogEntry &entry, AlterForeignKeyType a } auto &fk = cond->Cast(); if (fk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE) { - AlterEntryData alter_data(entry.ParentCatalog().GetName(), fk.info.schema, fk.info.table, + AlterEntryData alter_data(catalog.GetName(), fk.info.schema, fk.info.table, OnEntryNotFound::THROW_EXCEPTION); - fk_arrays.push_back(make_uniq(std::move(alter_data), entry.name, fk.pk_columns, + fk_arrays.push_back(make_uniq(std::move(alter_data), name, fk.pk_columns, fk.fk_columns, fk.info.pk_keys, fk.info.fk_keys, alter_fk_type)); } else if (fk.info.type == ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE && @@ -66,13 +66,13 @@ static void FindForeignKeyInformation(CatalogEntry &entry, AlterForeignKeyType a static void LazyLoadIndexes(ClientContext &context, CatalogEntry &entry) { if (entry.type == CatalogType::TABLE_ENTRY) { auto &table_entry = entry.Cast(); - table_entry.GetStorage().info->InitializeIndexes(context); + table_entry.GetStorage().InitializeIndexes(context); } else if (entry.type == CatalogType::INDEX_ENTRY) { auto &index_entry = entry.Cast(); auto &table_entry = Catalog::GetEntry(context, CatalogType::TABLE_ENTRY, index_entry.catalog.GetName(), index_entry.GetSchemaName(), index_entry.GetTableName()) .Cast(); - table_entry.GetStorage().info->InitializeIndexes(context); + table_entry.GetStorage().InitializeIndexes(context); } } @@ -100,6 +100,17 @@ optional_ptr DuckSchemaEntry::AddEntryInternal(CatalogTransaction auto entry_type = entry->type; auto result = entry.get(); + if (transaction.context) { + auto &meta = MetaTransaction::Get(transaction.GetContext()); + auto modified_database = meta.ModifiedDatabase(); + auto &db = ParentCatalog().GetAttached(); + if (!db.IsTemporary() && !db.IsSystem()) { + if (!modified_database || !RefersToSameObject(*modified_database, ParentCatalog().GetAttached())) { + throw InternalException( + "DuckSchemaEntry::AddEntryInternal called but this database is not marked as modified"); + } + } + } // first find the set for this entry auto &set = GetCatalogSet(entry_type); dependencies.AddDependency(*this); @@ -107,6 +118,9 @@ optional_ptr DuckSchemaEntry::AddEntryInternal(CatalogTransaction // CREATE OR REPLACE: first try to drop the entry auto old_entry = set.GetEntry(transaction, entry_name); if (old_entry) { + if (dependencies.Contains(*old_entry)) { + throw CatalogException("CREATE OR REPLACE is not allowed to depend on itself"); + } if (old_entry->type != entry_type) { throw CatalogException("Existing object %s is of type %s, trying to replace with type %s", entry_name, CatalogTypeToString(old_entry->type), CatalogTypeToString(entry_type)); @@ -128,26 +142,25 @@ optional_ptr DuckSchemaEntry::AddEntryInternal(CatalogTransaction optional_ptr DuckSchemaEntry::CreateTable(CatalogTransaction transaction, BoundCreateTableInfo &info) { auto table = make_uniq(catalog, *this, info); - auto &storage = table->GetStorage(); - storage.info->cardinality = storage.GetTotalRows(); - - auto entry = AddEntryInternal(transaction, std::move(table), info.Base().on_conflict, info.dependencies); - if (!entry) { - return nullptr; - } // add a foreign key constraint in main key table if there is a foreign key constraint vector> fk_arrays; - FindForeignKeyInformation(*entry, AlterForeignKeyType::AFT_ADD, fk_arrays); + FindForeignKeyInformation(*table, AlterForeignKeyType::AFT_ADD, fk_arrays); for (idx_t i = 0; i < fk_arrays.size(); i++) { // alter primary key table auto &fk_info = *fk_arrays[i]; - catalog.Alter(transaction.GetContext(), fk_info); + Alter(transaction, fk_info); // make a dependency between this table and referenced table auto &set = GetCatalogSet(CatalogType::TABLE_ENTRY); info.dependencies.AddDependency(*set.GetEntry(transaction, fk_info.name)); } + + auto entry = AddEntryInternal(transaction, std::move(table), info.Base().on_conflict, info.dependencies); + if (!entry) { + return nullptr; + } + return entry; } @@ -159,7 +172,7 @@ optional_ptr DuckSchemaEntry::CreateFunction(CatalogTransaction tr if (current_entry) { // the current entry exists - alter it instead auto alter_info = info.GetAlterInfo(); - Alter(transaction.GetContext(), *alter_info); + Alter(transaction, *alter_info); return nullptr; } } @@ -197,7 +210,7 @@ optional_ptr DuckSchemaEntry::CreateFunction(CatalogTransaction tr optional_ptr DuckSchemaEntry::AddEntry(CatalogTransaction transaction, unique_ptr entry, OnCreateConflict on_conflict) { - LogicalDependencyList dependencies; + LogicalDependencyList dependencies = entry->dependencies; return AddEntryInternal(transaction, std::move(entry), on_conflict, dependencies); } @@ -216,19 +229,20 @@ optional_ptr DuckSchemaEntry::CreateView(CatalogTransaction transa return AddEntry(transaction, std::move(view), info.on_conflict); } -optional_ptr DuckSchemaEntry::CreateIndex(ClientContext &context, CreateIndexInfo &info, +optional_ptr DuckSchemaEntry::CreateIndex(CatalogTransaction transaction, CreateIndexInfo &info, TableCatalogEntry &table) { - LogicalDependencyList dependencies; - dependencies.AddDependency(table); + info.dependencies.AddDependency(table); // currently, we can not alter PK/FK/UNIQUE constraints // concurrency-safe name checks against other INDEX catalog entries happens in the catalog - if (!table.GetStorage().IndexNameIsUnique(info.index_name)) { - throw CatalogException("An index with the name " + info.index_name + "already exists!"); + if (info.on_conflict != OnCreateConflict::IGNORE_ON_CONFLICT && + !table.GetStorage().IndexNameIsUnique(info.index_name)) { + throw CatalogException("An index with the name " + info.index_name + " already exists!"); } auto index = make_uniq(catalog, *this, info); - return AddEntryInternal(GetCatalogTransaction(context), std::move(index), info.on_conflict, dependencies); + auto dependencies = index->dependencies; + return AddEntryInternal(transaction, std::move(index), info.on_conflict, dependencies); } optional_ptr DuckSchemaEntry::CreateCollation(CatalogTransaction transaction, CreateCollationInfo &info) { @@ -258,11 +272,10 @@ optional_ptr DuckSchemaEntry::CreatePragmaFunction(CatalogTransact return AddEntry(transaction, std::move(pragma_function), info.on_conflict); } -void DuckSchemaEntry::Alter(ClientContext &context, AlterInfo &info) { +void DuckSchemaEntry::Alter(CatalogTransaction transaction, AlterInfo &info) { CatalogType type = info.GetCatalogType(); auto &set = GetCatalogSet(type); - auto transaction = GetCatalogTransaction(context); if (info.type == AlterType::CHANGE_OWNERSHIP) { if (!set.AlterOwnership(transaction, info.Cast())) { throw CatalogException("Couldn't change ownership!"); @@ -305,7 +318,10 @@ void DuckSchemaEntry::DropEntry(ClientContext &context, DropInfo &info) { // if there is a foreign key constraint, get that information vector> fk_arrays; - FindForeignKeyInformation(*existing_entry, AlterForeignKeyType::AFT_DELETE, fk_arrays); + if (existing_entry->type == CatalogType::TABLE_ENTRY) { + FindForeignKeyInformation(existing_entry->Cast(), AlterForeignKeyType::AFT_DELETE, + fk_arrays); + } if (!set.DropEntry(transaction, info.name, info.cascade, info.allow_drop_internal)) { throw InternalException("Could not drop element because of an internal error"); @@ -314,7 +330,7 @@ void DuckSchemaEntry::DropEntry(ClientContext &context, DropInfo &info) { // remove the foreign key constraint in main key table if main key table's name is valid for (idx_t i = 0; i < fk_arrays.size(); i++) { // alter primary key table - catalog.Alter(context, *fk_arrays[i]); + Alter(transaction, *fk_arrays[i]); } } diff --git a/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp b/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp index eb7be8d7..144fe314 100644 --- a/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp @@ -50,7 +50,7 @@ void AddDataTableIndex(DataTable &storage, const ColumnList &columns, const vect if (!info.IsValid() && !info.name.empty() && !storage.IsRoot()) { throw TransactionException("Transaction conflict: cannot add an index to a table that has been altered!"); } - storage.info->indexes.AddIndex(std::move(art)); + storage.AddIndex(std::move(art)); } void AddDataTableIndex(DataTable &storage, const ColumnList &columns, vector &keys, @@ -71,10 +71,21 @@ IndexStorageInfo GetIndexInfo(const IndexConstraintType &constraint_type, unique return IndexStorageInfo(constraint_name + create_table_info.table + "_" + to_string(idx)); } +vector GetUniqueConstraintKeys(const ColumnList &columns, const UniqueConstraint &constraint) { + vector indexes; + if (constraint.HasIndex()) { + indexes.push_back(columns.LogicalToPhysical(constraint.GetIndex())); + } else { + for (auto &keyname : constraint.GetColumnNames()) { + indexes.push_back(columns.GetColumn(keyname).Physical()); + } + } + return indexes; +} + DuckTableEntry::DuckTableEntry(Catalog &catalog, SchemaCatalogEntry &schema, BoundCreateTableInfo &info, - std::shared_ptr inherited_storage) + shared_ptr inherited_storage) : TableCatalogEntry(catalog, schema, info.Base()), storage(std::move(inherited_storage)), - bound_constraints(std::move(info.bound_constraints)), column_dependency_manager(std::move(info.column_dependency_manager)) { if (!storage) { @@ -83,26 +94,25 @@ DuckTableEntry::DuckTableEntry(Catalog &catalog, SchemaCatalogEntry &schema, Bou for (auto &col_def : columns.Physical()) { storage_columns.push_back(col_def.Copy()); } - storage = make_shared(catalog.GetAttached(), StorageManager::Get(catalog).GetTableIOManager(&info), - schema.name, name, std::move(storage_columns), std::move(info.data)); + storage = + make_shared_ptr(catalog.GetAttached(), StorageManager::Get(catalog).GetTableIOManager(&info), + schema.name, name, std::move(storage_columns), std::move(info.data)); // create the unique indexes for the UNIQUE and PRIMARY KEY and FOREIGN KEY constraints idx_t indexes_idx = 0; - for (idx_t i = 0; i < bound_constraints.size(); i++) { - - auto &constraint = bound_constraints[i]; - + for (idx_t i = 0; i < constraints.size(); i++) { + auto &constraint = constraints[i]; if (constraint->type == ConstraintType::UNIQUE) { // unique constraint: create a unique index - auto &unique = constraint->Cast(); + auto &unique = constraint->Cast(); IndexConstraintType constraint_type = IndexConstraintType::UNIQUE; if (unique.is_primary_key) { constraint_type = IndexConstraintType::PRIMARY; } - + auto unique_keys = GetUniqueConstraintKeys(columns, unique); if (info.indexes.empty()) { - AddDataTableIndex(*storage, columns, unique.keys, constraint_type, + AddDataTableIndex(*storage, columns, unique_keys, constraint_type, GetIndexInfo(constraint_type, info.base, i)); } else { // we read the index from an old storage version, so we have to apply a dummy name @@ -112,13 +122,12 @@ DuckTableEntry::DuckTableEntry(Catalog &catalog, SchemaCatalogEntry &schema, Bou } // now add the index - AddDataTableIndex(*storage, columns, unique.keys, constraint_type, info.indexes[indexes_idx++]); + AddDataTableIndex(*storage, columns, unique_keys, constraint_type, info.indexes[indexes_idx++]); } } else if (constraint->type == ConstraintType::FOREIGN_KEY) { - // foreign key constraint: create a foreign key index - auto &bfk = constraint->Cast(); + auto &bfk = constraint->Cast(); if (bfk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE || bfk.info.type == ForeignKeyType::FK_TYPE_SELF_REFERENCE_TABLE) { @@ -144,7 +153,7 @@ DuckTableEntry::DuckTableEntry(Catalog &catalog, SchemaCatalogEntry &schema, Bou } if (!info.indexes.empty()) { - storage->info->index_storage_infos = info.indexes; + storage->SetIndexStorageInfo(std::move(info.indexes)); } } @@ -159,6 +168,23 @@ unique_ptr DuckTableEntry::GetStatistics(ClientContext &context, return storage->GetStatistics(context, column.StorageOid()); } +unique_ptr DuckTableEntry::AlterEntry(CatalogTransaction transaction, AlterInfo &info) { + if (transaction.context) { + return AlterEntry(*transaction.context, info); + } + if (info.type == AlterType::ALTER_TABLE) { + auto &table_info = info.Cast(); + if (table_info.alter_table_type == AlterTableType::FOREIGN_KEY_CONSTRAINT) { + auto &foreign_key_constraint_info = table_info.Cast(); + if (foreign_key_constraint_info.type == AlterForeignKeyType::AFT_ADD) { + // for checkpoint loading we support adding foreign key constraints without a client context + return AddForeignKeyConstraint(nullptr, foreign_key_constraint_info); + } + } + } + return CatalogEntry::AlterEntry(transaction, info); +} + unique_ptr DuckTableEntry::AlterEntry(ClientContext &context, AlterInfo &info) { D_ASSERT(!internal); @@ -181,7 +207,7 @@ unique_ptr DuckTableEntry::AlterEntry(ClientContext &context, Alte auto &rename_info = table_info.Cast(); auto copied_table = Copy(context); copied_table->name = rename_info.new_table_name; - storage->info->table = rename_info.new_table_name; + storage->SetTableName(rename_info.new_table_name); return copied_table; } case AlterTableType::ADD_COLUMN: { @@ -227,7 +253,7 @@ void DuckTableEntry::UndoAlter(ClientContext &context, AlterInfo &info) { auto &table_info = info.Cast(); switch (table_info.alter_table_type) { case AlterTableType::RENAME_TABLE: { - storage->info->table = this->name; + storage->SetTableName(this->name); break; default: break; @@ -254,6 +280,7 @@ unique_ptr DuckTableEntry::RenameColumn(ClientContext &context, Re auto create_info = make_uniq(schema, name); create_info->temporary = temporary; create_info->comment = comment; + create_info->tags = tags; for (auto &col : columns.Logical()) { auto copy = col.Copy(); if (rename_idx == col.Logical()) { @@ -327,6 +354,7 @@ unique_ptr DuckTableEntry::AddColumn(ClientContext &context, AddCo auto create_info = make_uniq(schema, name); create_info->temporary = temporary; create_info->comment = comment; + create_info->tags = tags; for (auto &col : columns.Logical()) { create_info->columns.AddColumn(col.Copy()); @@ -334,27 +362,27 @@ unique_ptr DuckTableEntry::AddColumn(ClientContext &context, AddCo for (auto &constraint : constraints) { create_info->constraints.push_back(constraint->Copy()); } - Binder::BindLogicalType(context, info.new_column.TypeMutable(), &catalog, schema.name); + auto binder = Binder::CreateBinder(context); + binder->BindLogicalType(info.new_column.TypeMutable(), &catalog, schema.name); info.new_column.SetOid(columns.LogicalColumnCount()); info.new_column.SetStorageOid(columns.PhysicalColumnCount()); auto col = info.new_column.Copy(); create_info->columns.AddColumn(std::move(col)); - auto binder = Binder::CreateBinder(context); - auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema); - auto new_storage = - make_shared(context, *storage, info.new_column, *bound_create_info->bound_defaults.back()); + vector> bound_defaults; + auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema, bound_defaults); + auto new_storage = make_shared_ptr(context, *storage, info.new_column, *bound_defaults.back()); return make_uniq(catalog, schema, *bound_create_info, new_storage); } void DuckTableEntry::UpdateConstraintsOnColumnDrop(const LogicalIndex &removed_index, const vector &adjusted_indices, const RemoveColumnInfo &info, CreateTableInfo &create_info, + const vector> &bound_constraints, bool is_generated) { // handle constraints for the new table D_ASSERT(constraints.size() == bound_constraints.size()); - for (idx_t constr_idx = 0; constr_idx < constraints.size(); constr_idx++) { auto &constraint = constraints[constr_idx]; auto &bound_constraint = bound_constraints[constr_idx]; @@ -449,6 +477,7 @@ unique_ptr DuckTableEntry::RemoveColumn(ClientContext &context, Re auto create_info = make_uniq(schema, name); create_info->temporary = temporary; create_info->comment = comment; + create_info->tags = tags; logical_index_set_t removed_columns; if (column_dependency_manager.HasDependents(removed_index)) { @@ -472,21 +501,25 @@ unique_ptr DuckTableEntry::RemoveColumn(ClientContext &context, Re } auto adjusted_indices = column_dependency_manager.RemoveColumn(removed_index, columns.LogicalColumnCount()); - UpdateConstraintsOnColumnDrop(removed_index, adjusted_indices, info, *create_info, dropped_column_is_generated); - auto binder = Binder::CreateBinder(context); + auto bound_constraints = binder->BindConstraints(constraints, name, columns); + + UpdateConstraintsOnColumnDrop(removed_index, adjusted_indices, info, *create_info, bound_constraints, + dropped_column_is_generated); + auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema); if (columns.GetColumn(LogicalIndex(removed_index)).Generated()) { return make_uniq(catalog, schema, *bound_create_info, storage); } auto new_storage = - make_shared(context, *storage, columns.LogicalToPhysical(LogicalIndex(removed_index)).index); + make_shared_ptr(context, *storage, columns.LogicalToPhysical(LogicalIndex(removed_index)).index); return make_uniq(catalog, schema, *bound_create_info, new_storage); } unique_ptr DuckTableEntry::SetDefault(ClientContext &context, SetDefaultInfo &info) { auto create_info = make_uniq(schema, name); create_info->comment = comment; + create_info->tags = tags; auto default_idx = GetColumnIndex(info.column_name); if (default_idx.index == COLUMN_IDENTIFIER_ROW_ID) { throw CatalogException("Cannot SET DEFAULT for rowid column"); @@ -519,6 +552,7 @@ unique_ptr DuckTableEntry::SetNotNull(ClientContext &context, SetN auto create_info = make_uniq(schema, name); create_info->comment = comment; + create_info->tags = tags; create_info->columns = columns.Copy(); auto not_null_idx = GetColumnIndex(info.column_name); @@ -548,7 +582,7 @@ unique_ptr DuckTableEntry::SetNotNull(ClientContext &context, SetN } // Return with new storage info. Note that we need the bound column index here. - auto new_storage = make_shared( + auto new_storage = make_shared_ptr( context, *storage, make_uniq(columns.LogicalToPhysical(LogicalIndex(not_null_idx)))); return make_uniq(catalog, schema, *bound_create_info, new_storage); } @@ -556,6 +590,7 @@ unique_ptr DuckTableEntry::SetNotNull(ClientContext &context, SetN unique_ptr DuckTableEntry::DropNotNull(ClientContext &context, DropNotNullInfo &info) { auto create_info = make_uniq(schema, name); create_info->comment = comment; + create_info->tags = tags; create_info->columns = columns.Copy(); auto not_null_idx = GetColumnIndex(info.column_name); @@ -577,12 +612,15 @@ unique_ptr DuckTableEntry::DropNotNull(ClientContext &context, Dro } unique_ptr DuckTableEntry::ChangeColumnType(ClientContext &context, ChangeColumnTypeInfo &info) { - Binder::BindLogicalType(context, info.target_type, &catalog, schema.name); + auto binder = Binder::CreateBinder(context); + binder->BindLogicalType(info.target_type, &catalog, schema.name); auto change_idx = GetColumnIndex(info.column_name); auto create_info = make_uniq(schema, name); create_info->temporary = temporary; create_info->comment = comment; + create_info->tags = tags; + auto bound_constraints = binder->BindConstraints(constraints, name, columns); for (auto &col : columns.Logical()) { auto copy = col.Copy(); if (change_idx == col.Logical()) { @@ -643,7 +681,6 @@ unique_ptr DuckTableEntry::ChangeColumnType(ClientContext &context create_info->constraints.push_back(std::move(constraint)); } - auto binder = Binder::CreateBinder(context); // bind the specified expression vector bound_columns; AlterBinder expr_binder(*binder, context, *this, bound_columns, info.target_type); @@ -659,8 +696,8 @@ unique_ptr DuckTableEntry::ChangeColumnType(ClientContext &context } auto new_storage = - make_shared(context, *storage, columns.LogicalToPhysical(LogicalIndex(change_idx)).index, - info.target_type, std::move(storage_oids), *bound_expression); + make_shared_ptr(context, *storage, columns.LogicalToPhysical(LogicalIndex(change_idx)).index, + info.target_type, std::move(storage_oids), *bound_expression); auto result = make_uniq(catalog, schema, *bound_create_info, new_storage); return std::move(result); } @@ -668,6 +705,7 @@ unique_ptr DuckTableEntry::ChangeColumnType(ClientContext &context unique_ptr DuckTableEntry::SetColumnComment(ClientContext &context, SetColumnCommentInfo &info) { auto create_info = make_uniq(schema, name); create_info->comment = comment; + create_info->tags = tags; auto default_idx = GetColumnIndex(info.column_name); if (default_idx.index == COLUMN_IDENTIFIER_ROW_ID) { throw CatalogException("Cannot SET DEFAULT for rowid column"); @@ -692,11 +730,13 @@ unique_ptr DuckTableEntry::SetColumnComment(ClientContext &context return make_uniq(catalog, schema, *bound_create_info, storage); } -unique_ptr DuckTableEntry::AddForeignKeyConstraint(ClientContext &context, AlterForeignKeyInfo &info) { +unique_ptr DuckTableEntry::AddForeignKeyConstraint(optional_ptr context, + AlterForeignKeyInfo &info) { D_ASSERT(info.type == AlterForeignKeyType::AFT_ADD); auto create_info = make_uniq(schema, name); create_info->temporary = temporary; create_info->comment = comment; + create_info->tags = tags; create_info->columns = columns.Copy(); for (idx_t i = 0; i < constraints.size(); i++) { @@ -711,8 +751,13 @@ unique_ptr DuckTableEntry::AddForeignKeyConstraint(ClientContext & create_info->constraints.push_back( make_uniq(info.pk_columns, info.fk_columns, std::move(fk_info))); - auto binder = Binder::CreateBinder(context); - auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema); + unique_ptr bound_create_info; + if (context) { + auto binder = Binder::CreateBinder(*context); + bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema); + } else { + bound_create_info = Binder::BindCreateTableCheckpoint(std::move(create_info), schema); + } return make_uniq(catalog, schema, *bound_create_info, storage); } @@ -722,6 +767,7 @@ unique_ptr DuckTableEntry::DropForeignKeyConstraint(ClientContext auto create_info = make_uniq(schema, name); create_info->temporary = temporary; create_info->comment = comment; + create_info->tags = tags; create_info->columns = columns.Copy(); for (idx_t i = 0; i < constraints.size(); i++) { @@ -744,6 +790,7 @@ unique_ptr DuckTableEntry::DropForeignKeyConstraint(ClientContext unique_ptr DuckTableEntry::Copy(ClientContext &context) const { auto create_info = make_uniq(schema, name); create_info->comment = comment; + create_info->tags = tags; create_info->columns = columns.Copy(); for (idx_t i = 0; i < constraints.size(); i++) { @@ -758,7 +805,7 @@ unique_ptr DuckTableEntry::Copy(ClientContext &context) const { void DuckTableEntry::SetAsRoot() { storage->SetAsRoot(); - storage->info->table = name; + storage->SetTableName(name); } void DuckTableEntry::CommitAlter(string &column_name) { @@ -785,10 +832,6 @@ DataTable &DuckTableEntry::GetStorage() { return *storage; } -const vector> &DuckTableEntry::GetBoundConstraints() { - return bound_constraints; -} - TableFunction DuckTableEntry::GetScanFunction(ClientContext &context, unique_ptr &bind_data) { bind_data = make_uniq(*this); return TableScanFunction::GetFunction(); @@ -799,18 +842,7 @@ vector DuckTableEntry::GetColumnSegmentInfo() { } TableStorageInfo DuckTableEntry::GetStorageInfo(ClientContext &context) { - TableStorageInfo result; - result.cardinality = storage->info->cardinality.load(); - storage->info->indexes.Scan([&](Index &index) { - IndexInfo info; - info.is_primary = index.IsPrimary(); - info.is_unique = index.IsUnique() || info.is_primary; - info.is_foreign = index.IsForeign(); - info.column_set = index.column_id_set; - result.index_info.push_back(std::move(info)); - return false; - }); - return result; + return storage->GetStorageInfo(); } } // namespace duckdb diff --git a/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp b/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp index 90909222..9e704dcd 100644 --- a/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp @@ -7,6 +7,7 @@ IndexCatalogEntry::IndexCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schem index_type(info.index_type), index_constraint_type(info.constraint_type), column_ids(info.column_ids) { this->temporary = info.temporary; + this->dependencies = info.dependencies; this->comment = info.comment; } @@ -21,6 +22,7 @@ unique_ptr IndexCatalogEntry::GetInfo() const { result->index_type = index_type; result->constraint_type = index_constraint_type; result->column_ids = column_ids; + result->dependencies = dependencies; for (auto &expr : expressions) { result->expressions.push_back(expr->Copy()); @@ -30,14 +32,14 @@ unique_ptr IndexCatalogEntry::GetInfo() const { } result->comment = comment; + result->tags = tags; return std::move(result); } string IndexCatalogEntry::ToSQL() const { auto info = GetInfo(); - auto result = info->ToString(); - return result + ";\n"; + return info->ToString(); } bool IndexCatalogEntry::IsUnique() { diff --git a/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp b/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp index 3ac57460..473b07f4 100644 --- a/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp @@ -11,7 +11,9 @@ MacroCatalogEntry::MacroCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schem function(std::move(info.function)) { this->temporary = info.temporary; this->internal = info.internal; + this->dependencies = info.dependencies; this->comment = info.comment; + this->tags = info.tags; } ScalarMacroCatalogEntry::ScalarMacroCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateMacroInfo &info) @@ -42,7 +44,9 @@ unique_ptr MacroCatalogEntry::GetInfo() const { info->schema = schema.name; info->name = name; info->function = function->Copy(); + info->dependencies = dependencies; info->comment = comment; + info->tags = tags; return std::move(info); } diff --git a/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp b/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp index 0f7e1dfc..5789cff8 100644 --- a/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp @@ -14,12 +14,18 @@ SchemaCatalogEntry::SchemaCatalogEntry(Catalog &catalog, CreateSchemaInfo &info) : InCatalogEntry(CatalogType::SCHEMA_ENTRY, catalog, info.schema) { this->internal = info.internal; this->comment = info.comment; + this->tags = info.tags; } CatalogTransaction SchemaCatalogEntry::GetCatalogTransaction(ClientContext &context) { return CatalogTransaction(catalog, context); } +optional_ptr SchemaCatalogEntry::CreateIndex(ClientContext &context, CreateIndexInfo &info, + TableCatalogEntry &table) { + return CreateIndex(GetCatalogTransaction(context), info, table); +} + SimilarCatalogEntry SchemaCatalogEntry::GetSimilarEntry(CatalogTransaction transaction, CatalogType type, const string &name) { SimilarCatalogEntry result; @@ -37,6 +43,7 @@ unique_ptr SchemaCatalogEntry::GetInfo() const { auto result = make_uniq(); result->schema = name; result->comment = comment; + result->tags = tags; return std::move(result); } diff --git a/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp b/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp index 5606ddc8..085048b0 100644 --- a/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp @@ -22,6 +22,7 @@ SequenceCatalogEntry::SequenceCatalogEntry(Catalog &catalog, SchemaCatalogEntry : StandardEntry(CatalogType::SEQUENCE_ENTRY, schema, catalog, info.name), data(info) { this->temporary = info.temporary; this->comment = info.comment; + this->tags = info.tags; } unique_ptr SequenceCatalogEntry::Copy(ClientContext &context) const { @@ -73,7 +74,7 @@ int64_t SequenceCatalogEntry::NextValue(DuckTransaction &transaction) { data.last_value = result; data.usage_count++; if (!temporary) { - transaction.sequence_usage[this] = SequenceValue(data.usage_count, data.counter); + transaction.PushSequenceUsage(*this, data); } return result; } @@ -98,7 +99,9 @@ unique_ptr SequenceCatalogEntry::GetInfo() const { result->max_value = seq_data.max_value; result->start_value = seq_data.counter; result->cycle = seq_data.cycle; + result->dependencies = dependencies; result->comment = comment; + result->tags = tags; return std::move(result); } diff --git a/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp b/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp index f89d214f..33f6c1e4 100644 --- a/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp @@ -12,6 +12,8 @@ #include "duckdb/planner/operator/logical_get.hpp" #include "duckdb/planner/constraints/bound_check_constraint.hpp" #include "duckdb/planner/operator/logical_projection.hpp" +#include "duckdb/common/extra_type_info.hpp" +#include "duckdb/parser/expression/cast_expression.hpp" #include @@ -21,7 +23,9 @@ TableCatalogEntry::TableCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schem : StandardEntry(CatalogType::TABLE_ENTRY, schema, catalog, info.table), columns(std::move(info.columns)), constraints(std::move(info.constraints)) { this->temporary = info.temporary; + this->dependencies = info.dependencies; this->comment = info.comment; + this->tags = info.tags; } bool TableCatalogEntry::HasGeneratedColumns() const { @@ -62,9 +66,11 @@ unique_ptr TableCatalogEntry::GetInfo() const { result->table = name; result->columns = columns.Copy(); result->constraints.reserve(constraints.size()); + result->dependencies = dependencies; std::for_each(constraints.begin(), constraints.end(), [&result](const unique_ptr &c) { result->constraints.emplace_back(c->Copy()); }); result->comment = comment; + result->tags = tags; return std::move(result); } @@ -118,11 +124,35 @@ string TableCatalogEntry::ColumnsToSQL(const ColumnList &columns, const vectortype == ExtraTypeInfoType::STRING_TYPE_INFO) { + auto &string_info = extra_type_info->Cast(); + if (!string_info.collation.empty()) { + ss << " COLLATE " + string_info.collation; + } + } bool not_null = not_null_columns.find(column.Logical()) != not_null_columns.end(); bool is_single_key_pk = pk_columns.find(column.Logical()) != pk_columns.end(); bool is_multi_key_pk = multi_key_pks.find(column.Name()) != multi_key_pks.end(); bool is_unique = unique_columns.find(column.Logical()) != unique_columns.end(); + if (column.Generated()) { + reference generated_expression = column.GeneratedExpression(); + if (column_type.id() != LogicalTypeId::ANY) { + // We artificially add a cast if the type is specified, need to strip it + auto &expr = generated_expression.get(); + D_ASSERT(expr.type == ExpressionType::OPERATOR_CAST); + auto &cast_expr = expr.Cast(); + D_ASSERT(cast_expr.cast_type.id() == column_type.id()); + generated_expression = *cast_expr.child; + } + ss << " GENERATED ALWAYS AS(" << generated_expression.get().ToString() << ")"; + } else if (column.HasDefaultValue()) { + ss << " DEFAULT(" << column.DefaultValue().ToString() << ")"; + } if (not_null && !is_single_key_pk && !is_multi_key_pk) { // NOT NULL but not a primary key column ss << " NOT NULL"; @@ -135,11 +165,6 @@ string TableCatalogEntry::ColumnsToSQL(const ColumnList &columns, const vector> &TableCatalogEntry::GetConstraints() { +const vector> &TableCatalogEntry::GetConstraints() const { return constraints; } @@ -172,11 +197,6 @@ const vector> &TableCatalogEntry::GetConstraints() { DataTable &TableCatalogEntry::GetStorage() { throw InternalException("Calling GetStorage on a TableCatalogEntry that is not a DuckTableEntry"); } - -const vector> &TableCatalogEntry::GetBoundConstraints() { - throw InternalException("Calling GetBoundConstraints on a TableCatalogEntry that is not a DuckTableEntry"); -} - // LCOV_EXCL_STOP static void BindExtraColumns(TableCatalogEntry &table, LogicalGet &get, LogicalProjection &proj, LogicalUpdate &update, @@ -239,14 +259,15 @@ vector TableCatalogEntry::GetColumnSegmentInfo() { return {}; } -void TableCatalogEntry::BindUpdateConstraints(LogicalGet &get, LogicalProjection &proj, LogicalUpdate &update, - ClientContext &context) { +void TableCatalogEntry::BindUpdateConstraints(Binder &binder, LogicalGet &get, LogicalProjection &proj, + LogicalUpdate &update, ClientContext &context) { // check the constraints and indexes of the table to see if we need to project any additional columns // we do this for indexes with multiple columns and CHECK constraints in the UPDATE clause // suppose we have a constraint CHECK(i + j < 10); now we need both i and j to check the constraint // if we are only updating one of the two columns we add the other one to the UPDATE set // with a "useless" update (i.e. i=i) so we can verify that the CHECK constraint is not violated - for (auto &constraint : GetBoundConstraints()) { + auto bound_constraints = binder.BindConstraints(constraints, name, columns); + for (auto &constraint : bound_constraints) { if (constraint->type == ConstraintType::CHECK) { auto &check = constraint->Cast(); // check constraint! check if we need to add any extra columns to the UPDATE clause diff --git a/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp b/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp index 4e04ee26..c60c7167 100644 --- a/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp @@ -10,10 +10,13 @@ namespace duckdb { TypeCatalogEntry::TypeCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateTypeInfo &info) - : StandardEntry(CatalogType::TYPE_ENTRY, schema, catalog, info.name), user_type(info.type) { + : StandardEntry(CatalogType::TYPE_ENTRY, schema, catalog, info.name), user_type(info.type), + bind_modifiers(info.bind_modifiers) { this->temporary = info.temporary; this->internal = info.internal; + this->dependencies = info.dependencies; this->comment = info.comment; + this->tags = info.tags; } unique_ptr TypeCatalogEntry::Copy(ClientContext &context) const { @@ -29,7 +32,10 @@ unique_ptr TypeCatalogEntry::GetInfo() const { result->schema = schema.name; result->name = name; result->type = user_type; + result->dependencies = dependencies; result->comment = comment; + result->tags = tags; + result->bind_modifiers = bind_modifiers; return std::move(result); } diff --git a/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp b/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp index 8d3a0deb..9f029f21 100644 --- a/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +++ b/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp @@ -20,7 +20,9 @@ void ViewCatalogEntry::Initialize(CreateViewInfo &info) { this->temporary = info.temporary; this->sql = info.sql; this->internal = info.internal; + this->dependencies = info.dependencies; this->comment = info.comment; + this->tags = info.tags; this->column_comments = info.column_comments; } @@ -39,7 +41,9 @@ unique_ptr ViewCatalogEntry::GetInfo() const { result->names = names; result->types = types; result->temporary = temporary; + result->dependencies = dependencies; result->comment = comment; + result->tags = tags; result->column_comments = column_comments; return std::move(result); } @@ -93,7 +97,7 @@ string ViewCatalogEntry::ToSQL() const { } auto info = GetInfo(); auto result = info->ToString(); - return result + ";\n"; + return result; } unique_ptr ViewCatalogEntry::Copy(ClientContext &context) const { diff --git a/src/duckdb/src/catalog/catalog_entry_retriever.cpp b/src/duckdb/src/catalog/catalog_entry_retriever.cpp new file mode 100644 index 00000000..db0d0d42 --- /dev/null +++ b/src/duckdb/src/catalog/catalog_entry_retriever.cpp @@ -0,0 +1,64 @@ +#include "duckdb/catalog/catalog_entry_retriever.hpp" +#include "duckdb/catalog/catalog.hpp" +#include "duckdb/catalog/catalog_entry.hpp" +#include "duckdb/parser/query_error_context.hpp" +#include "duckdb/main/client_context.hpp" +#include "duckdb/common/enums/on_entry_not_found.hpp" +#include "duckdb/common/enums/catalog_type.hpp" +#include "duckdb/common/optional_ptr.hpp" +#include "duckdb/catalog/catalog_entry/type_catalog_entry.hpp" + +namespace duckdb { + +LogicalType CatalogEntryRetriever::GetType(Catalog &catalog, const string &schema, const string &name, + OnEntryNotFound on_entry_not_found) { + QueryErrorContext error_context; + auto result = GetEntry(CatalogType::TYPE_ENTRY, catalog, schema, name, on_entry_not_found, error_context); + if (!result) { + return LogicalType::INVALID; + } + auto &type_entry = result->Cast(); + return type_entry.user_type; +} + +LogicalType CatalogEntryRetriever::GetType(const string &catalog, const string &schema, const string &name, + OnEntryNotFound on_entry_not_found) { + QueryErrorContext error_context; + auto result = GetEntry(CatalogType::TYPE_ENTRY, catalog, schema, name, on_entry_not_found, error_context); + if (!result) { + return LogicalType::INVALID; + } + auto &type_entry = result->Cast(); + return type_entry.user_type; +} + +optional_ptr CatalogEntryRetriever::GetEntry(CatalogType type, const string &catalog, + const string &schema, const string &name, + OnEntryNotFound on_entry_not_found, + QueryErrorContext error_context) { + return GetEntryInternal( + [&]() { return Catalog::GetEntry(context, type, catalog, schema, name, on_entry_not_found, error_context); }); +} + +optional_ptr CatalogEntryRetriever::GetSchema(const string &catalog, const string &name, + OnEntryNotFound on_entry_not_found, + QueryErrorContext error_context) { + auto result = Catalog::GetSchema(context, catalog, name, on_entry_not_found, error_context); + if (!result) { + return result; + } + if (callback) { + // Call the callback if it's set + callback(*result); + } + return result; +} + +optional_ptr CatalogEntryRetriever::GetEntry(CatalogType type, Catalog &catalog, const string &schema, + const string &name, OnEntryNotFound on_entry_not_found, + QueryErrorContext error_context) { + return GetEntryInternal( + [&]() { return catalog.GetEntry(context, type, schema, name, on_entry_not_found, error_context); }); +} + +} // namespace duckdb diff --git a/src/duckdb/src/catalog/catalog_set.cpp b/src/duckdb/src/catalog/catalog_set.cpp index d167fd90..716be598 100644 --- a/src/duckdb/src/catalog/catalog_set.cpp +++ b/src/duckdb/src/catalog/catalog_set.cpp @@ -14,6 +14,7 @@ #include "duckdb/transaction/transaction_manager.hpp" #include "duckdb/catalog/dependency_list.hpp" #include "duckdb/common/exception/transaction_exception.hpp" +#include "duckdb/catalog/catalog_entry/schema_catalog_entry.hpp" namespace duckdb { @@ -245,10 +246,22 @@ bool CatalogSet::AlterOwnership(CatalogTransaction transaction, ChangeOwnershipI if (!entry) { return false; } - - auto &owner_entry = catalog.GetEntry(transaction.GetContext(), info.owner_schema, info.owner_name); + optional_ptr owner_entry; + auto schema = catalog.GetSchema(transaction, info.owner_schema, OnEntryNotFound::RETURN_NULL); + if (schema) { + vector entry_types {CatalogType::TABLE_ENTRY, CatalogType::SEQUENCE_ENTRY}; + for (auto entry_type : entry_types) { + owner_entry = schema->GetEntry(transaction, entry_type, info.owner_name); + if (owner_entry) { + break; + } + } + } + if (!owner_entry) { + throw CatalogException("CatalogElement \"%s.%s\" does not exist!", info.owner_schema, info.owner_name); + } write_lock.unlock(); - catalog.GetDependencyManager().AddOwnership(transaction, owner_entry, *entry); + catalog.GetDependencyManager().AddOwnership(transaction, *owner_entry, *entry); return true; } @@ -292,39 +305,41 @@ bool CatalogSet::RenameEntryInternal(CatalogTransaction transaction, CatalogEntr } bool CatalogSet::AlterEntry(CatalogTransaction transaction, const string &name, AlterInfo &alter_info) { - // lock the catalog for writing - unique_lock write_lock(catalog.GetWriteLock()); - // lock this catalog set to disallow reading - unique_lock read_lock(catalog_lock); - // If the entry does not exist, we error - auto entry = GetEntryInternal(transaction, name); + auto entry = GetEntry(transaction, name); if (!entry) { return false; } if (!alter_info.allow_internal && entry->internal) { throw CatalogException("Cannot alter entry \"%s\" because it is an internal system entry", entry->name); } - if (!transaction.context) { - throw InternalException("Cannot AlterEntry without client context"); - } - - auto &context = *transaction.context; unique_ptr value; if (alter_info.type == AlterType::SET_COMMENT) { // Copy the existing entry; we are only changing metadata here - value = entry->Copy(context); + if (!transaction.context) { + throw InternalException("Cannot AlterEntry::SET_COMMENT without client context"); + } + value = entry->Copy(*transaction.context); value->comment = alter_info.Cast().comment_value; } else { // Use the existing entry to create the altered entry - value = entry->AlterEntry(context, alter_info); + value = entry->AlterEntry(transaction, alter_info); if (!value) { // alter failed, but did not result in an error return true; } } + // lock the catalog for writing + unique_lock write_lock(catalog.GetWriteLock()); + // lock this catalog set to disallow reading + unique_lock read_lock(catalog_lock); + + // fetch the entry again before doing the modification + // this will catch any write-write conflicts between transactions + entry = GetEntryInternal(transaction, name); + // Mark this entry as being created by this transaction value->timestamp = transaction.transaction_id; value->set = this; @@ -355,7 +370,7 @@ bool CatalogSet::AlterEntry(CatalogTransaction transaction, const string &name, write_lock.unlock(); // Check the dependency manager to verify that there are no conflicting dependencies with this alter - catalog.GetDependencyManager().AlterObject(transaction, *entry, *new_entry); + catalog.GetDependencyManager().AlterObject(transaction, *entry, *new_entry, alter_info); return true; } diff --git a/src/duckdb/src/catalog/default/default_functions.cpp b/src/duckdb/src/catalog/default/default_functions.cpp index ee8ba09b..60ac77ca 100644 --- a/src/duckdb/src/catalog/default/default_functions.cpp +++ b/src/duckdb/src/catalog/default/default_functions.cpp @@ -60,8 +60,9 @@ static const DefaultMacro internal_macros[] = { {"pg_catalog", "pg_get_viewdef", {"oid", nullptr}, "(select sql from duckdb_views() v where v.view_oid=oid)"}, {"pg_catalog", "pg_get_constraintdef", {"constraint_oid", "pretty_bool", nullptr}, "(select constraint_text from duckdb_constraints() d_constraint where d_constraint.table_oid=constraint_oid//1000000 and d_constraint.constraint_index=constraint_oid%1000000)"}, {"pg_catalog", "pg_get_expr", {"pg_node_tree", "relation_oid", nullptr}, "pg_node_tree"}, - {"pg_catalog", "format_pg_type", {"logical_type", "type_name", nullptr}, "case when logical_type='FLOAT' then 'real' when logical_type='DOUBLE' then 'double precision' when logical_type='DECIMAL' then 'numeric' when logical_type='ENUM' then lower(type_name) when logical_type='VARCHAR' then 'character varying' when logical_type='BLOB' then 'bytea' when logical_type='TIMESTAMP' then 'timestamp without time zone' when logical_type='TIME' then 'time without time zone' else lower(logical_type) end"}, + {"pg_catalog", "format_pg_type", {"logical_type", "type_name", nullptr}, "case upper(logical_type) when 'FLOAT' then 'float4' when 'DOUBLE' then 'float8' when 'DECIMAL' then 'numeric' when 'ENUM' then lower(type_name) when 'VARCHAR' then 'varchar' when 'BLOB' then 'bytea' when 'TIMESTAMP' then 'timestamp' when 'TIME' then 'time' when 'TIMESTAMP WITH TIME ZONE' then 'timestamptz' when 'TIME WITH TIME ZONE' then 'timetz' when 'SMALLINT' then 'int2' when 'INTEGER' then 'int4' when 'BIGINT' then 'int8' when 'BOOLEAN' then 'bool' else lower(logical_type) end"}, {"pg_catalog", "format_type", {"type_oid", "typemod", nullptr}, "(select format_pg_type(logical_type, type_name) from duckdb_types() t where t.type_oid=type_oid) || case when typemod>0 then concat('(', typemod//1000, ',', typemod%1000, ')') else '' end"}, + {"pg_catalog", "map_to_pg_oid", {"type_name", nullptr}, "case type_name when 'bool' then 16 when 'int16' then 21 when 'int' then 23 when 'bigint' then 20 when 'date' then 1082 when 'time' then 1083 when 'datetime' then 1114 when 'dec' then 1700 when 'float' then 700 when 'double' then 701 when 'bpchar' then 1043 when 'binary' then 17 when 'interval' then 1186 when 'timestamptz' then 1184 when 'timetz' then 1266 when 'bit' then 1560 when 'guid' then 2950 else null end"}, // map duckdb_oid to pg_oid. If no corresponding type, return null {"pg_catalog", "pg_has_role", {"user", "role", "privilege", nullptr}, "true"}, //boolean //does user have privilege for role {"pg_catalog", "pg_has_role", {"role", "privilege", nullptr}, "true"}, //boolean //does current user have privilege for role diff --git a/src/duckdb/src/catalog/default/default_views.cpp b/src/duckdb/src/catalog/default/default_views.cpp index 967d1d57..aeec5865 100644 --- a/src/duckdb/src/catalog/default/default_views.cpp +++ b/src/duckdb/src/catalog/default/default_views.cpp @@ -44,7 +44,7 @@ static const DefaultView internal_views[] = { {"pg_catalog", "pg_settings", "SELECT name, value setting, description short_desc, CASE WHEN input_type = 'VARCHAR' THEN 'string' WHEN input_type = 'BOOLEAN' THEN 'bool' WHEN input_type IN ('BIGINT', 'UBIGINT') THEN 'integer' ELSE input_type END vartype FROM duckdb_settings()"}, {"pg_catalog", "pg_tables", "SELECT schema_name schemaname, table_name tablename, 'duckdb' tableowner, NULL \"tablespace\", index_count > 0 hasindexes, false hasrules, false hastriggers FROM duckdb_tables()"}, {"pg_catalog", "pg_tablespace", "SELECT 0 oid, 'pg_default' spcname, 0 spcowner, NULL spcacl, NULL spcoptions"}, - {"pg_catalog", "pg_type", "SELECT type_oid oid, format_pg_type(logical_type, type_name) typname, schema_oid typnamespace, 0 typowner, type_size typlen, false typbyval, CASE WHEN logical_type='ENUM' THEN 'e' else 'b' end typtype, CASE WHEN type_category='NUMERIC' THEN 'N' WHEN type_category='STRING' THEN 'S' WHEN type_category='DATETIME' THEN 'D' WHEN type_category='BOOLEAN' THEN 'B' WHEN type_category='COMPOSITE' THEN 'C' WHEN type_category='USER' THEN 'U' ELSE 'X' END typcategory, false typispreferred, true typisdefined, NULL typdelim, NULL typrelid, NULL typsubscript, NULL typelem, NULL typarray, NULL typinput, NULL typoutput, NULL typreceive, NULL typsend, NULL typmodin, NULL typmodout, NULL typanalyze, 'd' typalign, 'p' typstorage, NULL typnotnull, NULL typbasetype, NULL typtypmod, NULL typndims, NULL typcollation, NULL typdefaultbin, NULL typdefault, NULL typacl FROM duckdb_types() WHERE type_size IS NOT NULL;"}, + {"pg_catalog", "pg_type", "SELECT CASE WHEN type_oid IS NULL THEN NULL WHEN logical_type = 'ENUM' AND type_name <> 'enum' THEN type_oid ELSE map_to_pg_oid(type_name) END oid, format_pg_type(logical_type, type_name) typname, schema_oid typnamespace, 0 typowner, type_size typlen, false typbyval, CASE WHEN logical_type='ENUM' THEN 'e' else 'b' end typtype, CASE WHEN type_category='NUMERIC' THEN 'N' WHEN type_category='STRING' THEN 'S' WHEN type_category='DATETIME' THEN 'D' WHEN type_category='BOOLEAN' THEN 'B' WHEN type_category='COMPOSITE' THEN 'C' WHEN type_category='USER' THEN 'U' ELSE 'X' END typcategory, false typispreferred, true typisdefined, NULL typdelim, NULL typrelid, NULL typsubscript, NULL typelem, NULL typarray, NULL typinput, NULL typoutput, NULL typreceive, NULL typsend, NULL typmodin, NULL typmodout, NULL typanalyze, 'd' typalign, 'p' typstorage, NULL typnotnull, NULL typbasetype, NULL typtypmod, NULL typndims, NULL typcollation, NULL typdefaultbin, NULL typdefault, NULL typacl FROM duckdb_types() WHERE type_oid IS NOT NULL;"}, {"pg_catalog", "pg_views", "SELECT schema_name schemaname, view_name viewname, 'duckdb' viewowner, sql definition FROM duckdb_views()"}, {"information_schema", "columns", "SELECT database_name table_catalog, schema_name table_schema, table_name, column_name, column_index ordinal_position, column_default, CASE WHEN is_nullable THEN 'YES' ELSE 'NO' END is_nullable, data_type, character_maximum_length, NULL::INT character_octet_length, numeric_precision, numeric_precision_radix, numeric_scale, NULL::INT datetime_precision, NULL::VARCHAR interval_type, NULL::INT interval_precision, NULL::VARCHAR character_set_catalog, NULL::VARCHAR character_set_schema, NULL::VARCHAR character_set_name, NULL::VARCHAR collation_catalog, NULL::VARCHAR collation_schema, NULL::VARCHAR collation_name, NULL::VARCHAR domain_catalog, NULL::VARCHAR domain_schema, NULL::VARCHAR domain_name, NULL::VARCHAR udt_catalog, NULL::VARCHAR udt_schema, NULL::VARCHAR udt_name, NULL::VARCHAR scope_catalog, NULL::VARCHAR scope_schema, NULL::VARCHAR scope_name, NULL::BIGINT maximum_cardinality, NULL::VARCHAR dtd_identifier, NULL::BOOL is_self_referencing, NULL::BOOL is_identity, NULL::VARCHAR identity_generation, NULL::VARCHAR identity_start, NULL::VARCHAR identity_increment, NULL::VARCHAR identity_maximum, NULL::VARCHAR identity_minimum, NULL::BOOL identity_cycle, NULL::VARCHAR is_generated, NULL::VARCHAR generation_expression, NULL::BOOL is_updatable, comment AS COLUMN_COMMENT FROM duckdb_columns;"}, {"information_schema", "schemata", "SELECT database_name catalog_name, schema_name, 'duckdb' schema_owner, NULL::VARCHAR default_character_set_catalog, NULL::VARCHAR default_character_set_schema, NULL::VARCHAR default_character_set_name, sql sql_path FROM duckdb_schemas()"}, diff --git a/src/duckdb/src/catalog/dependency_manager.cpp b/src/duckdb/src/catalog/dependency_manager.cpp index 86b1fb25..66042b4d 100644 --- a/src/duckdb/src/catalog/dependency_manager.cpp +++ b/src/duckdb/src/catalog/dependency_manager.cpp @@ -349,6 +349,90 @@ void DependencyManager::CleanupDependencies(CatalogTransaction transaction, Cata } } +static string EntryToString(CatalogEntryInfo &info) { + auto type = info.type; + switch (type) { + case CatalogType::TABLE_ENTRY: { + return StringUtil::Format("table \"%s\"", info.name); + } + case CatalogType::SCHEMA_ENTRY: { + return StringUtil::Format("schema \"%s\"", info.name); + } + case CatalogType::VIEW_ENTRY: { + return StringUtil::Format("view \"%s\"", info.name); + } + case CatalogType::INDEX_ENTRY: { + return StringUtil::Format("index \"%s\"", info.name); + } + case CatalogType::SEQUENCE_ENTRY: { + return StringUtil::Format("index \"%s\"", info.name); + } + case CatalogType::COLLATION_ENTRY: { + return StringUtil::Format("collation \"%s\"", info.name); + } + case CatalogType::TYPE_ENTRY: { + return StringUtil::Format("type \"%s\"", info.name); + } + case CatalogType::TABLE_FUNCTION_ENTRY: { + return StringUtil::Format("table function \"%s\"", info.name); + } + case CatalogType::SCALAR_FUNCTION_ENTRY: { + return StringUtil::Format("scalar function \"%s\"", info.name); + } + case CatalogType::AGGREGATE_FUNCTION_ENTRY: { + return StringUtil::Format("aggregate function \"%s\"", info.name); + } + case CatalogType::PRAGMA_FUNCTION_ENTRY: { + return StringUtil::Format("pragma function \"%s\"", info.name); + } + case CatalogType::COPY_FUNCTION_ENTRY: { + return StringUtil::Format("copy function \"%s\"", info.name); + } + case CatalogType::MACRO_ENTRY: { + return StringUtil::Format("macro function \"%s\"", info.name); + } + case CatalogType::TABLE_MACRO_ENTRY: { + return StringUtil::Format("table macro function \"%s\"", info.name); + } + case CatalogType::SECRET_ENTRY: { + return StringUtil::Format("secret \"%s\"", info.name); + } + case CatalogType::SECRET_TYPE_ENTRY: { + return StringUtil::Format("secret type \"%s\"", info.name); + } + case CatalogType::SECRET_FUNCTION_ENTRY: { + return StringUtil::Format("secret function \"%s\"", info.name); + } + default: + throw InternalException("CatalogType not handled in EntryToString (DependencyManager) for %s", + CatalogTypeToString(type)); + }; +} + +string DependencyManager::CollectDependents(CatalogTransaction transaction, catalog_entry_set_t &entries, + CatalogEntryInfo &info) { + string result; + for (auto &entry : entries) { + D_ASSERT(!IsSystemEntry(entry.get())); + auto other_info = GetLookupProperties(entry); + result += StringUtil::Format("%s depends on %s.\n", EntryToString(other_info), EntryToString(info)); + catalog_entry_set_t entry_dependents; + ScanDependents(transaction, other_info, [&](DependencyEntry &dep) { + auto child = LookupEntry(transaction, dep); + if (!child) { + return; + } + if (!CascadeDrop(false, dep.Dependent().flags)) { + entry_dependents.insert(*child); + } + }); + if (!entry_dependents.empty()) { + result += CollectDependents(transaction, entry_dependents, other_info); + } + } + return result; +} + void DependencyManager::DropObject(CatalogTransaction transaction, CatalogEntry &object, bool cascade) { if (IsSystemEntry(object)) { // Don't do anything for this @@ -358,6 +442,8 @@ void DependencyManager::DropObject(CatalogTransaction transaction, CatalogEntry auto info = GetLookupProperties(object); // Check if there are any entries that block the DROP because they still depend on the object catalog_entry_set_t to_drop; + + catalog_entry_set_t blocking_dependents; ScanDependents(transaction, info, [&](DependencyEntry &dep) { // It makes no sense to have a schema depend on anything D_ASSERT(dep.EntryInfo().type != CatalogType::SCHEMA_ENTRY); @@ -368,12 +454,19 @@ void DependencyManager::DropObject(CatalogTransaction transaction, CatalogEntry if (!CascadeDrop(cascade, dep.Dependent().flags)) { // no cascade and there are objects that depend on this object: throw error - throw DependencyException("Cannot drop entry \"%s\" because there are entries that " - "depend on it. Use DROP...CASCADE to drop all dependents.", - object.name); + blocking_dependents.insert(*entry); + } else { + to_drop.insert(*entry); } - to_drop.insert(*entry); }); + if (!blocking_dependents.empty()) { + string error_string = + StringUtil::Format("Cannot drop entry \"%s\" because there are entries that depend on it.\n", object.name); + error_string += CollectDependents(transaction, blocking_dependents, info); + error_string += "Use DROP...CASCADE to drop all dependents."; + throw DependencyException(error_string); + } + ScanSubjects(transaction, info, [&](DependencyEntry &dep) { auto flags = dep.Subject().flags; if (flags.IsOwnership()) { @@ -392,7 +485,8 @@ void DependencyManager::DropObject(CatalogTransaction transaction, CatalogEntry } } -void DependencyManager::AlterObject(CatalogTransaction transaction, CatalogEntry &old_obj, CatalogEntry &new_obj) { +void DependencyManager::AlterObject(CatalogTransaction transaction, CatalogEntry &old_obj, CatalogEntry &new_obj, + AlterInfo &alter_info) { if (IsSystemEntry(new_obj)) { D_ASSERT(IsSystemEntry(old_obj)); // Don't do anything for this @@ -408,9 +502,35 @@ void DependencyManager::AlterObject(CatalogTransaction transaction, CatalogEntry // It makes no sense to have a schema depend on anything D_ASSERT(dep.EntryInfo().type != CatalogType::SCHEMA_ENTRY); - throw DependencyException("Cannot alter entry \"%s\" because there are entries that " - "depend on it.", - old_obj.name); + bool disallow_alter = true; + switch (alter_info.type) { + case AlterType::ALTER_TABLE: { + auto &alter_table = alter_info.Cast(); + switch (alter_table.alter_table_type) { + case AlterTableType::FOREIGN_KEY_CONSTRAINT: { + // These alters are made as part of a CREATE or DROP table statement when a foreign key column is + // present either adding or removing a reference to the referenced primary key table + disallow_alter = false; + break; + } + default: + break; + } + break; + } + case AlterType::SET_COLUMN_COMMENT: + case AlterType::SET_COMMENT: { + disallow_alter = false; + break; + } + default: + break; + } + if (disallow_alter) { + throw DependencyException("Cannot alter entry \"%s\" because there are entries that " + "depend on it.", + old_obj.name); + } auto dep_info = DependencyInfo::FromDependent(dep); dep_info.subject.entry = new_info; @@ -447,8 +567,8 @@ void DependencyManager::AlterObject(CatalogTransaction transaction, CatalogEntry void DependencyManager::Scan( ClientContext &context, const std::function &callback) { - lock_guard write_lock(catalog.GetWriteLock()); auto transaction = catalog.GetCatalogTransaction(context); + lock_guard write_lock(catalog.GetWriteLock()); // All the objects registered in the dependency manager catalog_entry_set_t entries; diff --git a/src/duckdb/src/catalog/duck_catalog.cpp b/src/duckdb/src/catalog/duck_catalog.cpp index ebf1bb53..1adebff7 100644 --- a/src/duckdb/src/catalog/duck_catalog.cpp +++ b/src/duckdb/src/catalog/duck_catalog.cpp @@ -7,6 +7,7 @@ #include "duckdb/catalog/default/default_schemas.hpp" #include "duckdb/function/built_in_functions.hpp" #include "duckdb/main/attached_database.hpp" +#include "duckdb/transaction/duck_transaction_manager.hpp" #ifndef DISABLE_CORE_FUNCTIONS_EXTENSION #include "duckdb/core_functions/core_functions.hpp" #endif @@ -129,10 +130,14 @@ optional_ptr DuckCatalog::GetSchema(CatalogTransaction trans } DatabaseSize DuckCatalog::GetDatabaseSize(ClientContext &context) { + auto &transaction = DuckTransactionManager::Get(db); + auto lock = transaction.SharedCheckpointLock(); return db.GetStorageManager().GetDatabaseSize(); } vector DuckCatalog::GetMetadataInfo(ClientContext &context) { + auto &transaction = DuckTransactionManager::Get(db); + auto lock = transaction.SharedCheckpointLock(); return db.GetStorageManager().GetMetadataInfo(); } diff --git a/src/duckdb/src/common/adbc/nanoarrow/allocator.cpp b/src/duckdb/src/common/adbc/nanoarrow/allocator.cpp index 692cb58a..cea53b18 100644 --- a/src/duckdb/src/common/adbc/nanoarrow/allocator.cpp +++ b/src/duckdb/src/common/adbc/nanoarrow/allocator.cpp @@ -23,11 +23,11 @@ namespace duckdb_nanoarrow { void *ArrowMalloc(int64_t size) { - return malloc(size); + return malloc(size_t(size)); } void *ArrowRealloc(void *ptr, int64_t size) { - return realloc(ptr, size); + return realloc(ptr, size_t(size)); } void ArrowFree(void *ptr) { diff --git a/src/duckdb/src/common/adbc/nanoarrow/metadata.cpp b/src/duckdb/src/common/adbc/nanoarrow/metadata.cpp index 742bbe41..cb3009c0 100644 --- a/src/duckdb/src/common/adbc/nanoarrow/metadata.cpp +++ b/src/duckdb/src/common/adbc/nanoarrow/metadata.cpp @@ -78,7 +78,7 @@ int64_t ArrowMetadataSizeOf(const char *metadata) { int64_t size = sizeof(int32_t); while (ArrowMetadataReaderRead(&reader, &key, &value) == NANOARROW_OK) { - size += sizeof(int32_t) + key.n_bytes + sizeof(int32_t) + value.n_bytes; + size += sizeof(int32_t) + uint64_t(key.n_bytes) + sizeof(int32_t) + uint64_t(value.n_bytes); } return size; @@ -89,7 +89,7 @@ ArrowErrorCode ArrowMetadataGetValue(const char *metadata, const char *key, cons struct ArrowStringView target_key_view = {key, static_cast(strlen(key))}; value_out->data = default_value; if (default_value != NULL) { - value_out->n_bytes = strlen(default_value); + value_out->n_bytes = int64_t(strlen(default_value)); } else { value_out->n_bytes = 0; } @@ -101,7 +101,7 @@ ArrowErrorCode ArrowMetadataGetValue(const char *metadata, const char *key, cons while (ArrowMetadataReaderRead(&reader, &key_view, &value) == NANOARROW_OK) { int key_equal = target_key_view.n_bytes == key_view.n_bytes && - strncmp(target_key_view.data, key_view.data, key_view.n_bytes) == 0; + strncmp(target_key_view.data, key_view.data, size_t(key_view.n_bytes)) == 0; if (key_equal) { value_out->data = value.data; value_out->n_bytes = value.n_bytes; diff --git a/src/duckdb/src/common/adbc/nanoarrow/schema.cpp b/src/duckdb/src/common/adbc/nanoarrow/schema.cpp index 1ed36f1f..38d1b314 100644 --- a/src/duckdb/src/common/adbc/nanoarrow/schema.cpp +++ b/src/duckdb/src/common/adbc/nanoarrow/schema.cpp @@ -318,7 +318,7 @@ ArrowErrorCode ArrowSchemaSetFormat(struct ArrowSchema *schema, const char *form if (format != NULL) { size_t format_size = strlen(format) + 1; - schema->format = (const char *)ArrowMalloc(format_size); + schema->format = (const char *)ArrowMalloc(int64_t(format_size)); if (schema->format == NULL) { return ENOMEM; } @@ -338,7 +338,7 @@ ArrowErrorCode ArrowSchemaSetName(struct ArrowSchema *schema, const char *name) if (name != NULL) { size_t name_size = strlen(name) + 1; - schema->name = (const char *)ArrowMalloc(name_size); + schema->name = (const char *)ArrowMalloc(int64_t(name_size)); if (schema->name == NULL) { return ENOMEM; } @@ -357,13 +357,13 @@ ArrowErrorCode ArrowSchemaSetMetadata(struct ArrowSchema *schema, const char *me } if (metadata != NULL) { - size_t metadata_size = ArrowMetadataSizeOf(metadata); + auto metadata_size = ArrowMetadataSizeOf(metadata); schema->metadata = (const char *)ArrowMalloc(metadata_size); if (schema->metadata == NULL) { return ENOMEM; } - memcpy((void *)schema->metadata, metadata, metadata_size); + memcpy((void *)schema->metadata, metadata, size_t(metadata_size)); } else { schema->metadata = NULL; } @@ -377,7 +377,8 @@ ArrowErrorCode ArrowSchemaAllocateChildren(struct ArrowSchema *schema, int64_t n } if (n_children > 0) { - schema->children = (struct ArrowSchema **)ArrowMalloc(n_children * sizeof(struct ArrowSchema *)); + schema->children = + (struct ArrowSchema **)ArrowMalloc(int64_t(uint64_t(n_children) * sizeof(struct ArrowSchema *))); if (schema->children == NULL) { return ENOMEM; @@ -385,7 +386,7 @@ ArrowErrorCode ArrowSchemaAllocateChildren(struct ArrowSchema *schema, int64_t n schema->n_children = n_children; - memset(schema->children, 0, n_children * sizeof(struct ArrowSchema *)); + memset(schema->children, 0, uint64_t(n_children) * sizeof(struct ArrowSchema *)); for (int64_t i = 0; i < n_children; i++) { schema->children[i] = (struct ArrowSchema *)ArrowMalloc(sizeof(struct ArrowSchema)); diff --git a/src/duckdb/src/common/allocator.cpp b/src/duckdb/src/common/allocator.cpp index 5487578f..772db6ee 100644 --- a/src/duckdb/src/common/allocator.cpp +++ b/src/duckdb/src/common/allocator.cpp @@ -173,7 +173,11 @@ data_ptr_t Allocator::DefaultAllocate(PrivateAllocatorData *private_data, idx_t #ifdef USE_JEMALLOC return JemallocExtension::Allocate(private_data, size); #else - return data_ptr_cast(malloc(size)); + auto default_allocate_result = malloc(size); + if (!default_allocate_result) { + throw std::bad_alloc(); + } + return data_ptr_cast(default_allocate_result); #endif } @@ -195,7 +199,7 @@ data_ptr_t Allocator::DefaultReallocate(PrivateAllocatorData *private_data, data } shared_ptr &Allocator::DefaultAllocatorReference() { - static shared_ptr DEFAULT_ALLOCATOR = make_shared(); + static shared_ptr DEFAULT_ALLOCATOR = make_shared_ptr(); return DEFAULT_ALLOCATOR; } diff --git a/src/duckdb/src/common/arrow/appender/bool_data.cpp b/src/duckdb/src/common/arrow/appender/bool_data.cpp index 6a5f6728..d30b3933 100644 --- a/src/duckdb/src/common/arrow/appender/bool_data.cpp +++ b/src/duckdb/src/common/arrow/appender/bool_data.cpp @@ -6,6 +6,7 @@ namespace duckdb { void ArrowBoolData::Initialize(ArrowAppendData &result, const LogicalType &type, idx_t capacity) { auto byte_count = (capacity + 7) / 8; result.main_buffer.reserve(byte_count); + (void)AppendValidity; // silence a compiler warning about unused static function } void ArrowBoolData::Append(ArrowAppendData &append_data, Vector &input, idx_t from, idx_t to, idx_t input_size) { diff --git a/src/duckdb/src/common/arrow/appender/struct_data.cpp b/src/duckdb/src/common/arrow/appender/struct_data.cpp index ce74a92a..b2afa62d 100644 --- a/src/duckdb/src/common/arrow/appender/struct_data.cpp +++ b/src/duckdb/src/common/arrow/appender/struct_data.cpp @@ -35,7 +35,7 @@ void ArrowStructData::Finalize(ArrowAppendData &append_data, const LogicalType & auto &child_types = StructType::GetChildTypes(type); ArrowAppender::AddChildren(append_data, child_types.size()); result->children = append_data.child_pointers.data(); - result->n_children = child_types.size(); + result->n_children = NumericCast(child_types.size()); for (idx_t i = 0; i < child_types.size(); i++) { auto &child_type = child_types[i].second; append_data.child_arrays[i] = *ArrowAppender::FinalizeChild(child_type, std::move(append_data.child_data[i])); diff --git a/src/duckdb/src/common/arrow/appender/union_data.cpp b/src/duckdb/src/common/arrow/appender/union_data.cpp index 9797aa9f..02acffe0 100644 --- a/src/duckdb/src/common/arrow/appender/union_data.cpp +++ b/src/duckdb/src/common/arrow/appender/union_data.cpp @@ -14,6 +14,7 @@ void ArrowUnionData::Initialize(ArrowAppendData &result, const LogicalType &type auto child_buffer = ArrowAppender::InitializeChild(child.second, capacity, result.options); result.child_data.push_back(std::move(child_buffer)); } + (void)AppendValidity; // silence a compiler warning about unused static functiondep } void ArrowUnionData::Append(ArrowAppendData &append_data, Vector &input, idx_t from, idx_t to, idx_t input_size) { @@ -61,7 +62,7 @@ void ArrowUnionData::Finalize(ArrowAppendData &append_data, const LogicalType &t auto &child_types = UnionType::CopyMemberTypes(type); ArrowAppender::AddChildren(append_data, child_types.size()); result->children = append_data.child_pointers.data(); - result->n_children = child_types.size(); + result->n_children = NumericCast(child_types.size()); for (idx_t i = 0; i < child_types.size(); i++) { auto &child_type = child_types[i].second; append_data.child_arrays[i] = *ArrowAppender::FinalizeChild(child_type, std::move(append_data.child_data[i])); diff --git a/src/duckdb/src/common/arrow/arrow_appender.cpp b/src/duckdb/src/common/arrow/arrow_appender.cpp index 6dc0c14b..8dd1f0cf 100644 --- a/src/duckdb/src/common/arrow/arrow_appender.cpp +++ b/src/duckdb/src/common/arrow/arrow_appender.cpp @@ -70,8 +70,8 @@ ArrowArray *ArrowAppender::FinalizeChild(const LogicalType &type, unique_ptroffset = 0; result->dictionary = nullptr; result->buffers = append_data.buffers.data(); - result->null_count = append_data.null_count; - result->length = append_data.row_count; + result->null_count = NumericCast(append_data.null_count); + result->length = NumericCast(append_data.row_count); result->buffers[0] = append_data.validity.data(); if (append_data.finalize) { @@ -90,10 +90,10 @@ ArrowArray ArrowAppender::Finalize() { ArrowArray result; AddChildren(*root_holder, types.size()); result.children = root_holder->child_pointers.data(); - result.n_children = types.size(); + result.n_children = NumericCast(types.size()); // Configure root array - result.length = row_count; + result.length = NumericCast(row_count); result.n_buffers = 1; result.buffers = root_holder->buffers.data(); // there is no actual buffer there since we don't have NULLs result.offset = 0; @@ -138,13 +138,15 @@ static void InitializeFunctionPointers(ArrowAppendData &append_data, const Logic case LogicalTypeId::INTEGER: InitializeAppenderForType>(append_data); break; + case LogicalTypeId::TIME_TZ: + InitializeAppenderForType>(append_data); + break; case LogicalTypeId::TIME: case LogicalTypeId::TIMESTAMP_SEC: case LogicalTypeId::TIMESTAMP_MS: case LogicalTypeId::TIMESTAMP: case LogicalTypeId::TIMESTAMP_NS: case LogicalTypeId::TIMESTAMP_TZ: - case LogicalTypeId::TIME_TZ: case LogicalTypeId::BIGINT: InitializeAppenderForType>(append_data); break; diff --git a/src/duckdb/src/common/arrow/arrow_converter.cpp b/src/duckdb/src/common/arrow/arrow_converter.cpp index 62be691b..5e807f6d 100644 --- a/src/duckdb/src/common/arrow/arrow_converter.cpp +++ b/src/duckdb/src/common/arrow/arrow_converter.cpp @@ -138,9 +138,7 @@ void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, co case LogicalTypeId::DATE: child.format = "tdD"; break; -#ifdef DUCKDB_WASM case LogicalTypeId::TIME_TZ: -#endif case LogicalTypeId::TIME: child.format = "ttu"; break; @@ -206,7 +204,7 @@ void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, co case LogicalTypeId::STRUCT: { child.format = "+s"; auto &child_types = StructType::GetChildTypes(type); - child.n_children = child_types.size(); + child.n_children = NumericCast(child_types.size()); root_holder.nested_children.emplace_back(); root_holder.nested_children.back().resize(child_types.size()); root_holder.nested_children_ptr.emplace_back(); @@ -251,7 +249,7 @@ void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, co std::string format = "+us:"; auto &child_types = UnionType::CopyMemberTypes(type); - child.n_children = child_types.size(); + child.n_children = NumericCast(child_types.size()); root_holder.nested_children.emplace_back(); root_holder.nested_children.back().resize(child_types.size()); root_holder.nested_children_ptr.emplace_back(); @@ -323,7 +321,7 @@ void ArrowConverter::ToArrowSchema(ArrowSchema *out_schema, const vectorchildren_ptrs[i] = &root_holder->children[i]; } out_schema->children = root_holder->children_ptrs.data(); - out_schema->n_children = column_count; + out_schema->n_children = NumericCast(column_count); // Store the schema out_schema->format = "+s"; // struct apparently diff --git a/src/duckdb/src/common/arrow/arrow_wrapper.cpp b/src/duckdb/src/common/arrow/arrow_wrapper.cpp index d439d990..0f0613bc 100644 --- a/src/duckdb/src/common/arrow/arrow_wrapper.cpp +++ b/src/duckdb/src/common/arrow/arrow_wrapper.cpp @@ -50,7 +50,7 @@ void ArrowArrayStreamWrapper::GetSchema(ArrowSchemaWrapper &schema) { } shared_ptr ArrowArrayStreamWrapper::GetNextChunk() { - auto current_chunk = make_shared(); + auto current_chunk = make_shared_ptr(); if (arrow_array_stream.get_next(&arrow_array_stream, ¤t_chunk->arrow_array)) { // LCOV_EXCL_START throw InvalidInputException("arrow_scan: get_next failed(): %s", string(GetError())); } // LCOV_EXCL_STOP diff --git a/src/duckdb/src/common/box_renderer.cpp b/src/duckdb/src/common/box_renderer.cpp index fc309150..404bb32f 100644 --- a/src/duckdb/src/common/box_renderer.cpp +++ b/src/duckdb/src/common/box_renderer.cpp @@ -77,6 +77,9 @@ void BoxRenderer::RenderValue(std::ostream &ss, const string &value, idx_t colum } string BoxRenderer::RenderType(const LogicalType &type) { + if (type.HasAlias()) { + return StringUtil::Lower(type.ToString()); + } switch (type.id()) { case LogicalTypeId::TINYINT: return "int8"; @@ -399,7 +402,7 @@ vector BoxRenderer::ComputeRenderWidths(const vector &names, cons // e.g. if we have 10 columns, we remove #5, then #4, then #6, then #3, then #7, etc int64_t offset = 0; while (total_length > max_width) { - idx_t c = column_count / 2 + offset; + auto c = NumericCast(NumericCast(column_count) / 2 + offset); total_length -= widths[c] + 3; pruned_columns.insert(c); if (offset >= 0) { @@ -477,8 +480,8 @@ void BoxRenderer::RenderHeader(const vector &names, const vector(remaining, stream_data.out_buff_end - stream_data.out_buff_start); + auto available = + MinValue(UnsafeNumericCast(remaining), + UnsafeNumericCast(stream_data.out_buff_end - stream_data.out_buff_start)); memcpy(data_ptr_t(buffer) + total_read, stream_data.out_buff_start, available); // increment the total read variables as required @@ -46,11 +49,11 @@ int64_t CompressedFile::ReadData(void *buffer, int64_t remaining) { remaining -= available; if (remaining == 0) { // done! read enough - return total_read; + return UnsafeNumericCast(total_read); } } if (!stream_wrapper) { - return total_read; + return UnsafeNumericCast(total_read); } // ran out of buffer: read more data from the child stream @@ -63,10 +66,11 @@ int64_t CompressedFile::ReadData(void *buffer, int64_t remaining) { if (stream_data.refresh && (stream_data.in_buff_end == stream_data.in_buff.get() + stream_data.in_buf_size)) { auto bufrem = stream_data.in_buff_end - stream_data.in_buff_start; // buffer not empty, move remaining bytes to the beginning - memmove(stream_data.in_buff.get(), stream_data.in_buff_start, bufrem); + memmove(stream_data.in_buff.get(), stream_data.in_buff_start, UnsafeNumericCast(bufrem)); stream_data.in_buff_start = stream_data.in_buff.get(); // refill the rest of input buffer - auto sz = child_handle->Read(stream_data.in_buff_start + bufrem, stream_data.in_buf_size - bufrem); + auto sz = child_handle->Read(stream_data.in_buff_start + bufrem, + stream_data.in_buf_size - UnsafeNumericCast(bufrem)); stream_data.in_buff_end = stream_data.in_buff_start + bufrem + sz; if (sz <= 0) { stream_wrapper.reset(); @@ -92,7 +96,7 @@ int64_t CompressedFile::ReadData(void *buffer, int64_t remaining) { stream_wrapper.reset(); } } - return total_read; + return UnsafeNumericCast(total_read); } int64_t CompressedFile::WriteData(data_ptr_t buffer, int64_t nr_bytes) { @@ -134,7 +138,7 @@ void CompressedFileSystem::Reset(FileHandle &handle) { int64_t CompressedFileSystem::GetFileSize(FileHandle &handle) { auto &compressed_file = handle.Cast(); - return compressed_file.child_handle->GetFileSize(); + return NumericCast(compressed_file.child_handle->GetFileSize()); } bool CompressedFileSystem::OnDiskFile(FileHandle &handle) { diff --git a/src/duckdb/src/common/enum_util.cpp b/src/duckdb/src/common/enum_util.cpp index b2db02f4..6ee1ec51 100644 --- a/src/duckdb/src/common/enum_util.cpp +++ b/src/duckdb/src/common/enum_util.cpp @@ -58,6 +58,8 @@ #include "duckdb/common/extra_type_info.hpp" #include "duckdb/common/file_buffer.hpp" #include "duckdb/common/file_open_flags.hpp" +#include "duckdb/common/multi_file_list.hpp" +#include "duckdb/common/operator/decimal_cast_operators.hpp" #include "duckdb/common/printer.hpp" #include "duckdb/common/sort/partition_state.hpp" #include "duckdb/common/types.hpp" @@ -76,6 +78,7 @@ #include "duckdb/execution/operator/csv_scanner/csv_option.hpp" #include "duckdb/execution/operator/csv_scanner/csv_state.hpp" #include "duckdb/execution/operator/csv_scanner/quote_rules.hpp" +#include "duckdb/execution/reservoir_sample.hpp" #include "duckdb/function/aggregate_state.hpp" #include "duckdb/function/function.hpp" #include "duckdb/function/macro_function.hpp" @@ -89,7 +92,7 @@ #include "duckdb/main/config.hpp" #include "duckdb/main/error_manager.hpp" #include "duckdb/main/extension_helper.hpp" -#include "duckdb/main/external_dependencies.hpp" +#include "duckdb/main/extension_install_info.hpp" #include "duckdb/main/query_result.hpp" #include "duckdb/main/secret/secret.hpp" #include "duckdb/main/settings.hpp" @@ -599,6 +602,29 @@ ArrowVariableSizeType EnumUtil::FromString(const char *va throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } +template<> +const char* EnumUtil::ToChars(BinderType value) { + switch(value) { + case BinderType::REGULAR_BINDER: + return "REGULAR_BINDER"; + case BinderType::VIEW_BINDER: + return "VIEW_BINDER"; + default: + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + } +} + +template<> +BinderType EnumUtil::FromString(const char *value) { + if (StringUtil::Equals(value, "REGULAR_BINDER")) { + return BinderType::REGULAR_BINDER; + } + if (StringUtil::Equals(value, "VIEW_BINDER")) { + return BinderType::VIEW_BINDER; + } + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); +} + template<> const char* EnumUtil::ToChars(BindingMode value) { switch(value) { @@ -1931,6 +1957,34 @@ ExplainType EnumUtil::FromString(const char *value) { throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } +template<> +const char* EnumUtil::ToChars(ExponentType value) { + switch(value) { + case ExponentType::NONE: + return "NONE"; + case ExponentType::POSITIVE: + return "POSITIVE"; + case ExponentType::NEGATIVE: + return "NEGATIVE"; + default: + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + } +} + +template<> +ExponentType EnumUtil::FromString(const char *value) { + if (StringUtil::Equals(value, "NONE")) { + return ExponentType::NONE; + } + if (StringUtil::Equals(value, "POSITIVE")) { + return ExponentType::POSITIVE; + } + if (StringUtil::Equals(value, "NEGATIVE")) { + return ExponentType::NEGATIVE; + } + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); +} + template<> const char* EnumUtil::ToChars(ExpressionClass value) { switch(value) { @@ -2502,6 +2556,44 @@ ExpressionType EnumUtil::FromString(const char *value) { throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } +template<> +const char* EnumUtil::ToChars(ExtensionInstallMode value) { + switch(value) { + case ExtensionInstallMode::UNKNOWN: + return "UNKNOWN"; + case ExtensionInstallMode::REPOSITORY: + return "REPOSITORY"; + case ExtensionInstallMode::CUSTOM_PATH: + return "CUSTOM_PATH"; + case ExtensionInstallMode::STATICALLY_LINKED: + return "STATICALLY_LINKED"; + case ExtensionInstallMode::NOT_INSTALLED: + return "NOT_INSTALLED"; + default: + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + } +} + +template<> +ExtensionInstallMode EnumUtil::FromString(const char *value) { + if (StringUtil::Equals(value, "UNKNOWN")) { + return ExtensionInstallMode::UNKNOWN; + } + if (StringUtil::Equals(value, "REPOSITORY")) { + return ExtensionInstallMode::REPOSITORY; + } + if (StringUtil::Equals(value, "CUSTOM_PATH")) { + return ExtensionInstallMode::CUSTOM_PATH; + } + if (StringUtil::Equals(value, "STATICALLY_LINKED")) { + return ExtensionInstallMode::STATICALLY_LINKED; + } + if (StringUtil::Equals(value, "NOT_INSTALLED")) { + return ExtensionInstallMode::NOT_INSTALLED; + } + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); +} + template<> const char* EnumUtil::ToChars(ExtensionLoadResult value) { switch(value) { @@ -2531,19 +2623,54 @@ ExtensionLoadResult EnumUtil::FromString(const char *value) } template<> -const char* EnumUtil::ToChars(ExternalDependenciesType value) { +const char* EnumUtil::ToChars(ExtensionUpdateResultTag value) { switch(value) { - case ExternalDependenciesType::PYTHON_DEPENDENCY: - return "PYTHON_DEPENDENCY"; + case ExtensionUpdateResultTag::UNKNOWN: + return "UNKNOWN"; + case ExtensionUpdateResultTag::NO_UPDATE_AVAILABLE: + return "NO_UPDATE_AVAILABLE"; + case ExtensionUpdateResultTag::NOT_A_REPOSITORY: + return "NOT_A_REPOSITORY"; + case ExtensionUpdateResultTag::NOT_INSTALLED: + return "NOT_INSTALLED"; + case ExtensionUpdateResultTag::STATICALLY_LOADED: + return "STATICALLY_LOADED"; + case ExtensionUpdateResultTag::MISSING_INSTALL_INFO: + return "MISSING_INSTALL_INFO"; + case ExtensionUpdateResultTag::REDOWNLOADED: + return "REDOWNLOADED"; + case ExtensionUpdateResultTag::UPDATED: + return "UPDATED"; default: throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); } } template<> -ExternalDependenciesType EnumUtil::FromString(const char *value) { - if (StringUtil::Equals(value, "PYTHON_DEPENDENCY")) { - return ExternalDependenciesType::PYTHON_DEPENDENCY; +ExtensionUpdateResultTag EnumUtil::FromString(const char *value) { + if (StringUtil::Equals(value, "UNKNOWN")) { + return ExtensionUpdateResultTag::UNKNOWN; + } + if (StringUtil::Equals(value, "NO_UPDATE_AVAILABLE")) { + return ExtensionUpdateResultTag::NO_UPDATE_AVAILABLE; + } + if (StringUtil::Equals(value, "NOT_A_REPOSITORY")) { + return ExtensionUpdateResultTag::NOT_A_REPOSITORY; + } + if (StringUtil::Equals(value, "NOT_INSTALLED")) { + return ExtensionUpdateResultTag::NOT_INSTALLED; + } + if (StringUtil::Equals(value, "STATICALLY_LOADED")) { + return ExtensionUpdateResultTag::STATICALLY_LOADED; + } + if (StringUtil::Equals(value, "MISSING_INSTALL_INFO")) { + return ExtensionUpdateResultTag::MISSING_INSTALL_INFO; + } + if (StringUtil::Equals(value, "REDOWNLOADED")) { + return ExtensionUpdateResultTag::REDOWNLOADED; + } + if (StringUtil::Equals(value, "UPDATED")) { + return ExtensionUpdateResultTag::UPDATED; } throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } @@ -2705,6 +2832,34 @@ FileCompressionType EnumUtil::FromString(const char *value) throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } +template<> +const char* EnumUtil::ToChars(FileExpandResult value) { + switch(value) { + case FileExpandResult::NO_FILES: + return "NO_FILES"; + case FileExpandResult::SINGLE_FILE: + return "SINGLE_FILE"; + case FileExpandResult::MULTIPLE_FILES: + return "MULTIPLE_FILES"; + default: + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + } +} + +template<> +FileExpandResult EnumUtil::FromString(const char *value) { + if (StringUtil::Equals(value, "NO_FILES")) { + return FileExpandResult::NO_FILES; + } + if (StringUtil::Equals(value, "SINGLE_FILE")) { + return FileExpandResult::SINGLE_FILE; + } + if (StringUtil::Equals(value, "MULTIPLE_FILES")) { + return FileExpandResult::MULTIPLE_FILES; + } + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); +} + template<> const char* EnumUtil::ToChars(FileGlobOptions value) { switch(value) { @@ -3304,6 +3459,8 @@ const char* EnumUtil::ToChars(LogicalOperatorType value) { return "LOGICAL_LOAD"; case LogicalOperatorType::LOGICAL_RESET: return "LOGICAL_RESET"; + case LogicalOperatorType::LOGICAL_UPDATE_EXTENSIONS: + return "LOGICAL_UPDATE_EXTENSIONS"; case LogicalOperatorType::LOGICAL_CREATE_SECRET: return "LOGICAL_CREATE_SECRET"; case LogicalOperatorType::LOGICAL_EXTENSION_OPERATOR: @@ -3489,6 +3646,9 @@ LogicalOperatorType EnumUtil::FromString(const char *value) if (StringUtil::Equals(value, "LOGICAL_RESET")) { return LogicalOperatorType::LOGICAL_RESET; } + if (StringUtil::Equals(value, "LOGICAL_UPDATE_EXTENSIONS")) { + return LogicalOperatorType::LOGICAL_UPDATE_EXTENSIONS; + } if (StringUtil::Equals(value, "LOGICAL_CREATE_SECRET")) { return LogicalOperatorType::LOGICAL_CREATE_SECRET; } @@ -3802,14 +3962,10 @@ const char* EnumUtil::ToChars(MapInvalidReason value) { switch(value) { case MapInvalidReason::VALID: return "VALID"; - case MapInvalidReason::NULL_KEY_LIST: - return "NULL_KEY_LIST"; case MapInvalidReason::NULL_KEY: return "NULL_KEY"; case MapInvalidReason::DUPLICATE_KEY: return "DUPLICATE_KEY"; - case MapInvalidReason::NULL_VALUE_LIST: - return "NULL_VALUE_LIST"; case MapInvalidReason::NOT_ALIGNED: return "NOT_ALIGNED"; case MapInvalidReason::INVALID_PARAMS: @@ -3824,18 +3980,12 @@ MapInvalidReason EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "VALID")) { return MapInvalidReason::VALID; } - if (StringUtil::Equals(value, "NULL_KEY_LIST")) { - return MapInvalidReason::NULL_KEY_LIST; - } if (StringUtil::Equals(value, "NULL_KEY")) { return MapInvalidReason::NULL_KEY; } if (StringUtil::Equals(value, "DUPLICATE_KEY")) { return MapInvalidReason::DUPLICATE_KEY; } - if (StringUtil::Equals(value, "NULL_VALUE_LIST")) { - return MapInvalidReason::NULL_VALUE_LIST; - } if (StringUtil::Equals(value, "NOT_ALIGNED")) { return MapInvalidReason::NOT_ALIGNED; } @@ -4399,6 +4549,8 @@ const char* EnumUtil::ToChars(ParseInfoType value) { return "COMMENT_ON_COLUMN_INFO"; case ParseInfoType::COPY_DATABASE_INFO: return "COPY_DATABASE_INFO"; + case ParseInfoType::UPDATE_EXTENSIONS_INFO: + return "UPDATE_EXTENSIONS_INFO"; default: throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); } @@ -4454,6 +4606,9 @@ ParseInfoType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "COPY_DATABASE_INFO")) { return ParseInfoType::COPY_DATABASE_INFO; } + if (StringUtil::Equals(value, "UPDATE_EXTENSIONS_INFO")) { + return ParseInfoType::UPDATE_EXTENSIONS_INFO; + } throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } @@ -4765,6 +4920,8 @@ const char* EnumUtil::ToChars(PhysicalOperatorType value) return "EXTENSION"; case PhysicalOperatorType::VERIFY_VECTOR: return "VERIFY_VECTOR"; + case PhysicalOperatorType::UPDATE_EXTENSIONS: + return "UPDATE_EXTENSIONS"; case PhysicalOperatorType::CREATE_SECRET: return "CREATE_SECRET"; default: @@ -4999,6 +5156,9 @@ PhysicalOperatorType EnumUtil::FromString(const char *valu if (StringUtil::Equals(value, "VERIFY_VECTOR")) { return PhysicalOperatorType::VERIFY_VECTOR; } + if (StringUtil::Equals(value, "UPDATE_EXTENSIONS")) { + return PhysicalOperatorType::UPDATE_EXTENSIONS; + } if (StringUtil::Equals(value, "CREATE_SECRET")) { return PhysicalOperatorType::CREATE_SECRET; } @@ -5397,6 +5557,8 @@ const char* EnumUtil::ToChars(RelationType value) { return "INSERT_RELATION"; case RelationType::VALUE_LIST_RELATION: return "VALUE_LIST_RELATION"; + case RelationType::MATERIALIZED_RELATION: + return "MATERIALIZED_RELATION"; case RelationType::DELETE_RELATION: return "DELETE_RELATION"; case RelationType::UPDATE_RELATION: @@ -5470,6 +5632,9 @@ RelationType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "VALUE_LIST_RELATION")) { return RelationType::VALUE_LIST_RELATION; } + if (StringUtil::Equals(value, "MATERIALIZED_RELATION")) { + return RelationType::MATERIALIZED_RELATION; + } if (StringUtil::Equals(value, "DELETE_RELATION")) { return RelationType::DELETE_RELATION; } @@ -5584,6 +5749,34 @@ SampleMethod EnumUtil::FromString(const char *value) { throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } +template<> +const char* EnumUtil::ToChars(SampleType value) { + switch(value) { + case SampleType::BLOCKING_SAMPLE: + return "BLOCKING_SAMPLE"; + case SampleType::RESERVOIR_SAMPLE: + return "RESERVOIR_SAMPLE"; + case SampleType::RESERVOIR_PERCENTAGE_SAMPLE: + return "RESERVOIR_PERCENTAGE_SAMPLE"; + default: + throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); + } +} + +template<> +SampleType EnumUtil::FromString(const char *value) { + if (StringUtil::Equals(value, "BLOCKING_SAMPLE")) { + return SampleType::BLOCKING_SAMPLE; + } + if (StringUtil::Equals(value, "RESERVOIR_SAMPLE")) { + return SampleType::RESERVOIR_SAMPLE; + } + if (StringUtil::Equals(value, "RESERVOIR_PERCENTAGE_SAMPLE")) { + return SampleType::RESERVOIR_PERCENTAGE_SAMPLE; + } + throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); +} + template<> const char* EnumUtil::ToChars(ScanType value) { switch(value) { @@ -6108,6 +6301,8 @@ const char* EnumUtil::ToChars(StatementType value) { return "MULTI_STATEMENT"; case StatementType::COPY_DATABASE_STATEMENT: return "COPY_DATABASE_STATEMENT"; + case StatementType::UPDATE_EXTENSIONS_STATEMENT: + return "UPDATE_EXTENSIONS_STATEMENT"; default: throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); } @@ -6202,6 +6397,9 @@ StatementType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "COPY_DATABASE_STATEMENT")) { return StatementType::COPY_DATABASE_STATEMENT; } + if (StringUtil::Equals(value, "UPDATE_EXTENSIONS_STATEMENT")) { + return StatementType::UPDATE_EXTENSIONS_STATEMENT; + } throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } @@ -6606,6 +6804,8 @@ const char* EnumUtil::ToChars(TableReferenceType value) { return "PIVOT"; case TableReferenceType::SHOW_REF: return "SHOW_REF"; + case TableReferenceType::COLUMN_DATA: + return "COLUMN_DATA"; default: throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); } @@ -6643,6 +6843,9 @@ TableReferenceType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "SHOW_REF")) { return TableReferenceType::SHOW_REF; } + if (StringUtil::Equals(value, "COLUMN_DATA")) { + return TableReferenceType::COLUMN_DATA; + } throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } @@ -6657,6 +6860,8 @@ const char* EnumUtil::ToChars(TableScanType value) { return "TABLE_SCAN_COMMITTED_ROWS_DISALLOW_UPDATES"; case TableScanType::TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED: return "TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED"; + case TableScanType::TABLE_SCAN_LATEST_COMMITTED_ROWS: + return "TABLE_SCAN_LATEST_COMMITTED_ROWS"; default: throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); } @@ -6676,6 +6881,9 @@ TableScanType EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED")) { return TableScanType::TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED; } + if (StringUtil::Equals(value, "TABLE_SCAN_LATEST_COMMITTED_ROWS")) { + return TableScanType::TABLE_SCAN_LATEST_COMMITTED_ROWS; + } throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } @@ -6847,6 +7055,8 @@ const char* EnumUtil::ToChars(UndoFlags value) { return "DELETE_TUPLE"; case UndoFlags::UPDATE_TUPLE: return "UPDATE_TUPLE"; + case UndoFlags::SEQUENCE_VALUE: + return "SEQUENCE_VALUE"; default: throw NotImplementedException(StringUtil::Format("Enum value: '%d' not implemented", value)); } @@ -6869,6 +7079,9 @@ UndoFlags EnumUtil::FromString(const char *value) { if (StringUtil::Equals(value, "UPDATE_TUPLE")) { return UndoFlags::UPDATE_TUPLE; } + if (StringUtil::Equals(value, "SEQUENCE_VALUE")) { + return UndoFlags::SEQUENCE_VALUE; + } throw NotImplementedException(StringUtil::Format("Enum value: '%s' not implemented", value)); } diff --git a/src/duckdb/src/common/enums/logical_operator_type.cpp b/src/duckdb/src/common/enums/logical_operator_type.cpp index c2beaae9..550bea5b 100644 --- a/src/duckdb/src/common/enums/logical_operator_type.cpp +++ b/src/duckdb/src/common/enums/logical_operator_type.cpp @@ -128,6 +128,8 @@ string LogicalOperatorToString(LogicalOperatorType type) { return "CUSTOM_OP"; case LogicalOperatorType::LOGICAL_PIVOT: return "PIVOT"; + case LogicalOperatorType::LOGICAL_UPDATE_EXTENSIONS: + return "UPDATE_EXTENSIONS"; } return "INVALID"; } diff --git a/src/duckdb/src/common/enums/physical_operator_type.cpp b/src/duckdb/src/common/enums/physical_operator_type.cpp index 1d1a3b39..4cb851c9 100644 --- a/src/duckdb/src/common/enums/physical_operator_type.cpp +++ b/src/duckdb/src/common/enums/physical_operator_type.cpp @@ -155,6 +155,8 @@ string PhysicalOperatorToString(PhysicalOperatorType type) { return "COPY_DATABASE"; case PhysicalOperatorType::VERIFY_VECTOR: return "VERIFY_VECTOR"; + case PhysicalOperatorType::UPDATE_EXTENSIONS: + return "UPDATE_EXTENSIONS"; case PhysicalOperatorType::INVALID: break; } diff --git a/src/duckdb/src/common/enums/relation_type.cpp b/src/duckdb/src/common/enums/relation_type.cpp index 3c55f95a..caac469a 100644 --- a/src/duckdb/src/common/enums/relation_type.cpp +++ b/src/duckdb/src/common/enums/relation_type.cpp @@ -37,6 +37,8 @@ string RelationTypeToString(RelationType type) { return "INSERT_RELATION"; case RelationType::VALUE_LIST_RELATION: return "VALUE_LIST_RELATION"; + case RelationType::MATERIALIZED_RELATION: + return "MATERIALIZED_RELATION"; case RelationType::DELETE_RELATION: return "DELETE_RELATION"; case RelationType::UPDATE_RELATION: diff --git a/src/duckdb/src/common/enums/statement_type.cpp b/src/duckdb/src/common/enums/statement_type.cpp index eddee179..0250ff2c 100644 --- a/src/duckdb/src/common/enums/statement_type.cpp +++ b/src/duckdb/src/common/enums/statement_type.cpp @@ -61,6 +61,8 @@ string StatementTypeToString(StatementType type) { return "DETACH"; case StatementType::MULTI_STATEMENT: return "MULTI"; + case StatementType::UPDATE_EXTENSIONS_STATEMENT: + return "UPDATE_EXTENSIONS"; case StatementType::INVALID_STATEMENT: break; } diff --git a/src/duckdb/src/common/error_data.cpp b/src/duckdb/src/common/error_data.cpp index add9a273..07457419 100644 --- a/src/duckdb/src/common/error_data.cpp +++ b/src/duckdb/src/common/error_data.cpp @@ -25,6 +25,13 @@ ErrorData::ErrorData(const string &message) : initialized(true), type(ExceptionT // parse the constructed JSON if (message.empty() || message[0] != '{') { // not JSON! Use the message as a raw Exception message and leave type as uninitialized + + if (message == std::bad_alloc().what()) { + type = ExceptionType::OUT_OF_MEMORY; + raw_message = "Allocation failure"; + return; + } + raw_message = message; return; } else { @@ -44,6 +51,11 @@ ErrorData::ErrorData(const string &message) : initialized(true), type(ExceptionT const string &ErrorData::Message() { if (final_message.empty()) { final_message = Exception::ExceptionTypeToString(type) + " Error: " + raw_message; + if (type == ExceptionType::INTERNAL) { + final_message += "\nThis error signals an assertion failure within DuckDB. This usually occurs due to " + "unexpected conditions or errors in the program's logic.\nFor more information, see " + "https://duckdb.org/docs/dev/internal_errors"; + } } return final_message; } diff --git a/src/duckdb/src/common/exception_format_value.cpp b/src/duckdb/src/common/exception_format_value.cpp index 1eb9d459..ddef4e10 100644 --- a/src/duckdb/src/common/exception_format_value.cpp +++ b/src/duckdb/src/common/exception_format_value.cpp @@ -1,5 +1,6 @@ #include "duckdb/common/exception.hpp" #include "duckdb/common/types.hpp" +#include "duckdb/common/helper.hpp" // defines DUCKDB_EXPLICIT_FALLTHROUGH which fmt will use to annotate #include "fmt/format.h" #include "fmt/printf.h" #include "duckdb/common/types/hugeint.hpp" diff --git a/src/duckdb/src/common/extra_type_info.cpp b/src/duckdb/src/common/extra_type_info.cpp index f8d27d86..88dacaf3 100644 --- a/src/duckdb/src/common/extra_type_info.cpp +++ b/src/duckdb/src/common/extra_type_info.cpp @@ -17,6 +17,28 @@ ExtraTypeInfo::ExtraTypeInfo(ExtraTypeInfoType type, string alias) : type(type), } ExtraTypeInfo::~ExtraTypeInfo() { } +shared_ptr ExtraTypeInfo::Copy() const { + return make_shared_ptr(*this); +} + +static bool CompareModifiers(const vector &left, const vector &right) { + // Check if the common prefix of the properties is the same for both types + auto common_props = MinValue(left.size(), right.size()); + for (idx_t i = 0; i < common_props; i++) { + if (left[i].type() != right[i].type()) { + return false; + } + // Special case for nulls: + // For type modifiers, NULL is equivalent to ANY + if (left[i].IsNull() || right[i].IsNull()) { + continue; + } + if (left[i] != right[i]) { + return false; + } + } + return true; +} bool ExtraTypeInfo::Equals(ExtraTypeInfo *other_p) const { if (type == ExtraTypeInfoType::INVALID_TYPE_INFO || type == ExtraTypeInfoType::STRING_TYPE_INFO || @@ -31,6 +53,9 @@ bool ExtraTypeInfo::Equals(ExtraTypeInfo *other_p) const { if (alias != other_p->alias) { return false; } + if (!CompareModifiers(modifiers, other_p->modifiers)) { + return false; + } return true; } if (!other_p) { @@ -39,7 +64,13 @@ bool ExtraTypeInfo::Equals(ExtraTypeInfo *other_p) const { if (type != other_p->type) { return false; } - return alias == other_p->alias && EqualsInternal(other_p); + if (alias != other_p->alias) { + return false; + } + if (!CompareModifiers(modifiers, other_p->modifiers)) { + return false; + } + return EqualsInternal(other_p); } bool ExtraTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { @@ -63,6 +94,10 @@ bool DecimalTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { return width == other.width && scale == other.scale; } +shared_ptr DecimalTypeInfo::Copy() const { + return make_shared_ptr(*this); +} + //===--------------------------------------------------------------------===// // String Type Info //===--------------------------------------------------------------------===// @@ -78,6 +113,10 @@ bool StringTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { return true; } +shared_ptr StringTypeInfo::Copy() const { + return make_shared_ptr(*this); +} + //===--------------------------------------------------------------------===// // List Type Info //===--------------------------------------------------------------------===// @@ -93,6 +132,10 @@ bool ListTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { return child_type == other.child_type; } +shared_ptr ListTypeInfo::Copy() const { + return make_shared_ptr(*this); +} + //===--------------------------------------------------------------------===// // Struct Type Info //===--------------------------------------------------------------------===// @@ -108,6 +151,10 @@ bool StructTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { return child_types == other.child_types; } +shared_ptr StructTypeInfo::Copy() const { + return make_shared_ptr(*this); +} + //===--------------------------------------------------------------------===// // Aggregate State Type Info //===--------------------------------------------------------------------===// @@ -125,6 +172,10 @@ bool AggregateStateTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { state_type.bound_argument_types == other.state_type.bound_argument_types; } +shared_ptr AggregateStateTypeInfo::Copy() const { + return make_shared_ptr(*this); +} + //===--------------------------------------------------------------------===// // User Type Info //===--------------------------------------------------------------------===// @@ -135,9 +186,14 @@ UserTypeInfo::UserTypeInfo(string name_p) : ExtraTypeInfo(ExtraTypeInfoType::USER_TYPE_INFO), user_type_name(std::move(name_p)) { } -UserTypeInfo::UserTypeInfo(string catalog_p, string schema_p, string name_p) +UserTypeInfo::UserTypeInfo(string name_p, vector modifiers_p) + : ExtraTypeInfo(ExtraTypeInfoType::USER_TYPE_INFO), user_type_name(std::move(name_p)), + user_type_modifiers(std::move(modifiers_p)) { +} + +UserTypeInfo::UserTypeInfo(string catalog_p, string schema_p, string name_p, vector modifiers_p) : ExtraTypeInfo(ExtraTypeInfoType::USER_TYPE_INFO), catalog(std::move(catalog_p)), schema(std::move(schema_p)), - user_type_name(std::move(name_p)) { + user_type_name(std::move(name_p)), user_type_modifiers(std::move(modifiers_p)) { } bool UserTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { @@ -145,6 +201,10 @@ bool UserTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { return other.user_type_name == user_type_name; } +shared_ptr UserTypeInfo::Copy() const { + return make_shared_ptr(*this); +} + //===--------------------------------------------------------------------===// // Enum Type Info //===--------------------------------------------------------------------===// @@ -190,7 +250,7 @@ struct EnumTypeInfoTemplated : public EnumTypeInfo { deserializer.ReadList(201, "values", [&](Deserializer::List &list, idx_t i) { strings[i] = StringVector::AddStringOrBlob(values_insert_order, list.ReadElement()); }); - return make_shared(values_insert_order, size); + return make_shared_ptr(values_insert_order, size); } const string_map_t &GetValues() const { @@ -227,13 +287,13 @@ LogicalType EnumTypeInfo::CreateType(Vector &ordered_data, idx_t size) { auto enum_internal_type = EnumTypeInfo::DictType(size); switch (enum_internal_type) { case PhysicalType::UINT8: - info = make_shared>(ordered_data, size); + info = make_shared_ptr>(ordered_data, size); break; case PhysicalType::UINT16: - info = make_shared>(ordered_data, size); + info = make_shared_ptr>(ordered_data, size); break; case PhysicalType::UINT32: - info = make_shared>(ordered_data, size); + info = make_shared_ptr>(ordered_data, size); break; default: throw InternalException("Invalid Physical Type for ENUMs"); @@ -318,6 +378,12 @@ void EnumTypeInfo::Serialize(Serializer &serializer) const { [&](Serializer::List &list, idx_t i) { list.WriteElement(strings[i]); }); } +shared_ptr EnumTypeInfo::Copy() const { + Vector values_insert_order_copy(LogicalType::VARCHAR, false, false, 0); + values_insert_order_copy.Reference(values_insert_order); + return make_shared_ptr(values_insert_order_copy, dict_size); +} + //===--------------------------------------------------------------------===// // ArrayTypeInfo //===--------------------------------------------------------------------===// @@ -331,6 +397,10 @@ bool ArrayTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { return child_type == other.child_type && size == other.size; } +shared_ptr ArrayTypeInfo::Copy() const { + return make_shared_ptr(*this); +} + //===--------------------------------------------------------------------===// // Any Type Info //===--------------------------------------------------------------------===// @@ -346,8 +416,12 @@ bool AnyTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { return target_type == other.target_type && cast_score == other.cast_score; } +shared_ptr AnyTypeInfo::Copy() const { + return make_shared_ptr(*this); +} + //===--------------------------------------------------------------------===// -// Any Type Info +// Integer Literal Type Info //===--------------------------------------------------------------------===// IntegerLiteralTypeInfo::IntegerLiteralTypeInfo() : ExtraTypeInfo(ExtraTypeInfoType::INTEGER_LITERAL_TYPE_INFO) { } @@ -361,4 +435,8 @@ bool IntegerLiteralTypeInfo::EqualsInternal(ExtraTypeInfo *other_p) const { return constant_value == other.constant_value; } +shared_ptr IntegerLiteralTypeInfo::Copy() const { + return make_shared_ptr(*this); +} + } // namespace duckdb diff --git a/src/duckdb/src/common/file_system.cpp b/src/duckdb/src/common/file_system.cpp index d2288b42..27160adc 100644 --- a/src/duckdb/src/common/file_system.cpp +++ b/src/duckdb/src/common/file_system.cpp @@ -12,6 +12,7 @@ #include "duckdb/main/database.hpp" #include "duckdb/main/extension_helper.hpp" #include "duckdb/common/windows_util.hpp" +#include "duckdb/common/operator/multiply.hpp" #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include @@ -133,6 +135,24 @@ optional_idx FileSystem::GetAvailableMemory() { return max_memory; } +optional_idx FileSystem::GetAvailableDiskSpace(const string &path) { + struct statvfs vfs; + + auto ret = statvfs(path.c_str(), &vfs); + if (ret == -1) { + return optional_idx(); + } + auto block_size = vfs.f_frsize; + // These are the blocks available for creating new files or extending existing ones + auto available_blocks = vfs.f_bfree; + idx_t available_disk_space = DConstants::INVALID_INDEX; + if (!TryMultiplyOperator::Operation(static_cast(block_size), static_cast(available_blocks), + available_disk_space)) { + return optional_idx(); + } + return available_disk_space; +} + string FileSystem::GetWorkingDirectory() { auto buffer = make_unsafe_uniq_array(PATH_MAX); char *ret = getcwd(buffer.get(), PATH_MAX); @@ -233,6 +253,18 @@ optional_idx FileSystem::GetAvailableMemory() { return optional_idx(); } +optional_idx FileSystem::GetAvailableDiskSpace(const string &path) { + ULARGE_INTEGER available_bytes, total_bytes, free_bytes; + + auto unicode_path = WindowsUtil::UTF8ToUnicode(path.c_str()); + if (!GetDiskFreeSpaceExW(unicode_path.c_str(), &available_bytes, &total_bytes, &free_bytes)) { + return optional_idx(); + } + (void)total_bytes; + (void)free_bytes; + return NumericCast(available_bytes.QuadPart); +} + string FileSystem::GetWorkingDirectory() { idx_t count = GetCurrentDirectoryW(0, nullptr); if (count == 0) { @@ -517,7 +549,7 @@ FileHandle::~FileHandle() { } int64_t FileHandle::Read(void *buffer, idx_t nr_bytes) { - return file_system.Read(*this, buffer, nr_bytes); + return file_system.Read(*this, buffer, UnsafeNumericCast(nr_bytes)); } bool FileHandle::Trim(idx_t offset_bytes, idx_t length_bytes) { @@ -525,15 +557,15 @@ bool FileHandle::Trim(idx_t offset_bytes, idx_t length_bytes) { } int64_t FileHandle::Write(void *buffer, idx_t nr_bytes) { - return file_system.Write(*this, buffer, nr_bytes); + return file_system.Write(*this, buffer, UnsafeNumericCast(nr_bytes)); } void FileHandle::Read(void *buffer, idx_t nr_bytes, idx_t location) { - file_system.Read(*this, buffer, nr_bytes, location); + file_system.Read(*this, buffer, UnsafeNumericCast(nr_bytes), location); } void FileHandle::Write(void *buffer, idx_t nr_bytes, idx_t location) { - file_system.Write(*this, buffer, nr_bytes, location); + file_system.Write(*this, buffer, UnsafeNumericCast(nr_bytes), location); } void FileHandle::Seek(idx_t location) { @@ -560,7 +592,7 @@ string FileHandle::ReadLine() { string result; char buffer[1]; while (true) { - idx_t tuples_read = Read(buffer, 1); + auto tuples_read = UnsafeNumericCast(Read(buffer, 1)); if (tuples_read == 0 || buffer[0] == '\n') { return result; } @@ -575,7 +607,7 @@ bool FileHandle::OnDiskFile() { } idx_t FileHandle::GetFileSize() { - return file_system.GetFileSize(*this); + return NumericCast(file_system.GetFileSize(*this)); } void FileHandle::Sync() { @@ -591,7 +623,7 @@ FileType FileHandle::GetType() { } bool FileSystem::IsRemoteFile(const string &path) { - const string prefixes[] = {"http://", "https://", "s3://", "s3a://", "s3n://", "gcs://", "gs://", "r2://"}; + const string prefixes[] = {"http://", "https://", "s3://", "s3a://", "s3n://", "gcs://", "gs://", "r2://", "hf://"}; for (auto &prefix : prefixes) { if (StringUtil::StartsWith(path, prefix)) { return true; diff --git a/src/duckdb/src/common/gzip_file_system.cpp b/src/duckdb/src/common/gzip_file_system.cpp index d24d5e57..100721a3 100644 --- a/src/duckdb/src/common/gzip_file_system.cpp +++ b/src/duckdb/src/common/gzip_file_system.cpp @@ -120,13 +120,13 @@ void MiniZStreamWrapper::Initialize(CompressedFile &file, bool write) { } else { idx_t data_start = GZIP_HEADER_MINSIZE; auto read_count = file.child_handle->Read(gzip_hdr, GZIP_HEADER_MINSIZE); - GZipFileSystem::VerifyGZIPHeader(gzip_hdr, read_count); + GZipFileSystem::VerifyGZIPHeader(gzip_hdr, NumericCast(read_count)); // Skip over the extra field if necessary if (gzip_hdr[3] & GZIP_FLAG_EXTRA) { uint8_t gzip_xlen[2]; file.child_handle->Seek(data_start); file.child_handle->Read(gzip_xlen, 2); - idx_t xlen = (uint8_t)gzip_xlen[0] | (uint8_t)gzip_xlen[1] << 8; + auto xlen = NumericCast((uint8_t)gzip_xlen[0] | (uint8_t)gzip_xlen[1] << 8); data_start += xlen + 2; } // Skip over the file name if necessary @@ -160,7 +160,7 @@ bool MiniZStreamWrapper::Read(StreamData &sd) { GZipFileSystem::VerifyGZIPHeader(gzip_hdr, GZIP_HEADER_MINSIZE); body_ptr += GZIP_HEADER_MINSIZE; if (gzip_hdr[3] & GZIP_FLAG_EXTRA) { - idx_t xlen = (uint8_t)*body_ptr | (uint8_t) * (body_ptr + 1) << 8; + auto xlen = NumericCast((uint8_t)*body_ptr | (uint8_t) * (body_ptr + 1) << 8); body_ptr += xlen + 2; if (GZIP_FOOTER_SIZE + GZIP_HEADER_MINSIZE + 2 + xlen >= GZIP_HEADER_MAXSIZE) { throw InternalException("Extra field resulting in GZIP header larger than defined maximum (%d)", @@ -170,7 +170,7 @@ bool MiniZStreamWrapper::Read(StreamData &sd) { if (gzip_hdr[3] & GZIP_FLAG_NAME) { char c; do { - c = *body_ptr; + c = UnsafeNumericCast(*body_ptr); body_ptr++; } while (c != '\0' && body_ptr < sd.in_buff_end); if ((idx_t)(body_ptr - sd.in_buff_start) >= GZIP_HEADER_MAXSIZE) { @@ -217,12 +217,13 @@ bool MiniZStreamWrapper::Read(StreamData &sd) { void MiniZStreamWrapper::Write(CompressedFile &file, StreamData &sd, data_ptr_t uncompressed_data, int64_t uncompressed_size) { // update the src and the total size - crc = duckdb_miniz::mz_crc32(crc, reinterpret_cast(uncompressed_data), uncompressed_size); - total_size += uncompressed_size; + crc = duckdb_miniz::mz_crc32(crc, reinterpret_cast(uncompressed_data), + UnsafeNumericCast(uncompressed_size)); + total_size += UnsafeNumericCast(uncompressed_size); auto remaining = uncompressed_size; while (remaining > 0) { - idx_t output_remaining = (sd.out_buff.get() + sd.out_buf_size) - sd.out_buff_start; + auto output_remaining = UnsafeNumericCast((sd.out_buff.get() + sd.out_buf_size) - sd.out_buff_start); mz_stream_ptr->next_in = reinterpret_cast(uncompressed_data); mz_stream_ptr->avail_in = NumericCast(remaining); @@ -237,10 +238,11 @@ void MiniZStreamWrapper::Write(CompressedFile &file, StreamData &sd, data_ptr_t sd.out_buff_start += output_remaining - mz_stream_ptr->avail_out; if (mz_stream_ptr->avail_out == 0) { // no more output buffer available: flush - file.child_handle->Write(sd.out_buff.get(), sd.out_buff_start - sd.out_buff.get()); + file.child_handle->Write(sd.out_buff.get(), + UnsafeNumericCast(sd.out_buff_start - sd.out_buff.get())); sd.out_buff_start = sd.out_buff.get(); } - idx_t written = remaining - mz_stream_ptr->avail_in; + auto written = UnsafeNumericCast(remaining - mz_stream_ptr->avail_in); uncompressed_data += written; remaining = mz_stream_ptr->avail_in; } @@ -258,7 +260,8 @@ void MiniZStreamWrapper::FlushStream() { auto res = mz_deflate(mz_stream_ptr.get(), duckdb_miniz::MZ_FINISH); sd.out_buff_start += (output_remaining - mz_stream_ptr->avail_out); if (sd.out_buff_start > sd.out_buff.get()) { - file->child_handle->Write(sd.out_buff.get(), sd.out_buff_start - sd.out_buff.get()); + file->child_handle->Write(sd.out_buff.get(), + UnsafeNumericCast(sd.out_buff_start - sd.out_buff.get())); sd.out_buff_start = sd.out_buff.get(); } if (res == duckdb_miniz::MZ_STREAM_END) { @@ -317,9 +320,30 @@ void GZipFileSystem::VerifyGZIPHeader(uint8_t gzip_hdr[], idx_t read_count) { } } +bool GZipFileSystem::CheckIsZip(const char *data, duckdb::idx_t size) { + if (size < GZIP_HEADER_MINSIZE) { + return false; + } + + auto data_ptr = reinterpret_cast(data); + if (data_ptr[0] != 0x1F || data_ptr[1] != 0x8B) { + return false; + } + + if (data_ptr[2] != GZIP_COMPRESSION_DEFLATE) { + return false; + } + + return true; +} + string GZipFileSystem::UncompressGZIPString(const string &in) { + return UncompressGZIPString(in.data(), in.size()); +} + +string GZipFileSystem::UncompressGZIPString(const char *data, idx_t size) { // decompress file - auto body_ptr = in.data(); + auto body_ptr = data; auto mz_stream_ptr = make_uniq(); memset(mz_stream_ptr.get(), 0, sizeof(duckdb_miniz::mz_stream)); @@ -329,7 +353,7 @@ string GZipFileSystem::UncompressGZIPString(const string &in) { // check for incorrectly formatted files // TODO this is mostly the same as gzip_file_system.cpp - if (in.size() < GZIP_HEADER_MINSIZE) { + if (size < GZIP_HEADER_MINSIZE) { throw IOException("Input is not a GZIP stream"); } memcpy(gzip_hdr, body_ptr, GZIP_HEADER_MINSIZE); @@ -345,7 +369,7 @@ string GZipFileSystem::UncompressGZIPString(const string &in) { do { c = *body_ptr; body_ptr++; - } while (c != '\0' && (idx_t)(body_ptr - in.data()) < in.size()); + } while (c != '\0' && (idx_t)(body_ptr - data) < size); } // stream is now set to beginning of payload data @@ -354,7 +378,7 @@ string GZipFileSystem::UncompressGZIPString(const string &in) { throw InternalException("Failed to initialize miniz"); } - auto bytes_remaining = in.size() - (body_ptr - in.data()); + auto bytes_remaining = size - NumericCast(body_ptr - data); mz_stream_ptr->next_in = const_uchar_ptr_cast(body_ptr); mz_stream_ptr->avail_in = NumericCast(bytes_remaining); diff --git a/src/duckdb/src/common/hive_partitioning.cpp b/src/duckdb/src/common/hive_partitioning.cpp index 0bb3306b..3ae1f7f3 100644 --- a/src/duckdb/src/common/hive_partitioning.cpp +++ b/src/duckdb/src/common/hive_partitioning.cpp @@ -148,17 +148,6 @@ void HivePartitioning::ApplyFiltersToFileList(ClientContext &context, vector lck(global_state->lock); - SynchronizeLocalMap(); - } - InitializeKeys(); -} - void HivePartitionedColumnData::InitializeKeys() { keys.resize(STANDARD_VECTOR_SIZE); for (idx_t i = 0; i < STANDARD_VECTOR_SIZE; i++) { @@ -320,82 +309,45 @@ std::map HivePartitionedColumnData::GetReverseM return ret; } -void HivePartitionedColumnData::GrowAllocators() { - unique_lock lck_gstate(allocators->lock); - - idx_t current_allocator_size = allocators->allocators.size(); - idx_t required_allocators = local_partition_map.size(); - - allocators->allocators.reserve(current_allocator_size); - for (idx_t i = current_allocator_size; i < required_allocators; i++) { - CreateAllocator(); - } - - D_ASSERT(allocators->allocators.size() == local_partition_map.size()); -} - -void HivePartitionedColumnData::GrowAppendState(PartitionedColumnDataAppendState &state) { - idx_t current_append_state_size = state.partition_append_states.size(); - idx_t required_append_state_size = local_partition_map.size(); - - for (idx_t i = current_append_state_size; i < required_append_state_size; i++) { - state.partition_append_states.emplace_back(make_uniq()); - state.partition_buffers.emplace_back(CreatePartitionBuffer()); - } +HivePartitionedColumnData::HivePartitionedColumnData(ClientContext &context, vector types, + vector partition_by_cols, + shared_ptr global_state) + : PartitionedColumnData(PartitionedColumnDataType::HIVE, context, std::move(types)), + global_state(std::move(global_state)), group_by_columns(std::move(partition_by_cols)), + hashes_v(LogicalType::HASH) { + InitializeKeys(); + CreateAllocator(); } -void HivePartitionedColumnData::GrowPartitions(PartitionedColumnDataAppendState &state) { - idx_t current_partitions = partitions.size(); - idx_t required_partitions = local_partition_map.size(); - - D_ASSERT(allocators->allocators.size() == required_partitions); - - for (idx_t i = current_partitions; i < required_partitions; i++) { - partitions.emplace_back(CreatePartitionCollection(i)); - partitions[i]->InitializeAppend(*state.partition_append_states[i]); - } - D_ASSERT(partitions.size() == local_partition_map.size()); -} +void HivePartitionedColumnData::AddNewPartition(HivePartitionKey key, idx_t partition_id, + PartitionedColumnDataAppendState &state) { + local_partition_map.emplace(std::move(key), partition_id); -void HivePartitionedColumnData::SynchronizeLocalMap() { - // Synchronise global map into local, may contain changes from other threads too - for (auto it = global_state->partitions.begin() + local_partition_map.size(); it < global_state->partitions.end(); - it++) { - local_partition_map[(*it)->first] = (*it)->second; + if (state.partition_append_states.size() <= partition_id) { + state.partition_append_states.resize(partition_id + 1); + state.partition_buffers.resize(partition_id + 1); + partitions.resize(partition_id + 1); } + state.partition_append_states[partition_id] = make_uniq(); + state.partition_buffers[partition_id] = CreatePartitionBuffer(); + partitions[partition_id] = CreatePartitionCollection(0); + partitions[partition_id]->InitializeAppend(*state.partition_append_states[partition_id]); } idx_t HivePartitionedColumnData::RegisterNewPartition(HivePartitionKey key, PartitionedColumnDataAppendState &state) { + idx_t partition_id; if (global_state) { - idx_t partition_id; - - // Synchronize Global state with our local state with the newly discoveren partition - { - unique_lock lck_gstate(global_state->lock); - - // Insert into global map, or return partition if already present - auto res = - global_state->partition_map.emplace(std::make_pair(std::move(key), global_state->partition_map.size())); - auto it = res.first; - partition_id = it->second; - - // Add iterator to vector to allow incrementally updating local states from global state - global_state->partitions.emplace_back(it); - SynchronizeLocalMap(); - } - - // After synchronizing with the global state, we need to grow the shared allocators to support - // the number of partitions, which guarantees that there's always enough allocators available to each thread - GrowAllocators(); - - // Grow local partition data - GrowAppendState(state); - GrowPartitions(state); + // Synchronize Global state with our local state with the newly discovered partition + unique_lock lck_gstate(global_state->lock); - return partition_id; + // Insert into global map, or return partition if already present + auto res = global_state->partition_map.emplace(std::make_pair(key, global_state->partition_map.size())); + partition_id = res.first->second; } else { - return local_partition_map.emplace(std::make_pair(std::move(key), local_partition_map.size())).first->second; + partition_id = local_partition_map.size(); } + AddNewPartition(std::move(key), partition_id, state); + return partition_id; } } // namespace duckdb diff --git a/src/duckdb/src/common/http_state.cpp b/src/duckdb/src/common/http_state.cpp index b07c0d4b..a2e91182 100644 --- a/src/duckdb/src/common/http_state.cpp +++ b/src/duckdb/src/common/http_state.cpp @@ -26,7 +26,7 @@ void CachedFileHandle::AllocateBuffer(idx_t size) { if (file->initialized) { throw InternalException("Cannot allocate a buffer for a cached file that was already initialized"); } - file->data = std::shared_ptr(new char[size], std::default_delete()); + file->data = shared_ptr(new char[size], std::default_delete()); file->capacity = size; } @@ -62,14 +62,14 @@ shared_ptr HTTPState::TryGetState(ClientContext &context, bool create auto lookup = context.registered_state.find("http_state"); if (lookup != context.registered_state.end()) { - return std::static_pointer_cast(lookup->second); + return shared_ptr_cast(lookup->second); } if (!create_on_missing) { return nullptr; } - auto http_state = make_shared(); + auto http_state = make_shared_ptr(); context.registered_state["http_state"] = http_state; return http_state; } @@ -87,7 +87,7 @@ shared_ptr &HTTPState::GetCachedFile(const string &path) { lock_guard lock(cached_files_mutex); auto &cache_entry_ref = cached_files[path]; if (!cache_entry_ref) { - cache_entry_ref = make_shared(); + cache_entry_ref = make_shared_ptr(); } return cache_entry_ref; } diff --git a/src/duckdb/src/common/local_file_system.cpp b/src/duckdb/src/common/local_file_system.cpp index 9345ed4d..cb15b5d6 100644 --- a/src/duckdb/src/common/local_file_system.cpp +++ b/src/duckdb/src/common/local_file_system.cpp @@ -40,7 +40,11 @@ extern "C" WINBASEAPI BOOL WINAPI GetPhysicallyInstalledSystemMemory(PULONGLONG) #endif #if defined(__linux__) -#include +// See https://man7.org/linux/man-pages/man2/fallocate.2.html +#ifndef _GNU_SOURCE +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#endif +#include #include // See e.g.: // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html @@ -379,6 +383,10 @@ unique_ptr LocalFileSystem::OpenFile(const string &path_p, FileOpenF "using the -readonly parameter in the CLI"; } } + rc = close(fd); + if (rc == -1) { + message += ". Also, failed closing file"; + } message += ". See also https://duckdb.org/docs/connect/concurrency"; throw IOException("Could not set lock on file \"%s\": %s", {{"errno", std::to_string(retained_errno)}}, path, message); @@ -390,7 +398,7 @@ unique_ptr LocalFileSystem::OpenFile(const string &path_p, FileOpenF void LocalFileSystem::SetFilePointer(FileHandle &handle, idx_t location) { int fd = handle.Cast().fd; - off_t offset = lseek(fd, location, SEEK_SET); + off_t offset = lseek(fd, UnsafeNumericCast(location), SEEK_SET); if (offset == (off_t)-1) { throw IOException("Could not seek to location %lld for file \"%s\": %s", {{"errno", std::to_string(errno)}}, location, handle.path, strerror(errno)); @@ -404,14 +412,15 @@ idx_t LocalFileSystem::GetFilePointer(FileHandle &handle) { throw IOException("Could not get file position file \"%s\": %s", {{"errno", std::to_string(errno)}}, handle.path, strerror(errno)); } - return position; + return UnsafeNumericCast(position); } void LocalFileSystem::Read(FileHandle &handle, void *buffer, int64_t nr_bytes, idx_t location) { int fd = handle.Cast().fd; auto read_buffer = char_ptr_cast(buffer); while (nr_bytes > 0) { - int64_t bytes_read = pread(fd, read_buffer, nr_bytes, location); + int64_t bytes_read = + pread(fd, read_buffer, UnsafeNumericCast(nr_bytes), UnsafeNumericCast(location)); if (bytes_read == -1) { throw IOException("Could not read from file \"%s\": %s", {{"errno", std::to_string(errno)}}, handle.path, strerror(errno)); @@ -423,13 +432,13 @@ void LocalFileSystem::Read(FileHandle &handle, void *buffer, int64_t nr_bytes, i } read_buffer += bytes_read; nr_bytes -= bytes_read; - location += bytes_read; + location += UnsafeNumericCast(bytes_read); } } int64_t LocalFileSystem::Read(FileHandle &handle, void *buffer, int64_t nr_bytes) { int fd = handle.Cast().fd; - int64_t bytes_read = read(fd, buffer, nr_bytes); + int64_t bytes_read = read(fd, buffer, UnsafeNumericCast(nr_bytes)); if (bytes_read == -1) { throw IOException("Could not read from file \"%s\": %s", {{"errno", std::to_string(errno)}}, handle.path, strerror(errno)); @@ -441,7 +450,8 @@ void LocalFileSystem::Write(FileHandle &handle, void *buffer, int64_t nr_bytes, int fd = handle.Cast().fd; auto write_buffer = char_ptr_cast(buffer); while (nr_bytes > 0) { - int64_t bytes_written = pwrite(fd, write_buffer, nr_bytes, location); + int64_t bytes_written = + pwrite(fd, write_buffer, UnsafeNumericCast(nr_bytes), UnsafeNumericCast(location)); if (bytes_written < 0) { throw IOException("Could not write file \"%s\": %s", {{"errno", std::to_string(errno)}}, handle.path, strerror(errno)); @@ -452,7 +462,7 @@ void LocalFileSystem::Write(FileHandle &handle, void *buffer, int64_t nr_bytes, } write_buffer += bytes_written; nr_bytes -= bytes_written; - location += bytes_written; + location += UnsafeNumericCast(bytes_written); } } @@ -534,7 +544,8 @@ void LocalFileSystem::CreateDirectory(const string &directory, optional_ptr> dir_unique_ptr(dir, [](DIR *d) { closedir(d); }); + struct dirent *ent; // loop over all files in the directory while ((ent = readdir(dir)) != nullptr) { @@ -624,7 +640,7 @@ bool LocalFileSystem::ListFiles(const string &directory, const std::function + +namespace duckdb { + +// Helper method to do Filter Pushdown into a MultiFileList +bool PushdownInternal(ClientContext &context, const MultiFileReaderOptions &options, LogicalGet &get, + vector> &filters, vector &expanded_files) { + unordered_map column_map; + for (idx_t i = 0; i < get.column_ids.size(); i++) { + if (!IsRowIdColumnId(get.column_ids[i])) { + column_map.insert({get.names[get.column_ids[i]], i}); + } + } + + auto start_files = expanded_files.size(); + HivePartitioning::ApplyFiltersToFileList(context, expanded_files, filters, column_map, get, + options.hive_partitioning, options.filename); + + if (expanded_files.size() != start_files) { + return true; + } + + return false; +} + +//===--------------------------------------------------------------------===// +// MultiFileListIterator +//===--------------------------------------------------------------------===// +MultiFileListIterationHelper MultiFileList::Files() { + return MultiFileListIterationHelper(*this); +} + +MultiFileListIterationHelper::MultiFileListIterationHelper(MultiFileList &file_list_p) : file_list(file_list_p) { +} + +MultiFileListIterationHelper::MultiFileListIterator::MultiFileListIterator(MultiFileList *file_list_p) + : file_list(file_list_p) { + if (!file_list) { + return; + } + + file_list->InitializeScan(file_scan_data); + if (!file_list->Scan(file_scan_data, current_file)) { + // There is no first file: move iterator to nop state + file_list = nullptr; + file_scan_data.current_file_idx = DConstants::INVALID_INDEX; + } +} + +void MultiFileListIterationHelper::MultiFileListIterator::Next() { + if (!file_list) { + return; + } + + if (!file_list->Scan(file_scan_data, current_file)) { + // exhausted collection: move iterator to nop state + file_list = nullptr; + file_scan_data.current_file_idx = DConstants::INVALID_INDEX; + } +} + +MultiFileListIterationHelper::MultiFileListIterator MultiFileListIterationHelper::begin() { // NOLINT: match stl API + return MultiFileListIterationHelper::MultiFileListIterator( + file_list.GetExpandResult() == FileExpandResult::NO_FILES ? nullptr : &file_list); +} +MultiFileListIterationHelper::MultiFileListIterator MultiFileListIterationHelper::end() { // NOLINT: match stl API + return MultiFileListIterationHelper::MultiFileListIterator(nullptr); +} + +MultiFileListIterationHelper::MultiFileListIterator &MultiFileListIterationHelper::MultiFileListIterator::operator++() { + Next(); + return *this; +} + +bool MultiFileListIterationHelper::MultiFileListIterator::operator!=(const MultiFileListIterator &other) const { + return file_list != other.file_list || file_scan_data.current_file_idx != other.file_scan_data.current_file_idx; +} + +const string &MultiFileListIterationHelper::MultiFileListIterator::operator*() const { + return current_file; +} + +//===--------------------------------------------------------------------===// +// MultiFileList +//===--------------------------------------------------------------------===// +MultiFileList::MultiFileList(vector paths, FileGlobOptions options) + : paths(std::move(paths)), glob_options(options) { +} + +MultiFileList::~MultiFileList() { +} + +const vector MultiFileList::GetPaths() const { + return paths; +} + +void MultiFileList::InitializeScan(MultiFileListScanData &iterator) { + iterator.current_file_idx = 0; +} + +bool MultiFileList::Scan(MultiFileListScanData &iterator, string &result_file) { + D_ASSERT(iterator.current_file_idx != DConstants::INVALID_INDEX); + auto maybe_file = GetFile(iterator.current_file_idx); + + if (maybe_file.empty()) { + D_ASSERT(iterator.current_file_idx >= GetTotalFileCount()); + return false; + } + + result_file = maybe_file; + iterator.current_file_idx++; + return true; +} + +unique_ptr MultiFileList::ComplexFilterPushdown(ClientContext &context, + const MultiFileReaderOptions &options, LogicalGet &get, + vector> &filters) { + // By default the filter pushdown into a multifilelist does nothing + return nullptr; +} + +string MultiFileList::GetFirstFile() { + return GetFile(0); +} + +bool MultiFileList::IsEmpty() { + return GetExpandResult() == FileExpandResult::NO_FILES; +} + +//===--------------------------------------------------------------------===// +// SimpleMultiFileList +//===--------------------------------------------------------------------===// +SimpleMultiFileList::SimpleMultiFileList(vector paths_p) + : MultiFileList(std::move(paths_p), FileGlobOptions::ALLOW_EMPTY) { +} + +unique_ptr SimpleMultiFileList::ComplexFilterPushdown(ClientContext &context_p, + const MultiFileReaderOptions &options, + LogicalGet &get, + vector> &filters) { + if (!options.hive_partitioning && !options.filename) { + return nullptr; + } + + // FIXME: don't copy list until first file is filtered + auto file_copy = paths; + auto res = PushdownInternal(context_p, options, get, filters, file_copy); + + if (res) { + return make_uniq(file_copy); + } + + return nullptr; +} + +vector SimpleMultiFileList::GetAllFiles() { + return paths; +} + +FileExpandResult SimpleMultiFileList::GetExpandResult() { + if (paths.size() > 1) { + return FileExpandResult::MULTIPLE_FILES; + } else if (paths.size() == 1) { + return FileExpandResult::SINGLE_FILE; + } + + return FileExpandResult::NO_FILES; +} + +string SimpleMultiFileList::GetFile(idx_t i) { + if (paths.empty() || i >= paths.size()) { + return ""; + } + + return paths[i]; +} + +idx_t SimpleMultiFileList::GetTotalFileCount() { + return paths.size(); +} + +//===--------------------------------------------------------------------===// +// GlobMultiFileList +//===--------------------------------------------------------------------===// +GlobMultiFileList::GlobMultiFileList(ClientContext &context_p, vector paths_p, FileGlobOptions options) + : MultiFileList(std::move(paths_p), options), context(context_p), current_path(0) { +} + +unique_ptr GlobMultiFileList::ComplexFilterPushdown(ClientContext &context_p, + const MultiFileReaderOptions &options, + LogicalGet &get, + vector> &filters) { + lock_guard lck(lock); + + // Expand all + // FIXME: lazy expansion + // FIXME: push down filters into glob + while (ExpandPathInternal()) { + } + + if (!options.hive_partitioning && !options.filename) { + return nullptr; + } + auto res = PushdownInternal(context, options, get, filters, expanded_files); + + if (res) { + return make_uniq(expanded_files); + } + + return nullptr; +} + +vector GlobMultiFileList::GetAllFiles() { + lock_guard lck(lock); + while (ExpandPathInternal()) { + } + return expanded_files; +} + +idx_t GlobMultiFileList::GetTotalFileCount() { + lock_guard lck(lock); + while (ExpandPathInternal()) { + } + return expanded_files.size(); +} + +FileExpandResult GlobMultiFileList::GetExpandResult() { + // GetFile(1) will ensure at least the first 2 files are expanded if they are available + GetFile(1); + + if (expanded_files.size() > 1) { + return FileExpandResult::MULTIPLE_FILES; + } else if (expanded_files.size() == 1) { + return FileExpandResult::SINGLE_FILE; + } + + return FileExpandResult::NO_FILES; +} + +string GlobMultiFileList::GetFile(idx_t i) { + lock_guard lck(lock); + return GetFileInternal(i); +} + +string GlobMultiFileList::GetFileInternal(idx_t i) { + while (expanded_files.size() <= i) { + if (!ExpandPathInternal()) { + return ""; + } + } + D_ASSERT(expanded_files.size() > i); + return expanded_files[i]; +} + +bool GlobMultiFileList::ExpandPathInternal() { + if (IsFullyExpanded()) { + return false; + } + + auto &fs = FileSystem::GetFileSystem(context); + auto glob_files = fs.GlobFiles(paths[current_path], context, glob_options); + std::sort(glob_files.begin(), glob_files.end()); + expanded_files.insert(expanded_files.end(), glob_files.begin(), glob_files.end()); + + current_path++; + + return true; +} + +bool GlobMultiFileList::IsFullyExpanded() { + return current_path == paths.size(); +} + +} // namespace duckdb diff --git a/src/duckdb/src/common/multi_file_reader.cpp b/src/duckdb/src/common/multi_file_reader.cpp index 2aa6521f..7e08b7f8 100644 --- a/src/duckdb/src/common/multi_file_reader.cpp +++ b/src/duckdb/src/common/multi_file_reader.cpp @@ -8,11 +8,33 @@ #include "duckdb/function/table_function.hpp" #include "duckdb/main/config.hpp" #include "duckdb/planner/operator/logical_get.hpp" +#include "duckdb/common/string_util.hpp" #include namespace duckdb { +MultiFileReader::~MultiFileReader() { +} + +unique_ptr MultiFileReader::Create(const TableFunction &table_function) { + unique_ptr res; + if (table_function.get_multi_file_reader) { + res = table_function.get_multi_file_reader(); + res->function_name = table_function.name; + } else { + res = make_uniq(); + res->function_name = table_function.name; + } + return res; +} + +unique_ptr MultiFileReader::CreateDefault(const string &function_name) { + auto res = make_uniq(); + res->function_name = function_name; + return res; +} + void MultiFileReader::AddParameters(TableFunction &table_function) { table_function.named_parameters["filename"] = LogicalType::BOOLEAN; table_function.named_parameters["hive_partitioning"] = LogicalType::BOOLEAN; @@ -21,44 +43,49 @@ void MultiFileReader::AddParameters(TableFunction &table_function) { table_function.named_parameters["hive_types_autocast"] = LogicalType::BOOLEAN; } -vector MultiFileReader::GetFileList(ClientContext &context, const Value &input, const string &name, - FileGlobOptions options) { - auto &config = DBConfig::GetConfig(context); - if (!config.options.enable_external_access) { - throw PermissionException("Scanning %s files is disabled through configuration", name); - } +vector MultiFileReader::ParsePaths(const Value &input) { if (input.IsNull()) { - throw ParserException("%s reader cannot take NULL list as parameter", name); + throw ParserException("%s cannot take NULL list as parameter", function_name); } - FileSystem &fs = FileSystem::GetFileSystem(context); - vector files; - if (input.type().id() == LogicalTypeId::VARCHAR) { - auto file_name = StringValue::Get(input); - files = fs.GlobFiles(file_name, context, options); - - // Sort the files to ensure that the order is deterministic - std::sort(files.begin(), files.end()); + if (input.type().id() == LogicalTypeId::VARCHAR) { + return {StringValue::Get(input)}; } else if (input.type().id() == LogicalTypeId::LIST) { + vector paths; for (auto &val : ListValue::GetChildren(input)) { if (val.IsNull()) { - throw ParserException("%s reader cannot take NULL input as parameter", name); + throw ParserException("%s reader cannot take NULL input as parameter", function_name); } if (val.type().id() != LogicalTypeId::VARCHAR) { - throw ParserException("%s reader can only take a list of strings as a parameter", name); + throw ParserException("%s reader can only take a list of strings as a parameter", function_name); } - auto glob_files = fs.GlobFiles(StringValue::Get(val), context, options); - std::sort(glob_files.begin(), glob_files.end()); - files.insert(files.end(), glob_files.begin(), glob_files.end()); + paths.push_back(StringValue::Get(val)); } + return paths; } else { - throw InternalException("Unsupported type for MultiFileReader::GetFileList"); + throw InternalException("Unsupported type for MultiFileReader::ParsePaths called with: '%s'"); } - if (files.empty() && options == FileGlobOptions::DISALLOW_EMPTY) { - throw IOException("%s reader needs at least one file to read", name); +} + +unique_ptr MultiFileReader::CreateFileList(ClientContext &context, const vector &paths, + FileGlobOptions options) { + auto &config = DBConfig::GetConfig(context); + if (!config.options.enable_external_access) { + throw PermissionException("Scanning %s files is disabled through configuration", function_name); } + vector result_files; - return files; + auto res = make_uniq(context, paths, options); + if (res->GetExpandResult() == FileExpandResult::NO_FILES && options == FileGlobOptions::DISALLOW_EMPTY) { + throw IOException("%s needs at least one file to read", function_name); + } + return std::move(res); +} + +unique_ptr MultiFileReader::CreateFileList(ClientContext &context, const Value &input, + FileGlobOptions options) { + auto paths = ParsePaths(input); + return CreateFileList(context, paths, options); } bool MultiFileReader::ParseOption(const string &key, const Value &val, MultiFileReaderOptions &options, @@ -99,37 +126,21 @@ bool MultiFileReader::ParseOption(const string &key, const Value &val, MultiFile return true; } -bool MultiFileReader::ComplexFilterPushdown(ClientContext &context, vector &files, - const MultiFileReaderOptions &options, LogicalGet &get, - vector> &filters) { - if (files.empty()) { - return false; - } - if (!options.hive_partitioning && !options.filename) { - return false; - } - - unordered_map column_map; - for (idx_t i = 0; i < get.column_ids.size(); i++) { - if (!IsRowIdColumnId(get.column_ids[i])) { - column_map.insert({get.names[get.column_ids[i]], i}); - } - } - - auto start_files = files.size(); - HivePartitioning::ApplyFiltersToFileList(context, files, filters, column_map, get, options.hive_partitioning, - options.filename); +unique_ptr MultiFileReader::ComplexFilterPushdown(ClientContext &context, MultiFileList &files, + const MultiFileReaderOptions &options, LogicalGet &get, + vector> &filters) { + return files.ComplexFilterPushdown(context, options, get, filters); +} - if (files.size() != start_files) { - // we have pruned files - return true; - } +bool MultiFileReader::Bind(MultiFileReaderOptions &options, MultiFileList &files, vector &return_types, + vector &names, MultiFileReaderBindData &bind_data) { + // The Default MultiFileReader can not perform any binding as it uses MultiFileLists with no schema information. return false; } -MultiFileReaderBindData MultiFileReader::BindOptions(MultiFileReaderOptions &options, const vector &files, - vector &return_types, vector &names) { - MultiFileReaderBindData bind_data; +void MultiFileReader::BindOptions(MultiFileReaderOptions &options, MultiFileList &files, + vector &return_types, vector &names, + MultiFileReaderBindData &bind_data) { // Add generated constant column for filename if (options.filename) { if (std::find(names.begin(), names.end(), "filename") != names.end()) { @@ -142,27 +153,28 @@ MultiFileReaderBindData MultiFileReader::BindOptions(MultiFileReaderOptions &opt // Add generated constant columns from hive partitioning scheme if (options.hive_partitioning) { - D_ASSERT(!files.empty()); - auto partitions = HivePartitioning::Parse(files[0]); + D_ASSERT(files.GetExpandResult() != FileExpandResult::NO_FILES); + auto partitions = HivePartitioning::Parse(files.GetFirstFile()); // verify that all files have the same hive partitioning scheme - for (auto &f : files) { - auto file_partitions = HivePartitioning::Parse(f); + for (const auto &file : files.Files()) { + auto file_partitions = HivePartitioning::Parse(file); for (auto &part_info : partitions) { if (file_partitions.find(part_info.first) == file_partitions.end()) { string error = "Hive partition mismatch between file \"%s\" and \"%s\": key \"%s\" not found"; if (options.auto_detect_hive_partitioning == true) { - throw InternalException(error + "(hive partitioning was autodetected)", files[0], f, - part_info.first); + throw InternalException(error + "(hive partitioning was autodetected)", files.GetFirstFile(), + file, part_info.first); } - throw BinderException(error.c_str(), files[0], f, part_info.first); + throw BinderException(error.c_str(), files.GetFirstFile(), file, part_info.first); } } if (partitions.size() != file_partitions.size()) { string error_msg = "Hive partition mismatch between file \"%s\" and \"%s\""; if (options.auto_detect_hive_partitioning == true) { - throw InternalException(error_msg + "(hive partitioning was autodetected)", files[0], f); + throw InternalException(error_msg + "(hive partitioning was autodetected)", files.GetFirstFile(), + file); } - throw BinderException(error_msg.c_str(), files[0], f); + throw BinderException(error_msg.c_str(), files.GetFirstFile(), file); } } @@ -176,7 +188,7 @@ MultiFileReaderBindData MultiFileReader::BindOptions(MultiFileReaderOptions &opt auto lookup = std::find(names.begin(), names.end(), part.first); if (lookup != names.end()) { // hive partitioning column also exists in file - override - auto idx = lookup - names.begin(); + auto idx = NumericCast(lookup - names.begin()); hive_partitioning_index = idx; return_types[idx] = options.GetHiveLogicalType(part.first); } else { @@ -188,14 +200,13 @@ MultiFileReaderBindData MultiFileReader::BindOptions(MultiFileReaderOptions &opt bind_data.hive_partitioning_indexes.emplace_back(part.first, hive_partitioning_index); } } - return bind_data; } void MultiFileReader::FinalizeBind(const MultiFileReaderOptions &file_options, const MultiFileReaderBindData &options, const string &filename, const vector &local_names, const vector &global_types, const vector &global_names, const vector &global_column_ids, MultiFileReaderData &reader_data, - ClientContext &context) { + ClientContext &context, optional_ptr global_state) { // create a map of name -> column index case_insensitive_map_t name_map; @@ -247,10 +258,20 @@ void MultiFileReader::FinalizeBind(const MultiFileReaderOptions &file_options, c } } +unique_ptr +MultiFileReader::InitializeGlobalState(ClientContext &context, const MultiFileReaderOptions &file_options, + const MultiFileReaderBindData &bind_data, const MultiFileList &file_list, + const vector &global_types, const vector &global_names, + const vector &global_column_ids) { + // By default, the multifilereader does not require any global state + return nullptr; +} + void MultiFileReader::CreateNameMapping(const string &file_name, const vector &local_types, const vector &local_names, const vector &global_types, const vector &global_names, const vector &global_column_ids, - MultiFileReaderData &reader_data, const string &initial_file) { + MultiFileReaderData &reader_data, const string &initial_file, + optional_ptr global_state) { D_ASSERT(global_types.size() == global_names.size()); D_ASSERT(local_types.size() == local_names.size()); // we have expected types: create a map of name -> column index @@ -307,6 +328,7 @@ void MultiFileReader::CreateNameMapping(const string &file_name, const vector &local_names, const vector &global_types, const vector &global_names, const vector &global_column_ids, optional_ptr filters, MultiFileReaderData &reader_data, - const string &initial_file) { + const string &initial_file, const MultiFileReaderBindData &options, + optional_ptr global_state) { CreateNameMapping(file_name, local_types, local_names, global_types, global_names, global_column_ids, reader_data, - initial_file); - CreateFilterMap(global_types, filters, reader_data); + initial_file, global_state); + CreateFilterMap(global_types, filters, reader_data, global_state); } void MultiFileReader::CreateFilterMap(const vector &global_types, optional_ptr filters, - MultiFileReaderData &reader_data) { + MultiFileReaderData &reader_data, + optional_ptr global_state) { if (filters) { - reader_data.filter_map.resize(global_types.size()); + auto filter_map_size = global_types.size(); + if (global_state) { + filter_map_size += global_state->extra_columns.size(); + } + reader_data.filter_map.resize(filter_map_size); + for (idx_t c = 0; c < reader_data.column_mapping.size(); c++) { auto map_index = reader_data.column_mapping[c]; reader_data.filter_map[map_index].index = c; @@ -337,8 +366,9 @@ void MultiFileReader::CreateFilterMap(const vector &global_types, o } } -void MultiFileReader::FinalizeChunk(const MultiFileReaderBindData &bind_data, const MultiFileReaderData &reader_data, - DataChunk &chunk) { +void MultiFileReader::FinalizeChunk(ClientContext &context, const MultiFileReaderBindData &bind_data, + const MultiFileReaderData &reader_data, DataChunk &chunk, + optional_ptr global_state) { // reference all the constants set up in MultiFileReader::FinalizeBind for (auto &entry : reader_data.constant_map) { chunk.data[entry.column_id].Reference(entry.value); @@ -387,16 +417,17 @@ void UnionByName::CombineUnionTypes(const vector &col_names, const vecto } } -bool MultiFileReaderOptions::AutoDetectHivePartitioningInternal(const vector &files, ClientContext &context) { +bool MultiFileReaderOptions::AutoDetectHivePartitioningInternal(MultiFileList &files, ClientContext &context) { std::unordered_set partitions; auto &fs = FileSystem::GetFileSystem(context); - auto splits_first_file = StringUtil::Split(files.front(), fs.PathSeparator(files.front())); + auto first_file = files.GetFirstFile(); + auto splits_first_file = StringUtil::Split(first_file, fs.PathSeparator(first_file)); if (splits_first_file.size() < 2) { return false; } - for (auto it = splits_first_file.begin(); it != splits_first_file.end(); it++) { - auto partition = StringUtil::Split(*it, "="); + for (auto &split : splits_first_file) { + auto partition = StringUtil::Split(split, "="); if (partition.size() == 2) { partitions.insert(partition.front()); } @@ -404,7 +435,8 @@ bool MultiFileReaderOptions::AutoDetectHivePartitioningInternal(const vector &files, ClientContext &context) { +void MultiFileReaderOptions::AutoDetectHiveTypesInternal(MultiFileList &files, ClientContext &context) { const LogicalType candidates[] = {LogicalType::DATE, LogicalType::TIMESTAMP, LogicalType::BIGINT}; auto &fs = FileSystem::GetFileSystem(context); unordered_map detected_types; - for (auto &file : files) { + for (const auto &file : files.Files()) { unordered_map partitions; auto splits = StringUtil::Split(file, fs.PathSeparator(file)); if (splits.size() < 2) { @@ -475,8 +507,8 @@ void MultiFileReaderOptions::AutoDetectHiveTypesInternal(const vector &f hive_types_schema.insert(make_pair(entry.first, std::move(entry.second))); } } -void MultiFileReaderOptions::AutoDetectHivePartitioning(const vector &files, ClientContext &context) { - D_ASSERT(!files.empty()); +void MultiFileReaderOptions::AutoDetectHivePartitioning(MultiFileList &files, ClientContext &context) { + D_ASSERT(files.GetExpandResult() != FileExpandResult::NO_FILES); const bool hp_explicitly_disabled = !auto_detect_hive_partitioning && !hive_partitioning; const bool ht_enabled = !hive_types_schema.empty(); if (hp_explicitly_disabled && ht_enabled) { diff --git a/src/duckdb/src/common/operator/cast_operators.cpp b/src/duckdb/src/common/operator/cast_operators.cpp index c63adefc..4d69aaf1 100644 --- a/src/duckdb/src/common/operator/cast_operators.cpp +++ b/src/duckdb/src/common/operator/cast_operators.cpp @@ -1142,7 +1142,7 @@ timestamp_t CastTimestampUsToMs::Operation(timestamp_t input) { if (!Timestamp::IsFinite(input)) { return input; } - timestamp_t cast_timestamp(Timestamp::GetEpochMs(input)); + timestamp_t cast_timestamp(Timestamp::GetEpochRounded(input, Interval::MICROS_PER_MSEC)); return cast_timestamp; } @@ -1160,7 +1160,7 @@ timestamp_t CastTimestampUsToSec::Operation(timestamp_t input) { if (!Timestamp::IsFinite(input)) { return input; } - timestamp_t cast_timestamp(Timestamp::GetEpochSeconds(input)); + timestamp_t cast_timestamp(Timestamp::GetEpochRounded(input, Interval::MICROS_PER_SEC)); return cast_timestamp; } @@ -1279,10 +1279,7 @@ bool TryCastToTimestampMS::Operation(string_t input, timestamp_t &result, bool s if (!TryCast::Operation(input, result, strict)) { return false; } - if (!Timestamp::IsFinite(result)) { - return true; - } - result = Timestamp::GetEpochMs(result); + result = CastTimestampUsToMs::Operation(result); return true; } @@ -1291,10 +1288,7 @@ bool TryCastToTimestampSec::Operation(string_t input, timestamp_t &result, bool if (!TryCast::Operation(input, result, strict)) { return false; } - if (!Timestamp::IsFinite(result)) { - return true; - } - result = Timestamp::GetEpochSeconds(result); + result = CastTimestampUsToSec::Operation(result); return true; } @@ -1588,17 +1582,18 @@ bool TryCastErrorMessage::Operation(string_t input, interval_t &result, CastPara // when that value is full, we perform a HUGEINT multiplication to flush it into the hugeint // this takes the number of HUGEINT multiplications down from [0-38] to [0-2] -template +template struct HugeIntCastData { using ResultType = T; + using IntermediateType = INTERMEDIATE_T; using Operation = OP; ResultType result; - int64_t intermediate; + IntermediateType intermediate; uint8_t digits; ResultType decimal; uint16_t decimal_total_digits; - int64_t decimal_intermediate; + ResultType decimal_intermediate; uint16_t decimal_intermediate_digits; bool Flush() { @@ -1647,7 +1642,8 @@ struct HugeIntegerCastOperation { template static bool HandleDigit(T &state, uint8_t digit) { if (NEGATIVE) { - if (DUCKDB_UNLIKELY(state.intermediate < (NumericLimits::Minimum() + digit) / 10)) { + if (DUCKDB_UNLIKELY(state.intermediate < + (NumericLimits::Minimum() + digit) / 10)) { // intermediate is full: need to flush it if (!state.Flush()) { return false; @@ -1655,7 +1651,8 @@ struct HugeIntegerCastOperation { } state.intermediate = state.intermediate * 10 - digit; } else { - if (DUCKDB_UNLIKELY(state.intermediate > (NumericLimits::Maximum() - digit) / 10)) { + if (DUCKDB_UNLIKELY(state.intermediate > + (NumericLimits::Maximum() - digit) / 10)) { if (!state.Flush()) { return false; } @@ -1694,10 +1691,14 @@ struct HugeIntegerCastOperation { if (e < 0) { state.result = T::Operation::DivMod(state.result, T::Operation::POWERS_OF_TEN[-e], remainder); if (remainder < 0) { - remainder *= -1; + result_t negate_result; + if (!T::Operation::TryNegate(remainder, negate_result)) { + return false; + } + remainder = negate_result; } state.decimal = remainder; - state.decimal_total_digits = UnsafeNumericCast(-e); + state.decimal_total_digits = static_cast(-e); state.decimal_intermediate = 0; state.decimal_intermediate_digits = 0; return Finalize(state); @@ -1785,8 +1786,8 @@ struct HugeIntegerCastOperation { template <> bool TryCast::Operation(string_t input, hugeint_t &result, bool strict) { - HugeIntCastData state {}; - if (!TryIntegerCast, true, true, HugeIntegerCastOperation>( + HugeIntCastData state {}; + if (!TryIntegerCast, true, true, HugeIntegerCastOperation>( input.GetData(), input.GetSize(), state, strict)) { return false; } @@ -1796,8 +1797,8 @@ bool TryCast::Operation(string_t input, hugeint_t &result, bool strict) { template <> bool TryCast::Operation(string_t input, uhugeint_t &result, bool strict) { - HugeIntCastData state {}; - if (!TryIntegerCast, false, true, HugeIntegerCastOperation>( + HugeIntCastData state {}; + if (!TryIntegerCast, false, true, HugeIntegerCastOperation>( input.GetData(), input.GetSize(), state, strict)) { return false; } @@ -1809,205 +1810,6 @@ bool TryCast::Operation(string_t input, uhugeint_t &result, bool strict) { // Decimal String Cast //===--------------------------------------------------------------------===// -template -struct DecimalCastData { - using StoreType = T; - StoreType result; - uint8_t width; - uint8_t scale; - uint8_t digit_count; - uint8_t decimal_count; - //! Whether we have determined if the result should be rounded - bool round_set; - //! If the result should be rounded - bool should_round; - //! Only set when ALLOW_EXPONENT is enabled - enum class ExponentType : uint8_t { NONE, POSITIVE, NEGATIVE }; - uint8_t excessive_decimals; - ExponentType exponent_type; -}; - -struct DecimalCastOperation { - template - static bool HandleDigit(T &state, uint8_t digit) { - if (state.result == 0 && digit == 0) { - // leading zero's don't count towards the digit count - return true; - } - if (state.digit_count == state.width - state.scale) { - // width of decimal type is exceeded! - return false; - } - state.digit_count++; - if (NEGATIVE) { - if (state.result < (NumericLimits::Minimum() / 10)) { - return false; - } - state.result = state.result * 10 - digit; - } else { - if (state.result > (NumericLimits::Maximum() / 10)) { - return false; - } - state.result = state.result * 10 + digit; - } - return true; - } - - template - static bool HandleHexDigit(T &state, uint8_t digit) { - return false; - } - - template - static bool HandleBinaryDigit(T &state, uint8_t digit) { - return false; - } - - template - static void RoundUpResult(T &state) { - if (NEGATIVE) { - state.result -= 1; - } else { - state.result += 1; - } - } - - template - static bool HandleExponent(T &state, int32_t exponent) { - auto decimal_excess = (state.decimal_count > state.scale) ? state.decimal_count - state.scale : 0; - if (exponent > 0) { - state.exponent_type = T::ExponentType::POSITIVE; - // Positive exponents need up to 'exponent' amount of digits - // Everything beyond that amount needs to be truncated - if (decimal_excess > exponent) { - // We've allowed too many decimals - state.excessive_decimals = UnsafeNumericCast(decimal_excess - exponent); - exponent = 0; - } else { - exponent -= decimal_excess; - } - D_ASSERT(exponent >= 0); - } else if (exponent < 0) { - state.exponent_type = T::ExponentType::NEGATIVE; - } - if (!Finalize(state)) { - return false; - } - if (exponent < 0) { - bool round_up = false; - for (idx_t i = 0; i < idx_t(-int64_t(exponent)); i++) { - auto mod = state.result % 10; - round_up = NEGATIVE ? mod <= -5 : mod >= 5; - state.result /= 10; - if (state.result == 0) { - break; - } - } - if (round_up) { - RoundUpResult(state); - } - return true; - } else { - // positive exponent: append 0's - for (idx_t i = 0; i < idx_t(exponent); i++) { - if (!HandleDigit(state, 0)) { - return false; - } - } - return true; - } - } - - template - static bool HandleDecimal(T &state, uint8_t digit) { - if (state.decimal_count == state.scale && !state.round_set) { - // Determine whether the last registered decimal should be rounded or not - state.round_set = true; - state.should_round = digit >= 5; - } - if (!ALLOW_EXPONENT && state.decimal_count == state.scale) { - // we exceeded the amount of supported decimals - // however, we don't throw an error here - // we just truncate the decimal - return true; - } - //! If we expect an exponent, we need to preserve the decimals - //! But we don't want to overflow, so we prevent overflowing the result with this check - if (state.digit_count + state.decimal_count >= DecimalWidth::max) { - return true; - } - state.decimal_count++; - if (NEGATIVE) { - state.result = state.result * 10 - digit; - } else { - state.result = state.result * 10 + digit; - } - return true; - } - - template - static bool TruncateExcessiveDecimals(T &state) { - D_ASSERT(state.excessive_decimals); - bool round_up = false; - for (idx_t i = 0; i < state.excessive_decimals; i++) { - auto mod = state.result % 10; - round_up = NEGATIVE ? mod <= -5 : mod >= 5; - state.result /= 10.0; - } - //! Only round up when exponents are involved - if (state.exponent_type == T::ExponentType::POSITIVE && round_up) { - RoundUpResult(state); - } - D_ASSERT(state.decimal_count > state.scale); - state.decimal_count = state.scale; - return true; - } - - template - static bool Finalize(T &state) { - if (state.exponent_type != T::ExponentType::POSITIVE && state.decimal_count > state.scale) { - //! Did not encounter an exponent, but ALLOW_EXPONENT was on - state.excessive_decimals = state.decimal_count - state.scale; - } - if (state.excessive_decimals && !TruncateExcessiveDecimals(state)) { - return false; - } - if (state.exponent_type == T::ExponentType::NONE && state.round_set && state.should_round) { - RoundUpResult(state); - } - // if we have not gotten exactly "scale" decimals, we need to multiply the result - // e.g. if we have a string "1.0" that is cast to a DECIMAL(9,3), the value needs to be 1000 - // but we have only gotten the value "10" so far, so we multiply by 1000 - for (uint8_t i = state.decimal_count; i < state.scale; i++) { - state.result *= 10; - } - return true; - } -}; - -template -bool TryDecimalStringCast(string_t input, T &result, CastParameters ¶meters, uint8_t width, uint8_t scale) { - DecimalCastData state; - state.result = 0; - state.width = width; - state.scale = scale; - state.digit_count = 0; - state.decimal_count = 0; - state.excessive_decimals = 0; - state.exponent_type = DecimalCastData::ExponentType::NONE; - state.round_set = false; - state.should_round = false; - if (!TryIntegerCast, true, true, DecimalCastOperation, false, decimal_separator>( - input.GetData(), input.GetSize(), state, false)) { - string error = StringUtil::Format("Could not convert string \"%s\" to DECIMAL(%d,%d)", input.GetString(), - (int)width, (int)scale); - HandleCastError::AssignError(error, parameters); - return false; - } - result = state.result; - return true; -} - template <> bool TryCastToDecimal::Operation(string_t input, int16_t &result, CastParameters ¶meters, uint8_t width, uint8_t scale) { @@ -2058,22 +1860,22 @@ bool TryCastToDecimalCommaSeparated::Operation(string_t input, hugeint_t &result template <> string_t StringCastFromDecimal::Operation(int16_t input, uint8_t width, uint8_t scale, Vector &result) { - return DecimalToString::Format(input, width, scale, result); + return DecimalToString::Format(input, width, scale, result); } template <> string_t StringCastFromDecimal::Operation(int32_t input, uint8_t width, uint8_t scale, Vector &result) { - return DecimalToString::Format(input, width, scale, result); + return DecimalToString::Format(input, width, scale, result); } template <> string_t StringCastFromDecimal::Operation(int64_t input, uint8_t width, uint8_t scale, Vector &result) { - return DecimalToString::Format(input, width, scale, result); + return DecimalToString::Format(input, width, scale, result); } template <> string_t StringCastFromDecimal::Operation(hugeint_t input, uint8_t width, uint8_t scale, Vector &result) { - return HugeintToStringCast::FormatDecimal(input, width, scale, result); + return DecimalToString::Format(input, width, scale, result); } //===--------------------------------------------------------------------===// @@ -2481,7 +2283,7 @@ bool DoubleToDecimalCast(SRC input, DST &result, CastParameters ¶meters, uin HandleCastError::AssignError(error, parameters); return false; } - result = Cast::Operation(value); + result = Cast::Operation(static_cast(value)); return true; } diff --git a/src/duckdb/src/common/operator/string_cast.cpp b/src/duckdb/src/common/operator/string_cast.cpp index 2da6949a..0e0665a9 100644 --- a/src/duckdb/src/common/operator/string_cast.cpp +++ b/src/duckdb/src/common/operator/string_cast.cpp @@ -24,37 +24,41 @@ string_t StringCast::Operation(bool input, Vector &vector) { template <> string_t StringCast::Operation(int8_t input, Vector &vector) { - return NumericHelper::FormatSigned(input, vector); + return NumericHelper::FormatSigned(input, vector); } template <> string_t StringCast::Operation(int16_t input, Vector &vector) { - return NumericHelper::FormatSigned(input, vector); + return NumericHelper::FormatSigned(input, vector); } template <> string_t StringCast::Operation(int32_t input, Vector &vector) { - return NumericHelper::FormatSigned(input, vector); + return NumericHelper::FormatSigned(input, vector); } template <> string_t StringCast::Operation(int64_t input, Vector &vector) { - return NumericHelper::FormatSigned(input, vector); + return NumericHelper::FormatSigned(input, vector); } template <> duckdb::string_t StringCast::Operation(uint8_t input, Vector &vector) { - return NumericHelper::FormatSigned(input, vector); + return NumericHelper::FormatSigned(input, vector); } template <> duckdb::string_t StringCast::Operation(uint16_t input, Vector &vector) { - return NumericHelper::FormatSigned(input, vector); + return NumericHelper::FormatSigned(input, vector); } template <> duckdb::string_t StringCast::Operation(uint32_t input, Vector &vector) { - return NumericHelper::FormatSigned(input, vector); + return NumericHelper::FormatSigned(input, vector); } template <> duckdb::string_t StringCast::Operation(uint64_t input, Vector &vector) { - return NumericHelper::FormatSigned(input, vector); + return NumericHelper::FormatSigned(input, vector); +} +template <> +duckdb::string_t StringCast::Operation(hugeint_t input, Vector &vector) { + return NumericHelper::FormatSigned(input, vector); } template <> @@ -76,11 +80,6 @@ string_t StringCast::Operation(interval_t input, Vector &vector) { return StringVector::AddString(vector, buffer, length); } -template <> -duckdb::string_t StringCast::Operation(hugeint_t input, Vector &vector) { - return HugeintToStringCast::FormatSigned(input, vector); -} - template <> duckdb::string_t StringCast::Operation(uhugeint_t input, Vector &vector) { return UhugeintToStringCast::Format(input, vector); @@ -181,7 +180,7 @@ string_t StringCastTZ::Operation(dtime_tz_t input, Vector &vector) { auto ss = std::abs(offset); const auto hh = ss / Interval::SECS_PER_HOUR; - const auto hh_length = (hh < 100) ? 2 : NumericHelper::UnsignedLength(uint32_t(hh)); + const auto hh_length = UnsafeNumericCast((hh < 100) ? 2 : NumericHelper::UnsignedLength(uint32_t(hh))); length += hh_length; ss %= Interval::SECS_PER_HOUR; diff --git a/src/duckdb/src/common/pipe_file_system.cpp b/src/duckdb/src/common/pipe_file_system.cpp index 39a1877d..d6eb2c6a 100644 --- a/src/duckdb/src/common/pipe_file_system.cpp +++ b/src/duckdb/src/common/pipe_file_system.cpp @@ -2,6 +2,7 @@ #include "duckdb/common/exception.hpp" #include "duckdb/common/file_system.hpp" #include "duckdb/common/helper.hpp" +#include "duckdb/common/numeric_utils.hpp" namespace duckdb { class PipeFile : public FileHandle { @@ -22,10 +23,10 @@ class PipeFile : public FileHandle { }; int64_t PipeFile::ReadChunk(void *buffer, int64_t nr_bytes) { - return child_handle->Read(buffer, nr_bytes); + return child_handle->Read(buffer, UnsafeNumericCast(nr_bytes)); } int64_t PipeFile::WriteChunk(void *buffer, int64_t nr_bytes) { - return child_handle->Write(buffer, nr_bytes); + return child_handle->Write(buffer, UnsafeNumericCast(nr_bytes)); } void PipeFileSystem::Reset(FileHandle &handle) { diff --git a/src/duckdb/src/common/progress_bar/progress_bar.cpp b/src/duckdb/src/common/progress_bar/progress_bar.cpp index 9c6a75fb..720f5499 100644 --- a/src/duckdb/src/common/progress_bar/progress_bar.cpp +++ b/src/duckdb/src/common/progress_bar/progress_bar.cpp @@ -121,7 +121,7 @@ void ProgressBar::Update(bool final) { if (final) { FinishProgressBarPrint(); } else { - PrintProgress(query_progress.percentage); + PrintProgress(NumericCast(query_progress.percentage.load())); } #endif } diff --git a/src/duckdb/src/common/random_engine.cpp b/src/duckdb/src/common/random_engine.cpp index 0c9aec4e..acbda8b3 100644 --- a/src/duckdb/src/common/random_engine.cpp +++ b/src/duckdb/src/common/random_engine.cpp @@ -1,4 +1,5 @@ #include "duckdb/common/random_engine.hpp" +#include "duckdb/common/numeric_utils.hpp" #include "pcg_random.hpp" #include @@ -15,7 +16,7 @@ RandomEngine::RandomEngine(int64_t seed) : random_state(make_uniq() if (seed < 0) { random_state->pcg.seed(pcg_extras::seed_seq_from()); } else { - random_state->pcg.seed(seed); + random_state->pcg.seed(NumericCast(seed)); } } diff --git a/src/duckdb/src/common/re2_regex.cpp b/src/duckdb/src/common/re2_regex.cpp index f22b681a..0b981062 100644 --- a/src/duckdb/src/common/re2_regex.cpp +++ b/src/duckdb/src/common/re2_regex.cpp @@ -10,17 +10,18 @@ namespace duckdb_re2 { Regex::Regex(const std::string &pattern, RegexOptions options) { RE2::Options o; o.set_case_sensitive(options == RegexOptions::CASE_INSENSITIVE); - regex = std::make_shared(StringPiece(pattern), o); + regex = duckdb::make_shared_ptr(StringPiece(pattern), o); } bool RegexSearchInternal(const char *input, Match &match, const Regex &r, RE2::Anchor anchor, size_t start, size_t end) { auto ®ex = r.GetRegex(); duckdb::vector target_groups; - auto group_count = regex.NumberOfCapturingGroups() + 1; + auto group_count = duckdb::UnsafeNumericCast(regex.NumberOfCapturingGroups() + 1); target_groups.resize(group_count); match.groups.clear(); - if (!regex.Match(StringPiece(input), start, end, anchor, target_groups.data(), group_count)) { + if (!regex.Match(StringPiece(input), start, end, anchor, target_groups.data(), + duckdb::UnsafeNumericCast(group_count))) { return false; } for (auto &group : target_groups) { @@ -41,7 +42,8 @@ bool RegexMatch(const std::string &input, Match &match, const Regex ®ex) { } bool RegexMatch(const char *start, const char *end, Match &match, const Regex ®ex) { - return RegexSearchInternal(start, match, regex, RE2::ANCHOR_BOTH, 0, end - start); + return RegexSearchInternal(start, match, regex, RE2::ANCHOR_BOTH, 0, + duckdb::UnsafeNumericCast(end - start)); } bool RegexMatch(const std::string &input, const Regex ®ex) { diff --git a/src/duckdb/src/common/row_operations/row_aggregate.cpp b/src/duckdb/src/common/row_operations/row_aggregate.cpp index f6e9e6cb..0ea80035 100644 --- a/src/duckdb/src/common/row_operations/row_aggregate.cpp +++ b/src/duckdb/src/common/row_operations/row_aggregate.cpp @@ -36,14 +36,14 @@ void RowOperations::DestroyStates(RowOperationsState &state, TupleDataLayout &la return; } // Move to the first aggregate state - VectorOperations::AddInPlace(addresses, layout.GetAggrOffset(), count); + VectorOperations::AddInPlace(addresses, UnsafeNumericCast(layout.GetAggrOffset()), count); for (const auto &aggr : layout.GetAggregates()) { if (aggr.function.destructor) { AggregateInputData aggr_input_data(aggr.GetFunctionData(), state.allocator); aggr.function.destructor(addresses, aggr_input_data, count); } // Move to the next aggregate state - VectorOperations::AddInPlace(addresses, aggr.payload_size, count); + VectorOperations::AddInPlace(addresses, UnsafeNumericCast(aggr.payload_size), count); } } @@ -74,8 +74,8 @@ void RowOperations::CombineStates(RowOperationsState &state, TupleDataLayout &la } // Move to the first aggregate states - VectorOperations::AddInPlace(sources, layout.GetAggrOffset(), count); - VectorOperations::AddInPlace(targets, layout.GetAggrOffset(), count); + VectorOperations::AddInPlace(sources, UnsafeNumericCast(layout.GetAggrOffset()), count); + VectorOperations::AddInPlace(targets, UnsafeNumericCast(layout.GetAggrOffset()), count); // Keep track of the offset idx_t offset = layout.GetAggrOffset(); @@ -87,16 +87,16 @@ void RowOperations::CombineStates(RowOperationsState &state, TupleDataLayout &la aggr.function.combine(sources, targets, aggr_input_data, count); // Move to the next aggregate states - VectorOperations::AddInPlace(sources, aggr.payload_size, count); - VectorOperations::AddInPlace(targets, aggr.payload_size, count); + VectorOperations::AddInPlace(sources, UnsafeNumericCast(aggr.payload_size), count); + VectorOperations::AddInPlace(targets, UnsafeNumericCast(aggr.payload_size), count); // Increment the offset offset += aggr.payload_size; } // Now subtract the offset to get back to the original position - VectorOperations::AddInPlace(sources, -offset, count); - VectorOperations::AddInPlace(targets, -offset, count); + VectorOperations::AddInPlace(sources, -UnsafeNumericCast(offset), count); + VectorOperations::AddInPlace(targets, -UnsafeNumericCast(offset), count); } void RowOperations::FinalizeStates(RowOperationsState &state, TupleDataLayout &layout, Vector &addresses, @@ -106,7 +106,7 @@ void RowOperations::FinalizeStates(RowOperationsState &state, TupleDataLayout &l VectorOperations::Copy(addresses, addresses_copy, result.size(), 0, 0); // Move to the first aggregate state - VectorOperations::AddInPlace(addresses_copy, layout.GetAggrOffset(), result.size()); + VectorOperations::AddInPlace(addresses_copy, UnsafeNumericCast(layout.GetAggrOffset()), result.size()); auto &aggregates = layout.GetAggregates(); for (idx_t i = 0; i < aggregates.size(); i++) { @@ -116,7 +116,7 @@ void RowOperations::FinalizeStates(RowOperationsState &state, TupleDataLayout &l aggr.function.finalize(addresses_copy, aggr_input_data, target, result.size(), 0); // Move to the next aggregate state - VectorOperations::AddInPlace(addresses_copy, aggr.payload_size, result.size()); + VectorOperations::AddInPlace(addresses_copy, UnsafeNumericCast(aggr.payload_size), result.size()); } } diff --git a/src/duckdb/src/common/row_operations/row_external.cpp b/src/duckdb/src/common/row_operations/row_external.cpp index 9e2fa071..5aef76a0 100644 --- a/src/duckdb/src/common/row_operations/row_external.cpp +++ b/src/duckdb/src/common/row_operations/row_external.cpp @@ -37,7 +37,8 @@ void RowOperations::SwizzleColumns(const RowLayout &layout, const data_ptr_t bas for (idx_t i = 0; i < next; i++) { if (Load(col_ptr) > string_t::INLINE_LENGTH) { // Overwrite the string pointer with the within-row offset (if not inlined) - Store(Load(string_ptr) - heap_row_ptrs[i], string_ptr); + Store(UnsafeNumericCast(Load(string_ptr) - heap_row_ptrs[i]), + string_ptr); } col_ptr += row_width; string_ptr += row_width; @@ -46,7 +47,7 @@ void RowOperations::SwizzleColumns(const RowLayout &layout, const data_ptr_t bas // Non-varchar blob columns for (idx_t i = 0; i < next; i++) { // Overwrite the column data pointer with the within-row offset - Store(Load(col_ptr) - heap_row_ptrs[i], col_ptr); + Store(UnsafeNumericCast(Load(col_ptr) - heap_row_ptrs[i]), col_ptr); col_ptr += row_width; } } @@ -79,7 +80,7 @@ void RowOperations::CopyHeapAndSwizzle(const RowLayout &layout, data_ptr_t row_p // Copy and swizzle memcpy(heap_ptr, source_heap_ptr, size); - Store(heap_ptr - heap_base_ptr, row_ptr + heap_offset); + Store(UnsafeNumericCast(heap_ptr - heap_base_ptr), row_ptr + heap_offset); // Increment for next iteration row_ptr += row_width; diff --git a/src/duckdb/src/common/row_operations/row_heap_gather.cpp b/src/duckdb/src/common/row_operations/row_heap_gather.cpp index dbcfea6c..fa433c64 100644 --- a/src/duckdb/src/common/row_operations/row_heap_gather.cpp +++ b/src/duckdb/src/common/row_operations/row_heap_gather.cpp @@ -153,6 +153,8 @@ static void HeapGatherArrayVector(Vector &v, const idx_t vcount, const Selection data_ptr_t array_validitymask_location = key_locations[i]; key_locations[i] += array_validitymask_size; + NestedValidity parent_validity(array_validitymask_location); + // The size of each variable size entry is stored after the validity mask // (if the child type is variable size) data_ptr_t var_entry_size_ptr = nullptr; @@ -164,8 +166,8 @@ static void HeapGatherArrayVector(Vector &v, const idx_t vcount, const Selection // row idx const auto row_idx = sel.get_index(i); - auto array_start = row_idx * array_size; - auto elem_remaining = array_size; + idx_t array_start = row_idx * array_size; + idx_t elem_remaining = array_size; while (elem_remaining > 0) { auto chunk_size = MinValue(static_cast(STANDARD_VECTOR_SIZE), elem_remaining); @@ -190,11 +192,11 @@ static void HeapGatherArrayVector(Vector &v, const idx_t vcount, const Selection } // Pass on this array's validity mask to the child vector - NestedValidity parent_validity(array_validitymask_location); RowOperations::HeapGather(child_vector, chunk_size, array_sel, array_entry_locations, &parent_validity); elem_remaining -= chunk_size; array_start += chunk_size; + parent_validity.OffsetListBy(chunk_size); } } } diff --git a/src/duckdb/src/common/row_operations/row_heap_scatter.cpp b/src/duckdb/src/common/row_operations/row_heap_scatter.cpp index 3c7f9d41..01cf7b58 100644 --- a/src/duckdb/src/common/row_operations/row_heap_scatter.cpp +++ b/src/duckdb/src/common/row_operations/row_heap_scatter.cpp @@ -8,18 +8,22 @@ namespace duckdb { using ValidityBytes = TemplatedValidityMask; NestedValidity::NestedValidity(data_ptr_t validitymask_location) - : list_validity_location(validitymask_location), struct_validity_locations(nullptr), entry_idx(0), idx_in_entry(0) { + : list_validity_location(validitymask_location), struct_validity_locations(nullptr), entry_idx(0), idx_in_entry(0), + list_validity_offset(0) { } NestedValidity::NestedValidity(data_ptr_t *validitymask_locations, idx_t child_vector_index) - : list_validity_location(nullptr), struct_validity_locations(validitymask_locations), entry_idx(0), - idx_in_entry(0) { + : list_validity_location(nullptr), struct_validity_locations(validitymask_locations), entry_idx(0), idx_in_entry(0), + list_validity_offset(0) { ValidityBytes::GetEntryIndex(child_vector_index, entry_idx, idx_in_entry); } void NestedValidity::SetInvalid(idx_t idx) { if (list_validity_location) { // Is List + + idx = idx + list_validity_offset; + idx_t list_entry_idx; idx_t list_idx_in_entry; ValidityBytes::GetEntryIndex(idx, list_entry_idx, list_idx_in_entry); @@ -32,9 +36,16 @@ void NestedValidity::SetInvalid(idx_t idx) { } } +void NestedValidity::OffsetListBy(idx_t offset) { + list_validity_offset += offset; +} + bool NestedValidity::IsValid(idx_t idx) { if (list_validity_location) { // Is List + + idx = idx + list_validity_offset; + idx_t list_entry_idx; idx_t list_idx_in_entry; ValidityBytes::GetEntryIndex(idx, list_entry_idx, list_idx_in_entry); @@ -437,6 +448,8 @@ static void HeapScatterArrayVector(Vector &v, idx_t vcount, const SelectionVecto memset(array_validitymask_location, -1, array_validitymask_size); key_locations[i] += array_validitymask_size; + NestedValidity array_parent_validity(array_validitymask_location); + // If the array contains variable size entries, we reserve spaces for them here data_ptr_t var_entry_size_ptr = nullptr; if (child_type_is_var_size) { @@ -474,7 +487,6 @@ static void HeapScatterArrayVector(Vector &v, idx_t vcount, const SelectionVecto } } - NestedValidity array_parent_validity(array_validitymask_location); RowOperations::HeapScatter(child_vector, ArrayVector::GetTotalSize(v), *FlatVector::IncrementalSelectionVector(), chunk_size, array_entry_locations, &array_parent_validity, array_start); @@ -482,6 +494,7 @@ static void HeapScatterArrayVector(Vector &v, idx_t vcount, const SelectionVecto // update for next iteration elem_remaining -= chunk_size; array_start += chunk_size; + array_parent_validity.OffsetListBy(chunk_size); } } } diff --git a/src/duckdb/src/common/row_operations/row_radix_scatter.cpp b/src/duckdb/src/common/row_operations/row_radix_scatter.cpp index 01557ca4..73242d13 100644 --- a/src/duckdb/src/common/row_operations/row_radix_scatter.cpp +++ b/src/duckdb/src/common/row_operations/row_radix_scatter.cpp @@ -125,7 +125,7 @@ void RadixScatterListVector(Vector &v, UnifiedVectorFormat &vdata, const Selecti key_locations[i][0] = 1; key_locations[i]++; RowOperations::RadixScatter(child_vector, list_size, *FlatVector::IncrementalSelectionVector(), 1, - key_locations + i, false, true, false, prefix_len, width - 1, + key_locations + i, false, true, false, prefix_len, width - 2, list_entry.offset); } else { // denote that the list is empty with a 0 diff --git a/src/duckdb/src/common/serializer/buffered_file_reader.cpp b/src/duckdb/src/common/serializer/buffered_file_reader.cpp index 762e1ca8..a6ed87e9 100644 --- a/src/duckdb/src/common/serializer/buffered_file_reader.cpp +++ b/src/duckdb/src/common/serializer/buffered_file_reader.cpp @@ -11,20 +11,20 @@ BufferedFileReader::BufferedFileReader(FileSystem &fs, const char *path, FileLoc optional_ptr opener) : fs(fs), data(make_unsafe_uniq_array(FILE_BUFFER_SIZE)), offset(0), read_data(0), total_read(0) { handle = fs.OpenFile(path, FileFlags::FILE_FLAGS_READ | lock_type, opener.get()); - file_size = fs.GetFileSize(*handle); + file_size = NumericCast(fs.GetFileSize(*handle)); } BufferedFileReader::BufferedFileReader(FileSystem &fs, unique_ptr handle_p) : fs(fs), data(make_unsafe_uniq_array(FILE_BUFFER_SIZE)), offset(0), read_data(0), handle(std::move(handle_p)), total_read(0) { - file_size = fs.GetFileSize(*handle); + file_size = NumericCast(fs.GetFileSize(*handle)); } void BufferedFileReader::ReadData(data_ptr_t target_buffer, uint64_t read_size) { // first copy anything we can from the buffer data_ptr_t end_ptr = target_buffer + read_size; while (true) { - idx_t to_read = MinValue(end_ptr - target_buffer, read_data - offset); + idx_t to_read = MinValue(UnsafeNumericCast(end_ptr - target_buffer), read_data - offset); if (to_read > 0) { memcpy(target_buffer, data.get() + offset, to_read); offset += to_read; @@ -36,7 +36,7 @@ void BufferedFileReader::ReadData(data_ptr_t target_buffer, uint64_t read_size) // did not finish reading yet but exhausted buffer // read data into buffer offset = 0; - read_data = fs.Read(*handle, data.get(), FILE_BUFFER_SIZE); + read_data = UnsafeNumericCast(fs.Read(*handle, data.get(), FILE_BUFFER_SIZE)); if (read_data == 0) { throw SerializationException("not enough data in file to deserialize result"); } diff --git a/src/duckdb/src/common/serializer/buffered_file_writer.cpp b/src/duckdb/src/common/serializer/buffered_file_writer.cpp index dcbe7d4f..be4f51fc 100644 --- a/src/duckdb/src/common/serializer/buffered_file_writer.cpp +++ b/src/duckdb/src/common/serializer/buffered_file_writer.cpp @@ -15,7 +15,7 @@ BufferedFileWriter::BufferedFileWriter(FileSystem &fs, const string &path_p, Fil } int64_t BufferedFileWriter::GetFileSize() { - return fs.GetFileSize(*handle) + offset; + return fs.GetFileSize(*handle) + NumericCast(offset); } idx_t BufferedFileWriter::GetTotalWritten() { @@ -37,13 +37,14 @@ void BufferedFileWriter::WriteData(const_data_ptr_t buffer, idx_t write_size) { Flush(); // Flush buffer before writing every things else } idx_t remaining_to_write = write_size - to_copy; - fs.Write(*handle, const_cast(buffer + to_copy), remaining_to_write); // NOLINT: wrong API in Write + fs.Write(*handle, const_cast(buffer + to_copy), // NOLINT: wrong API in Write + UnsafeNumericCast(remaining_to_write)); total_written += remaining_to_write; } else { // first copy anything we can from the buffer const_data_ptr_t end_ptr = buffer + write_size; while (buffer < end_ptr) { - idx_t to_write = MinValue((end_ptr - buffer), FILE_BUFFER_SIZE - offset); + idx_t to_write = MinValue(UnsafeNumericCast((end_ptr - buffer)), FILE_BUFFER_SIZE - offset); D_ASSERT(to_write > 0); memcpy(data.get() + offset, buffer, to_write); offset += to_write; @@ -59,7 +60,7 @@ void BufferedFileWriter::Flush() { if (offset == 0) { return; } - fs.Write(*handle, data.get(), offset); + fs.Write(*handle, data.get(), UnsafeNumericCast(offset)); total_written += offset; offset = 0; } @@ -70,11 +71,11 @@ void BufferedFileWriter::Sync() { } void BufferedFileWriter::Truncate(int64_t size) { - uint64_t persistent = fs.GetFileSize(*handle); - D_ASSERT((uint64_t)size <= persistent + offset); - if (persistent <= (uint64_t)size) { + auto persistent = fs.GetFileSize(*handle); + D_ASSERT(size <= persistent + NumericCast(offset)); + if (persistent <= size) { // truncating into the pending write buffer. - offset = size - persistent; + offset = NumericCast(size - persistent); } else { // truncate the physical file on disk handle->Truncate(size); diff --git a/src/duckdb/src/common/serializer/memory_stream.cpp b/src/duckdb/src/common/serializer/memory_stream.cpp index 6064ebe1..1fd0ff81 100644 --- a/src/duckdb/src/common/serializer/memory_stream.cpp +++ b/src/duckdb/src/common/serializer/memory_stream.cpp @@ -2,8 +2,12 @@ namespace duckdb { -MemoryStream::MemoryStream(idx_t capacity) - : position(0), capacity(capacity), owns_data(true), data(static_cast(malloc(capacity))) { +MemoryStream::MemoryStream(idx_t capacity) : position(0), capacity(capacity), owns_data(true) { + auto data_malloc_result = malloc(capacity); + if (!data_malloc_result) { + throw std::bad_alloc(); + } + data = static_cast(data_malloc_result); } MemoryStream::MemoryStream(data_ptr_t buffer, idx_t capacity) @@ -25,7 +29,6 @@ void MemoryStream::WriteData(const_data_ptr_t source, idx_t write_size) { throw SerializationException("Failed to serialize: not enough space in buffer to fulfill write request"); } } - memcpy(data + position, source, write_size); position += write_size; } diff --git a/src/duckdb/src/common/serializer/serializer.cpp b/src/duckdb/src/common/serializer/serializer.cpp index e7446120..91a7f477 100644 --- a/src/duckdb/src/common/serializer/serializer.cpp +++ b/src/duckdb/src/common/serializer/serializer.cpp @@ -17,7 +17,7 @@ template <> void Serializer::WritePropertyWithDefault(const field_id_t field_id, const char *tag, const Value &value, const Value &&default_value) { // If current value is default, don't write it - if (!serialize_default_values && ValueOperations::NotDistinctFrom(value, default_value)) { + if (!options.serialize_default_values && ValueOperations::NotDistinctFrom(value, default_value)) { OnOptionalPropertyBegin(field_id, tag, false); OnOptionalPropertyEnd(false); return; diff --git a/src/duckdb/src/common/sort/comparators.cpp b/src/duckdb/src/common/sort/comparators.cpp index 7084a3f9..82e8069d 100644 --- a/src/duckdb/src/common/sort/comparators.cpp +++ b/src/duckdb/src/common/sort/comparators.cpp @@ -501,7 +501,7 @@ void Comparators::SwizzleSingleValue(data_ptr_t data_ptr, const data_ptr_t &heap if (type.InternalType() == PhysicalType::VARCHAR) { data_ptr += string_t::HEADER_SIZE; } - Store(Load(data_ptr) - heap_ptr, data_ptr); + Store(UnsafeNumericCast(Load(data_ptr) - heap_ptr), data_ptr); } } // namespace duckdb diff --git a/src/duckdb/src/common/sort/merge_sorter.cpp b/src/duckdb/src/common/sort/merge_sorter.cpp index 7d2f6a1d..b36887e6 100644 --- a/src/duckdb/src/common/sort/merge_sorter.cpp +++ b/src/duckdb/src/common/sort/merge_sorter.cpp @@ -516,9 +516,9 @@ void MergeSorter::MergeData(SortedData &result_data, SortedData &l_data, SortedD entry_size = l_smaller * Load(l_heap_ptr_copy) + r_smaller * Load(r_heap_ptr_copy); D_ASSERT(entry_size >= sizeof(uint32_t)); - D_ASSERT(l_heap_ptr_copy - l.BaseHeapPtr(l_data) + l_smaller * entry_size <= + D_ASSERT(NumericCast(l_heap_ptr_copy - l.BaseHeapPtr(l_data)) + l_smaller * entry_size <= l_data.heap_blocks[l.block_idx]->byte_offset); - D_ASSERT(r_heap_ptr_copy - r.BaseHeapPtr(r_data) + r_smaller * entry_size <= + D_ASSERT(NumericCast(r_heap_ptr_copy - r.BaseHeapPtr(r_data)) + r_smaller * entry_size <= r_data.heap_blocks[r.block_idx]->byte_offset); l_heap_ptr_copy += l_smaller * entry_size; r_heap_ptr_copy += r_smaller * entry_size; diff --git a/src/duckdb/src/common/sort/partition_state.cpp b/src/duckdb/src/common/sort/partition_state.cpp index c123f275..5346d057 100644 --- a/src/duckdb/src/common/sort/partition_state.cpp +++ b/src/duckdb/src/common/sort/partition_state.cpp @@ -318,7 +318,7 @@ void PartitionLocalSinkState::Sink(DataChunk &input_chunk) { const auto entry_size = payload_layout.GetRowWidth(); const auto capacity = MaxValue(STANDARD_VECTOR_SIZE, (Storage::BLOCK_SIZE / entry_size) + 1); rows = make_uniq(gstate.buffer_manager, capacity, entry_size); - strings = make_uniq(gstate.buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1, true); + strings = make_uniq(gstate.buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1U, true); } const auto row_count = input_chunk.size(); const auto row_sel = FlatVector::IncrementalSelectionVector(); @@ -402,8 +402,8 @@ void PartitionLocalSinkState::Combine() { PartitionGlobalMergeState::PartitionGlobalMergeState(PartitionGlobalSinkState &sink, GroupDataPtr group_data_p, hash_t hash_bin) : sink(sink), group_data(std::move(group_data_p)), memory_per_thread(sink.memory_per_thread), - num_threads(TaskScheduler::GetScheduler(sink.context).NumberOfThreads()), stage(PartitionSortStage::INIT), - total_tasks(0), tasks_assigned(0), tasks_completed(0) { + num_threads(NumericCast(TaskScheduler::GetScheduler(sink.context).NumberOfThreads())), + stage(PartitionSortStage::INIT), total_tasks(0), tasks_assigned(0), tasks_completed(0) { const auto group_idx = sink.hash_groups.size(); auto new_group = make_uniq(sink.buffer_manager, sink.partitions, sink.orders, @@ -424,8 +424,8 @@ PartitionGlobalMergeState::PartitionGlobalMergeState(PartitionGlobalSinkState &s PartitionGlobalMergeState::PartitionGlobalMergeState(PartitionGlobalSinkState &sink) : sink(sink), memory_per_thread(sink.memory_per_thread), - num_threads(TaskScheduler::GetScheduler(sink.context).NumberOfThreads()), stage(PartitionSortStage::INIT), - total_tasks(0), tasks_assigned(0), tasks_completed(0) { + num_threads(NumericCast(TaskScheduler::GetScheduler(sink.context).NumberOfThreads())), + stage(PartitionSortStage::INIT), total_tasks(0), tasks_assigned(0), tasks_completed(0) { const hash_t hash_bin = 0; const size_t group_idx = 0; @@ -661,7 +661,7 @@ void PartitionMergeEvent::Schedule() { // Schedule tasks equal to the number of threads, which will each merge multiple partitions auto &ts = TaskScheduler::GetScheduler(context); - idx_t num_threads = ts.NumberOfThreads(); + auto num_threads = NumericCast(ts.NumberOfThreads()); vector> merge_tasks; for (idx_t tnum = 0; tnum < num_threads; tnum++) { diff --git a/src/duckdb/src/common/sort/radix_sort.cpp b/src/duckdb/src/common/sort/radix_sort.cpp index 9d40f90d..a917631a 100644 --- a/src/duckdb/src/common/sort/radix_sort.cpp +++ b/src/duckdb/src/common/sort/radix_sort.cpp @@ -244,7 +244,7 @@ void RadixSort(BufferManager &buffer_manager, const data_ptr_t &dataptr, const i duckdb_pdqsort::PDQConstants constants(sort_layout.entry_size, col_offset, sorting_size, *end); duckdb_pdqsort::pdqsort_branchless(begin, begin + count, constants); } else if (count <= SortConstants::INSERTION_SORT_THRESHOLD) { - InsertionSort(dataptr, nullptr, count, 0, sort_layout.entry_size, sort_layout.comparison_size, 0, false); + InsertionSort(dataptr, nullptr, count, col_offset, sort_layout.entry_size, sorting_size, 0, false); } else if (sorting_size <= SortConstants::MSD_RADIX_SORT_SIZE_THRESHOLD) { RadixSortLSD(buffer_manager, dataptr, count, col_offset, sort_layout.entry_size, sorting_size); } else { diff --git a/src/duckdb/src/common/sort/sort_state.cpp b/src/duckdb/src/common/sort/sort_state.cpp index 9c859486..27650b46 100644 --- a/src/duckdb/src/common/sort/sort_state.cpp +++ b/src/duckdb/src/common/sort/sort_state.cpp @@ -171,13 +171,13 @@ void LocalSortState::Initialize(GlobalSortState &global_sort_state, BufferManage auto blob_row_width = sort_layout->blob_layout.GetRowWidth(); blob_sorting_data = make_uniq( *buffer_manager, RowDataCollection::EntriesPerBlock(blob_row_width), blob_row_width); - blob_sorting_heap = make_uniq(*buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1, true); + blob_sorting_heap = make_uniq(*buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1U, true); } // Payload data auto payload_row_width = payload_layout->GetRowWidth(); payload_data = make_uniq(*buffer_manager, RowDataCollection::EntriesPerBlock(payload_row_width), payload_row_width); - payload_heap = make_uniq(*buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1, true); + payload_heap = make_uniq(*buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1U, true); // Init done initialized = true; } @@ -323,7 +323,7 @@ void LocalSortState::ReOrder(SortedData &sd, data_ptr_t sorting_ptr, RowDataColl std::accumulate(heap.blocks.begin(), heap.blocks.end(), (idx_t)0, [](idx_t a, const unique_ptr &b) { return a + b->byte_offset; }); idx_t heap_block_size = MaxValue(total_byte_offset, (idx_t)Storage::BLOCK_SIZE); - auto ordered_heap_block = make_uniq(MemoryTag::ORDER_BY, *buffer_manager, heap_block_size, 1); + auto ordered_heap_block = make_uniq(MemoryTag::ORDER_BY, *buffer_manager, heap_block_size, 1U); ordered_heap_block->count = count; ordered_heap_block->byte_offset = total_byte_offset; auto ordered_heap_handle = buffer_manager->Pin(ordered_heap_block->block); diff --git a/src/duckdb/src/common/sort/sorted_block.cpp b/src/duckdb/src/common/sort/sorted_block.cpp index 22127abe..9539302c 100644 --- a/src/duckdb/src/common/sort/sorted_block.cpp +++ b/src/duckdb/src/common/sort/sorted_block.cpp @@ -30,7 +30,7 @@ void SortedData::CreateBlock() { data_blocks.push_back(make_uniq(MemoryTag::ORDER_BY, buffer_manager, capacity, layout.GetRowWidth())); if (!layout.AllConstant() && state.external) { heap_blocks.push_back( - make_uniq(MemoryTag::ORDER_BY, buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1)); + make_uniq(MemoryTag::ORDER_BY, buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1U)); D_ASSERT(data_blocks.size() == heap_blocks.size()); } } @@ -291,10 +291,10 @@ PayloadScanner::PayloadScanner(SortedData &sorted_data, GlobalSortState &global_ auto &layout = sorted_data.layout; // Create collections to put the data into so we can use RowDataCollectionScanner - rows = make_uniq(global_sort_state.buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1); + rows = make_uniq(global_sort_state.buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1U); rows->count = count; - heap = make_uniq(global_sort_state.buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1); + heap = make_uniq(global_sort_state.buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1U); if (!sorted_data.layout.AllConstant()) { heap->count = count; } @@ -330,7 +330,7 @@ PayloadScanner::PayloadScanner(GlobalSortState &global_sort_state, idx_t block_i auto &layout = sorted_data.layout; // Create collections to put the data into so we can use RowDataCollectionScanner - rows = make_uniq(global_sort_state.buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1); + rows = make_uniq(global_sort_state.buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1U); if (flush_p) { rows->blocks.emplace_back(std::move(sorted_data.data_blocks[block_idx])); } else { @@ -338,7 +338,7 @@ PayloadScanner::PayloadScanner(GlobalSortState &global_sort_state, idx_t block_i } rows->count = count; - heap = make_uniq(global_sort_state.buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1); + heap = make_uniq(global_sort_state.buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1U); if (!sorted_data.layout.AllConstant() && sorted_data.swizzled) { if (flush_p) { heap->blocks.emplace_back(std::move(sorted_data.heap_blocks[block_idx])); diff --git a/src/duckdb/src/common/string_util.cpp b/src/duckdb/src/common/string_util.cpp index 7898a343..5cdf95a6 100644 --- a/src/duckdb/src/common/string_util.cpp +++ b/src/duckdb/src/common/string_util.cpp @@ -15,6 +15,10 @@ #include #include +#include "yyjson.hpp" + +using namespace duckdb_yyjson; // NOLINT + namespace duckdb { string StringUtil::GenerateRandomName(idx_t length) { @@ -203,7 +207,8 @@ string StringUtil::Upper(const string &str) { string StringUtil::Lower(const string &str) { string copy(str); - transform(copy.begin(), copy.end(), copy.begin(), [](unsigned char c) { return StringUtil::CharacterToLower(c); }); + transform(copy.begin(), copy.end(), copy.begin(), + [](unsigned char c) { return StringUtil::CharacterToLower(static_cast(c)); }); return (copy); } @@ -215,7 +220,7 @@ bool StringUtil::IsLower(const string &str) { uint64_t StringUtil::CIHash(const string &str) { uint32_t hash = 0; for (auto c : str) { - hash += StringUtil::CharacterToLower(c); + hash += static_cast(StringUtil::CharacterToLower(static_cast(c))); hash += hash << 10; hash ^= hash >> 6; } @@ -255,6 +260,16 @@ bool StringUtil::CILessThan(const string &s1, const string &s2) { return (charmap[u1] - charmap[u2]) < 0; } +idx_t StringUtil::CIFind(vector &vector, const string &search_string) { + for (idx_t i = 0; i < vector.size(); i++) { + const auto &string = vector[i]; + if (CIEquals(string, search_string)) { + return i; + } + } + return DConstants::INVALID_INDEX; +} + vector StringUtil::Split(const string &input, const string &split) { vector splits; @@ -404,181 +419,73 @@ string StringUtil::CandidatesErrorMessage(const vector &strings, const s return StringUtil::CandidatesMessage(closest_strings, message_prefix); } -static void SkipSpaces(const string &message, idx_t &pos) { - for (; pos < message.size() && StringUtil::CharacterIsSpace(message[pos]); pos++) { - } -} - -static bool MatchCharacter(const string &message, idx_t &pos, char c) { - if (pos >= message.size()) { - return false; - } - return message[pos] == c; -} - -static string ParseJSONValue(const string &message, idx_t &pos) { - string result; - if (!MatchCharacter(message, pos, '"')) { - // values need to start with a quote - D_ASSERT(0); - return result; - } - pos++; - for (; pos < message.size(); pos++) { - if (message[pos] == '\\') { - // escape - pos++; - if (pos >= message.size()) { - // escape at end of string!? - D_ASSERT(0); - return result; - } - switch (message[pos]) { - case 'r': - result += '\r'; - break; - case 'n': - result += '\n'; - break; - case 't': - result += '\t'; - break; - case 'b': - result += '\b'; - break; - case 'f': - result += '\f'; - break; - case '0': - result += '\0'; - break; - case '\\': - case '"': - case '/': - result += message[pos]; - break; - default: - // unsupported escape character - // NOTE: we do not support unicode escape sequences here - D_ASSERT(0); - result += message[pos]; - break; - } - } else if (message[pos] == '"') { - // end of message - pos++; - return result; - } else { - result += message[pos]; - } - } - // no end-of-value found - D_ASSERT(0); - return result; -} - unordered_map StringUtil::ParseJSONMap(const string &json) { unordered_map result; if (json.empty()) { return result; } - idx_t pos = 0; - SkipSpaces(json, pos); - if (!MatchCharacter(json, pos, '{')) { - D_ASSERT(0); - return result; - } - pos++; - while (true) { - SkipSpaces(json, pos); - if (MatchCharacter(json, pos, '}')) { - // end of object - break; + yyjson_read_flag flags = YYJSON_READ_ALLOW_INVALID_UNICODE; + yyjson_doc *doc = yyjson_read(json.c_str(), json.size(), flags); + if (!doc) { + throw SerializationException("Failed to parse JSON string: %s", json); + } + yyjson_val *root = yyjson_doc_get_root(doc); + if (!root || yyjson_get_type(root) != YYJSON_TYPE_OBJ) { + yyjson_doc_free(doc); + throw SerializationException("Failed to parse JSON string: %s", json); + } + yyjson_obj_iter iter; + yyjson_obj_iter_init(root, &iter); + yyjson_val *key, *value; + while ((key = yyjson_obj_iter_next(&iter))) { + value = yyjson_obj_iter_get_val(key); + if (yyjson_get_type(value) != YYJSON_TYPE_STR) { + yyjson_doc_free(doc); + throw SerializationException("Failed to parse JSON string: %s", json); } - if (!result.empty()) { - // objects are comma separated - if (!MatchCharacter(json, pos, ',')) { - D_ASSERT(0); - return result; - } - pos++; - } - string key = ParseJSONValue(json, pos); - SkipSpaces(json, pos); - if (!MatchCharacter(json, pos, ':')) { - D_ASSERT(0); - return result; - } - pos++; - string value = ParseJSONValue(json, pos); - auto entry = result.find(key); - if (entry != result.end()) { - // entry already exists - D_ASSERT(0); - continue; - } - result.insert(make_pair(std::move(key), std::move(value))); + auto key_val = yyjson_get_str(key); + auto key_len = yyjson_get_len(key); + auto value_val = yyjson_get_str(value); + auto value_len = yyjson_get_len(value); + result.emplace(string(key_val, key_len), string(value_val, value_len)); } + yyjson_doc_free(doc); return result; } -static void WriteJSONValue(const string &value, string &result) { - result += '"'; - for (auto c : value) { - // check for characters we need to escape - switch (c) { - case '\0': - result += "\\0"; - break; - case '\\': - result += "\\\\"; - break; - case '\b': - result += "\\b"; - break; - case '\f': - result += "\\f"; - break; - case '\t': - result += "\\t"; - break; - case '\r': - result += "\\r"; - break; - case '\n': - result += "\\n"; - break; - case '"': - result += "\\\""; - break; - default: - result += c; - break; - } - } - result += '"'; -} - -static void WriteJSONPair(const string &key, const string &value, string &result) { - WriteJSONValue(key, result); - result += ":"; - WriteJSONValue(value, result); -} - string StringUtil::ToJSONMap(ExceptionType type, const string &message, const unordered_map &map) { D_ASSERT(map.find("exception_type") == map.end()); D_ASSERT(map.find("exception_message") == map.end()); - string result; - result += "{"; - // we always write exception type/message - WriteJSONPair("exception_type", Exception::ExceptionTypeToString(type), result); - result += ","; - WriteJSONPair("exception_message", message, result); + + yyjson_mut_doc *doc = yyjson_mut_doc_new(nullptr); + yyjson_mut_val *root = yyjson_mut_obj(doc); + yyjson_mut_doc_set_root(doc, root); + + auto except_str = Exception::ExceptionTypeToString(type); + yyjson_mut_obj_add_strncpy(doc, root, "exception_type", except_str.c_str(), except_str.size()); + yyjson_mut_obj_add_strncpy(doc, root, "exception_message", message.c_str(), message.size()); for (auto &entry : map) { - result += ","; - WriteJSONPair(entry.first, entry.second, result); + auto key = yyjson_mut_strncpy(doc, entry.first.c_str(), entry.first.size()); + auto value = yyjson_mut_strncpy(doc, entry.second.c_str(), entry.second.size()); + yyjson_mut_obj_add(root, key, value); + } + + yyjson_write_err err; + size_t len; + yyjson_write_flag flags = YYJSON_WRITE_ALLOW_INVALID_UNICODE; + const char *json = yyjson_mut_write_opts(doc, flags, nullptr, &len, &err); + if (!json) { + yyjson_mut_doc_free(doc); + throw SerializationException("Failed to write JSON string: %s", err.msg); } - result += "}"; + // Create a string from the JSON + string result(json, len); + + // Free the JSON and the document + free((void *)json); + yyjson_mut_doc_free(doc); + + // Return the result return result; } diff --git a/src/duckdb/src/common/types.cpp b/src/duckdb/src/common/types.cpp index 862f86e5..18b594ef 100644 --- a/src/duckdb/src/common/types.cpp +++ b/src/duckdb/src/common/types.cpp @@ -364,6 +364,18 @@ string LogicalType::ToString() const { if (id_ != LogicalTypeId::USER) { auto alias = GetAlias(); if (!alias.empty()) { + auto mods_ptr = GetModifiers(); + if (mods_ptr && !mods_ptr->empty()) { + auto &mods = *mods_ptr; + alias += "("; + for (idx_t i = 0; i < mods.size(); i++) { + alias += mods[i].ToString(); + if (i < mods.size() - 1) { + alias += ", "; + } + } + alias += ")"; + } return alias; } } @@ -457,6 +469,7 @@ string LogicalType::ToString() const { auto &catalog = UserType::GetCatalog(*this); auto &schema = UserType::GetSchema(*this); auto &type = UserType::GetTypeName(*this); + auto &mods = UserType::GetTypeModifiers(*this); if (!catalog.empty()) { result = KeywordHelper::WriteOptionallyQuoted(catalog); @@ -471,11 +484,26 @@ string LogicalType::ToString() const { result += "."; } result += KeywordHelper::WriteOptionallyQuoted(type); + + if (!mods.empty()) { + result += "("; + for (idx_t i = 0; i < mods.size(); i++) { + result += mods[i].ToString(); + if (i < mods.size() - 1) { + result += ", "; + } + } + result += ")"; + } + return result; } case LogicalTypeId::AGGREGATE_STATE: { return AggregateStateType::GetTypeName(*this); } + case LogicalTypeId::SQLNULL: { + return "\"NULL\""; + } default: return EnumUtil::ToString(id_); } @@ -501,7 +529,9 @@ LogicalType TransformStringToLogicalType(const string &str) { LogicalType GetUserTypeRecursive(const LogicalType &type, ClientContext &context) { if (type.id() == LogicalTypeId::USER && type.HasAlias()) { - return Catalog::GetType(context, INVALID_CATALOG, INVALID_SCHEMA, type.GetAlias()); + auto &type_entry = + Catalog::GetEntry(context, INVALID_CATALOG, INVALID_SCHEMA, type.GetAlias()); + return type_entry.user_type; } // Look for LogicalTypeId::USER in nested types if (type.id() == LogicalTypeId::STRUCT) { @@ -1110,7 +1140,7 @@ bool ApproxEqual(float ldecimal, float rdecimal) { if (!Value::FloatIsFinite(ldecimal) || !Value::FloatIsFinite(rdecimal)) { return ldecimal == rdecimal; } - float epsilon = std::fabs(rdecimal) * 0.01 + 0.00000001; + float epsilon = static_cast(std::fabs(rdecimal) * 0.01 + 0.00000001); return std::fabs(ldecimal - rdecimal) <= epsilon; } @@ -1128,9 +1158,18 @@ bool ApproxEqual(double ldecimal, double rdecimal) { //===--------------------------------------------------------------------===// // Extra Type Info //===--------------------------------------------------------------------===// + +LogicalType LogicalType::DeepCopy() const { + LogicalType copy = *this; + if (type_info_) { + copy.type_info_ = type_info_->Copy(); + } + return copy; +} + void LogicalType::SetAlias(string alias) { if (!type_info_) { - type_info_ = make_shared(ExtraTypeInfoType::GENERIC_TYPE_INFO, std::move(alias)); + type_info_ = make_shared_ptr(ExtraTypeInfoType::GENERIC_TYPE_INFO, std::move(alias)); } else { type_info_->alias = std::move(alias); } @@ -1156,6 +1195,53 @@ bool LogicalType::HasAlias() const { return false; } +void LogicalType::SetModifiers(vector modifiers) { + if (!type_info_ && !modifiers.empty()) { + type_info_ = make_shared_ptr(ExtraTypeInfoType::GENERIC_TYPE_INFO); + } + type_info_->modifiers = std::move(modifiers); +} + +bool LogicalType::HasModifiers() const { + if (id() == LogicalTypeId::USER) { + return !UserType::GetTypeModifiers(*this).empty(); + } + if (type_info_) { + return !type_info_->modifiers.empty(); + } + return false; +} + +vector LogicalType::GetModifiersCopy() const { + if (id() == LogicalTypeId::USER) { + return UserType::GetTypeModifiers(*this); + } + if (type_info_) { + return type_info_->modifiers; + } + return {}; +} + +optional_ptr> LogicalType::GetModifiers() { + if (id() == LogicalTypeId::USER) { + return UserType::GetTypeModifiers(*this); + } + if (type_info_) { + return type_info_->modifiers; + } + return nullptr; +} + +optional_ptr> LogicalType::GetModifiers() const { + if (id() == LogicalTypeId::USER) { + return UserType::GetTypeModifiers(*this); + } + if (type_info_) { + return type_info_->modifiers; + } + return nullptr; +} + //===--------------------------------------------------------------------===// // Decimal Type //===--------------------------------------------------------------------===// @@ -1179,7 +1265,7 @@ uint8_t DecimalType::MaxWidth() { LogicalType LogicalType::DECIMAL(uint8_t width, uint8_t scale) { D_ASSERT(width >= scale); - auto type_info = make_shared(width, scale); + auto type_info = make_shared_ptr(width, scale); return LogicalType(LogicalTypeId::DECIMAL, std::move(type_info)); } @@ -1201,7 +1287,7 @@ string StringType::GetCollation(const LogicalType &type) { } LogicalType LogicalType::VARCHAR_COLLATION(string collation) { // NOLINT - auto string_info = make_shared(std::move(collation)); + auto string_info = make_shared_ptr(std::move(collation)); return LogicalType(LogicalTypeId::VARCHAR, std::move(string_info)); } @@ -1216,7 +1302,7 @@ const LogicalType &ListType::GetChildType(const LogicalType &type) { } LogicalType LogicalType::LIST(const LogicalType &child) { - auto info = make_shared(child); + auto info = make_shared_ptr(child); return LogicalType(LogicalTypeId::LIST, std::move(info)); } @@ -1288,12 +1374,12 @@ bool StructType::IsUnnamed(const LogicalType &type) { } LogicalType LogicalType::STRUCT(child_list_t children) { - auto info = make_shared(std::move(children)); + auto info = make_shared_ptr(std::move(children)); return LogicalType(LogicalTypeId::STRUCT, std::move(info)); } LogicalType LogicalType::AGGREGATE_STATE(aggregate_state_t state_type) { // NOLINT - auto info = make_shared(std::move(state_type)); + auto info = make_shared_ptr(std::move(state_type)); return LogicalType(LogicalTypeId::AGGREGATE_STATE, std::move(info)); } @@ -1318,7 +1404,7 @@ LogicalType LogicalType::MAP(const LogicalType &child_p) { new_children[1].first = "value"; auto child = LogicalType::STRUCT(std::move(new_children)); - auto info = make_shared(child); + auto info = make_shared_ptr(child); return LogicalType(LogicalTypeId::MAP, std::move(info)); } @@ -1347,7 +1433,7 @@ LogicalType LogicalType::UNION(child_list_t members) { D_ASSERT(members.size() <= UnionType::MAX_UNION_MEMBERS); // union types always have a hidden "tag" field in front members.insert(members.begin(), {"", LogicalType::UTINYINT}); - auto info = make_shared(std::move(members)); + auto info = make_shared_ptr(std::move(members)); return LogicalType(LogicalTypeId::UNION, std::move(info)); } @@ -1399,13 +1485,33 @@ const string &UserType::GetTypeName(const LogicalType &type) { return info->Cast().user_type_name; } +const vector &UserType::GetTypeModifiers(const LogicalType &type) { + D_ASSERT(type.id() == LogicalTypeId::USER); + auto info = type.AuxInfo(); + D_ASSERT(info); + return info->Cast().user_type_modifiers; +} + +vector &UserType::GetTypeModifiers(LogicalType &type) { + D_ASSERT(type.id() == LogicalTypeId::USER); + auto info = type.GetAuxInfoShrPtr(); + D_ASSERT(info); + return info->Cast().user_type_modifiers; +} + LogicalType LogicalType::USER(const string &user_type_name) { - auto info = make_shared(user_type_name); + auto info = make_shared_ptr(user_type_name); + return LogicalType(LogicalTypeId::USER, std::move(info)); +} + +LogicalType LogicalType::USER(const string &user_type_name, const vector &user_type_mods) { + auto info = make_shared_ptr(user_type_name, user_type_mods); return LogicalType(LogicalTypeId::USER, std::move(info)); } -LogicalType LogicalType::USER(string catalog, string schema, string name) { - auto info = make_shared(std::move(catalog), std::move(schema), std::move(name)); +LogicalType LogicalType::USER(string catalog, string schema, string name, vector user_type_mods) { + auto info = make_shared_ptr(std::move(catalog), std::move(schema), std::move(name), + std::move(user_type_mods)); return LogicalType(LogicalTypeId::USER, std::move(info)); } @@ -1520,13 +1626,13 @@ LogicalType ArrayType::ConvertToList(const LogicalType &type) { LogicalType LogicalType::ARRAY(const LogicalType &child, idx_t size) { D_ASSERT(size > 0); - D_ASSERT(size < ArrayType::MAX_ARRAY_SIZE); - auto info = make_shared(child, size); + D_ASSERT(size <= ArrayType::MAX_ARRAY_SIZE); + auto info = make_shared_ptr(child, size); return LogicalType(LogicalTypeId::ARRAY, std::move(info)); } LogicalType LogicalType::ARRAY(const LogicalType &child) { - auto info = make_shared(child, 0); + auto info = make_shared_ptr(child, 0); return LogicalType(LogicalTypeId::ARRAY, std::move(info)); } @@ -1534,7 +1640,7 @@ LogicalType LogicalType::ARRAY(const LogicalType &child) { // Any Type //===--------------------------------------------------------------------===// LogicalType LogicalType::ANY_PARAMS(LogicalType target, idx_t cast_score) { // NOLINT - auto type_info = make_shared(std::move(target), cast_score); + auto type_info = make_shared_ptr(std::move(target), cast_score); return LogicalType(LogicalTypeId::ANY, std::move(type_info)); } @@ -1587,7 +1693,7 @@ LogicalType LogicalType::INTEGER_LITERAL(const Value &constant) { // NOLINT if (!constant.type().IsIntegral()) { throw InternalException("INTEGER_LITERAL can only be made from literals of integer types"); } - auto type_info = make_shared(constant); + auto type_info = make_shared_ptr(constant); return LogicalType(LogicalTypeId::INTEGER_LITERAL, std::move(type_info)); } diff --git a/src/duckdb/src/common/types/bit.cpp b/src/duckdb/src/common/types/bit.cpp index 6f2bd8a0..83f0ce83 100644 --- a/src/duckdb/src/common/types/bit.cpp +++ b/src/duckdb/src/common/types/bit.cpp @@ -179,7 +179,7 @@ void Bit::BitToBlob(string_t bit, string_t &output_blob) { auto output = output_blob.GetDataWriteable(); idx_t size = output_blob.GetSize(); - output[0] = GetFirstByte(bit); + output[0] = UnsafeNumericCast(GetFirstByte(bit)); if (size > 2) { ++output; // First byte in bitstring contains amount of padded bits, diff --git a/src/duckdb/src/common/types/blob.cpp b/src/duckdb/src/common/types/blob.cpp index 5cb8e5df..6f472c0e 100644 --- a/src/duckdb/src/common/types/blob.cpp +++ b/src/duckdb/src/common/types/blob.cpp @@ -47,7 +47,7 @@ void Blob::ToString(string_t blob, char *output) { for (idx_t i = 0; i < len; i++) { if (IsRegularCharacter(data[i])) { // ascii characters are rendered as-is - output[str_idx++] = data[i]; + output[str_idx++] = UnsafeNumericCast(data[i]); } else { auto byte_a = data[i] >> 4; auto byte_b = data[i] & 0x0F; @@ -244,8 +244,8 @@ uint32_t DecodeBase64Bytes(const string_t &str, const_data_ptr_t input_data, idx input_data[base_idx + decode_idx], base_idx + decode_idx); } } - return (decoded_bytes[0] << 3 * 6) + (decoded_bytes[1] << 2 * 6) + (decoded_bytes[2] << 1 * 6) + - (decoded_bytes[3] << 0 * 6); + return UnsafeNumericCast((decoded_bytes[0] << 3 * 6) + (decoded_bytes[1] << 2 * 6) + + (decoded_bytes[2] << 1 * 6) + (decoded_bytes[3] << 0 * 6)); } void Blob::FromBase64(string_t str, data_ptr_t output, idx_t output_size) { diff --git a/src/duckdb/src/common/types/cast_helpers.cpp b/src/duckdb/src/common/types/cast_helpers.cpp index f37fbaa9..5a5f1121 100644 --- a/src/duckdb/src/common/types/cast_helpers.cpp +++ b/src/duckdb/src/common/types/cast_helpers.cpp @@ -103,6 +103,101 @@ int NumericHelper::UnsignedLength(uint64_t value) { } } +template <> +int NumericHelper::UnsignedLength(hugeint_t value) { + D_ASSERT(value.upper >= 0); + if (value.upper == 0) { + return UnsignedLength(value.lower); + } + // search the length using the POWERS_OF_TEN array + // the length has to be between [17] and [38], because the hugeint is bigger than 2^63 + // we use the same approach as above, but split a bit more because comparisons for hugeints are more expensive + if (value >= Hugeint::POWERS_OF_TEN[27]) { + // [27..38] + if (value >= Hugeint::POWERS_OF_TEN[32]) { + if (value >= Hugeint::POWERS_OF_TEN[36]) { + int length = 37; + length += value >= Hugeint::POWERS_OF_TEN[37]; + length += value >= Hugeint::POWERS_OF_TEN[38]; + return length; + } else { + int length = 33; + length += value >= Hugeint::POWERS_OF_TEN[33]; + length += value >= Hugeint::POWERS_OF_TEN[34]; + length += value >= Hugeint::POWERS_OF_TEN[35]; + return length; + } + } else { + if (value >= Hugeint::POWERS_OF_TEN[30]) { + int length = 31; + length += value >= Hugeint::POWERS_OF_TEN[31]; + length += value >= Hugeint::POWERS_OF_TEN[32]; + return length; + } else { + int length = 28; + length += value >= Hugeint::POWERS_OF_TEN[28]; + length += value >= Hugeint::POWERS_OF_TEN[29]; + return length; + } + } + } else { + // [17..27] + if (value >= Hugeint::POWERS_OF_TEN[22]) { + // [22..27] + if (value >= Hugeint::POWERS_OF_TEN[25]) { + int length = 26; + length += value >= Hugeint::POWERS_OF_TEN[26]; + return length; + } else { + int length = 23; + length += value >= Hugeint::POWERS_OF_TEN[23]; + length += value >= Hugeint::POWERS_OF_TEN[24]; + return length; + } + } else { + // [17..22] + if (value >= Hugeint::POWERS_OF_TEN[20]) { + int length = 21; + length += value >= Hugeint::POWERS_OF_TEN[21]; + return length; + } else { + int length = 18; + length += value >= Hugeint::POWERS_OF_TEN[18]; + length += value >= Hugeint::POWERS_OF_TEN[19]; + return length; + } + } + } +} + +template <> +string_t NumericHelper::FormatSigned(hugeint_t value, Vector &vector) { + int negative = value.upper < 0; + if (negative) { + if (value == NumericLimits::Minimum()) { + string_t result = StringVector::AddString(vector, Hugeint::HUGEINT_MINIMUM_STRING); + return result; + } + Hugeint::NegateInPlace(value); + } + int length = UnsignedLength(value) + negative; + string_t result = StringVector::EmptyString(vector, NumericCast(length)); + auto dataptr = result.GetDataWriteable(); + auto endptr = dataptr + length; + if (value.upper == 0) { + // small value: format as uint64_t + endptr = NumericHelper::FormatUnsigned(value.lower, endptr); + } else { + endptr = FormatUnsigned(value, endptr); + } + if (negative) { + *--endptr = '-'; + } + D_ASSERT(endptr == dataptr); + result.Finalize(); + return result; +} + template <> std::string NumericHelper::ToString(hugeint_t value) { return Hugeint::ToString(value); @@ -113,4 +208,106 @@ std::string NumericHelper::ToString(uhugeint_t value) { return Uhugeint::ToString(value); } +template <> +int DecimalToString::DecimalLength(hugeint_t value, uint8_t width, uint8_t scale) { + D_ASSERT(value > NumericLimits::Minimum()); + int negative; + + if (value.upper < 0) { + Hugeint::NegateInPlace(value); + negative = 1; + } else { + negative = 0; + } + if (scale == 0) { + // scale is 0: regular number + return NumericHelper::UnsignedLength(value) + negative; + } + // length is max of either: + // scale + 2 OR + // integer length + 1 + // scale + 2 happens when the number is in the range of (-1, 1) + // in that case we print "0.XXX", which is the scale, plus "0." (2 chars) + // integer length + 1 happens when the number is outside of that range + // in that case we print the integer number, but with one extra character ('.') + auto extra_numbers = width > scale ? 2 : 1; + return MaxValue(scale + extra_numbers, NumericHelper::UnsignedLength(value) + 1) + negative; +} + +template <> +string_t DecimalToString::Format(hugeint_t value, uint8_t width, uint8_t scale, Vector &vector) { + int length = DecimalLength(value, width, scale); + string_t result = StringVector::EmptyString(vector, NumericCast(length)); + + auto dst = result.GetDataWriteable(); + + FormatDecimal(value, width, scale, dst, NumericCast(length)); + + result.Finalize(); + return result; +} + +template <> +char *NumericHelper::FormatUnsigned(hugeint_t value, char *ptr) { + while (value.upper > 0) { + // while integer division is slow, hugeint division is MEGA slow + // we want to avoid doing as many divisions as possible + // for that reason we start off doing a division by a large power of ten that uint64_t can hold + // (100000000000000000) - this is the third largest + // the reason we don't use the largest is because that can result in an overflow inside the division + // function + uint64_t remainder; + value = Hugeint::DivModPositive(value, 100000000000000000ULL, remainder); + + auto startptr = ptr; + // now we format the remainder: note that we need to pad with zero's in case + // the remainder is small (i.e. less than 10000000000000000) + ptr = NumericHelper::FormatUnsigned(remainder, ptr); + + int format_length = UnsafeNumericCast(startptr - ptr); + // pad with zero + for (int i = format_length; i < 17; i++) { + *--ptr = '0'; + } + } + // once the value falls in the range of a uint64_t, fallback to formatting as uint64_t to avoid hugeint division + return NumericHelper::FormatUnsigned(value.lower, ptr); +} + +template <> +void DecimalToString::FormatDecimal(hugeint_t value, uint8_t width, uint8_t scale, char *dst, idx_t len) { + auto endptr = dst + len; + + int negative = value.upper < 0; + if (negative) { + Hugeint::NegateInPlace(value); + *dst = '-'; + dst++; + } + if (scale == 0) { + // with scale=0 we format the number as a regular number + NumericHelper::FormatUnsigned(value, endptr); + return; + } + + // we write two numbers: + // the numbers BEFORE the decimal (major) + // and the numbers AFTER the decimal (minor) + hugeint_t minor; + hugeint_t major = Hugeint::DivMod(value, Hugeint::POWERS_OF_TEN[scale], minor); + + // write the number after the decimal + dst = NumericHelper::FormatUnsigned(minor, endptr); + // (optionally) pad with zeros and add the decimal point + while (dst > (endptr - scale)) { + *--dst = '0'; + } + *--dst = '.'; + // now write the part before the decimal + D_ASSERT(width > scale || major == 0); + if (width > scale) { + dst = NumericHelper::FormatUnsigned(major, dst); + } +} + } // namespace duckdb diff --git a/src/duckdb/src/common/types/column/column_data_collection.cpp b/src/duckdb/src/common/types/column/column_data_collection.cpp index 8552332c..c3752a98 100644 --- a/src/duckdb/src/common/types/column/column_data_collection.cpp +++ b/src/duckdb/src/common/types/column/column_data_collection.cpp @@ -51,17 +51,17 @@ ColumnDataCollection::ColumnDataCollection(Allocator &allocator_p) { types.clear(); count = 0; this->finished_append = false; - allocator = make_shared(allocator_p); + allocator = make_shared_ptr(allocator_p); } ColumnDataCollection::ColumnDataCollection(Allocator &allocator_p, vector types_p) { Initialize(std::move(types_p)); - allocator = make_shared(allocator_p); + allocator = make_shared_ptr(allocator_p); } ColumnDataCollection::ColumnDataCollection(BufferManager &buffer_manager, vector types_p) { Initialize(std::move(types_p)); - allocator = make_shared(buffer_manager); + allocator = make_shared_ptr(buffer_manager); } ColumnDataCollection::ColumnDataCollection(shared_ptr allocator_p, vector types_p) { @@ -71,7 +71,7 @@ ColumnDataCollection::ColumnDataCollection(shared_ptr alloc ColumnDataCollection::ColumnDataCollection(ClientContext &context, vector types_p, ColumnDataAllocatorType type) - : ColumnDataCollection(make_shared(context, type), std::move(types_p)) { + : ColumnDataCollection(make_shared_ptr(context, type), std::move(types_p)) { D_ASSERT(!types.empty()); } @@ -199,7 +199,7 @@ ColumnDataChunkIterationHelper::ColumnDataChunkIterationHelper(const ColumnDataC ColumnDataChunkIterationHelper::ColumnDataChunkIterator::ColumnDataChunkIterator( const ColumnDataCollection *collection_p, vector column_ids_p) - : collection(collection_p), scan_chunk(make_shared()), row_index(0) { + : collection(collection_p), scan_chunk(make_shared_ptr()), row_index(0) { if (!collection) { return; } @@ -246,7 +246,7 @@ ColumnDataRowIterationHelper::ColumnDataRowIterationHelper(const ColumnDataColle } ColumnDataRowIterationHelper::ColumnDataRowIterator::ColumnDataRowIterator(const ColumnDataCollection *collection_p) - : collection(collection_p), scan_chunk(make_shared()), current_row(*scan_chunk, 0, 0) { + : collection(collection_p), scan_chunk(make_shared_ptr()), current_row(*scan_chunk, 0, 0) { if (!collection) { return; } @@ -690,8 +690,16 @@ void ColumnDataCopyArray(ColumnDataMetaData &meta_data, const UnifiedVectorForma } } - child_function.function(child_meta_data, child_vector_data, child_vector, offset * array_size, - array_size * copy_count); + auto is_constant = source.GetVectorType() == VectorType::CONSTANT_VECTOR; + // If the array is constant, we need to copy the child vector n times + if (is_constant) { + for (idx_t i = 0; i < copy_count; i++) { + child_function.function(child_meta_data, child_vector_data, child_vector, 0, array_size); + } + } else { + child_function.function(child_meta_data, child_vector_data, child_vector, offset * array_size, + copy_count * array_size); + } } ColumnDataCopyFunction ColumnDataCollection::GetCopyFunction(const LogicalType &type) { @@ -1041,7 +1049,7 @@ void ColumnDataCollection::Reset() { segments.clear(); // Refreshes the ColumnDataAllocator to prevent holding on to allocated data unnecessarily - allocator = make_shared(*allocator); + allocator = make_shared_ptr(*allocator); } struct ValueResultEquals { diff --git a/src/duckdb/src/common/types/column/column_data_collection_segment.cpp b/src/duckdb/src/common/types/column/column_data_collection_segment.cpp index 9713b66a..918680c1 100644 --- a/src/duckdb/src/common/types/column/column_data_collection_segment.cpp +++ b/src/duckdb/src/common/types/column/column_data_collection_segment.cpp @@ -7,7 +7,7 @@ namespace duckdb { ColumnDataCollectionSegment::ColumnDataCollectionSegment(shared_ptr allocator_p, vector types_p) : allocator(std::move(allocator_p)), types(std::move(types_p)), count(0), - heap(make_shared(allocator->GetAllocator())) { + heap(make_shared_ptr(allocator->GetAllocator())) { } idx_t ColumnDataCollectionSegment::GetDataSize(idx_t type_size) { diff --git a/src/duckdb/src/common/types/column/partitioned_column_data.cpp b/src/duckdb/src/common/types/column/partitioned_column_data.cpp index c785f346..d59659d3 100644 --- a/src/duckdb/src/common/types/column/partitioned_column_data.cpp +++ b/src/duckdb/src/common/types/column/partitioned_column_data.cpp @@ -9,7 +9,7 @@ namespace duckdb { PartitionedColumnData::PartitionedColumnData(PartitionedColumnDataType type_p, ClientContext &context_p, vector types_p) : type(type_p), context(context_p), types(std::move(types_p)), - allocators(make_shared()) { + allocators(make_shared_ptr()) { } PartitionedColumnData::PartitionedColumnData(const PartitionedColumnData &other) @@ -20,8 +20,6 @@ unique_ptr PartitionedColumnData::CreateShared() { switch (type) { case PartitionedColumnDataType::RADIX: return make_uniq(Cast()); - case PartitionedColumnDataType::HIVE: - return make_uniq(Cast()); default: throw NotImplementedException("CreateShared for this type of PartitionedColumnData"); } @@ -136,6 +134,9 @@ void PartitionedColumnData::Append(PartitionedColumnDataAppendState &state, Data void PartitionedColumnData::FlushAppendState(PartitionedColumnDataAppendState &state) { for (idx_t i = 0; i < state.partition_buffers.size(); i++) { + if (!state.partition_buffers[i]) { + continue; + } auto &partition_buffer = *state.partition_buffers[i]; if (partition_buffer.size() > 0) { partitions[i]->Append(partition_buffer); @@ -155,7 +156,14 @@ void PartitionedColumnData::Combine(PartitionedColumnData &other) { D_ASSERT(partitions.size() == other.partitions.size()); // Combine the append state's partitions into this PartitionedColumnData for (idx_t i = 0; i < other.partitions.size(); i++) { - partitions[i]->Combine(*other.partitions[i]); + if (!other.partitions[i]) { + continue; + } + if (!partitions[i]) { + partitions[i] = std::move(other.partitions[i]); + } else { + partitions[i]->Combine(*other.partitions[i]); + } } } } @@ -165,7 +173,7 @@ vector> &PartitionedColumnData::GetPartitions() } void PartitionedColumnData::CreateAllocator() { - allocators->allocators.emplace_back(make_shared(BufferManager::GetBufferManager(context))); + allocators->allocators.emplace_back(make_shared_ptr(BufferManager::GetBufferManager(context))); allocators->allocators.back()->MakeShared(); } diff --git a/src/duckdb/src/common/types/conflict_info.cpp b/src/duckdb/src/common/types/conflict_info.cpp index e832bf89..44f8aa7f 100644 --- a/src/duckdb/src/common/types/conflict_info.cpp +++ b/src/duckdb/src/common/types/conflict_info.cpp @@ -12,7 +12,7 @@ bool ConflictInfo::ConflictTargetMatches(Index &index) const { return true; } // Check whether the column ids match - return column_ids == index.column_id_set; + return column_ids == index.GetColumnIdSet(); } } // namespace duckdb diff --git a/src/duckdb/src/common/types/conflict_manager.cpp b/src/duckdb/src/common/types/conflict_manager.cpp index 38d61240..8e7ce0b9 100644 --- a/src/duckdb/src/common/types/conflict_manager.cpp +++ b/src/duckdb/src/common/types/conflict_manager.cpp @@ -159,7 +159,7 @@ bool ConflictManager::AddNull(idx_t chunk_index) { if (!IsConflict(LookupResultType::LOOKUP_NULL)) { return false; } - return AddHit(chunk_index, DConstants::INVALID_INDEX); + return AddHit(chunk_index, static_cast(DConstants::INVALID_INDEX)); } bool ConflictManager::SingleIndexTarget() const { diff --git a/src/duckdb/src/common/types/data_chunk.cpp b/src/duckdb/src/common/types/data_chunk.cpp index 114beb1f..22ecb963 100644 --- a/src/duckdb/src/common/types/data_chunk.cpp +++ b/src/duckdb/src/common/types/data_chunk.cpp @@ -273,7 +273,7 @@ void DataChunk::Deserialize(Deserializer &deserializer) { // initialize the data chunk D_ASSERT(!types.empty()); - Initialize(Allocator::DefaultAllocator(), types); + Initialize(Allocator::DefaultAllocator(), types, MaxValue(row_count, STANDARD_VECTOR_SIZE)); SetCardinality(row_count); // read the data diff --git a/src/duckdb/src/common/types/date.cpp b/src/duckdb/src/common/types/date.cpp index 1f06b884..be334903 100644 --- a/src/duckdb/src/common/types/date.cpp +++ b/src/duckdb/src/common/types/date.cpp @@ -307,7 +307,7 @@ bool Date::TryConvertDate(const char *buf, idx_t len, idx_t &pos, date_t &result // in strict mode, check remaining string for non-space characters if (strict) { // skip trailing spaces - while (pos < len && StringUtil::CharacterIsSpace((unsigned char)buf[pos])) { + while (pos < len && StringUtil::CharacterIsSpace(buf[pos])) { pos++; } // check position. if end was not reached, non-space chars remaining @@ -316,7 +316,7 @@ bool Date::TryConvertDate(const char *buf, idx_t len, idx_t &pos, date_t &result } } else { // in non-strict mode, check for any direct trailing digits - if (pos < len && StringUtil::CharacterIsDigit((unsigned char)buf[pos])) { + if (pos < len && StringUtil::CharacterIsDigit(buf[pos])) { return false; } } diff --git a/src/duckdb/src/common/types/decimal.cpp b/src/duckdb/src/common/types/decimal.cpp index 323cec4e..d05e4a00 100644 --- a/src/duckdb/src/common/types/decimal.cpp +++ b/src/duckdb/src/common/types/decimal.cpp @@ -3,31 +3,31 @@ namespace duckdb { -template +template string TemplatedDecimalToString(SIGNED value, uint8_t width, uint8_t scale) { - auto len = DecimalToString::DecimalLength(value, width, scale); - auto data = make_unsafe_uniq_array(len + 1); - DecimalToString::FormatDecimal(value, width, scale, data.get(), len); - return string(data.get(), len); + auto len = DecimalToString::DecimalLength(value, width, scale); + auto data = make_unsafe_uniq_array(UnsafeNumericCast(len + 1)); + DecimalToString::FormatDecimal(value, width, scale, data.get(), UnsafeNumericCast(len)); + return string(data.get(), UnsafeNumericCast(len)); } string Decimal::ToString(int16_t value, uint8_t width, uint8_t scale) { - return TemplatedDecimalToString(value, width, scale); + return TemplatedDecimalToString(value, width, scale); } string Decimal::ToString(int32_t value, uint8_t width, uint8_t scale) { - return TemplatedDecimalToString(value, width, scale); + return TemplatedDecimalToString(value, width, scale); } string Decimal::ToString(int64_t value, uint8_t width, uint8_t scale) { - return TemplatedDecimalToString(value, width, scale); + return TemplatedDecimalToString(value, width, scale); } string Decimal::ToString(hugeint_t value, uint8_t width, uint8_t scale) { - auto len = HugeintToStringCast::DecimalLength(value, width, scale); - auto data = make_unsafe_uniq_array(len + 1); - HugeintToStringCast::FormatDecimal(value, width, scale, data.get(), len); - return string(data.get(), len); + auto len = DecimalToString::DecimalLength(value, width, scale); + auto data = make_unsafe_uniq_array(UnsafeNumericCast(len + 1)); + DecimalToString::FormatDecimal(value, width, scale, data.get(), UnsafeNumericCast(len)); + return string(data.get(), UnsafeNumericCast(len)); } } // namespace duckdb diff --git a/src/duckdb/src/common/types/hash.cpp b/src/duckdb/src/common/types/hash.cpp index cdc9ba30..83a1ef22 100644 --- a/src/duckdb/src/common/types/hash.cpp +++ b/src/duckdb/src/common/types/hash.cpp @@ -22,7 +22,7 @@ hash_t Hash(int64_t val) { template <> hash_t Hash(hugeint_t val) { - return MurmurHash64(val.lower) ^ MurmurHash64(val.upper); + return MurmurHash64(val.lower) ^ MurmurHash64(static_cast(val.upper)); } template <> diff --git a/src/duckdb/src/common/types/hugeint.cpp b/src/duckdb/src/common/types/hugeint.cpp index d5343fc6..d83d81ca 100644 --- a/src/duckdb/src/common/types/hugeint.cpp +++ b/src/duckdb/src/common/types/hugeint.cpp @@ -85,7 +85,7 @@ static uint8_t PositiveHugeintHighestBit(hugeint_t bits) { uint8_t out = 0; if (bits.upper) { out = 64; - uint64_t up = bits.upper; + uint64_t up = static_cast(bits.upper); while (up) { up >>= 1; out++; @@ -104,7 +104,7 @@ static bool PositiveHugeintIsBitSet(hugeint_t lhs, uint8_t bit_position) { if (bit_position < 64) { return lhs.lower & (uint64_t(1) << uint64_t(bit_position)); } else { - return lhs.upper & (uint64_t(1) << uint64_t(bit_position - 64)); + return static_cast(lhs.upper) & (uint64_t(1) << uint64_t(bit_position - 64)); } } @@ -112,7 +112,8 @@ static hugeint_t PositiveHugeintLeftShift(hugeint_t lhs, uint32_t amount) { D_ASSERT(amount > 0 && amount < 64); hugeint_t result; result.lower = lhs.lower << amount; - result.upper = (lhs.upper << amount) + (lhs.lower >> (64 - amount)); + result.upper = + UnsafeNumericCast((UnsafeNumericCast(lhs.upper) << amount) + (lhs.lower >> (64 - amount))); return result; } @@ -625,7 +626,7 @@ bool Hugeint::TryCast(hugeint_t input, uhugeint_t &result) { } result.lower = input.lower; - result.upper = input.upper; + result.upper = UnsafeNumericCast(input.upper); return true; } @@ -744,7 +745,7 @@ bool ConvertFloatingToBigint(REAL_T value, hugeint_t &result) { value = -value; } result.lower = (uint64_t)fmod(value, REAL_T(NumericLimits::Maximum())); - result.upper = (uint64_t)(value / REAL_T(NumericLimits::Maximum())); + result.upper = (int64_t)(value / REAL_T(NumericLimits::Maximum())); if (negative) { Hugeint::NegateInPlace(result); } @@ -829,14 +830,14 @@ hugeint_t hugeint_t::operator>>(const hugeint_t &rhs) const { return *this; } else if (shift == 64) { result.upper = (upper < 0) ? -1 : 0; - result.lower = upper; + result.lower = uint64_t(upper); } else if (shift < 64) { // perform lower shift in unsigned integer, and mask away the most significant bit result.lower = (uint64_t(upper) << (64 - shift)) | (lower >> shift); result.upper = upper >> shift; } else { D_ASSERT(shift < 128); - result.lower = upper >> (shift - 64); + result.lower = uint64_t(upper >> (shift - 64)); result.upper = (upper < 0) ? -1 : 0; } return result; @@ -851,7 +852,7 @@ hugeint_t hugeint_t::operator<<(const hugeint_t &rhs) const { if (rhs.upper != 0 || shift >= 128) { return hugeint_t(0); } else if (shift == 64) { - result.upper = lower; + result.upper = int64_t(lower); result.lower = 0; } else if (shift == 0) { return *this; @@ -859,7 +860,7 @@ hugeint_t hugeint_t::operator<<(const hugeint_t &rhs) const { // perform upper shift in unsigned integer, and mask away the most significant bit uint64_t upper_shift = ((uint64_t(upper) << shift) + (lower >> (64 - shift))) & 0x7FFFFFFFFFFFFFFF; result.lower = lower << shift; - result.upper = upper_shift; + result.upper = int64_t(upper_shift); } else { D_ASSERT(shift < 128); result.lower = 0; diff --git a/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp b/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp index 979b2922..870bd3aa 100644 --- a/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp +++ b/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp @@ -9,7 +9,7 @@ namespace duckdb { PartitionedTupleData::PartitionedTupleData(PartitionedTupleDataType type_p, BufferManager &buffer_manager_p, const TupleDataLayout &layout_p) : type(type_p), buffer_manager(buffer_manager_p), layout(layout_p.Copy()), count(0), data_size(0), - allocators(make_shared()) { + allocators(make_shared_ptr()) { } PartitionedTupleData::PartitionedTupleData(const PartitionedTupleData &other) @@ -329,8 +329,8 @@ void PartitionedTupleData::Repartition(PartitionedTupleData &new_partitioned_dat const int64_t update = reverse ? -1 : 1; const int64_t adjustment = reverse ? -1 : 0; - for (idx_t partition_idx = start_idx; partition_idx != end_idx; partition_idx += update) { - auto actual_partition_idx = partition_idx + adjustment; + for (idx_t partition_idx = start_idx; partition_idx != end_idx; partition_idx += idx_t(update)) { + auto actual_partition_idx = partition_idx + idx_t(adjustment); auto &partition = *partitions[actual_partition_idx]; if (partition.Count() > 0) { @@ -434,7 +434,7 @@ void PartitionedTupleData::Print() { // LCOV_EXCL_STOP void PartitionedTupleData::CreateAllocator() { - allocators->allocators.emplace_back(make_shared(buffer_manager, layout)); + allocators->allocators.emplace_back(make_shared_ptr(buffer_manager, layout)); } } // namespace duckdb diff --git a/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp b/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp index 50135d88..efbd072e 100644 --- a/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp +++ b/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp @@ -56,7 +56,8 @@ void RowDataCollectionScanner::AlignHeapBlocks(RowDataCollection &swizzled_block if (!swizzled_string_heap.keep_pinned) { auto heap_ptr = Load(data_ptr + layout.GetHeapOffset()); auto heap_offset = heap_ptr - heap_handle.Ptr(); - RowOperations::SwizzleHeapPointer(layout, data_ptr, heap_ptr, data_block->count, heap_offset); + RowOperations::SwizzleHeapPointer(layout, data_ptr, heap_ptr, data_block->count, + NumericCast(heap_offset)); } else { swizzled_string_heap.pinned_blocks.emplace_back(std::move(heap_handle)); } @@ -84,7 +85,7 @@ void RowDataCollectionScanner::AlignHeapBlocks(RowDataCollection &swizzled_block auto heap_start_ptr = Load(data_ptr + layout.GetHeapOffset()); auto heap_end_ptr = Load(data_ptr + layout.GetHeapOffset() + (next - 1) * layout.GetRowWidth()); - idx_t size = heap_end_ptr - heap_start_ptr + Load(heap_end_ptr); + auto size = NumericCast(heap_end_ptr - heap_start_ptr + Load(heap_end_ptr)); ptrs_and_sizes.emplace_back(heap_start_ptr, size); D_ASSERT(size <= heap_blocks[heap_block_idx]->byte_offset); @@ -100,7 +101,7 @@ void RowDataCollectionScanner::AlignHeapBlocks(RowDataCollection &swizzled_block // Finally, we allocate a new heap block and copy data to it swizzled_string_heap.blocks.emplace_back(make_uniq( - MemoryTag::ORDER_BY, buffer_manager, MaxValue(total_size, (idx_t)Storage::BLOCK_SIZE), 1)); + MemoryTag::ORDER_BY, buffer_manager, MaxValue(total_size, (idx_t)Storage::BLOCK_SIZE), 1U)); auto new_heap_handle = buffer_manager.Pin(swizzled_string_heap.blocks.back()->block); auto new_heap_ptr = new_heap_handle.Ptr(); for (auto &ptr_and_size : ptrs_and_sizes) { @@ -174,7 +175,7 @@ RowDataCollectionScanner::RowDataCollectionScanner(RowDataCollection &rows_p, Ro // Pretend that we have scanned up to the start block // and will stop at the end auto begin = rows.blocks.begin(); - auto end = begin + block_idx; + auto end = begin + NumericCast(block_idx); total_scanned = std::accumulate(begin, end, idx_t(0), [&](idx_t c, const unique_ptr &b) { return c + b->count; }); total_count = total_scanned + (*end)->count; @@ -194,7 +195,7 @@ void RowDataCollectionScanner::SwizzleBlock(RowDataBlock &data_block, RowDataBlo auto heap_handle = heap.buffer_manager.Pin(heap_block.block); auto heap_ptr = Load(data_ptr + layout.GetHeapOffset()); auto heap_offset = heap_ptr - heap_handle.Ptr(); - RowOperations::SwizzleHeapPointer(layout, data_ptr, heap_ptr, data_block.count, heap_offset); + RowOperations::SwizzleHeapPointer(layout, data_ptr, heap_ptr, data_block.count, NumericCast(heap_offset)); } void RowDataCollectionScanner::ReSwizzle() { diff --git a/src/duckdb/src/common/types/row/tuple_data_allocator.cpp b/src/duckdb/src/common/types/row/tuple_data_allocator.cpp index ee3d93ee..cb6f0bb1 100644 --- a/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +++ b/src/duckdb/src/common/types/row/tuple_data_allocator.cpp @@ -1,9 +1,9 @@ #include "duckdb/common/types/row/tuple_data_allocator.hpp" +#include "duckdb/common/fast_mem.hpp" #include "duckdb/common/types/row/tuple_data_segment.hpp" #include "duckdb/common/types/row/tuple_data_states.hpp" #include "duckdb/storage/buffer_manager.hpp" -#include "duckdb/common/fast_mem.hpp" namespace duckdb { @@ -140,22 +140,12 @@ TupleDataChunkPart TupleDataAllocator::BuildChunkPart(TupleDataPinState &pin_sta } if (total_heap_size == 0) { - // We don't need a heap at all - result.heap_block_index = TupleDataChunkPart::INVALID_INDEX; - result.heap_block_offset = TupleDataChunkPart::INVALID_INDEX; - result.total_heap_size = 0; - result.base_heap_ptr = nullptr; + result.SetHeapEmpty(); } else { - // Allocate heap block (if needed) - if (heap_blocks.empty() || heap_blocks.back().RemainingCapacity() < heap_sizes[append_offset]) { - const auto size = MaxValue((idx_t)Storage::BLOCK_SIZE, heap_sizes[append_offset]); - heap_blocks.emplace_back(buffer_manager, size); - } - result.heap_block_index = NumericCast(heap_blocks.size() - 1); - auto &heap_block = heap_blocks[result.heap_block_index]; - result.heap_block_offset = NumericCast(heap_block.size); + const auto heap_remaining = MaxValue(heap_blocks.empty() ? (idx_t)Storage::BLOCK_SIZE + : heap_blocks.back().RemainingCapacity(), + heap_sizes[append_offset]); - const auto heap_remaining = heap_block.RemainingCapacity(); if (total_heap_size <= heap_remaining) { // Everything fits result.total_heap_size = NumericCast(total_heap_size); @@ -172,9 +162,22 @@ TupleDataChunkPart TupleDataAllocator::BuildChunkPart(TupleDataPinState &pin_sta } } - // Mark this portion of the heap block as filled and set the pointer - heap_block.size += result.total_heap_size; - result.base_heap_ptr = GetBaseHeapPointer(pin_state, result); + if (result.total_heap_size == 0) { + result.SetHeapEmpty(); + } else { + // Allocate heap block (if needed) + if (heap_blocks.empty() || heap_blocks.back().RemainingCapacity() < heap_sizes[append_offset]) { + const auto size = MaxValue((idx_t)Storage::BLOCK_SIZE, heap_sizes[append_offset]); + heap_blocks.emplace_back(buffer_manager, size); + } + result.heap_block_index = NumericCast(heap_blocks.size() - 1); + auto &heap_block = heap_blocks[result.heap_block_index]; + result.heap_block_offset = NumericCast(heap_block.size); + + // Mark this portion of the heap block as filled and set the pointer + heap_block.size += result.total_heap_size; + result.base_heap_ptr = GetBaseHeapPointer(pin_state, result); + } } } D_ASSERT(result.count != 0 && result.count <= STANDARD_VECTOR_SIZE); diff --git a/src/duckdb/src/common/types/row/tuple_data_collection.cpp b/src/duckdb/src/common/types/row/tuple_data_collection.cpp index 8e548f9f..86cbb144 100644 --- a/src/duckdb/src/common/types/row/tuple_data_collection.cpp +++ b/src/duckdb/src/common/types/row/tuple_data_collection.cpp @@ -12,7 +12,7 @@ namespace duckdb { using ValidityBytes = TupleDataLayout::ValidityBytes; TupleDataCollection::TupleDataCollection(BufferManager &buffer_manager, const TupleDataLayout &layout_p) - : layout(layout_p.Copy()), allocator(make_shared(buffer_manager, layout)) { + : layout(layout_p.Copy()), allocator(make_shared_ptr(buffer_manager, layout)) { Initialize(); } @@ -377,7 +377,7 @@ void TupleDataCollection::Reset() { segments.clear(); // Refreshes the TupleDataAllocator to prevent holding on to allocated data unnecessarily - allocator = make_shared(*allocator); + allocator = make_shared_ptr(*allocator); } void TupleDataCollection::InitializeChunk(DataChunk &chunk) const { diff --git a/src/duckdb/src/common/types/row/tuple_data_segment.cpp b/src/duckdb/src/common/types/row/tuple_data_segment.cpp index d84da30f..eb38913b 100644 --- a/src/duckdb/src/common/types/row/tuple_data_segment.cpp +++ b/src/duckdb/src/common/types/row/tuple_data_segment.cpp @@ -7,6 +7,13 @@ namespace duckdb { TupleDataChunkPart::TupleDataChunkPart(mutex &lock_p) : lock(lock_p) { } +void TupleDataChunkPart::SetHeapEmpty() { + heap_block_index = INVALID_INDEX; + heap_block_offset = INVALID_INDEX; + total_heap_size = 0; + base_heap_ptr = nullptr; +} + void SwapTupleDataChunkPart(TupleDataChunkPart &a, TupleDataChunkPart &b) { std::swap(a.row_block_index, b.row_block_index); std::swap(a.row_block_offset, b.row_block_offset); diff --git a/src/duckdb/src/common/types/string_heap.cpp b/src/duckdb/src/common/types/string_heap.cpp index eac0f59e..be23433d 100644 --- a/src/duckdb/src/common/types/string_heap.cpp +++ b/src/duckdb/src/common/types/string_heap.cpp @@ -51,6 +51,10 @@ string_t StringHeap::AddBlob(const string_t &data) { string_t StringHeap::EmptyString(idx_t len) { D_ASSERT(len > string_t::INLINE_LENGTH); + if (len > string_t::MAX_STRING_SIZE) { + throw OutOfRangeException("Cannot create a string of size: '%d', the maximum supported string size is: '%d'", + len, string_t::MAX_STRING_SIZE); + } auto insert_pos = const_char_ptr_cast(allocator.Allocate(len)); return string_t(insert_pos, UnsafeNumericCast(len)); } diff --git a/src/duckdb/src/common/types/timestamp.cpp b/src/duckdb/src/common/types/timestamp.cpp index 3ae9e462..e0f14a5e 100644 --- a/src/duckdb/src/common/types/timestamp.cpp +++ b/src/duckdb/src/common/types/timestamp.cpp @@ -79,7 +79,14 @@ bool Timestamp::TryConvertTimestampTZ(const char *str, idx_t len, timestamp_t &r pos++; } idx_t time_pos = 0; - if (!Time::TryConvertTime(str + pos, len - pos, time_pos, time)) { + // TryConvertTime may recursively call us, so we opt for a stricter + // operation. Note that we can't pass strict== true here because we + // want to process any suffix. + if (!Time::TryConvertInterval(str + pos, len - pos, time_pos, time)) { + return false; + } + // We parsed an interval, so make sure it is in range. + if (time.micros > Interval::MICROS_PER_DAY) { return false; } pos += time_pos; @@ -380,6 +387,21 @@ int64_t Timestamp::GetEpochNanoSeconds(timestamp_t timestamp) { return result; } +int64_t Timestamp::GetEpochRounded(timestamp_t input, int64_t power_of_ten) { + D_ASSERT(Timestamp::IsFinite(input)); + // Round away from the epoch. + // Scale first so we don't overflow. + const auto scaling = power_of_ten / 2; + input.value /= scaling; + if (input.value < 0) { + --input.value; + } else { + ++input.value; + } + input.value /= 2; + return input.value; +} + double Timestamp::GetJulianDay(timestamp_t timestamp) { double result = double(Timestamp::GetTime(timestamp).micros); result /= Interval::MICROS_PER_DAY; diff --git a/src/duckdb/src/common/types/uhugeint.cpp b/src/duckdb/src/common/types/uhugeint.cpp index 479f756d..7469dd80 100644 --- a/src/duckdb/src/common/types/uhugeint.cpp +++ b/src/duckdb/src/common/types/uhugeint.cpp @@ -399,7 +399,7 @@ bool Uhugeint::TryCast(uhugeint_t input, hugeint_t &result) { } result.lower = input.lower; - result.upper = input.upper; + result.upper = UnsafeNumericCast(input.upper); return true; } diff --git a/src/duckdb/src/common/types/uuid.cpp b/src/duckdb/src/common/types/uuid.cpp index 818d9e8d..82583fe9 100644 --- a/src/duckdb/src/common/types/uuid.cpp +++ b/src/duckdb/src/common/types/uuid.cpp @@ -6,13 +6,13 @@ namespace duckdb { bool UUID::FromString(const string &str, hugeint_t &result) { auto hex2char = [](char ch) -> unsigned char { if (ch >= '0' && ch <= '9') { - return ch - '0'; + return UnsafeNumericCast(ch - '0'); } if (ch >= 'a' && ch <= 'f') { - return 10 + ch - 'a'; + return UnsafeNumericCast(10 + ch - 'a'); } if (ch >= 'A' && ch <= 'F') { - return 10 + ch - 'A'; + return UnsafeNumericCast(10 + ch - 'A'); } return 0; }; @@ -23,7 +23,7 @@ bool UUID::FromString(const string &str, hugeint_t &result) { if (str.empty()) { return false; } - int has_braces = 0; + idx_t has_braces = 0; if (str.front() == '{') { has_braces = 1; } @@ -54,14 +54,15 @@ bool UUID::FromString(const string &str, hugeint_t &result) { } void UUID::ToString(hugeint_t input, char *buf) { - auto byte_to_hex = [](char byte_val, char *buf, idx_t &pos) { + auto byte_to_hex = [](uint64_t byte_val, char *buf, idx_t &pos) { + D_ASSERT(byte_val <= 0xFF); static char const HEX_DIGITS[] = "0123456789abcdef"; buf[pos++] = HEX_DIGITS[(byte_val >> 4) & 0xf]; buf[pos++] = HEX_DIGITS[byte_val & 0xf]; }; // Flip back before convert to string - int64_t upper = input.upper ^ (uint64_t(1) << 63); + int64_t upper = int64_t(uint64_t(input.upper) ^ (uint64_t(1) << 63)); idx_t pos = 0; byte_to_hex(upper >> 56 & 0xFF, buf, pos); byte_to_hex(upper >> 48 & 0xFF, buf, pos); diff --git a/src/duckdb/src/common/types/value.cpp b/src/duckdb/src/common/types/value.cpp index fb3ee10c..9fae9858 100644 --- a/src/duckdb/src/common/types/value.cpp +++ b/src/duckdb/src/common/types/value.cpp @@ -162,7 +162,7 @@ Value::Value(string val) : type_(LogicalType::VARCHAR), is_null(false) { if (!Value::StringIsValid(val.c_str(), val.size())) { throw ErrorManager::InvalidUnicodeError(val, "value construction"); } - value_info_ = make_shared(std::move(val)); + value_info_ = make_shared_ptr(std::move(val)); } Value::~Value() { @@ -230,10 +230,16 @@ Value Value::MinimumValue(const LogicalType &type) { case LogicalTypeId::TIMESTAMP: return Value::TIMESTAMP(Date::FromDate(Timestamp::MIN_YEAR, Timestamp::MIN_MONTH, Timestamp::MIN_DAY), dtime_t(0)); - case LogicalTypeId::TIMESTAMP_SEC: - return MinimumValue(LogicalType::TIMESTAMP).DefaultCastAs(LogicalType::TIMESTAMP_S); - case LogicalTypeId::TIMESTAMP_MS: - return MinimumValue(LogicalType::TIMESTAMP).DefaultCastAs(LogicalType::TIMESTAMP_MS); + case LogicalTypeId::TIMESTAMP_SEC: { + // Casting rounds up, which will overflow + const auto min_us = MinimumValue(LogicalType::TIMESTAMP).GetValue(); + return Value::TIMESTAMPSEC(timestamp_t(Timestamp::GetEpochSeconds(min_us))); + } + case LogicalTypeId::TIMESTAMP_MS: { + // Casting rounds up, which will overflow + const auto min_us = MinimumValue(LogicalType::TIMESTAMP).GetValue(); + return Value::TIMESTAMPMS(timestamp_t(Timestamp::GetEpochMs(min_us))); + } case LogicalTypeId::TIMESTAMP_NS: return Value::TIMESTAMPNS(timestamp_t(NumericLimits::Minimum())); case LogicalTypeId::TIME_TZ: @@ -303,12 +309,18 @@ Value Value::MaximumValue(const LogicalType &type) { return Value::TIME(dtime_t(Interval::MICROS_PER_DAY)); case LogicalTypeId::TIMESTAMP: return Value::TIMESTAMP(timestamp_t(NumericLimits::Maximum() - 1)); - case LogicalTypeId::TIMESTAMP_MS: - return MaximumValue(LogicalType::TIMESTAMP).DefaultCastAs(LogicalType::TIMESTAMP_MS); + case LogicalTypeId::TIMESTAMP_MS: { + // Casting rounds up, which will overflow + const auto max_us = MaximumValue(LogicalType::TIMESTAMP).GetValue(); + return Value::TIMESTAMPMS(timestamp_t(Timestamp::GetEpochMs(max_us))); + } case LogicalTypeId::TIMESTAMP_NS: return Value::TIMESTAMPNS(timestamp_t(NumericLimits::Maximum() - 1)); - case LogicalTypeId::TIMESTAMP_SEC: - return MaximumValue(LogicalType::TIMESTAMP).DefaultCastAs(LogicalType::TIMESTAMP_S); + case LogicalTypeId::TIMESTAMP_SEC: { + // Casting rounds up, which will overflow + const auto max_us = MaximumValue(LogicalType::TIMESTAMP).GetValue(); + return Value::TIMESTAMPSEC(timestamp_t(Timestamp::GetEpochSeconds(max_us))); + } case LogicalTypeId::TIME_TZ: // "24:00:00-1559" from the PG docs but actually "24:00:00-15:59:59" return Value::TIMETZ(dtime_tz_t(dtime_t(Interval::MICROS_PER_DAY), dtime_tz_t::MIN_OFFSET)); @@ -668,7 +680,7 @@ Value Value::STRUCT(const LogicalType &type, vector struct_values) { for (size_t i = 0; i < struct_values.size(); i++) { struct_values[i] = struct_values[i].DefaultCastAs(child_types[i].second); } - result.value_info_ = make_shared(std::move(struct_values)); + result.value_info_ = make_shared_ptr(std::move(struct_values)); result.type_ = type; result.is_null = false; return result; @@ -711,7 +723,19 @@ Value Value::MAP(const LogicalType &key_type, const LogicalType &value_type, vec new_children.push_back(std::make_pair("value", std::move(values[i]))); values[i] = Value::STRUCT(std::move(new_children)); } - result.value_info_ = make_shared(std::move(values)); + result.value_info_ = make_shared_ptr(std::move(values)); + return result; +} + +Value Value::MAP(const unordered_map &kv_pairs) { + Value result; + result.type_ = LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR); + result.is_null = false; + vector pairs; + for (auto &kv : kv_pairs) { + pairs.push_back(Value::STRUCT({{"key", Value(kv.first)}, {"value", Value(kv.second)}})); + } + result.value_info_ = make_shared_ptr(std::move(pairs)); return result; } @@ -735,7 +759,7 @@ Value Value::UNION(child_list_t members, uint8_t tag, Value value) } } union_values[tag + 1] = std::move(value); - result.value_info_ = make_shared(std::move(union_values)); + result.value_info_ = make_shared_ptr(std::move(union_values)); result.type_ = LogicalType::UNION(std::move(members)); return result; } @@ -752,7 +776,7 @@ Value Value::LIST(vector values) { #endif Value result; result.type_ = LogicalType::LIST(values[0].type()); - result.value_info_ = make_shared(std::move(values)); + result.value_info_ = make_shared_ptr(std::move(values)); result.is_null = false; return result; } @@ -770,7 +794,7 @@ Value Value::LIST(const LogicalType &child_type, vector values) { Value Value::EMPTYLIST(const LogicalType &child_type) { Value result; result.type_ = LogicalType::LIST(child_type); - result.value_info_ = make_shared(); + result.value_info_ = make_shared_ptr(); result.is_null = false; return result; } @@ -787,7 +811,7 @@ Value Value::ARRAY(vector values) { #endif Value result; result.type_ = LogicalType::ARRAY(values[0].type(), values.size()); - result.value_info_ = make_shared(std::move(values)); + result.value_info_ = make_shared_ptr(std::move(values)); result.is_null = false; return result; } @@ -805,7 +829,7 @@ Value Value::ARRAY(const LogicalType &child_type, vector values) { Value Value::EMPTYARRAY(const LogicalType &child_type, uint32_t size) { Value result; result.type_ = LogicalType::ARRAY(child_type, size); - result.value_info_ = make_shared(); + result.value_info_ = make_shared_ptr(); result.is_null = false; return result; } @@ -813,35 +837,35 @@ Value Value::EMPTYARRAY(const LogicalType &child_type, uint32_t size) { Value Value::BLOB(const_data_ptr_t data, idx_t len) { Value result(LogicalType::BLOB); result.is_null = false; - result.value_info_ = make_shared(string(const_char_ptr_cast(data), len)); + result.value_info_ = make_shared_ptr(string(const_char_ptr_cast(data), len)); return result; } Value Value::BLOB(const string &data) { Value result(LogicalType::BLOB); result.is_null = false; - result.value_info_ = make_shared(Blob::ToBlob(string_t(data))); + result.value_info_ = make_shared_ptr(Blob::ToBlob(string_t(data))); return result; } Value Value::AGGREGATE_STATE(const LogicalType &type, const_data_ptr_t data, idx_t len) { // NOLINT Value result(type); result.is_null = false; - result.value_info_ = make_shared(string(const_char_ptr_cast(data), len)); + result.value_info_ = make_shared_ptr(string(const_char_ptr_cast(data), len)); return result; } Value Value::BIT(const_data_ptr_t data, idx_t len) { Value result(LogicalType::BIT); result.is_null = false; - result.value_info_ = make_shared(string(const_char_ptr_cast(data), len)); + result.value_info_ = make_shared_ptr(string(const_char_ptr_cast(data), len)); return result; } Value Value::BIT(const string &data) { Value result(LogicalType::BIT); result.is_null = false; - result.value_info_ = make_shared(Bit::ToBit(string_t(data))); + result.value_info_ = make_shared_ptr(Bit::ToBit(string_t(data))); return result; } @@ -1209,11 +1233,11 @@ Value Value::Numeric(const LogicalType &type, int64_t value) { return Value::UINTEGER((uint32_t)value); case LogicalTypeId::UBIGINT: D_ASSERT(value >= 0); - return Value::UBIGINT(value); + return Value::UBIGINT(NumericCast(value)); case LogicalTypeId::HUGEINT: return Value::HUGEINT(value); case LogicalTypeId::UHUGEINT: - return Value::UHUGEINT(value); + return Value::UHUGEINT(NumericCast(value)); case LogicalTypeId::DECIMAL: return Value::DECIMAL(value, DecimalType::GetWidth(type), DecimalType::GetScale(type)); case LogicalTypeId::FLOAT: @@ -1221,7 +1245,7 @@ Value Value::Numeric(const LogicalType &type, int64_t value) { case LogicalTypeId::DOUBLE: return Value((double)value); case LogicalTypeId::POINTER: - return Value::POINTER(value); + return Value::POINTER(NumericCast(value)); case LogicalTypeId::DATE: D_ASSERT(value >= NumericLimits::Minimum() && value <= NumericLimits::Maximum()); return Value::DATE(date_t(NumericCast(value))); @@ -1662,7 +1686,7 @@ hugeint_t IntegralValue::Get(const Value &value) { case PhysicalType::UINT32: return UIntegerValue::Get(value); case PhysicalType::UINT64: - return UBigIntValue::Get(value); + return NumericCast(UBigIntValue::Get(value)); case PhysicalType::UINT128: return static_cast(UhugeIntValue::Get(value)); default: @@ -1936,27 +1960,27 @@ Value Value::Deserialize(Deserializer &deserializer) { case PhysicalType::VARCHAR: { auto str = deserializer.ReadProperty(102, "value"); if (type.id() == LogicalTypeId::BLOB) { - new_value.value_info_ = make_shared(Blob::ToBlob(str)); + new_value.value_info_ = make_shared_ptr(Blob::ToBlob(str)); } else { - new_value.value_info_ = make_shared(str); + new_value.value_info_ = make_shared_ptr(str); } } break; case PhysicalType::LIST: { deserializer.ReadObject(102, "value", [&](Deserializer &obj) { auto children = obj.ReadProperty>(100, "children"); - new_value.value_info_ = make_shared(children); + new_value.value_info_ = make_shared_ptr(children); }); } break; case PhysicalType::STRUCT: { deserializer.ReadObject(102, "value", [&](Deserializer &obj) { auto children = obj.ReadProperty>(100, "children"); - new_value.value_info_ = make_shared(children); + new_value.value_info_ = make_shared_ptr(children); }); } break; case PhysicalType::ARRAY: { deserializer.ReadObject(102, "value", [&](Deserializer &obj) { auto children = obj.ReadProperty>(100, "children"); - new_value.value_info_ = make_shared(children); + new_value.value_info_ = make_shared_ptr(children); }); } break; default: diff --git a/src/duckdb/src/common/types/vector.cpp b/src/duckdb/src/common/types/vector.cpp index b1779112..aa08072a 100644 --- a/src/duckdb/src/common/types/vector.cpp +++ b/src/duckdb/src/common/types/vector.cpp @@ -306,103 +306,82 @@ void Vector::Initialize(bool zero_data, idx_t capacity) { } } -struct DataArrays { - Vector &vec; - data_ptr_t data; - optional_ptr buffer; - idx_t type_size; - bool is_nested; - idx_t nested_multiplier; - DataArrays(Vector &vec, data_ptr_t data, optional_ptr buffer, idx_t type_size, bool is_nested, - idx_t nested_multiplier = 1) - : vec(vec), data(data), buffer(buffer), type_size(type_size), is_nested(is_nested), - nested_multiplier(nested_multiplier) { - } -}; - -void FindChildren(vector &to_resize, VectorBuffer &auxiliary, idx_t current_multiplier) { - if (auxiliary.GetBufferType() == VectorBufferType::LIST_BUFFER) { - auto &buffer = auxiliary.Cast(); - auto &child = buffer.GetChild(); - auto data = child.GetData(); - if (!data) { - //! Nested type - DataArrays arrays(child, data, child.GetBuffer().get(), GetTypeIdSize(child.GetType().InternalType()), - true); - to_resize.emplace_back(arrays); - FindChildren(to_resize, *child.GetAuxiliary(), current_multiplier); - } else { - DataArrays arrays(child, data, child.GetBuffer().get(), GetTypeIdSize(child.GetType().InternalType()), - false); - to_resize.emplace_back(arrays); - } - } else if (auxiliary.GetBufferType() == VectorBufferType::STRUCT_BUFFER) { - auto &buffer = auxiliary.Cast(); - auto &children = buffer.GetChildren(); +void Vector::FindResizeInfos(vector &resize_infos, const idx_t multiplier) { + + ResizeInfo resize_info(*this, data, buffer.get(), multiplier); + resize_infos.emplace_back(resize_info); + + // Base case. + if (data) { + return; + } + + D_ASSERT(auxiliary); + switch (GetAuxiliary()->GetBufferType()) { + case VectorBufferType::LIST_BUFFER: { + auto &vector_list_buffer = auxiliary->Cast(); + auto &child = vector_list_buffer.GetChild(); + child.FindResizeInfos(resize_infos, multiplier); + break; + } + case VectorBufferType::STRUCT_BUFFER: { + auto &vector_struct_buffer = auxiliary->Cast(); + auto &children = vector_struct_buffer.GetChildren(); for (auto &child : children) { - auto data = child->GetData(); - if (!data) { - //! Nested type - DataArrays arrays(*child, data, child->GetBuffer().get(), - GetTypeIdSize(child->GetType().InternalType()), true); - to_resize.emplace_back(arrays); - FindChildren(to_resize, *child->GetAuxiliary(), current_multiplier); - } else { - DataArrays arrays(*child, data, child->GetBuffer().get(), - GetTypeIdSize(child->GetType().InternalType()), false); - to_resize.emplace_back(arrays); - } - } - } else if (auxiliary.GetBufferType() == VectorBufferType::ARRAY_BUFFER) { - auto &buffer = auxiliary.Cast(); - auto array_size = buffer.GetArraySize(); - auto &child = buffer.GetChild(); - auto data = child.GetData(); - if (!data) { - //! Nested type - DataArrays arrays(child, data, child.GetBuffer().get(), GetTypeIdSize(child.GetType().InternalType()), true, - current_multiplier); - to_resize.emplace_back(arrays); - - // The child vectors of ArrayTypes always have to be (size * array_size), so we need to multiply the - // multiplier by the array size - auto new_multiplier = current_multiplier * array_size; - FindChildren(to_resize, *child.GetAuxiliary(), new_multiplier); - } else { - DataArrays arrays(child, data, child.GetBuffer().get(), GetTypeIdSize(child.GetType().InternalType()), - false, current_multiplier); - to_resize.emplace_back(arrays); + child->FindResizeInfos(resize_infos, multiplier); } + break; + } + case VectorBufferType::ARRAY_BUFFER: { + // We need to multiply the multiplier by the array size because + // the child vectors of ARRAY types are always child_count * array_size. + auto &vector_array_buffer = auxiliary->Cast(); + auto new_multiplier = vector_array_buffer.GetArraySize() * multiplier; + auto &child = vector_array_buffer.GetChild(); + child.FindResizeInfos(resize_infos, new_multiplier); + break; + } + default: + break; } } -void Vector::Resize(idx_t cur_size, idx_t new_size) { - vector to_resize; + +void Vector::Resize(idx_t current_size, idx_t new_size) { + // The vector does not contain any data. if (!buffer) { buffer = make_buffer(0); } - if (!data) { - //! this is a nested structure - DataArrays arrays(*this, data, buffer.get(), GetTypeIdSize(GetType().InternalType()), true); - to_resize.emplace_back(arrays); - // The child vectors of ArrayTypes always have to be (size * array_size), so we need to multiply the - // resize amount by the array size recursively for every nested array. - auto start_multiplier = GetType().id() == LogicalTypeId::ARRAY ? ArrayType::GetSize(GetType()) : 1; - FindChildren(to_resize, *auxiliary, start_multiplier); - } else { - DataArrays arrays(*this, data, buffer.get(), GetTypeIdSize(GetType().InternalType()), false); - to_resize.emplace_back(arrays); - } - for (auto &data_to_resize : to_resize) { - if (!data_to_resize.is_nested) { - auto new_data = - make_unsafe_uniq_array(new_size * data_to_resize.type_size * data_to_resize.nested_multiplier); - memcpy(new_data.get(), data_to_resize.data, - cur_size * data_to_resize.type_size * data_to_resize.nested_multiplier * sizeof(data_t)); - data_to_resize.buffer->SetData(std::move(new_data)); - data_to_resize.vec.data = data_to_resize.buffer->GetData(); + // Obtain the resize information for each (nested) vector. + vector resize_infos; + FindResizeInfos(resize_infos, 1); + + for (auto &resize_info_entry : resize_infos) { + // Resize the validity mask. + auto new_validity_size = new_size * resize_info_entry.multiplier; + resize_info_entry.vec.validity.Resize(current_size, new_validity_size); + + // For nested data types, we only need to resize the validity mask. + if (!resize_info_entry.data) { + continue; } - data_to_resize.vec.validity.Resize(cur_size, new_size * data_to_resize.nested_multiplier); + + auto type_size = GetTypeIdSize(resize_info_entry.vec.GetType().InternalType()); + auto old_size = current_size * type_size * resize_info_entry.multiplier * sizeof(data_t); + auto target_size = new_size * type_size * resize_info_entry.multiplier * sizeof(data_t); + + // We have an upper limit of 128GB for a single vector. + if (target_size > DConstants::MAX_VECTOR_SIZE) { + throw OutOfRangeException("Cannot resize vector to %s: maximum allowed vector size is %s", + StringUtil::BytesToHumanReadableString(target_size), + StringUtil::BytesToHumanReadableString(DConstants::MAX_VECTOR_SIZE)); + } + + // Copy the data buffer to a resized buffer. + auto new_data = make_unsafe_uniq_array(target_size); + memcpy(new_data.get(), resize_info_entry.data, old_size); + resize_info_entry.buffer->SetData(std::move(new_data)); + resize_info_entry.vec.data = resize_info_entry.buffer->GetData(); } } @@ -555,7 +534,7 @@ Value Vector::GetValueInternal(const Vector &v_p, idx_t index_p) { case VectorType::SEQUENCE_VECTOR: { int64_t start, increment; SequenceVector::GetSequence(*vector, start, increment); - return Value::Numeric(vector->GetType(), start + increment * index); + return Value::Numeric(vector->GetType(), start + increment * NumericCast(index)); } default: throw InternalException("Unimplemented vector type for Vector::GetValue"); @@ -788,7 +767,7 @@ string Vector::ToString(idx_t count) const { int64_t start, increment; SequenceVector::GetSequence(*this, start, increment); for (idx_t i = 0; i < count; i++) { - retval += to_string(start + increment * i) + (i == count - 1 ? "" : ", "); + retval += to_string(start + increment * UnsafeNumericCast(i)) + (i == count - 1 ? "" : ", "); } break; } @@ -1006,7 +985,7 @@ void Vector::Flatten(idx_t count) { buffer = VectorBuffer::CreateStandardVector(GetType()); data = buffer->GetData(); - VectorOperations::GenerateSequence(*this, sequence_count, start, increment); + VectorOperations::GenerateSequence(*this, NumericCast(sequence_count), start, increment); break; } default: @@ -1213,7 +1192,7 @@ void Vector::Deserialize(Deserializer &deserializer, idx_t count) { validity.Reset(); const auto has_validity = deserializer.ReadProperty(100, "all_valid"); if (has_validity) { - validity.Initialize(count); + validity.Initialize(MaxValue(count, STANDARD_VECTOR_SIZE)); deserializer.ReadProperty(101, "validity", data_ptr_cast(validity.GetData()), validity.ValidityMaskSize(count)); } @@ -2089,10 +2068,6 @@ void MapVector::EvalMapInvalidReason(MapInvalidReason reason) { throw InvalidInputException("Map keys must be unique."); case MapInvalidReason::NULL_KEY: throw InvalidInputException("Map keys can not be NULL."); - case MapInvalidReason::NULL_KEY_LIST: - throw InvalidInputException("The list of map keys must not be NULL."); - case MapInvalidReason::NULL_VALUE_LIST: - throw InvalidInputException("The list of map values must not be NULL."); case MapInvalidReason::NOT_ALIGNED: throw InvalidInputException("The map key list does not align with the map value list."); case MapInvalidReason::INVALID_PARAMS: diff --git a/src/duckdb/src/common/types/vector_buffer.cpp b/src/duckdb/src/common/types/vector_buffer.cpp index 7a7db5fa..59bc6f9c 100644 --- a/src/duckdb/src/common/types/vector_buffer.cpp +++ b/src/duckdb/src/common/types/vector_buffer.cpp @@ -68,6 +68,10 @@ VectorListBuffer::VectorListBuffer(const LogicalType &list_type, idx_t initial_c void VectorListBuffer::Reserve(idx_t to_reserve) { if (to_reserve > capacity) { idx_t new_capacity = NextPowerOfTwo(to_reserve); + if (new_capacity == 0) { + // Overflow: set to_reserve to the maximum value + new_capacity = to_reserve; + } D_ASSERT(new_capacity >= to_reserve); child->Resize(capacity, new_capacity); capacity = new_capacity; diff --git a/src/duckdb/src/common/types/vector_cache.cpp b/src/duckdb/src/common/types/vector_cache.cpp index c0ea6fa7..56664319 100644 --- a/src/duckdb/src/common/types/vector_cache.cpp +++ b/src/duckdb/src/common/types/vector_cache.cpp @@ -18,7 +18,7 @@ class VectorCacheBuffer : public VectorBuffer { auto &child_type = ListType::GetChildType(type); child_caches.push_back(make_buffer(allocator, child_type, capacity)); auto child_vector = make_uniq(child_type, false, false); - auxiliary = make_shared(std::move(child_vector)); + auxiliary = make_shared_ptr(std::move(child_vector)); break; } case PhysicalType::ARRAY: { @@ -26,7 +26,7 @@ class VectorCacheBuffer : public VectorBuffer { auto array_size = ArrayType::GetSize(type); child_caches.push_back(make_buffer(allocator, child_type, array_size * capacity)); auto child_vector = make_uniq(child_type, true, false, array_size * capacity); - auxiliary = make_shared(std::move(child_vector), array_size, capacity); + auxiliary = make_shared_ptr(std::move(child_vector), array_size, capacity); break; } case PhysicalType::STRUCT: { @@ -34,7 +34,7 @@ class VectorCacheBuffer : public VectorBuffer { for (auto &child_type : child_types) { child_caches.push_back(make_buffer(allocator, child_type.second, capacity)); } - auto struct_buffer = make_shared(type); + auto struct_buffer = make_shared_ptr(type); auxiliary = std::move(struct_buffer); break; } diff --git a/src/duckdb/src/common/vector_operations/generators.cpp b/src/duckdb/src/common/vector_operations/generators.cpp index a5faba93..2fc5b67c 100644 --- a/src/duckdb/src/common/vector_operations/generators.cpp +++ b/src/duckdb/src/common/vector_operations/generators.cpp @@ -18,7 +18,7 @@ void TemplatedGenerateSequence(Vector &result, idx_t count, int64_t start, int64 } result.SetVectorType(VectorType::FLAT_VECTOR); auto result_data = FlatVector::GetData(result); - auto value = (T)start; + auto value = T(start); for (idx_t i = 0; i < count; i++) { if (i > 0) { value += increment; @@ -44,12 +44,6 @@ void VectorOperations::GenerateSequence(Vector &result, idx_t count, int64_t sta case PhysicalType::INT64: TemplatedGenerateSequence(result, count, start, increment); break; - case PhysicalType::FLOAT: - TemplatedGenerateSequence(result, count, start, increment); - break; - case PhysicalType::DOUBLE: - TemplatedGenerateSequence(result, count, start, increment); - break; default: throw NotImplementedException("Unimplemented type for generate sequence"); } @@ -64,10 +58,10 @@ void TemplatedGenerateSequence(Vector &result, idx_t count, const SelectionVecto } result.SetVectorType(VectorType::FLAT_VECTOR); auto result_data = FlatVector::GetData(result); - auto value = (T)start; + auto value = static_cast(start); for (idx_t i = 0; i < count; i++) { - auto idx = UnsafeNumericCast(sel.get_index(i)); - result_data[idx] = UnsafeNumericCast(value + increment * idx); + auto idx = sel.get_index(i); + result_data[idx] = static_cast(value + static_cast(increment) * idx); } } @@ -89,12 +83,6 @@ void VectorOperations::GenerateSequence(Vector &result, idx_t count, const Selec case PhysicalType::INT64: TemplatedGenerateSequence(result, count, sel, start, increment); break; - case PhysicalType::FLOAT: - TemplatedGenerateSequence(result, count, sel, start, increment); - break; - case PhysicalType::DOUBLE: - TemplatedGenerateSequence(result, count, sel, start, increment); - break; default: throw NotImplementedException("Unimplemented type for generate sequence"); } diff --git a/src/duckdb/src/common/vector_operations/is_distinct_from.cpp b/src/duckdb/src/common/vector_operations/is_distinct_from.cpp index 82ef3166..e9a31ee0 100644 --- a/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +++ b/src/duckdb/src/common/vector_operations/is_distinct_from.cpp @@ -476,6 +476,16 @@ idx_t PositionComparator::Final(Vector &left, Vector & return VectorOperations::DistinctGreaterThan(right, left, &sel, count, true_sel, false_sel, null_mask); } +template <> +idx_t PositionComparator::Final(Vector &left, Vector &right, + const SelectionVector &sel, idx_t count, + optional_ptr true_sel, + optional_ptr false_sel, + optional_ptr null_mask) { + // DistinctGreaterThan has NULLs last + return VectorOperations::DistinctGreaterThan(right, left, &sel, count, true_sel, false_sel, null_mask); +} + template <> idx_t PositionComparator::Final(Vector &left, Vector &right, const SelectionVector &sel, idx_t count, optional_ptr true_sel, @@ -484,6 +494,16 @@ idx_t PositionComparator::Final(Vector &left, Vecto return VectorOperations::DistinctGreaterThan(left, right, &sel, count, true_sel, false_sel, null_mask); } +template <> +idx_t PositionComparator::Final(Vector &left, Vector &right, + const SelectionVector &sel, idx_t count, + optional_ptr true_sel, + optional_ptr false_sel, + optional_ptr null_mask) { + // DistinctLessThan has NULLs last + return VectorOperations::DistinctLessThan(right, left, &sel, count, true_sel, false_sel, null_mask); +} + using StructEntries = vector>; static void ExtractNestedSelection(const SelectionVector &slice_sel, const idx_t count, const SelectionVector &sel, diff --git a/src/duckdb/src/common/vector_operations/null_operations.cpp b/src/duckdb/src/common/vector_operations/null_operations.cpp index 48bc904d..dd34ac8e 100644 --- a/src/duckdb/src/common/vector_operations/null_operations.cpp +++ b/src/duckdb/src/common/vector_operations/null_operations.cpp @@ -102,7 +102,7 @@ idx_t VectorOperations::CountNotNull(Vector &input, const idx_t count) { default: for (idx_t i = 0; i < count; ++i) { const auto row_idx = vdata.sel->get_index(i); - valid += int(vdata.validity.RowIsValid(row_idx)); + valid += idx_t(vdata.validity.RowIsValid(row_idx)); } break; } diff --git a/src/duckdb/src/common/vector_operations/numeric_inplace_operators.cpp b/src/duckdb/src/common/vector_operations/numeric_inplace_operators.cpp index d2bd0f31..863f3ba8 100644 --- a/src/duckdb/src/common/vector_operations/numeric_inplace_operators.cpp +++ b/src/duckdb/src/common/vector_operations/numeric_inplace_operators.cpp @@ -23,14 +23,14 @@ void VectorOperations::AddInPlace(Vector &input, int64_t right, idx_t count) { case VectorType::CONSTANT_VECTOR: { D_ASSERT(!ConstantVector::IsNull(input)); auto data = ConstantVector::GetData(input); - *data += right; + *data += UnsafeNumericCast(right); break; } default: { D_ASSERT(input.GetVectorType() == VectorType::FLAT_VECTOR); auto data = FlatVector::GetData(input); for (idx_t i = 0; i < count; i++) { - data[i] += right; + data[i] = UnsafeNumericCast(UnsafeNumericCast(data[i]) + right); } break; } diff --git a/src/duckdb/src/core_functions/aggregate/distributive/approx_count.cpp b/src/duckdb/src/core_functions/aggregate/distributive/approx_count.cpp index 844e31ac..6b8dd0d7 100644 --- a/src/duckdb/src/core_functions/aggregate/distributive/approx_count.cpp +++ b/src/duckdb/src/core_functions/aggregate/distributive/approx_count.cpp @@ -43,7 +43,7 @@ struct ApproxCountDistinctFunction { template static void Finalize(STATE &state, T &target, AggregateFinalizeData &finalize_data) { if (state.log) { - target = state.log->Count(); + target = UnsafeNumericCast(state.log->Count()); } else { target = 0; } diff --git a/src/duckdb/src/core_functions/aggregate/distributive/arg_min_max.cpp b/src/duckdb/src/core_functions/aggregate/distributive/arg_min_max.cpp index 01f677e9..c39b0599 100644 --- a/src/duckdb/src/core_functions/aggregate/distributive/arg_min_max.cpp +++ b/src/duckdb/src/core_functions/aggregate/distributive/arg_min_max.cpp @@ -1,12 +1,12 @@ -#include "duckdb/core_functions/aggregate/distributive_functions.hpp" #include "duckdb/common/exception.hpp" +#include "duckdb/common/operator/comparison_operators.hpp" #include "duckdb/common/vector_operations/vector_operations.hpp" +#include "duckdb/core_functions/aggregate/distributive_functions.hpp" #include "duckdb/function/cast/cast_function_set.hpp" #include "duckdb/function/function_set.hpp" #include "duckdb/planner/expression/bound_aggregate_expression.hpp" #include "duckdb/planner/expression/bound_comparison_expression.hpp" #include "duckdb/planner/expression_binder.hpp" -#include "duckdb/common/operator/comparison_operators.hpp" namespace duckdb { @@ -174,7 +174,9 @@ struct ArgMinMaxBase { static unique_ptr Bind(ClientContext &context, AggregateFunction &function, vector> &arguments) { - ExpressionBinder::PushCollation(context, arguments[1], arguments[1]->return_type, false); + if (arguments[1]->return_type.InternalType() == PhysicalType::VARCHAR) { + ExpressionBinder::PushCollation(context, arguments[1], arguments[1]->return_type, false); + } function.arguments[0] = arguments[0]->return_type; function.return_type = arguments[0]->return_type; return nullptr; @@ -318,9 +320,7 @@ AggregateFunction GetArgMinMaxFunctionInternal(const LogicalType &by_type, const if (type.InternalType() == PhysicalType::VARCHAR || by_type.InternalType() == PhysicalType::VARCHAR) { function.destructor = AggregateFunction::StateDestroy; } - if (by_type.InternalType() == PhysicalType::VARCHAR) { - function.bind = OP::Bind; - } + function.bind = OP::Bind; return function; } @@ -376,6 +376,13 @@ static unique_ptr BindDecimalArgMinMax(ClientContext &context, Agg idx_t best_target = DConstants::INVALID_INDEX; int64_t lowest_cost = NumericLimits::Maximum(); for (idx_t i = 0; i < by_types.size(); ++i) { + // Before falling back to casting, check for a physical type match for the by_type + if (by_types[i].InternalType() == by_type.InternalType()) { + lowest_cost = 0; + best_target = DConstants::INVALID_INDEX; + break; + } + auto cast_cost = CastFunctionSet::Get(context).ImplicitCastCost(by_type, by_types[i]); if (cast_cost < 0) { continue; diff --git a/src/duckdb/src/core_functions/aggregate/distributive/bitagg.cpp b/src/duckdb/src/core_functions/aggregate/distributive/bitagg.cpp index 3943707f..2d57a4f5 100644 --- a/src/duckdb/src/core_functions/aggregate/distributive/bitagg.cpp +++ b/src/duckdb/src/core_functions/aggregate/distributive/bitagg.cpp @@ -10,6 +10,7 @@ namespace duckdb { template struct BitState { + using TYPE = T; bool is_set; T value; }; @@ -67,7 +68,7 @@ struct BitwiseOperation { template static void Assign(STATE &state, INPUT_TYPE input) { - state.value = input; + state.value = typename STATE::TYPE(input); } template @@ -90,7 +91,7 @@ struct BitwiseOperation { if (!state.is_set) { finalize_data.ReturnNull(); } else { - target = state.value; + target = T(state.value); } } @@ -102,21 +103,23 @@ struct BitwiseOperation { struct BitAndOperation : public BitwiseOperation { template static void Execute(STATE &state, INPUT_TYPE input) { - state.value &= input; + state.value &= typename STATE::TYPE(input); + ; } }; struct BitOrOperation : public BitwiseOperation { template static void Execute(STATE &state, INPUT_TYPE input) { - state.value |= input; + state.value |= typename STATE::TYPE(input); + ; } }; struct BitXorOperation : public BitwiseOperation { template static void Execute(STATE &state, INPUT_TYPE input) { - state.value ^= input; + state.value ^= typename STATE::TYPE(input); } template diff --git a/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp b/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp index 700b0cce..36920a47 100644 --- a/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp +++ b/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp @@ -107,7 +107,7 @@ struct BitStringAggOperation { if (!TrySubtractOperator::Operation(max, min, result)) { return NumericLimits::Maximum(); } - idx_t val(result); + auto val = NumericCast(result); if (val == NumericLimits::Maximum()) { return val; } @@ -116,7 +116,7 @@ struct BitStringAggOperation { template static void Execute(STATE &state, INPUT_TYPE input, INPUT_TYPE min) { - Bit::SetBit(state.value, input - min, 1); + Bit::SetBit(state.value, UnsafeNumericCast(input - min), 1); } template diff --git a/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp b/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp index 9162f72b..61c996c0 100644 --- a/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp +++ b/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp @@ -140,8 +140,8 @@ unique_ptr SumPropagateStats(ClientContext &context, BoundAggreg default: throw InternalException("Unsupported type for propagate sum stats"); } - auto max_sum_negative = max_negative * hugeint_t(input.node_stats->max_cardinality); - auto max_sum_positive = max_positive * hugeint_t(input.node_stats->max_cardinality); + auto max_sum_negative = max_negative * Hugeint::Convert(input.node_stats->max_cardinality); + auto max_sum_positive = max_positive * Hugeint::Convert(input.node_stats->max_cardinality); if (max_sum_positive >= NumericLimits::Maximum() || max_sum_negative <= NumericLimits::Minimum()) { // sum can potentially exceed int64_t bounds: use hugeint sum diff --git a/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp b/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp index 338a0647..e356caec 100644 --- a/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +++ b/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp @@ -185,6 +185,8 @@ unique_ptr BindApproxQuantile(ClientContext &context, AggregateFun vector quantiles; if (quantile_val.type().id() != LogicalTypeId::LIST) { quantiles.push_back(CheckApproxQuantile(quantile_val)); + } else if (quantile_val.IsNull()) { + throw BinderException("APPROXIMATE QUANTILE parameter list cannot be NULL"); } else { for (const auto &element_val : ListValue::GetChildren(quantile_val)) { quantiles.push_back(CheckApproxQuantile(element_val)); diff --git a/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp b/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp index 029b10c3..f33ccc41 100644 --- a/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp +++ b/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp @@ -27,7 +27,7 @@ struct hash { template <> struct hash { inline size_t operator()(const duckdb::hugeint_t &val) const { - return hash {}(val.upper) ^ hash {}(val.lower); + return hash {}(val.upper) ^ hash {}(val.lower); } }; @@ -102,7 +102,7 @@ struct ModeState { void ModeRm(const KEY_TYPE &key, idx_t frame) { auto &attr = (*frequency_map)[key]; auto old_count = attr.count; - nonzero -= int(old_count == 1); + nonzero -= size_t(old_count == 1); attr.count -= 1; if (count == old_count && key == *mode) { diff --git a/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp b/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp index c82f7dff..84446a6c 100644 --- a/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +++ b/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp @@ -157,7 +157,7 @@ struct CastInterpolation { template static inline TARGET_TYPE Interpolate(const TARGET_TYPE &lo, const double d, const TARGET_TYPE &hi) { const auto delta = hi - lo; - return lo + delta * d; + return UnsafeNumericCast(lo + delta * d); } }; @@ -295,7 +295,8 @@ bool operator==(const QuantileValue &x, const QuantileValue &y) { template struct Interpolator { Interpolator(const QuantileValue &q, const idx_t n_p, const bool desc_p) - : desc(desc_p), RN((double)(n_p - 1) * q.dbl), FRN(floor(RN)), CRN(ceil(RN)), begin(0), end(n_p) { + : desc(desc_p), RN((double)(n_p - 1) * q.dbl), FRN(UnsafeNumericCast(floor(RN))), + CRN(UnsafeNumericCast(ceil(RN))), begin(0), end(n_p) { } template > @@ -356,14 +357,16 @@ struct Interpolator { // Integer arithmetic for accuracy const auto integral = q.integral; const auto scaling = q.scaling; - const auto scaled_q = DecimalMultiplyOverflowCheck::Operation(n, integral); - const auto scaled_n = DecimalMultiplyOverflowCheck::Operation(n, scaling); + const auto scaled_q = + DecimalMultiplyOverflowCheck::Operation(Hugeint::Convert(n), integral); + const auto scaled_n = + DecimalMultiplyOverflowCheck::Operation(Hugeint::Convert(n), scaling); floored = Cast::Operation((scaled_n - scaled_q) / scaling); break; } default: const auto scaled_q = (double)(n * q.dbl); - floored = floor(n - scaled_q); + floored = UnsafeNumericCast(floor(n - scaled_q)); break; } diff --git a/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp b/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp index 7da2cdbe..b96100de 100644 --- a/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp +++ b/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp @@ -52,11 +52,11 @@ struct ReservoirQuantileState { struct ReservoirQuantileBindData : public FunctionData { ReservoirQuantileBindData() { } - ReservoirQuantileBindData(double quantile_p, int32_t sample_size_p) + ReservoirQuantileBindData(double quantile_p, idx_t sample_size_p) : quantiles(1, quantile_p), sample_size(sample_size_p) { } - ReservoirQuantileBindData(vector quantiles_p, int32_t sample_size_p) + ReservoirQuantileBindData(vector quantiles_p, idx_t sample_size_p) : quantiles(std::move(quantiles_p)), sample_size(sample_size_p) { } @@ -84,7 +84,7 @@ struct ReservoirQuantileBindData : public FunctionData { } vector quantiles; - int32_t sample_size; + idx_t sample_size; }; struct ReservoirQuantileOperation { @@ -325,12 +325,13 @@ unique_ptr BindReservoirQuantile(ClientContext &context, Aggregate } if (arguments.size() == 2) { + // remove the quantile argument so we can use the unary aggregate if (function.arguments.size() == 2) { Function::EraseArgument(function, arguments, arguments.size() - 1); } else { arguments.pop_back(); } - return make_uniq(quantiles, 8192); + return make_uniq(quantiles, 8192ULL); } if (!arguments[2]->IsFoldable()) { throw BinderException("RESERVOIR_QUANTILE can only take constant sample size parameters"); @@ -345,10 +346,15 @@ unique_ptr BindReservoirQuantile(ClientContext &context, Aggregate throw BinderException("Size of the RESERVOIR_QUANTILE sample must be bigger than 0"); } - // remove the quantile argument so we can use the unary aggregate - Function::EraseArgument(function, arguments, arguments.size() - 1); - Function::EraseArgument(function, arguments, arguments.size() - 1); - return make_uniq(quantiles, sample_size); + // remove the quantile arguments so we can use the unary aggregate + if (function.arguments.size() == arguments.size()) { + Function::EraseArgument(function, arguments, arguments.size() - 1); + Function::EraseArgument(function, arguments, arguments.size() - 1); + } else { + arguments.pop_back(); + arguments.pop_back(); + } + return make_uniq(quantiles, NumericCast(sample_size)); } unique_ptr BindReservoirQuantileDecimal(ClientContext &context, AggregateFunction &function, diff --git a/src/duckdb/src/core_functions/function_list.cpp b/src/duckdb/src/core_functions/function_list.cpp index 540752a4..e62330b5 100644 --- a/src/duckdb/src/core_functions/function_list.cpp +++ b/src/duckdb/src/core_functions/function_list.cpp @@ -341,6 +341,7 @@ static const StaticFunctionDefinition internal_functions[] = { DUCKDB_AGGREGATE_FUNCTION_ALIAS(SumkahanFun), DUCKDB_SCALAR_FUNCTION(TanFun), DUCKDB_SCALAR_FUNCTION_SET(TimeBucketFun), + DUCKDB_SCALAR_FUNCTION(TimeTZSortKeyFun), DUCKDB_SCALAR_FUNCTION_SET(TimezoneFun), DUCKDB_SCALAR_FUNCTION_SET(TimezoneHourFun), DUCKDB_SCALAR_FUNCTION_SET(TimezoneMinuteFun), @@ -357,6 +358,7 @@ static const StaticFunctionDefinition internal_functions[] = { DUCKDB_SCALAR_FUNCTION(ToMillisecondsFun), DUCKDB_SCALAR_FUNCTION(ToMinutesFun), DUCKDB_SCALAR_FUNCTION(ToMonthsFun), + DUCKDB_SCALAR_FUNCTION(ToQuartersFun), DUCKDB_SCALAR_FUNCTION(ToSecondsFun), DUCKDB_SCALAR_FUNCTION(ToTimestampFun), DUCKDB_SCALAR_FUNCTION(ToWeeksFun), @@ -385,7 +387,6 @@ static const StaticFunctionDefinition internal_functions[] = { DUCKDB_SCALAR_FUNCTION_SET(WeekFun), DUCKDB_SCALAR_FUNCTION_SET(WeekDayFun), DUCKDB_SCALAR_FUNCTION_SET(WeekOfYearFun), - DUCKDB_SCALAR_FUNCTION(WhichSecretFun), DUCKDB_SCALAR_FUNCTION_SET(BitwiseXorFun), DUCKDB_SCALAR_FUNCTION_SET(YearFun), DUCKDB_SCALAR_FUNCTION_SET(YearWeekFun), diff --git a/src/duckdb/src/core_functions/lambda_functions.cpp b/src/duckdb/src/core_functions/lambda_functions.cpp index 3b67f880..ee78be58 100644 --- a/src/duckdb/src/core_functions/lambda_functions.cpp +++ b/src/duckdb/src/core_functions/lambda_functions.cpp @@ -154,7 +154,7 @@ struct ListFilterFunctor { // slice the input chunk's corresponding vector to get the new lists // and append them to the result - auto source_list_idx = execute_info.has_index ? 1 : 0; + idx_t source_list_idx = execute_info.has_index ? 1 : 0; Vector result_lists(execute_info.input_chunk.data[source_list_idx], sel, count); ListVector::Append(result, result_lists, count, 0); } @@ -353,7 +353,7 @@ void ExecuteLambda(DataChunk &args, ExpressionState &state, Vector &result) { // set the index vector if (info.has_index) { - index_vector.SetValue(elem_cnt, Value::BIGINT(child_idx + 1)); + index_vector.SetValue(elem_cnt, Value::BIGINT(NumericCast(child_idx + 1))); } elem_cnt++; diff --git a/src/duckdb/src/core_functions/scalar/array/array_functions.cpp b/src/duckdb/src/core_functions/scalar/array/array_functions.cpp index 9840ba1c..c5e7189b 100644 --- a/src/duckdb/src/core_functions/scalar/array/array_functions.cpp +++ b/src/duckdb/src/core_functions/scalar/array/array_functions.cpp @@ -208,6 +208,11 @@ static unique_ptr ArrayGenericBinaryBind(ClientContext &context, S auto &left_type = arguments[0]->return_type; auto &right_type = arguments[1]->return_type; + // mystery to me how anything non-array could ever end up here but it happened + if (left_type.id() != LogicalTypeId::ARRAY || right_type.id() != LogicalTypeId::ARRAY) { + throw InvalidInputException(StringUtil::Format("%s: Arguments must be arrays of FLOAT or DOUBLE", OP::NAME)); + } + auto left_size = ArrayType::GetSize(left_type); auto right_size = ArrayType::GetSize(right_type); if (left_size != right_size) { diff --git a/src/duckdb/src/core_functions/scalar/bit/bitstring.cpp b/src/duckdb/src/core_functions/scalar/bit/bitstring.cpp index babfadfe..fc176885 100644 --- a/src/duckdb/src/core_functions/scalar/bit/bitstring.cpp +++ b/src/duckdb/src/core_functions/scalar/bit/bitstring.cpp @@ -19,9 +19,9 @@ static void BitStringFunction(DataChunk &args, ExpressionState &state, Vector &r idx_t len; Bit::TryGetBitStringSize(input, len, nullptr); // string verification - len = Bit::ComputeBitstringLen(n); + len = Bit::ComputeBitstringLen(UnsafeNumericCast(n)); string_t target = StringVector::EmptyString(result, len); - Bit::BitString(input, n, target); + Bit::BitString(input, UnsafeNumericCast(n), target); target.Finalize(); return target; }); @@ -41,7 +41,7 @@ struct GetBitOperator { throw OutOfRangeException("bit index %s out of valid range (0..%s)", NumericHelper::ToString(n), NumericHelper::ToString(Bit::BitLength(input) - 1)); } - return UnsafeNumericCast(Bit::GetBit(input, n)); + return UnsafeNumericCast(Bit::GetBit(input, UnsafeNumericCast(n))); } }; @@ -66,7 +66,7 @@ static void SetBitOperation(DataChunk &args, ExpressionState &state, Vector &res } string_t target = StringVector::EmptyString(result, input.GetSize()); memcpy(target.GetDataWriteable(), input.GetData(), input.GetSize()); - Bit::SetBit(target, n, new_value); + Bit::SetBit(target, UnsafeNumericCast(n), UnsafeNumericCast(new_value)); return target; }); } diff --git a/src/duckdb/src/core_functions/scalar/blob/create_sort_key.cpp b/src/duckdb/src/core_functions/scalar/blob/create_sort_key.cpp index 880acd2c..a9142443 100644 --- a/src/duckdb/src/core_functions/scalar/blob/create_sort_key.cpp +++ b/src/duckdb/src/core_functions/scalar/blob/create_sort_key.cpp @@ -186,7 +186,7 @@ struct SortKeyVarcharOperator { } static idx_t Encode(data_ptr_t result, TYPE input) { - auto input_data = input.GetDataUnsafe(); + auto input_data = const_data_ptr_cast(input.GetDataUnsafe()); auto input_size = input.GetSize(); for (idx_t r = 0; r < input_size; r++) { result[r] = input_data[r] + 1; @@ -519,7 +519,8 @@ void ConstructSortKeyList(SortKeyVectorData &vector_data, SortKeyChunk chunk, So } // write the end-of-list delimiter - result_ptr[offset++] = info.flip_bytes ? ~SortKeyVectorData::LIST_DELIMITER : SortKeyVectorData::LIST_DELIMITER; + result_ptr[offset++] = static_cast(info.flip_bytes ? ~SortKeyVectorData::LIST_DELIMITER + : SortKeyVectorData::LIST_DELIMITER); } } diff --git a/src/duckdb/src/core_functions/scalar/date/date_part.cpp b/src/duckdb/src/core_functions/scalar/date/date_part.cpp index 1c3e1644..3d0b7577 100644 --- a/src/duckdb/src/core_functions/scalar/date/date_part.cpp +++ b/src/duckdb/src/core_functions/scalar/date/date_part.cpp @@ -1432,8 +1432,8 @@ void DatePart::StructOperator::Operation(bigint_vec &bigint_values, double_vec & // Both define epoch, and the correct value is the sum. // So mask it out and compute it separately. - Operation(bigint_values, double_values, d, idx, mask & ~EPOCH); - Operation(bigint_values, double_values, t, idx, mask & ~EPOCH); + Operation(bigint_values, double_values, d, idx, mask & ~UnsafeNumericCast(EPOCH)); + Operation(bigint_values, double_values, t, idx, mask & ~UnsafeNumericCast(EPOCH)); if (mask & EPOCH) { auto part_data = HasPartValue(double_values, DatePartSpecifier::EPOCH); diff --git a/src/duckdb/src/core_functions/scalar/date/epoch.cpp b/src/duckdb/src/core_functions/scalar/date/epoch.cpp index 3de2d50a..0944335d 100644 --- a/src/duckdb/src/core_functions/scalar/date/epoch.cpp +++ b/src/duckdb/src/core_functions/scalar/date/epoch.cpp @@ -28,4 +28,21 @@ ScalarFunction ToTimestampFun::GetFunction() { return ScalarFunction({LogicalType::DOUBLE}, LogicalType::TIMESTAMP_TZ, EpochSecFunction); } +struct TimeTZSortKeyOperator { + template + static RESULT_TYPE Operation(INPUT_TYPE input) { + return input.sort_key(); + } +}; + +static void TimeTZSortKeyFunction(DataChunk &input, ExpressionState &state, Vector &result) { + D_ASSERT(input.ColumnCount() == 1); + + UnaryExecutor::Execute(input.data[0], result, input.size()); +} + +ScalarFunction TimeTZSortKeyFun::GetFunction() { + return ScalarFunction({LogicalType::TIME_TZ}, LogicalType::UBIGINT, TimeTZSortKeyFunction); +} + } // namespace duckdb diff --git a/src/duckdb/src/core_functions/scalar/date/strftime.cpp b/src/duckdb/src/core_functions/scalar/date/strftime.cpp index 72da80bb..01c907a5 100644 --- a/src/duckdb/src/core_functions/scalar/date/strftime.cpp +++ b/src/duckdb/src/core_functions/scalar/date/strftime.cpp @@ -33,7 +33,7 @@ struct StrfTimeBindData : public FunctionData { template static unique_ptr StrfTimeBindFunction(ClientContext &context, ScalarFunction &bound_function, vector> &arguments) { - auto format_idx = REVERSED ? 0 : 1; + auto format_idx = REVERSED ? 0U : 1U; auto &format_arg = arguments[format_idx]; if (format_arg->HasParameter()) { throw ParameterNotResolvedException(); diff --git a/src/duckdb/src/core_functions/scalar/date/to_interval.cpp b/src/duckdb/src/core_functions/scalar/date/to_interval.cpp index 6f283b15..d5ff5de6 100644 --- a/src/duckdb/src/core_functions/scalar/date/to_interval.cpp +++ b/src/duckdb/src/core_functions/scalar/date/to_interval.cpp @@ -65,6 +65,20 @@ struct ToYearsOperator { } }; +struct ToQuartersOperator { + template + static inline TR Operation(TA input) { + interval_t result; + if (!TryMultiplyOperator::Operation(input, Interval::MONTHS_PER_QUARTER, + result.months)) { + throw OutOfRangeException("Interval value %d quarters out of range", input); + } + result.days = 0; + result.micros = 0; + return result; + } +}; + struct ToMonthsOperator { template static inline TR Operation(TA input) { @@ -170,6 +184,11 @@ ScalarFunction ToYearsFun::GetFunction() { ScalarFunction::UnaryFunction); } +ScalarFunction ToQuartersFun::GetFunction() { + return ScalarFunction({LogicalType::INTEGER}, LogicalType::INTERVAL, + ScalarFunction::UnaryFunction); +} + ScalarFunction ToMonthsFun::GetFunction() { return ScalarFunction({LogicalType::INTEGER}, LogicalType::INTERVAL, ScalarFunction::UnaryFunction); diff --git a/src/duckdb/src/core_functions/scalar/debug/vector_type.cpp b/src/duckdb/src/core_functions/scalar/debug/vector_type.cpp index 0f2dc5e2..625273cd 100644 --- a/src/duckdb/src/core_functions/scalar/debug/vector_type.cpp +++ b/src/duckdb/src/core_functions/scalar/debug/vector_type.cpp @@ -1,6 +1,5 @@ #include "duckdb/core_functions/scalar/debug_functions.hpp" -#include "duckdb/common/exception.hpp" #include "duckdb/common/vector_operations/vector_operations.hpp" #include "duckdb/planner/expression/bound_function_expression.hpp" #include "duckdb/common/enum_util.hpp" @@ -14,10 +13,12 @@ static void VectorTypeFunction(DataChunk &input, ExpressionState &state, Vector } ScalarFunction VectorTypeFun::GetFunction() { - return ScalarFunction("vector_type", // name of the function - {LogicalType::ANY}, // argument list - LogicalType::VARCHAR, // return type - VectorTypeFunction); + auto vector_type_fun = ScalarFunction("vector_type", // name of the function + {LogicalType::ANY}, // argument list + LogicalType::VARCHAR, // return type + VectorTypeFunction); + vector_type_fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING; + return vector_type_fun; } } // namespace duckdb diff --git a/src/duckdb/src/core_functions/scalar/generic/current_setting.cpp b/src/duckdb/src/core_functions/scalar/generic/current_setting.cpp index 5eb5c91a..43bbdcfb 100644 --- a/src/duckdb/src/core_functions/scalar/generic/current_setting.cpp +++ b/src/duckdb/src/core_functions/scalar/generic/current_setting.cpp @@ -43,12 +43,11 @@ unique_ptr CurrentSettingBind(ClientContext &context, ScalarFuncti } Value key_val = ExpressionExecutor::EvaluateScalar(context, *key_child); D_ASSERT(key_val.type().id() == LogicalTypeId::VARCHAR); - auto &key_str = StringValue::Get(key_val); - if (key_val.IsNull() || key_str.empty()) { + if (key_val.IsNull() || StringValue::Get(key_val).empty()) { throw ParserException("Key name for current_setting needs to be neither NULL nor empty"); } - auto key = StringUtil::Lower(key_str); + auto key = StringUtil::Lower(StringValue::Get(key_val)); Value val; if (!context.TryGetCurrentSetting(key, val)) { Catalog::AutoloadExtensionByConfigName(context, key); diff --git a/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp b/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp index 6ef537ba..97fb3fbd 100644 --- a/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp +++ b/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp @@ -92,7 +92,7 @@ static void TransactionIdCurrent(DataChunk &input, ExpressionState &state, Vecto auto &context = state.GetContext(); auto &catalog = Catalog::GetCatalog(context, DatabaseManager::GetDefaultDatabase(context)); auto &transaction = DuckTransaction::Get(context, catalog); - auto val = Value::BIGINT(transaction.start_time); + auto val = Value::UBIGINT(transaction.start_time); result.Reference(val); } @@ -136,7 +136,7 @@ ScalarFunction InSearchPathFun::GetFunction() { } ScalarFunction CurrentTransactionIdFun::GetFunction() { - ScalarFunction txid_current({}, LogicalType::BIGINT, TransactionIdCurrent); + ScalarFunction txid_current({}, LogicalType::UBIGINT, TransactionIdCurrent); txid_current.stability = FunctionStability::CONSISTENT_WITHIN_QUERY; return txid_current; } diff --git a/src/duckdb/src/core_functions/scalar/list/array_slice.cpp b/src/duckdb/src/core_functions/scalar/list/array_slice.cpp index 83415d96..8075aeea 100644 --- a/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +++ b/src/duckdb/src/core_functions/scalar/list/array_slice.cpp @@ -48,14 +48,14 @@ static idx_t CalculateSliceLength(idx_t begin, idx_t end, INDEX_TYPE step, bool throw InvalidInputException("Slice step cannot be zero"); } if (step == 1) { - return NumericCast(end - begin); + return NumericCast(end - begin); } else if (static_cast(step) >= (end - begin)) { return 1; } - if ((end - begin) % step != 0) { - return (end - begin) / step + 1; + if ((end - begin) % UnsafeNumericCast(step) != 0) { + return (end - begin) / UnsafeNumericCast(step) + 1; } - return (end - begin) / step; + return (end - begin) / UnsafeNumericCast(step); } template @@ -65,7 +65,7 @@ INDEX_TYPE ValueLength(const INPUT_TYPE &value) { template <> int64_t ValueLength(const list_entry_t &value) { - return value.length; + return UnsafeNumericCast(value.length); } template <> @@ -119,8 +119,8 @@ INPUT_TYPE SliceValue(Vector &result, INPUT_TYPE input, INDEX_TYPE begin, INDEX_ template <> list_entry_t SliceValue(Vector &result, list_entry_t input, int64_t begin, int64_t end) { - input.offset += begin; - input.length = end - begin; + input.offset = UnsafeNumericCast(UnsafeNumericCast(input.offset) + begin); + input.length = UnsafeNumericCast(end - begin); return input; } @@ -144,15 +144,15 @@ list_entry_t SliceValueWithSteps(Vector &result, SelectionVector &sel, list_entr input.offset = sel_idx; return input; } - input.length = CalculateSliceLength(begin, end, step, true); - idx_t child_idx = input.offset + begin; + input.length = CalculateSliceLength(UnsafeNumericCast(begin), UnsafeNumericCast(end), step, true); + idx_t child_idx = input.offset + UnsafeNumericCast(begin); if (step < 0) { - child_idx = input.offset + end - 1; + child_idx = input.offset + UnsafeNumericCast(end) - 1; } input.offset = sel_idx; for (idx_t i = 0; i < input.length; i++) { sel.set_index(sel_idx, child_idx); - child_idx += step; + child_idx += static_cast(step); // intentional overflow?? sel_idx++; } return input; @@ -163,6 +163,18 @@ static void ExecuteConstantSlice(Vector &result, Vector &str_vector, Vector &beg optional_ptr step_vector, const idx_t count, SelectionVector &sel, idx_t &sel_idx, optional_ptr result_child_vector, bool begin_is_empty, bool end_is_empty) { + + // check all this nullness early + auto str_valid = !ConstantVector::IsNull(str_vector); + auto begin_valid = !ConstantVector::IsNull(begin_vector); + auto end_valid = !ConstantVector::IsNull(end_vector); + auto step_valid = step_vector && !ConstantVector::IsNull(*step_vector); + + if (!str_valid || !begin_valid || !end_valid || (step_vector && !step_valid)) { + ConstantVector::SetNull(result, true); + return; + } + auto result_data = ConstantVector::GetData(result); auto str_data = ConstantVector::GetData(str_vector); auto begin_data = ConstantVector::GetData(begin_vector); @@ -180,27 +192,23 @@ static void ExecuteConstantSlice(Vector &result, Vector &str_vector, Vector &beg end = begin_is_empty ? ValueLength(str) : end; } - auto str_valid = !ConstantVector::IsNull(str_vector); - auto begin_valid = !ConstantVector::IsNull(begin_vector); - auto end_valid = !ConstantVector::IsNull(end_vector); - auto step_valid = step_vector && !ConstantVector::IsNull(*step_vector); - // Clamp offsets bool clamp_result = false; - if (str_valid && begin_valid && end_valid && (step_valid || step == 1)) { + if (step_valid || step == 1) { clamp_result = ClampSlice(str, begin, end); } idx_t sel_length = 0; bool sel_valid = false; - if (step_vector && step_valid && str_valid && begin_valid && end_valid && step != 1 && end - begin > 0) { - sel_length = CalculateSliceLength(begin, end, step, step_valid); + if (step_valid && step != 1 && end - begin > 0) { + sel_length = + CalculateSliceLength(UnsafeNumericCast(begin), UnsafeNumericCast(end), step, step_valid); sel.Initialize(sel_length); sel_valid = true; } // Try to slice - if (!str_valid || !begin_valid || !end_valid || (step_vector && !step_valid) || !clamp_result) { + if (!clamp_result) { ConstantVector::SetNull(result, true); } else if (step == 1) { result_data[0] = SliceValue(result, str, begin, end); @@ -268,7 +276,8 @@ static void ExecuteFlatSlice(Vector &result, Vector &list_vector, Vector &begin_ idx_t length = 0; if (end - begin > 0) { - length = CalculateSliceLength(begin, end, step, step_valid); + length = + CalculateSliceLength(UnsafeNumericCast(begin), UnsafeNumericCast(end), step, step_valid); } sel_length += length; diff --git a/src/duckdb/src/core_functions/scalar/list/list_reduce.cpp b/src/duckdb/src/core_functions/scalar/list/list_reduce.cpp index 1f619780..b58a7412 100644 --- a/src/duckdb/src/core_functions/scalar/list/list_reduce.cpp +++ b/src/duckdb/src/core_functions/scalar/list/list_reduce.cpp @@ -99,7 +99,7 @@ static bool ExecuteReduce(idx_t loops, ReduceExecuteInfo &execute_info, LambdaFu } // create the index vector - Vector index_vector(Value::BIGINT(loops + 1)); + Vector index_vector(Value::BIGINT(UnsafeNumericCast(loops + 1))); // slice the left and right slice execute_info.left_slice.Slice(execute_info.left_slice, execute_info.left_sel, reduced_row_idx); diff --git a/src/duckdb/src/core_functions/scalar/list/list_sort.cpp b/src/duckdb/src/core_functions/scalar/list/list_sort.cpp index 9e52f4ea..f206c509 100644 --- a/src/duckdb/src/core_functions/scalar/list/list_sort.cpp +++ b/src/duckdb/src/core_functions/scalar/list/list_sort.cpp @@ -52,8 +52,8 @@ ListSortBindData::ListSortBindData(OrderType order_type_p, OrderByNullType null_ payload_layout.Initialize(payload_types); // get the BoundOrderByNode - auto idx_col_expr = make_uniq_base(LogicalType::USMALLINT, 0); - auto lists_col_expr = make_uniq_base(child_type, 1); + auto idx_col_expr = make_uniq_base(LogicalType::USMALLINT, 0U); + auto lists_col_expr = make_uniq_base(child_type, 1U); orders.emplace_back(OrderType::ASCENDING, OrderByNullType::ORDER_DEFAULT, std::move(idx_col_expr)); orders.emplace_back(order_type, null_order, std::move(lists_col_expr)); } @@ -244,7 +244,7 @@ static void ListSortFunction(DataChunk &args, ExpressionState &state, Vector &re } for (idx_t j = result_data[i].offset; j < result_data[i].offset + result_data[i].length; j++) { auto b = sel_sorted.get_index(j) - result_data[i].offset; - result_entry.SetValue(j, Value::BIGINT(b + 1)); + result_entry.SetValue(j, Value::BIGINT(UnsafeNumericCast(b + 1))); } } } else { diff --git a/src/duckdb/src/core_functions/scalar/list/list_value.cpp b/src/duckdb/src/core_functions/scalar/list/list_value.cpp index 9aae09e2..e2ae537f 100644 --- a/src/duckdb/src/core_functions/scalar/list/list_value.cpp +++ b/src/duckdb/src/core_functions/scalar/list/list_value.cpp @@ -59,7 +59,7 @@ static unique_ptr ListValueBind(ClientContext &context, ScalarFunc StringUtil::Format("Cannot unpivot columns of types %s and %s - an explicit cast is required", child_type.ToString(), arg_type.ToString()); throw BinderException(arguments[i]->query_location, - QueryErrorContext::Format(list_arguments, error, int(error_index), false)); + QueryErrorContext::Format(list_arguments, error, error_index, false)); } else { throw BinderException(arguments[i]->query_location, "Cannot create a list of types %s and %s - an explicit cast is required", diff --git a/src/duckdb/src/core_functions/scalar/list/range.cpp b/src/duckdb/src/core_functions/scalar/list/range.cpp index 4bb86853..d965eb30 100644 --- a/src/duckdb/src/core_functions/scalar/list/range.cpp +++ b/src/duckdb/src/core_functions/scalar/list/range.cpp @@ -80,7 +80,7 @@ struct TimestampRangeInfo { if (start_value < end_value && is_negative) { return 0; } - int64_t total_values = 0; + uint64_t total_values = 0; if (is_negative) { // negative interval, start_value is going down while (inclusive_bound ? start_value >= end_value : start_value > end_value) { @@ -203,7 +203,7 @@ static void ListRangeFunction(DataChunk &args, ExpressionState &state, Vector &r } auto list_data = FlatVector::GetData(result); auto &result_validity = FlatVector::Validity(result); - int64_t total_size = 0; + uint64_t total_size = 0; for (idx_t i = 0; i < args_size; i++) { if (!info.RowIsValid(i)) { result_validity.SetInvalid(i); diff --git a/src/duckdb/src/core_functions/scalar/map/map.cpp b/src/duckdb/src/core_functions/scalar/map/map.cpp index e27fe3fd..ab67475d 100644 --- a/src/duckdb/src/core_functions/scalar/map/map.cpp +++ b/src/duckdb/src/core_functions/scalar/map/map.cpp @@ -21,14 +21,38 @@ static void MapFunctionEmptyInput(Vector &result, const idx_t row_count) { result.Verify(row_count); } +static bool MapIsNull(DataChunk &chunk) { + if (chunk.data.empty()) { + return false; + } + D_ASSERT(chunk.data.size() == 2); + auto &keys = chunk.data[0]; + auto &values = chunk.data[1]; + + if (keys.GetType().id() == LogicalTypeId::SQLNULL) { + return true; + } + if (values.GetType().id() == LogicalTypeId::SQLNULL) { + return true; + } + return false; +} + static void MapFunction(DataChunk &args, ExpressionState &, Vector &result) { // internal MAP representation // - LIST-vector that contains STRUCTs as child entries // - STRUCTs have exactly two fields, a key-field, and a value-field // - key names are unique - D_ASSERT(result.GetType().id() == LogicalTypeId::MAP); + + if (MapIsNull(args)) { + auto &validity = FlatVector::Validity(result); + validity.SetInvalid(0); + result.SetVectorType(VectorType::CONSTANT_VECTOR); + return; + } + auto row_count = args.size(); // early-out, if no data @@ -63,13 +87,15 @@ static void MapFunction(DataChunk &args, ExpressionState &, Vector &result) { UnifiedVectorFormat result_data; result.ToUnifiedFormat(row_count, result_data); auto result_entries = UnifiedVectorFormat::GetDataNoConst(result_data); - result_data.validity.SetAllValid(row_count); + + auto &result_validity = FlatVector::Validity(result); // get the resulting size of the key/value child lists idx_t result_child_size = 0; for (idx_t row_idx = 0; row_idx < row_count; row_idx++) { auto keys_idx = keys_data.sel->get_index(row_idx); - if (!keys_data.validity.RowIsValid(keys_idx)) { + auto values_idx = values_data.sel->get_index(row_idx); + if (!keys_data.validity.RowIsValid(keys_idx) || !values_data.validity.RowIsValid(values_idx)) { continue; } auto keys_entry = keys_entries[keys_idx]; @@ -87,22 +113,15 @@ static void MapFunction(DataChunk &args, ExpressionState &, Vector &result) { auto values_idx = values_data.sel->get_index(row_idx); auto result_idx = result_data.sel->get_index(row_idx); - // empty map - if (!keys_data.validity.RowIsValid(keys_idx) && !values_data.validity.RowIsValid(values_idx)) { - result_entries[result_idx] = list_entry_t(); + // NULL MAP + if (!keys_data.validity.RowIsValid(keys_idx) || !values_data.validity.RowIsValid(values_idx)) { + result_validity.SetInvalid(row_idx); continue; } auto keys_entry = keys_entries[keys_idx]; auto values_entry = values_entries[values_idx]; - // validity checks - if (!keys_data.validity.RowIsValid(keys_idx)) { - MapVector::EvalMapInvalidReason(MapInvalidReason::NULL_KEY_LIST); - } - if (!values_data.validity.RowIsValid(values_idx)) { - MapVector::EvalMapInvalidReason(MapInvalidReason::NULL_VALUE_LIST); - } if (keys_entry.length != values_entry.length) { MapVector::EvalMapInvalidReason(MapInvalidReason::NOT_ALIGNED); } @@ -160,8 +179,19 @@ static unique_ptr MapBind(ClientContext &, ScalarFunction &bound_f MapVector::EvalMapInvalidReason(MapInvalidReason::INVALID_PARAMS); } - // bind an empty MAP + bool is_null = false; if (arguments.empty()) { + is_null = true; + } + if (!is_null) { + auto key_id = arguments[0]->return_type.id(); + auto value_id = arguments[1]->return_type.id(); + if (key_id == LogicalTypeId::SQLNULL || value_id == LogicalTypeId::SQLNULL) { + is_null = true; + } + } + + if (is_null) { bound_function.return_type = LogicalType::MAP(LogicalTypeId::SQLNULL, LogicalTypeId::SQLNULL); return make_uniq(bound_function.return_type); } diff --git a/src/duckdb/src/core_functions/scalar/map/map_concat.cpp b/src/duckdb/src/core_functions/scalar/map/map_concat.cpp index 1a6a2702..b3ffc174 100644 --- a/src/duckdb/src/core_functions/scalar/map/map_concat.cpp +++ b/src/duckdb/src/core_functions/scalar/map/map_concat.cpp @@ -61,14 +61,20 @@ static void MapConcatFunction(DataChunk &args, ExpressionState &state, Vector &r auto &result_entry = result_data[i]; vector index_to_map; vector keys_list; + bool all_null = true; for (idx_t map_idx = 0; map_idx < map_count; map_idx++) { if (args.data[map_idx].GetType().id() == LogicalTypeId::SQLNULL) { continue; } - auto &map_format = map_formats[map_idx]; - auto &keys = MapVector::GetKeys(args.data[map_idx]); + auto &map_format = map_formats[map_idx]; auto index = map_format.sel->get_index(i); + if (!map_format.validity.RowIsValid(index)) { + continue; + } + + all_null = false; + auto &keys = MapVector::GetKeys(args.data[map_idx]); auto entry = UnifiedVectorFormat::GetData(map_format)[index]; // Update the list for this row @@ -89,6 +95,15 @@ static void MapConcatFunction(DataChunk &args, ExpressionState &state, Vector &r } } } + + result_entry.offset = ListVector::GetListSize(result); + result_entry.length = keys_list.size(); + if (all_null) { + D_ASSERT(keys_list.empty() && index_to_map.empty()); + FlatVector::SetNull(result, i, true); + continue; + } + vector values_list; D_ASSERT(keys_list.size() == index_to_map.size()); // Get the values from the mapping @@ -98,8 +113,6 @@ static void MapConcatFunction(DataChunk &args, ExpressionState &state, Vector &r values_list.push_back(values.GetValue(mapping.key_index)); } D_ASSERT(values_list.size() == keys_list.size()); - result_entry.offset = ListVector::GetListSize(result); - result_entry.length = values_list.size(); auto list_entries = GetListEntries(std::move(keys_list), std::move(values_list)); for (auto &list_entry : list_entries) { ListVector::PushBack(result, list_entry); diff --git a/src/duckdb/src/core_functions/scalar/map/map_entries.cpp b/src/duckdb/src/core_functions/scalar/map/map_entries.cpp index 7629c789..47e65399 100644 --- a/src/duckdb/src/core_functions/scalar/map/map_entries.cpp +++ b/src/duckdb/src/core_functions/scalar/map/map_entries.cpp @@ -12,7 +12,15 @@ namespace duckdb { static void MapEntriesFunction(DataChunk &args, ExpressionState &state, Vector &result) { auto count = args.size(); - MapUtil::ReinterpretMap(result, args.data[0], count); + auto &map = args.data[0]; + if (map.GetType().id() == LogicalTypeId::SQLNULL) { + // Input is a constant NULL + result.SetVectorType(VectorType::CONSTANT_VECTOR); + ConstantVector::SetNull(result, true); + return; + } + + MapUtil::ReinterpretMap(result, map, count); if (args.AllConstant()) { result.SetVectorType(VectorType::CONSTANT_VECTOR); @@ -20,10 +28,20 @@ static void MapEntriesFunction(DataChunk &args, ExpressionState &state, Vector & result.Verify(count); } -static unique_ptr MapEntriesBind(ClientContext &context, ScalarFunction &bound_function, - vector> &arguments) { +static LogicalType CreateReturnType(const LogicalType &map) { + auto &key_type = MapType::KeyType(map); + auto &value_type = MapType::ValueType(map); + child_list_t child_types; + child_types.push_back(make_pair("key", key_type)); + child_types.push_back(make_pair("value", value_type)); + + auto row_type = LogicalType::STRUCT(child_types); + return LogicalType::LIST(row_type); +} +static unique_ptr MapEntriesBind(ClientContext &context, ScalarFunction &bound_function, + vector> &arguments) { if (arguments.size() != 1) { throw InvalidInputException("Too many arguments provided, only expecting a single map"); } @@ -36,25 +54,24 @@ static unique_ptr MapEntriesBind(ClientContext &context, ScalarFun return nullptr; } + if (map.id() == LogicalTypeId::SQLNULL) { + // Input is NULL, output is STRUCT(NULL, NULL)[] + auto map_type = LogicalType::MAP(LogicalTypeId::SQLNULL, LogicalTypeId::SQLNULL); + bound_function.return_type = CreateReturnType(map_type); + return make_uniq(bound_function.return_type); + } + if (map.id() != LogicalTypeId::MAP) { throw InvalidInputException("The provided argument is not a map"); } - auto &key_type = MapType::KeyType(map); - auto &value_type = MapType::ValueType(map); - - child_types.push_back(make_pair("key", key_type)); - child_types.push_back(make_pair("value", value_type)); - - auto row_type = LogicalType::STRUCT(child_types); - - bound_function.return_type = LogicalType::LIST(row_type); + bound_function.return_type = CreateReturnType(map); return make_uniq(bound_function.return_type); } ScalarFunction MapEntriesFun::GetFunction() { //! the arguments and return types are actually set in the binder function ScalarFunction fun({}, LogicalTypeId::LIST, MapEntriesFunction, MapEntriesBind); - fun.null_handling = FunctionNullHandling::DEFAULT_NULL_HANDLING; + fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING; fun.varargs = LogicalType::ANY; return fun; } diff --git a/src/duckdb/src/core_functions/scalar/map/map_extract.cpp b/src/duckdb/src/core_functions/scalar/map/map_extract.cpp index 2986a7f6..9cf1ca10 100644 --- a/src/duckdb/src/core_functions/scalar/map/map_extract.cpp +++ b/src/duckdb/src/core_functions/scalar/map/map_extract.cpp @@ -58,7 +58,7 @@ void FillResult(Vector &map, Vector &offsets, Vector &result, idx_t count) { auto &value_list_entry = UnifiedVectorFormat::GetData(map_data)[value_index]; // Add the values to the result - idx_t list_offset = value_list_entry.offset + offset; + idx_t list_offset = value_list_entry.offset + UnsafeNumericCast(offset); // All keys are unique, only one will ever match idx_t length = 1; ListVector::Append(result, values_entries, length + list_offset, list_offset); @@ -70,14 +70,20 @@ void FillResult(Vector &map, Vector &offsets, Vector &result, idx_t count) { } } +static bool ArgumentIsConstantNull(Vector &argument) { + return argument.GetType().id() == LogicalTypeId::SQLNULL; +} + static void MapExtractFunction(DataChunk &args, ExpressionState &state, Vector &result) { D_ASSERT(args.data.size() == 2); - D_ASSERT(args.data[0].GetType().id() == LogicalTypeId::MAP); result.SetVectorType(VectorType::FLAT_VECTOR); + auto &map = args.data[0]; + auto &key = args.data[1]; + idx_t tuple_count = args.size(); // Optimization: because keys are not allowed to be NULL, we can early-out - if (args.data[1].GetType().id() == LogicalTypeId::SQLNULL) { + if (ArgumentIsConstantNull(map) || ArgumentIsConstantNull(key)) { //! We don't need to look through the map if the 'key' to look for is NULL ListVector::SetListSize(result, 0); result.SetVectorType(VectorType::CONSTANT_VECTOR); @@ -87,9 +93,7 @@ static void MapExtractFunction(DataChunk &args, ExpressionState &state, Vector & result.Verify(tuple_count); return; } - - auto &map = args.data[0]; - auto &key = args.data[1]; + D_ASSERT(map.GetType().id() == LogicalTypeId::MAP); UnifiedVectorFormat map_data; @@ -124,18 +128,27 @@ static unique_ptr MapExtractBind(ClientContext &context, ScalarFun if (arguments.size() != 2) { throw BinderException("MAP_EXTRACT must have exactly two arguments"); } - if (arguments[0]->return_type.id() != LogicalTypeId::MAP) { + + auto &map_type = arguments[0]->return_type; + auto &input_type = arguments[1]->return_type; + + if (map_type.id() == LogicalTypeId::SQLNULL) { + bound_function.return_type = LogicalType::LIST(LogicalTypeId::SQLNULL); + return make_uniq(bound_function.return_type); + } + + if (map_type.id() != LogicalTypeId::MAP) { throw BinderException("MAP_EXTRACT can only operate on MAPs"); } - auto &value_type = MapType::ValueType(arguments[0]->return_type); + auto &value_type = MapType::ValueType(map_type); //! Here we have to construct the List Type that will be returned bound_function.return_type = LogicalType::LIST(value_type); - auto key_type = MapType::KeyType(arguments[0]->return_type); - if (key_type.id() != LogicalTypeId::SQLNULL && arguments[1]->return_type.id() != LogicalTypeId::SQLNULL) { - bound_function.arguments[1] = MapType::KeyType(arguments[0]->return_type); + auto key_type = MapType::KeyType(map_type); + if (key_type.id() != LogicalTypeId::SQLNULL && input_type.id() != LogicalTypeId::SQLNULL) { + bound_function.arguments[1] = MapType::KeyType(map_type); } - return make_uniq(value_type); + return make_uniq(bound_function.return_type); } ScalarFunction MapExtractFun::GetFunction() { diff --git a/src/duckdb/src/core_functions/scalar/map/map_keys_values.cpp b/src/duckdb/src/core_functions/scalar/map/map_keys_values.cpp index 6c1e8efb..c5578895 100644 --- a/src/duckdb/src/core_functions/scalar/map/map_keys_values.cpp +++ b/src/duckdb/src/core_functions/scalar/map/map_keys_values.cpp @@ -10,10 +10,16 @@ namespace duckdb { static void MapKeyValueFunction(DataChunk &args, ExpressionState &state, Vector &result, Vector &(*get_child_vector)(Vector &)) { + auto &map = args.data[0]; + D_ASSERT(result.GetType().id() == LogicalTypeId::LIST); - auto count = args.size(); + if (map.GetType().id() == LogicalTypeId::SQLNULL) { + result.SetVectorType(VectorType::CONSTANT_VECTOR); + ConstantVector::SetNull(result, true); + return; + } - auto &map = args.data[0]; + auto count = args.size(); D_ASSERT(map.GetType().id() == LogicalTypeId::MAP); auto child = get_child_vector(map); @@ -60,6 +66,12 @@ static unique_ptr MapKeyValueBind(ClientContext &context, ScalarFu return nullptr; } + if (map.id() == LogicalTypeId::SQLNULL) { + // Input is NULL, output is NULL[] + bound_function.return_type = LogicalType::LIST(LogicalTypeId::SQLNULL); + return make_uniq(bound_function.return_type); + } + if (map.id() != LogicalTypeId::MAP) { throw InvalidInputException("The provided argument is not a map"); } @@ -83,14 +95,14 @@ static unique_ptr MapValuesBind(ClientContext &context, ScalarFunc ScalarFunction MapKeysFun::GetFunction() { //! the arguments and return types are actually set in the binder function ScalarFunction fun({}, LogicalTypeId::LIST, MapKeysFunction, MapKeysBind); - fun.null_handling = FunctionNullHandling::DEFAULT_NULL_HANDLING; + fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING; fun.varargs = LogicalType::ANY; return fun; } ScalarFunction MapValuesFun::GetFunction() { ScalarFunction fun({}, LogicalTypeId::LIST, MapValuesFunction, MapValuesBind); - fun.null_handling = FunctionNullHandling::DEFAULT_NULL_HANDLING; + fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING; fun.varargs = LogicalType::ANY; return fun; } diff --git a/src/duckdb/src/core_functions/scalar/math/numeric.cpp b/src/duckdb/src/core_functions/scalar/math/numeric.cpp index 711f9260..4a6055a9 100644 --- a/src/duckdb/src/core_functions/scalar/math/numeric.cpp +++ b/src/duckdb/src/core_functions/scalar/math/numeric.cpp @@ -516,7 +516,7 @@ struct RoundOperatorPrecision { return input; } } - return rounded_value; + return UnsafeNumericCast(rounded_value); } }; @@ -527,7 +527,7 @@ struct RoundOperator { if (std::isinf(rounded_value) || std::isnan(rounded_value)) { return input; } - return rounded_value; + return UnsafeNumericCast(rounded_value); } }; diff --git a/src/duckdb/src/core_functions/scalar/operators/bitwise.cpp b/src/duckdb/src/core_functions/scalar/operators/bitwise.cpp index 73f968bb..d9bb5895 100644 --- a/src/duckdb/src/core_functions/scalar/operators/bitwise.cpp +++ b/src/duckdb/src/core_functions/scalar/operators/bitwise.cpp @@ -251,7 +251,7 @@ static void BitwiseShiftLeftOperation(DataChunk &args, ExpressionState &state, V Bit::SetEmptyBitString(target, input); return target; } - Bit::LeftShift(input, shift, target); + Bit::LeftShift(input, UnsafeNumericCast(shift), target); return target; }); } @@ -294,7 +294,7 @@ static void BitwiseShiftRightOperation(DataChunk &args, ExpressionState &state, Bit::SetEmptyBitString(target, input); return target; } - Bit::RightShift(input, shift, target); + Bit::RightShift(input, UnsafeNumericCast(shift), target); return target; }); } diff --git a/src/duckdb/src/core_functions/scalar/random/setseed.cpp b/src/duckdb/src/core_functions/scalar/random/setseed.cpp index f2db16e6..32965cf1 100644 --- a/src/duckdb/src/core_functions/scalar/random/setseed.cpp +++ b/src/duckdb/src/core_functions/scalar/random/setseed.cpp @@ -39,7 +39,7 @@ static void SetSeedFunction(DataChunk &args, ExpressionState &state, Vector &res if (input_seeds[i] < -1.0 || input_seeds[i] > 1.0 || Value::IsNan(input_seeds[i])) { throw InvalidInputException("SETSEED accepts seed values between -1.0 and 1.0, inclusive"); } - uint32_t norm_seed = (input_seeds[i] + 1.0) * half_max; + auto norm_seed = NumericCast((input_seeds[i] + 1.0) * half_max); random_engine.SetSeed(norm_seed); } diff --git a/src/duckdb/src/core_functions/scalar/string/bar.cpp b/src/duckdb/src/core_functions/scalar/string/bar.cpp index 291553a3..e9cd400c 100644 --- a/src/duckdb/src/core_functions/scalar/string/bar.cpp +++ b/src/duckdb/src/core_functions/scalar/string/bar.cpp @@ -40,7 +40,7 @@ static string_t BarScalarFunction(double x, double min, double max, double max_w result.clear(); - int32_t width_as_int = static_cast(width * PARTIAL_BLOCKS_COUNT); + auto width_as_int = NumericCast(width * PARTIAL_BLOCKS_COUNT); idx_t full_blocks_count = (width_as_int / PARTIAL_BLOCKS_COUNT); for (idx_t i = 0; i < full_blocks_count; i++) { result += FULL_BLOCK; diff --git a/src/duckdb/src/core_functions/scalar/string/chr.cpp b/src/duckdb/src/core_functions/scalar/string/chr.cpp index e7bb62e1..34f897eb 100644 --- a/src/duckdb/src/core_functions/scalar/string/chr.cpp +++ b/src/duckdb/src/core_functions/scalar/string/chr.cpp @@ -16,7 +16,7 @@ struct ChrOperator { char c[5] = {'\0', '\0', '\0', '\0', '\0'}; int utf8_bytes; GetCodepoint(input, c, utf8_bytes); - return string_t(&c[0], utf8_bytes); + return string_t(&c[0], UnsafeNumericCast(utf8_bytes)); } }; @@ -30,7 +30,7 @@ static void ChrFunction(DataChunk &args, ExpressionState &state, Vector &result) int utf8_bytes; UnaryExecutor::Execute(code_vec, result, args.size(), [&](int32_t input) { ChrOperator::GetCodepoint(input, c, utf8_bytes); - return StringVector::AddString(result, &c[0], utf8_bytes); + return StringVector::AddString(result, &c[0], UnsafeNumericCast(utf8_bytes)); }); } #endif diff --git a/src/duckdb/src/core_functions/scalar/string/hex.cpp b/src/duckdb/src/core_functions/scalar/string/hex.cpp index dffbae70..f399b65c 100644 --- a/src/duckdb/src/core_functions/scalar/string/hex.cpp +++ b/src/duckdb/src/core_functions/scalar/string/hex.cpp @@ -90,7 +90,7 @@ struct HexIntegralOperator { template static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) { - idx_t num_leading_zero = CountZeros::Leading(input); + auto num_leading_zero = CountZeros::Leading(static_cast(input)); idx_t num_bits_to_check = 64 - num_leading_zero; D_ASSERT(num_bits_to_check <= sizeof(INPUT_TYPE) * 8); @@ -109,7 +109,7 @@ struct HexIntegralOperator { auto target = StringVector::EmptyString(result, buffer_size); auto output = target.GetDataWriteable(); - WriteHexBytes(input, output, buffer_size); + WriteHexBytes(static_cast(input), output, buffer_size); target.Finalize(); return target; @@ -120,7 +120,7 @@ struct HexHugeIntOperator { template static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) { - idx_t num_leading_zero = CountZeros::Leading(input); + idx_t num_leading_zero = CountZeros::Leading(UnsafeNumericCast(input)); idx_t buffer_size = sizeof(INPUT_TYPE) * 2 - (num_leading_zero / 4); // Special case: All bits are zero @@ -147,7 +147,7 @@ struct HexUhugeIntOperator { template static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) { - idx_t num_leading_zero = CountZeros::Leading(input); + idx_t num_leading_zero = CountZeros::Leading(UnsafeNumericCast(input)); idx_t buffer_size = sizeof(INPUT_TYPE) * 2 - (num_leading_zero / 4); // Special case: All bits are zero @@ -189,7 +189,7 @@ struct BinaryStrOperator { auto output = target.GetDataWriteable(); for (idx_t i = 0; i < size; ++i) { - uint8_t byte = data[i]; + auto byte = static_cast(data[i]); for (idx_t i = 8; i >= 1; --i) { *output = ((byte >> (i - 1)) & 0x01) + '0'; output++; @@ -205,7 +205,7 @@ struct BinaryIntegralOperator { template static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) { - idx_t num_leading_zero = CountZeros::Leading(input); + auto num_leading_zero = CountZeros::Leading(static_cast(input)); idx_t num_bits_to_check = 64 - num_leading_zero; D_ASSERT(num_bits_to_check <= sizeof(INPUT_TYPE) * 8); @@ -224,7 +224,7 @@ struct BinaryIntegralOperator { auto target = StringVector::EmptyString(result, buffer_size); auto output = target.GetDataWriteable(); - WriteBinBytes(input, output, buffer_size); + WriteBinBytes(static_cast(input), output, buffer_size); target.Finalize(); return target; @@ -234,7 +234,7 @@ struct BinaryIntegralOperator { struct BinaryHugeIntOperator { template static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) { - idx_t num_leading_zero = CountZeros::Leading(input); + auto num_leading_zero = CountZeros::Leading(UnsafeNumericCast(input)); idx_t buffer_size = sizeof(INPUT_TYPE) * 8 - num_leading_zero; // Special case: All bits are zero @@ -259,7 +259,7 @@ struct BinaryHugeIntOperator { struct BinaryUhugeIntOperator { template static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) { - idx_t num_leading_zero = CountZeros::Leading(input); + auto num_leading_zero = CountZeros::Leading(UnsafeNumericCast(input)); idx_t buffer_size = sizeof(INPUT_TYPE) * 8 - num_leading_zero; // Special case: All bits are zero @@ -301,7 +301,7 @@ struct FromHexOperator { // Treated as a single byte idx_t i = 0; if (size % 2 != 0) { - *output = StringUtil::GetHexValue(data[i]); + *output = static_cast(StringUtil::GetHexValue(data[i])); i++; output++; } @@ -309,7 +309,7 @@ struct FromHexOperator { for (; i < size; i += 2) { uint8_t major = StringUtil::GetHexValue(data[i]); uint8_t minor = StringUtil::GetHexValue(data[i + 1]); - *output = UnsafeNumericCast((major << 4) | minor); + *output = static_cast((major << 4) | minor); output++; } @@ -343,7 +343,7 @@ struct FromBinaryOperator { byte |= StringUtil::GetBinaryValue(data[i]) << (j - 1); i++; } - *output = byte; + *output = static_cast(byte); // binary eh output++; } @@ -353,7 +353,7 @@ struct FromBinaryOperator { byte |= StringUtil::GetBinaryValue(data[i]) << (j - 1); i++; } - *output = byte; + *output = static_cast(byte); output++; } diff --git a/src/duckdb/src/core_functions/scalar/string/instr.cpp b/src/duckdb/src/core_functions/scalar/string/instr.cpp index becbbd48..66608db6 100644 --- a/src/duckdb/src/core_functions/scalar/string/instr.cpp +++ b/src/duckdb/src/core_functions/scalar/string/instr.cpp @@ -33,7 +33,7 @@ struct InstrAsciiOperator { template static inline TR Operation(TA haystack, TB needle) { auto location = ContainsFun::Find(haystack, needle); - return location == DConstants::INVALID_INDEX ? 0 : location + 1; + return UnsafeNumericCast(location == DConstants::INVALID_INDEX ? 0U : location + 1U); } }; diff --git a/src/duckdb/src/core_functions/scalar/string/pad.cpp b/src/duckdb/src/core_functions/scalar/string/pad.cpp index 85914229..856544ea 100644 --- a/src/duckdb/src/core_functions/scalar/string/pad.cpp +++ b/src/duckdb/src/core_functions/scalar/string/pad.cpp @@ -17,9 +17,9 @@ static pair PadCountChars(const idx_t len, const char *data, const idx_t nchars = 0; for (; nchars < len && nbytes < size; ++nchars) { utf8proc_int32_t codepoint; - auto bytes = utf8proc_iterate(str + nbytes, size - nbytes, &codepoint); + auto bytes = utf8proc_iterate(str + nbytes, UnsafeNumericCast(size - nbytes), &codepoint); D_ASSERT(bytes > 0); - nbytes += bytes; + nbytes += UnsafeNumericCast(bytes); } return pair(nbytes, nchars); @@ -47,9 +47,9 @@ static bool InsertPadding(const idx_t len, const string_t &pad, vector &re // Write the next character utf8proc_int32_t codepoint; - auto bytes = utf8proc_iterate(str + nbytes, size - nbytes, &codepoint); + auto bytes = utf8proc_iterate(str + nbytes, UnsafeNumericCast(size - nbytes), &codepoint); D_ASSERT(bytes > 0); - nbytes += bytes; + nbytes += UnsafeNumericCast(bytes); } // Flush the remaining pad @@ -67,10 +67,10 @@ static string_t LeftPadFunction(const string_t &str, const int32_t len, const st auto size_str = str.GetSize(); // Count how much of str will fit in the output - auto written = PadCountChars(len, data_str, size_str); + auto written = PadCountChars(UnsafeNumericCast(len), data_str, size_str); // Left pad by the number of characters still needed - if (!InsertPadding(len - written.second, pad, result)) { + if (!InsertPadding(UnsafeNumericCast(len) - written.second, pad, result)) { throw InvalidInputException("Insufficient padding in LPAD."); } @@ -96,13 +96,13 @@ static string_t RightPadFunction(const string_t &str, const int32_t len, const s auto size_str = str.GetSize(); // Count how much of str will fit in the output - auto written = PadCountChars(len, data_str, size_str); + auto written = PadCountChars(UnsafeNumericCast(len), data_str, size_str); // Append as much of the original string as fits result.insert(result.end(), data_str, data_str + written.first); // Right pad by the number of characters still needed - if (!InsertPadding(len - written.second, pad, result)) { + if (!InsertPadding(UnsafeNumericCast(len) - written.second, pad, result)) { throw InvalidInputException("Insufficient padding in RPAD."); }; diff --git a/src/duckdb/src/core_functions/scalar/string/repeat.cpp b/src/duckdb/src/core_functions/scalar/string/repeat.cpp index afe3269f..b124c65b 100644 --- a/src/duckdb/src/core_functions/scalar/string/repeat.cpp +++ b/src/duckdb/src/core_functions/scalar/string/repeat.cpp @@ -1,5 +1,6 @@ #include "duckdb/common/vector_operations/binary_executor.hpp" #include "duckdb/core_functions/scalar/string_functions.hpp" +#include "duckdb/common/operator/multiply.hpp" namespace duckdb { @@ -11,15 +12,22 @@ static void RepeatFunction(DataChunk &args, ExpressionState &, Vector &result) { str_vector, cnt_vector, result, args.size(), [&](string_t str, int64_t cnt) { auto input_str = str.GetData(); auto size_str = str.GetSize(); + idx_t copy_count = cnt <= 0 || size_str == 0 ? 0 : UnsafeNumericCast(cnt); - idx_t copy_count = cnt <= 0 || size_str == 0 ? 0 : idx_t(cnt); - auto result_str = StringVector::EmptyString(result, size_str * copy_count); - auto result_data = result_str.GetDataWriteable(); - for (idx_t i = 0; i < copy_count; i++) { - memcpy(result_data + i * size_str, input_str, size_str); + idx_t copy_size; + if (TryMultiplyOperator::Operation(size_str, copy_count, copy_size)) { + auto result_str = StringVector::EmptyString(result, copy_size); + auto result_data = result_str.GetDataWriteable(); + for (idx_t i = 0; i < copy_count; i++) { + memcpy(result_data + i * size_str, input_str, size_str); + } + result_str.Finalize(); + return result_str; + } else { + throw OutOfRangeException( + "Cannot create a string of size: '%d' * '%d', the maximum supported string size is: '%d'", size_str, + copy_count, string_t::MAX_STRING_SIZE); } - result_str.Finalize(); - return result_str; }); } diff --git a/src/duckdb/src/core_functions/scalar/string/string_split.cpp b/src/duckdb/src/core_functions/scalar/string/string_split.cpp index 9d3ea23b..c62cacd7 100644 --- a/src/duckdb/src/core_functions/scalar/string/string_split.cpp +++ b/src/duckdb/src/core_functions/scalar/string/string_split.cpp @@ -51,7 +51,7 @@ struct ConstantRegexpStringSplit { return DConstants::INVALID_INDEX; } match_size = match.size(); - return match.data() - input_data; + return UnsafeNumericCast(match.data() - input_data); } }; diff --git a/src/duckdb/src/core_functions/scalar/string/to_base.cpp b/src/duckdb/src/core_functions/scalar/string/to_base.cpp index ad5e1088..963f4f56 100644 --- a/src/duckdb/src/core_functions/scalar/string/to_base.cpp +++ b/src/duckdb/src/core_functions/scalar/string/to_base.cpp @@ -48,7 +48,7 @@ static void ToBaseFunction(DataChunk &args, ExpressionState &state, Vector &resu length++; } - return StringVector::AddString(result, ptr, end - ptr); + return StringVector::AddString(result, ptr, UnsafeNumericCast(end - ptr)); }); } diff --git a/src/duckdb/src/core_functions/scalar/string/translate.cpp b/src/duckdb/src/core_functions/scalar/string/translate.cpp index 19243869..c01ec2a2 100644 --- a/src/duckdb/src/core_functions/scalar/string/translate.cpp +++ b/src/duckdb/src/core_functions/scalar/string/translate.cpp @@ -37,10 +37,10 @@ static string_t TranslateScalarFunction(const string_t &haystack, const string_t while (i < size_needle && j < size_thread) { auto codepoint_needle = Utf8Proc::UTF8ToCodepoint(input_needle, sz); input_needle += sz; - i += sz; + i += UnsafeNumericCast(sz); auto codepoint_thread = Utf8Proc::UTF8ToCodepoint(input_thread, sz); input_thread += sz; - j += sz; + j += UnsafeNumericCast(sz); // Ignore unicode character that is existed in to_replace if (to_replace.count(codepoint_needle) == 0) { to_replace[codepoint_needle] = codepoint_thread; @@ -52,7 +52,7 @@ static string_t TranslateScalarFunction(const string_t &haystack, const string_t while (i < size_needle) { auto codepoint_needle = Utf8Proc::UTF8ToCodepoint(input_needle, sz); input_needle += sz; - i += sz; + i += UnsafeNumericCast(sz); // Add unicode character that will be deleted if (to_replace.count(codepoint_needle) == 0) { to_delete.insert(codepoint_needle); @@ -60,7 +60,7 @@ static string_t TranslateScalarFunction(const string_t &haystack, const string_t } char c[5] = {'\0', '\0', '\0', '\0', '\0'}; - for (i = 0; i < size_haystack; i += sz) { + for (i = 0; i < size_haystack; i += UnsafeNumericCast(sz)) { auto codepoint_haystack = Utf8Proc::UTF8ToCodepoint(input_haystack, sz); if (to_replace.count(codepoint_haystack) != 0) { Utf8Proc::CodepointToUtf8(to_replace[codepoint_haystack], c_sz, c); diff --git a/src/duckdb/src/core_functions/scalar/string/trim.cpp b/src/duckdb/src/core_functions/scalar/string/trim.cpp index 91e3b5dd..d89ebbaf 100644 --- a/src/duckdb/src/core_functions/scalar/string/trim.cpp +++ b/src/duckdb/src/core_functions/scalar/string/trim.cpp @@ -23,12 +23,13 @@ struct TrimOperator { idx_t begin = 0; if (LTRIM) { while (begin < size) { - auto bytes = utf8proc_iterate(str + begin, size - begin, &codepoint); + auto bytes = + utf8proc_iterate(str + begin, UnsafeNumericCast(size - begin), &codepoint); D_ASSERT(bytes > 0); if (utf8proc_category(codepoint) != UTF8PROC_CATEGORY_ZS) { break; } - begin += bytes; + begin += UnsafeNumericCast(bytes); } } @@ -37,9 +38,9 @@ struct TrimOperator { if (RTRIM) { end = begin; for (auto next = begin; next < size;) { - auto bytes = utf8proc_iterate(str + next, size - next, &codepoint); + auto bytes = utf8proc_iterate(str + next, UnsafeNumericCast(size - next), &codepoint); D_ASSERT(bytes > 0); - next += bytes; + next += UnsafeNumericCast(bytes); if (utf8proc_category(codepoint) != UTF8PROC_CATEGORY_ZS) { end = next; } @@ -69,7 +70,8 @@ static void GetIgnoredCodepoints(string_t ignored, unordered_set( + utf8proc_iterate(dataptr + pos, UnsafeNumericCast(size - pos), &codepoint)); ignored_codepoints.insert(codepoint); } } @@ -91,11 +93,12 @@ static void BinaryTrimFunction(DataChunk &input, ExpressionState &state, Vector idx_t begin = 0; if (LTRIM) { while (begin < size) { - auto bytes = utf8proc_iterate(str + begin, size - begin, &codepoint); + auto bytes = + utf8proc_iterate(str + begin, UnsafeNumericCast(size - begin), &codepoint); if (ignored_codepoints.find(codepoint) == ignored_codepoints.end()) { break; } - begin += bytes; + begin += UnsafeNumericCast(bytes); } } @@ -104,9 +107,10 @@ static void BinaryTrimFunction(DataChunk &input, ExpressionState &state, Vector if (RTRIM) { end = begin; for (auto next = begin; next < size;) { - auto bytes = utf8proc_iterate(str + next, size - next, &codepoint); + auto bytes = + utf8proc_iterate(str + next, UnsafeNumericCast(size - next), &codepoint); D_ASSERT(bytes > 0); - next += bytes; + next += UnsafeNumericCast(bytes); if (ignored_codepoints.find(codepoint) == ignored_codepoints.end()) { end = next; } diff --git a/src/duckdb/src/core_functions/scalar/string/unicode.cpp b/src/duckdb/src/core_functions/scalar/string/unicode.cpp index b621c532..b62a129a 100644 --- a/src/duckdb/src/core_functions/scalar/string/unicode.cpp +++ b/src/duckdb/src/core_functions/scalar/string/unicode.cpp @@ -15,7 +15,7 @@ struct UnicodeOperator { auto str = reinterpret_cast(input.GetData()); auto len = input.GetSize(); utf8proc_int32_t codepoint; - (void)utf8proc_iterate(str, len, &codepoint); + (void)utf8proc_iterate(str, UnsafeNumericCast(len), &codepoint); return codepoint; } }; diff --git a/src/duckdb/src/execution/adaptive_filter.cpp b/src/duckdb/src/execution/adaptive_filter.cpp index 37ffad99..166174d0 100644 --- a/src/duckdb/src/execution/adaptive_filter.cpp +++ b/src/duckdb/src/execution/adaptive_filter.cpp @@ -58,7 +58,7 @@ void AdaptiveFilter::AdaptRuntimeStatistics(double duration) { // get swap index and swap likeliness std::uniform_int_distribution distribution(1, NumericCast(right_random_border)); // a <= i <= b - idx_t random_number = distribution(generator) - 1; + auto random_number = UnsafeNumericCast(distribution(generator) - 1); swap_idx = random_number / 100; // index to be swapped idx_t likeliness = random_number - 100 * swap_idx; // random number between [0, 100) diff --git a/src/duckdb/src/execution/aggregate_hashtable.cpp b/src/duckdb/src/execution/aggregate_hashtable.cpp index 90029b0a..5e944fba 100644 --- a/src/duckdb/src/execution/aggregate_hashtable.cpp +++ b/src/duckdb/src/execution/aggregate_hashtable.cpp @@ -40,7 +40,7 @@ GroupedAggregateHashTable::GroupedAggregateHashTable(ClientContext &context, All vector aggregate_objects_p, idx_t initial_capacity, idx_t radix_bits) : BaseAggregateHashTable(context, allocator, aggregate_objects_p, std::move(payload_types_p)), - radix_bits(radix_bits), count(0), capacity(0), aggregate_allocator(make_shared(allocator)) { + radix_bits(radix_bits), count(0), capacity(0), aggregate_allocator(make_shared_ptr(allocator)) { // Append hash column to the end and initialise the row layout group_types_p.emplace_back(LogicalType::HASH); @@ -122,7 +122,7 @@ idx_t GroupedAggregateHashTable::InitialCapacity() { idx_t GroupedAggregateHashTable::GetCapacityForCount(idx_t count) { count = MaxValue(InitialCapacity(), count); - return NextPowerOfTwo(count * LOAD_FACTOR); + return NextPowerOfTwo(NumericCast(static_cast(count) * LOAD_FACTOR)); } idx_t GroupedAggregateHashTable::Capacity() const { @@ -130,7 +130,7 @@ idx_t GroupedAggregateHashTable::Capacity() const { } idx_t GroupedAggregateHashTable::ResizeThreshold() const { - return Capacity() / LOAD_FACTOR; + return NumericCast(static_cast(Capacity()) / LOAD_FACTOR); } idx_t GroupedAggregateHashTable::ApplyBitMask(hash_t hash) const { @@ -246,7 +246,7 @@ idx_t GroupedAggregateHashTable::AddChunk(DataChunk &groups, Vector &group_hashe #endif const auto new_group_count = FindOrCreateGroups(groups, group_hashes, state.addresses, state.new_groups); - VectorOperations::AddInPlace(state.addresses, layout.GetAggrOffset(), payload.size()); + VectorOperations::AddInPlace(state.addresses, NumericCast(layout.GetAggrOffset()), payload.size()); // Now every cell has an entry, update the aggregates auto &aggregates = layout.GetAggregates(); @@ -258,7 +258,7 @@ idx_t GroupedAggregateHashTable::AddChunk(DataChunk &groups, Vector &group_hashe if (filter_idx >= filter.size() || i < filter[filter_idx]) { // Skip all the aggregates that are not in the filter payload_idx += aggr.child_count; - VectorOperations::AddInPlace(state.addresses, aggr.payload_size, payload.size()); + VectorOperations::AddInPlace(state.addresses, NumericCast(aggr.payload_size), payload.size()); continue; } D_ASSERT(i == filter[filter_idx]); @@ -272,7 +272,7 @@ idx_t GroupedAggregateHashTable::AddChunk(DataChunk &groups, Vector &group_hashe // Move to the next aggregate payload_idx += aggr.child_count; - VectorOperations::AddInPlace(state.addresses, aggr.payload_size, payload.size()); + VectorOperations::AddInPlace(state.addresses, NumericCast(aggr.payload_size), payload.size()); filter_idx++; } @@ -360,7 +360,8 @@ idx_t GroupedAggregateHashTable::FindOrCreateGroupsInternal(DataChunk &groups, V idx_t new_group_count = 0; idx_t remaining_entries = groups.size(); - while (remaining_entries > 0) { + idx_t iteration_count; + for (iteration_count = 0; remaining_entries > 0 && iteration_count < capacity; iteration_count++) { idx_t new_entry_count = 0; idx_t need_compare_count = 0; idx_t no_match_count = 0; @@ -370,7 +371,9 @@ idx_t GroupedAggregateHashTable::FindOrCreateGroupsInternal(DataChunk &groups, V const auto index = sel_vector->get_index(i); const auto &salt = hash_salts[index]; auto &ht_offset = ht_offsets[index]; - while (true) { + + idx_t inner_iteration_count; + for (inner_iteration_count = 0; inner_iteration_count < capacity; inner_iteration_count++) { auto &entry = entries[ht_offset]; if (entry.IsOccupied()) { // Cell is occupied: Compare salts if (entry.GetSalt() == salt) { @@ -393,6 +396,9 @@ idx_t GroupedAggregateHashTable::FindOrCreateGroupsInternal(DataChunk &groups, V break; } } + if (inner_iteration_count == capacity) { + throw InternalException("Maximum inner iteration count reached in GroupedAggregateHashTable"); + } } if (new_entry_count != 0) { @@ -440,6 +446,9 @@ idx_t GroupedAggregateHashTable::FindOrCreateGroupsInternal(DataChunk &groups, V sel_vector = &state.no_match_vector; remaining_entries = no_match_count; } + if (iteration_count == capacity) { + throw InternalException("Maximum outer iteration count reached in GroupedAggregateHashTable"); + } count += new_group_count; return new_group_count; diff --git a/src/duckdb/src/execution/index/art/art.cpp b/src/duckdb/src/execution/index/art/art.cpp index 9fa44dea..a28a0f66 100644 --- a/src/duckdb/src/execution/index/art/art.cpp +++ b/src/duckdb/src/execution/index/art/art.cpp @@ -39,7 +39,7 @@ ART::ART(const string &name, const IndexConstraintType index_constraint_type, co TableIOManager &table_io_manager, const vector> &unbound_expressions, AttachedDatabase &db, const shared_ptr, ALLOCATOR_COUNT>> &allocators_ptr, const IndexStorageInfo &info) - : Index(name, ART::TYPE_NAME, index_constraint_type, column_ids, table_io_manager, unbound_expressions, db), + : BoundIndex(name, ART::TYPE_NAME, index_constraint_type, column_ids, table_io_manager, unbound_expressions, db), allocators(allocators_ptr), owns_data(false) { // initialize all allocators @@ -54,7 +54,8 @@ ART::ART(const string &name, const IndexConstraintType index_constraint_type, co make_uniq(sizeof(Node16), block_manager), make_uniq(sizeof(Node48), block_manager), make_uniq(sizeof(Node256), block_manager)}; - allocators = make_shared, ALLOCATOR_COUNT>>(std::move(allocator_array)); + allocators = + make_shared_ptr, ALLOCATOR_COUNT>>(std::move(allocator_array)); } // deserialize lazily @@ -1114,7 +1115,7 @@ void ART::WritePartialBlocks() { // use the partial block manager to serialize all allocator data auto &block_manager = table_io_manager.GetIndexBlockManager(); - PartialBlockManager partial_block_manager(block_manager, CheckpointType::FULL_CHECKPOINT); + PartialBlockManager partial_block_manager(block_manager, PartialBlockType::FULL_CHECKPOINT); for (auto &allocator : *allocators) { allocator->SerializeBuffers(partial_block_manager); @@ -1151,8 +1152,7 @@ void ART::Deserialize(const BlockPointer &pointer) { //===--------------------------------------------------------------------===// void ART::InitializeVacuum(ARTFlags &flags) { - - flags.vacuum_flags.reserve(allocators->size()); + flags.vacuum_flags.reserve(flags.vacuum_flags.size() + allocators->size()); for (auto &allocator : *allocators) { flags.vacuum_flags.push_back(allocator->InitializeVacuum()); } @@ -1230,7 +1230,7 @@ void ART::InitializeMerge(ARTFlags &flags) { } } -bool ART::MergeIndexes(IndexLock &state, Index &other_index) { +bool ART::MergeIndexes(IndexLock &state, BoundIndex &other_index) { auto &other_art = other_index.Cast(); if (!other_art.tree.HasMetadata()) { diff --git a/src/duckdb/src/execution/index/bound_index.cpp b/src/duckdb/src/execution/index/bound_index.cpp new file mode 100644 index 00000000..49a02a05 --- /dev/null +++ b/src/duckdb/src/execution/index/bound_index.cpp @@ -0,0 +1,115 @@ +#include "duckdb/execution/index/bound_index.hpp" + +#include "duckdb/common/radix.hpp" +#include "duckdb/common/serializer/serializer.hpp" +#include "duckdb/planner/expression/bound_columnref_expression.hpp" +#include "duckdb/planner/expression/bound_reference_expression.hpp" +#include "duckdb/planner/expression_iterator.hpp" +#include "duckdb/storage/table/append_state.hpp" + +namespace duckdb { + +//------------------------------------------------------------------------------- +// Bound index +//------------------------------------------------------------------------------- + +BoundIndex::BoundIndex(const string &name, const string &index_type, IndexConstraintType index_constraint_type, + const vector &column_ids, TableIOManager &table_io_manager, + const vector> &unbound_expressions_p, AttachedDatabase &db) + : Index(column_ids, table_io_manager, db), name(name), index_type(index_type), + index_constraint_type(index_constraint_type) { + + for (auto &expr : unbound_expressions_p) { + types.push_back(expr->return_type.InternalType()); + logical_types.push_back(expr->return_type); + unbound_expressions.emplace_back(expr->Copy()); + bound_expressions.push_back(BindExpression(expr->Copy())); + executor.AddExpression(*bound_expressions.back()); + } +} + +void BoundIndex::InitializeLock(IndexLock &state) { + state.index_lock = unique_lock(lock); +} + +ErrorData BoundIndex::Append(DataChunk &entries, Vector &row_identifiers) { + IndexLock state; + InitializeLock(state); + return Append(state, entries, row_identifiers); +} + +void BoundIndex::CommitDrop() { + IndexLock index_lock; + InitializeLock(index_lock); + CommitDrop(index_lock); +} + +void BoundIndex::Delete(DataChunk &entries, Vector &row_identifiers) { + IndexLock state; + InitializeLock(state); + Delete(state, entries, row_identifiers); +} + +bool BoundIndex::MergeIndexes(BoundIndex &other_index) { + IndexLock state; + InitializeLock(state); + return MergeIndexes(state, other_index); +} + +string BoundIndex::VerifyAndToString(const bool only_verify) { + IndexLock state; + InitializeLock(state); + return VerifyAndToString(state, only_verify); +} + +void BoundIndex::Vacuum() { + IndexLock state; + InitializeLock(state); + Vacuum(state); +} + +idx_t BoundIndex::GetInMemorySize() { + IndexLock state; + InitializeLock(state); + return GetInMemorySize(state); +} + +void BoundIndex::ExecuteExpressions(DataChunk &input, DataChunk &result) { + executor.Execute(input, result); +} + +unique_ptr BoundIndex::BindExpression(unique_ptr expr) { + if (expr->type == ExpressionType::BOUND_COLUMN_REF) { + auto &bound_colref = expr->Cast(); + return make_uniq(expr->return_type, column_ids[bound_colref.binding.column_index]); + } + ExpressionIterator::EnumerateChildren( + *expr, [this](unique_ptr &expr) { expr = BindExpression(std::move(expr)); }); + return expr; +} + +bool BoundIndex::IndexIsUpdated(const vector &column_ids_p) const { + for (auto &column : column_ids_p) { + if (column_id_set.find(column.index) != column_id_set.end()) { + return true; + } + } + return false; +} + +IndexStorageInfo BoundIndex::GetStorageInfo(const bool get_buffers) { + throw NotImplementedException("The implementation of this index serialization does not exist."); +} + +string BoundIndex::AppendRowError(DataChunk &input, idx_t index) { + string error; + for (idx_t c = 0; c < input.ColumnCount(); c++) { + if (c > 0) { + error += ", "; + } + error += input.GetValue(c, index).ToString(); + } + return error; +} + +} // namespace duckdb diff --git a/src/duckdb/src/execution/index/unbound_index.cpp b/src/duckdb/src/execution/index/unbound_index.cpp new file mode 100644 index 00000000..b8173d75 --- /dev/null +++ b/src/duckdb/src/execution/index/unbound_index.cpp @@ -0,0 +1,30 @@ +#include "duckdb/execution/index/unbound_index.hpp" +#include "duckdb/parser/parsed_data/create_index_info.hpp" +#include "duckdb/storage/table_io_manager.hpp" +#include "duckdb/storage/block_manager.hpp" +#include "duckdb/storage/index_storage_info.hpp" + +namespace duckdb { + +//------------------------------------------------------------------------------- +// Unbound index +//------------------------------------------------------------------------------- + +UnboundIndex::UnboundIndex(unique_ptr create_info, IndexStorageInfo storage_info_p, + TableIOManager &table_io_manager, AttachedDatabase &db) + : Index(create_info->Cast().column_ids, table_io_manager, db), create_info(std::move(create_info)), + storage_info(std::move(storage_info_p)) { +} + +void UnboundIndex::CommitDrop() { + auto &block_manager = table_io_manager.GetIndexBlockManager(); + for (auto &info : storage_info.allocator_infos) { + for (auto &block : info.block_pointers) { + if (block.IsValid()) { + block_manager.MarkBlockAsModified(block.block_id); + } + } + } +} + +} // namespace duckdb diff --git a/src/duckdb/src/execution/join_hashtable.cpp b/src/duckdb/src/execution/join_hashtable.cpp index 53adf3a8..c1f27391 100644 --- a/src/duckdb/src/execution/join_hashtable.cpp +++ b/src/duckdb/src/execution/join_hashtable.cpp @@ -940,7 +940,8 @@ void JoinHashTable::SetRepartitionRadixBits(vector> &l auto new_estimated_size = double(max_partition_size) / partition_multiplier; auto new_estimated_count = double(max_partition_count) / partition_multiplier; - auto new_estimated_ht_size = new_estimated_size + PointerTableSize(new_estimated_count); + auto new_estimated_ht_size = + new_estimated_size + static_cast(PointerTableSize(NumericCast(new_estimated_count))); if (new_estimated_ht_size <= double(max_ht_size) / 4) { // Aim for an estimated partition size of max_ht_size / 4 diff --git a/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp b/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp index 05af824d..af61fa17 100644 --- a/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp +++ b/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp @@ -9,7 +9,7 @@ AggregateObject::AggregateObject(AggregateFunction function, FunctionData *bind_ idx_t payload_size, AggregateType aggr_type, PhysicalType return_type, Expression *filter) : function(std::move(function)), - bind_data_wrapper(bind_data ? make_shared(bind_data->Copy()) : nullptr), + bind_data_wrapper(bind_data ? make_shared_ptr(bind_data->Copy()) : nullptr), child_count(child_count), payload_size(payload_size), aggr_type(aggr_type), return_type(return_type), filter(filter) { } diff --git a/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp b/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp index cd76deee..d1d0d20d 100644 --- a/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp +++ b/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp @@ -151,7 +151,7 @@ idx_t DistinctAggregateCollectionInfo::CreateTableIndexMap() { std::find_if(table_inputs.begin(), table_inputs.end(), FindMatchingAggregate(std::ref(aggregate))); if (matching_inputs != table_inputs.end()) { //! Assign the existing table to the aggregate - idx_t found_idx = std::distance(table_inputs.begin(), matching_inputs); + auto found_idx = NumericCast(std::distance(table_inputs.begin(), matching_inputs)); table_map[agg_idx] = found_idx; continue; } diff --git a/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp b/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp index 5217c110..a3f8044f 100644 --- a/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +++ b/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp @@ -565,7 +565,7 @@ class HashAggregateDistinctFinalizeTask : public ExecutorTask { void HashAggregateDistinctFinalizeEvent::Schedule() { auto n_tasks = CreateGlobalSources(); - n_tasks = MinValue(n_tasks, TaskScheduler::GetScheduler(context).NumberOfThreads()); + n_tasks = MinValue(n_tasks, NumericCast(TaskScheduler::GetScheduler(context).NumberOfThreads())); vector> tasks; for (idx_t i = 0; i < n_tasks; i++) { tasks.push_back(make_uniq(*pipeline, shared_from_this(), op, gstate)); @@ -608,7 +608,7 @@ idx_t HashAggregateDistinctFinalizeEvent::CreateGlobalSources() { void HashAggregateDistinctFinalizeEvent::FinishEvent() { // Now that everything is added to the main ht, we can actually finalize - auto new_event = make_shared(context, pipeline.get(), op, gstate); + auto new_event = make_shared_ptr(context, pipeline.get(), op, gstate); this->InsertEvent(std::move(new_event)); } @@ -755,7 +755,7 @@ SinkFinalizeType PhysicalHashAggregate::FinalizeDistinct(Pipeline &pipeline, Eve radix_table->Finalize(context, radix_state); } } - auto new_event = make_shared(context, pipeline, *this, gstate); + auto new_event = make_shared_ptr(context, pipeline, *this, gstate); event.InsertEvent(std::move(new_event)); return SinkFinalizeType::READY; } diff --git a/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp b/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp index 7f497468..9fc58500 100644 --- a/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +++ b/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp @@ -8,6 +8,30 @@ namespace duckdb { +bool PhysicalStreamingWindow::IsStreamingFunction(unique_ptr &expr) { + auto &wexpr = expr->Cast(); + if (!wexpr.partitions.empty() || !wexpr.orders.empty() || wexpr.ignore_nulls || + wexpr.exclude_clause != WindowExcludeMode::NO_OTHER) { + return false; + } + switch (wexpr.type) { + // TODO: add more expression types here? + case ExpressionType::WINDOW_AGGREGATE: + // We can stream aggregates if they are "running totals" + // TODO: Support FILTER and DISTINCT + return wexpr.start == WindowBoundary::UNBOUNDED_PRECEDING && wexpr.end == WindowBoundary::CURRENT_ROW_ROWS && + !wexpr.filter_expr && !wexpr.distinct; + case ExpressionType::WINDOW_FIRST_VALUE: + case ExpressionType::WINDOW_PERCENT_RANK: + case ExpressionType::WINDOW_RANK: + case ExpressionType::WINDOW_RANK_DENSE: + case ExpressionType::WINDOW_ROW_NUMBER: + return true; + default: + return false; + } +} + PhysicalStreamingWindow::PhysicalStreamingWindow(vector types, vector> select_list, idx_t estimated_cardinality, PhysicalOperatorType type) : PhysicalOperator(type, std::move(types), estimated_cardinality), select_list(std::move(select_list)) { @@ -142,7 +166,7 @@ OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, D auto data = FlatVector::GetData(result); int64_t start_row = gstate.row_number; for (idx_t i = 0; i < input.size(); ++i) { - data[i] = start_row + i; + data[i] = NumericCast(start_row + NumericCast(i)); } break; } @@ -167,13 +191,24 @@ OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, D sel_t s = 0; SelectionVector sel(&s); row.Slice(sel, 1); - for (size_t col_idx = 0; col_idx < payload.ColumnCount(); ++col_idx) { - DictionaryVector::Child(row.data[col_idx]).Reference(payload.data[col_idx]); + // This doesn't work for STRUCTs because the SV + // is not copied to the children when you slice + vector structs; + for (column_t col_idx = 0; col_idx < payload.ColumnCount(); ++col_idx) { + auto &col_vec = row.data[col_idx]; + DictionaryVector::Child(col_vec).Reference(payload.data[col_idx]); + if (col_vec.GetType().InternalType() == PhysicalType::STRUCT) { + structs.emplace_back(col_idx); + } } // Update the state and finalize it one row at a time. for (idx_t i = 0; i < input.size(); ++i) { sel.set_index(0, i); + for (const auto struct_idx : structs) { + row.data[struct_idx].Slice(payload.data[struct_idx], sel, 1); + } + // TODO: FILTER and DISTINCT would just skip this. aggregate.update(row.data.data(), aggr_input_data, row.ColumnCount(), statev, 1); aggregate.finalize(statev, aggr_input_data, result, 1, i); } @@ -192,7 +227,7 @@ OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, D int64_t start_row = gstate.row_number; auto rdata = FlatVector::GetData(chunk.data[col_idx]); for (idx_t i = 0; i < count; i++) { - rdata[i] = start_row + i; + rdata[i] = NumericCast(start_row + NumericCast(i)); } break; } @@ -200,7 +235,7 @@ OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, D throw NotImplementedException("%s for StreamingWindow", ExpressionTypeToString(expr.GetExpressionType())); } } - gstate.row_number += count; + gstate.row_number += NumericCast(count); chunk.SetCardinality(count); return OperatorResultType::NEED_MORE_INPUT; } diff --git a/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp b/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp index f1ceeab4..eab47dc7 100644 --- a/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +++ b/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp @@ -454,7 +454,7 @@ void UngroupedDistinctAggregateFinalizeEvent::Schedule() { global_source_states.push_back(radix_table_p.GetGlobalSourceState(context)); } n_tasks = MaxValue(n_tasks, 1); - n_tasks = MinValue(n_tasks, TaskScheduler::GetScheduler(context).NumberOfThreads()); + n_tasks = MinValue(n_tasks, NumericCast(TaskScheduler::GetScheduler(context).NumberOfThreads())); vector> tasks; for (idx_t i = 0; i < n_tasks; i++) { @@ -586,7 +586,7 @@ SinkFinalizeType PhysicalUngroupedAggregate::FinalizeDistinct(Pipeline &pipeline auto &radix_state = *distinct_state.radix_states[table_idx]; radix_table_p->Finalize(context, radix_state); } - auto new_event = make_shared(context, *this, gstate, pipeline); + auto new_event = make_shared_ptr(context, *this, gstate, pipeline); event.InsertEvent(std::move(new_event)); return SinkFinalizeType::READY; } diff --git a/src/duckdb/src/execution/operator/aggregate/physical_window.cpp b/src/duckdb/src/execution/operator/aggregate/physical_window.cpp index bcfe0a56..7790eb67 100644 --- a/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +++ b/src/duckdb/src/execution/operator/aggregate/physical_window.cpp @@ -171,7 +171,7 @@ SinkFinalizeType PhysicalWindow::Finalize(Pipeline &pipeline, Event &event, Clie } // Schedule all the sorts for maximum thread utilisation - auto new_event = make_shared(*state.global_partition, pipeline); + auto new_event = make_shared_ptr(*state.global_partition, pipeline); event.InsertEvent(std::move(new_event)); return SinkFinalizeType::READY; @@ -205,6 +205,8 @@ class WindowGlobalSourceState : public GlobalSourceState { mutable mutex built_lock; //! The number of unfinished tasks atomic tasks_remaining; + //! The number of rows returned + atomic returned; public: idx_t MaxThreads() override { @@ -217,7 +219,7 @@ class WindowGlobalSourceState : public GlobalSourceState { }; WindowGlobalSourceState::WindowGlobalSourceState(ClientContext &context_p, WindowGlobalSinkState &gsink_p) - : context(context_p), gsink(gsink_p), next_build(0), tasks_remaining(0) { + : context(context_p), gsink(gsink_p), next_build(0), tasks_remaining(0), returned(0) { auto &hash_groups = gsink.global_partition->hash_groups; auto &gpart = gsink.global_partition; @@ -327,7 +329,7 @@ void WindowPartitionSourceState::MaterializeSortedData() { heap->blocks = std::move(sd.heap_blocks); hash_group.reset(); } else { - heap = make_uniq(buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1, true); + heap = make_uniq(buffer_manager, (idx_t)Storage::BLOCK_SIZE, 1U, true); } heap->count = std::accumulate(heap->blocks.begin(), heap->blocks.end(), idx_t(0), [&](idx_t c, const unique_ptr &b) { return c + b->count; }); @@ -681,6 +683,15 @@ OrderPreservationType PhysicalWindow::SourceOrder() const { return SupportsBatchIndex() ? OrderPreservationType::FIXED_ORDER : OrderPreservationType::NO_ORDER; } +double PhysicalWindow::GetProgress(ClientContext &context, GlobalSourceState &gsource_p) const { + auto &gsource = gsource_p.Cast(); + const auto returned = gsource.returned.load(); + + auto &gsink = gsource.gsink; + const auto count = gsink.global_partition->count.load(); + return count ? (returned / double(count)) : -1; +} + idx_t PhysicalWindow::GetBatchIndex(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate_p, LocalSourceState &lstate_p) const { auto &lstate = lstate_p.Cast(); @@ -689,6 +700,7 @@ idx_t PhysicalWindow::GetBatchIndex(ExecutionContext &context, DataChunk &chunk, SourceResultType PhysicalWindow::GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const { + auto &gsource = input.global_state.Cast(); auto &lsource = input.local_state.Cast(); while (chunk.size() == 0) { // Move to the next bin if we are done. @@ -699,6 +711,7 @@ SourceResultType PhysicalWindow::GetData(ExecutionContext &context, DataChunk &c } lsource.Scan(chunk); + gsource.returned += chunk.size(); } return chunk.size() == 0 ? SourceResultType::FINISHED : SourceResultType::HAVE_MORE_OUTPUT; diff --git a/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp b/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp index 726b994c..93402542 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp @@ -41,8 +41,8 @@ shared_ptr CSVBuffer::Next(CSVFileHandle &file_handle, idx_t buffer_s file_handle.Seek(global_csv_start + actual_buffer_size); has_seaked = false; } - auto next_csv_buffer = make_shared(file_handle, context, buffer_size, - global_csv_start + actual_buffer_size, file_number_p, buffer_idx + 1); + auto next_csv_buffer = make_shared_ptr( + file_handle, context, buffer_size, global_csv_start + actual_buffer_size, file_number_p, buffer_idx + 1); if (next_csv_buffer->GetBufferSize() == 0) { // We are done reading return nullptr; @@ -76,8 +76,8 @@ shared_ptr CSVBuffer::Pin(CSVFileHandle &file_handle, bool &has Reload(file_handle); has_seeked = true; } - return make_shared(buffer_manager.Pin(block), actual_buffer_size, requested_size, last_buffer, - file_number, buffer_idx); + return make_shared_ptr(buffer_manager.Pin(block), actual_buffer_size, requested_size, last_buffer, + file_number, buffer_idx); } void CSVBuffer::Unpin() { diff --git a/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp b/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp index 6a7226ec..948e91cf 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp @@ -29,7 +29,7 @@ void CSVBufferManager::UnpinBuffer(const idx_t cache_idx) { void CSVBufferManager::Initialize() { if (cached_buffers.empty()) { cached_buffers.emplace_back( - make_shared(context, buffer_size, *file_handle, global_csv_pos, file_idx)); + make_shared_ptr(context, buffer_size, *file_handle, global_csv_pos, file_idx)); last_buffer = cached_buffers.front(); } } @@ -38,17 +38,7 @@ bool CSVBufferManager::ReadNextAndCacheIt() { D_ASSERT(last_buffer); for (idx_t i = 0; i < 2; i++) { if (!last_buffer->IsCSVFileLastBuffer()) { - auto cur_buffer_size = buffer_size; - if (file_handle->uncompressed) { - if (file_handle->FileSize() - bytes_read) { - cur_buffer_size = file_handle->FileSize() - bytes_read; - } - } - if (cur_buffer_size == 0) { - last_buffer->last_buffer = true; - return false; - } - auto maybe_last_buffer = last_buffer->Next(*file_handle, cur_buffer_size, file_idx, has_seeked); + auto maybe_last_buffer = last_buffer->Next(*file_handle, buffer_size, file_idx, has_seeked); if (!maybe_last_buffer) { last_buffer->last_buffer = true; return false; diff --git a/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp b/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp index d37e38be..5b970d8c 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp @@ -1,5 +1,6 @@ #include "duckdb/execution/operator/csv_scanner/csv_file_handle.hpp" #include "duckdb/common/exception/binder_exception.hpp" +#include "duckdb/common/numeric_utils.hpp" namespace duckdb { @@ -71,7 +72,7 @@ idx_t CSVFileHandle::Read(void *buffer, idx_t nr_bytes) { if (!finished) { finished = bytes_read == 0; } - return bytes_read; + return UnsafeNumericCast(bytes_read); } string CSVFileHandle::ReadLine() { diff --git a/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp b/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp index 23212e99..71a80064 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp @@ -1,10 +1,12 @@ -#include "duckdb/execution/operator/csv_scanner/csv_sniffer.hpp" #include "duckdb/execution/operator/csv_scanner/base_scanner.hpp" +#include "duckdb/execution/operator/csv_scanner/csv_sniffer.hpp" +#include "duckdb/execution/operator/csv_scanner/skip_scanner.hpp" + namespace duckdb { ScannerResult::ScannerResult(CSVStates &states_p, CSVStateMachine &state_machine_p) - : states(states_p), state_machine(state_machine_p) { + : state_machine(state_machine_p), states(states_p) { } BaseScanner::BaseScanner(shared_ptr buffer_manager_p, shared_ptr state_machine_p, @@ -39,15 +41,29 @@ bool BaseScanner::FinishedFile() { return iterator.pos.buffer_pos + 1 == cur_buffer_handle->actual_size; } -void BaseScanner::Reset() { - iterator.SetCurrentPositionToBoundary(); - lines_read = 0; +void BaseScanner::SkipCSVRows(idx_t rows_to_skip) { + if (rows_to_skip == 0) { + return; + } + SkipScanner row_skipper(buffer_manager, state_machine, error_handler, rows_to_skip); + row_skipper.ParseChunk(); + iterator.pos.buffer_pos = row_skipper.GetIteratorPosition(); + if (row_skipper.state_machine->options.dialect_options.state_machine_options.new_line == + NewLineIdentifier::CARRY_ON && + row_skipper.states.states[1] == CSVState::CARRIAGE_RETURN) { + iterator.pos.buffer_pos++; + } + lines_read += row_skipper.GetLinesRead(); } CSVIterator &BaseScanner::GetIterator() { return iterator; } +void BaseScanner::SetIterator(const CSVIterator &it) { + iterator = it; +} + ScannerResult &BaseScanner::ParseChunk() { throw InternalException("ParseChunk() from CSV Base Scanner is mot implemented"); } diff --git a/src/duckdb/src/execution/operator/csv_scanner/scanner/column_count_scanner.cpp b/src/duckdb/src/execution/operator/csv_scanner/scanner/column_count_scanner.cpp index 8894cbcf..70542ef4 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/scanner/column_count_scanner.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/scanner/column_count_scanner.cpp @@ -50,7 +50,7 @@ ColumnCountScanner::ColumnCountScanner(shared_ptr buffer_manag } unique_ptr ColumnCountScanner::UpgradeToStringValueScanner() { - auto scanner = make_uniq(0, buffer_manager, state_machine, error_handler, nullptr, true); + auto scanner = make_uniq(0U, buffer_manager, state_machine, error_handler, nullptr, true); return scanner; } diff --git a/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp b/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp index 9e6271c8..d9363074 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp @@ -1,26 +1,31 @@ #include "duckdb/execution/operator/csv_scanner/string_value_scanner.hpp" + +#include "duckdb/common/operator/decimal_cast_operators.hpp" +#include "duckdb/common/operator/double_cast_operator.hpp" +#include "duckdb/common/operator/integer_cast_operator.hpp" +#include "duckdb/common/types/time.hpp" #include "duckdb/execution/operator/csv_scanner/csv_casting.hpp" -#include "duckdb/execution/operator/csv_scanner/skip_scanner.hpp" #include "duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp" +#include "duckdb/execution/operator/csv_scanner/skip_scanner.hpp" +#include "duckdb/function/cast/cast_function_set.hpp" #include "duckdb/main/client_data.hpp" -#include "duckdb/common/operator/integer_cast_operator.hpp" -#include "duckdb/common/operator/double_cast_operator.hpp" -#include #include "utf8proc_wrapper.hpp" +#include + namespace duckdb { StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_machine, const shared_ptr &buffer_handle, Allocator &buffer_allocator, - idx_t result_size_p, idx_t buffer_position, CSVErrorHandler &error_hander_p, + bool figure_out_new_line_p, idx_t buffer_position, CSVErrorHandler &error_hander_p, CSVIterator &iterator_p, bool store_line_size_p, shared_ptr csv_file_scan_p, idx_t &lines_read_p, bool sniffing_p) : ScannerResult(states, state_machine), number_of_columns(NumericCast(state_machine.dialect_options.num_cols)), null_padding(state_machine.options.null_padding), ignore_errors(state_machine.options.ignore_errors.GetValue()), - result_size(result_size_p), error_handler(error_hander_p), iterator(iterator_p), + figure_out_new_line(figure_out_new_line_p), error_handler(error_hander_p), iterator(iterator_p), store_line_size(store_line_size_p), csv_file_scan(std::move(csv_file_scan_p)), lines_read(lines_read_p), - sniffing(sniffing_p) { + current_errors(state_machine.options.IgnoreErrors()), sniffing(sniffing_p) { // Vector information D_ASSERT(number_of_columns > 0); buffer_handles[buffer_handle->buffer_idx] = buffer_handle; @@ -29,16 +34,18 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m buffer_size = buffer_handle->actual_size; last_position = {buffer_handle->buffer_idx, buffer_position, buffer_size}; requested_size = buffer_handle->requested_size; + result_size = figure_out_new_line ? 1 : STANDARD_VECTOR_SIZE; // Current Result information current_line_position.begin = {iterator.pos.buffer_idx, iterator.pos.buffer_pos, buffer_handle->actual_size}; current_line_position.end = current_line_position.begin; // Fill out Parse Types vector logical_types; - parse_types = make_unsafe_uniq_array>(number_of_columns); + parse_types = make_unsafe_uniq_array(number_of_columns); + LogicalType varchar_type = LogicalType::VARCHAR; if (!csv_file_scan) { for (idx_t i = 0; i < number_of_columns; i++) { - parse_types[i] = {LogicalTypeId::VARCHAR, true}; + parse_types[i] = ParseTypeInfo(varchar_type, true); logical_types.emplace_back(LogicalType::VARCHAR); string name = "Column_" + to_string(i); names.emplace_back(name); @@ -51,11 +58,11 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m } for (idx_t i = 0; i < csv_file_scan->file_types.size(); i++) { auto &type = csv_file_scan->file_types[i]; - if (StringValueScanner::CanDirectlyCast(type, state_machine.options.dialect_options.date_format)) { - parse_types[i] = {type.id(), true}; + if (StringValueScanner::CanDirectlyCast(type)) { + parse_types[i] = ParseTypeInfo(type, true); logical_types.emplace_back(type); } else { - parse_types[i] = {LogicalTypeId::VARCHAR, type.id() == LogicalTypeId::VARCHAR || type.IsNested()}; + parse_types[i] = ParseTypeInfo(varchar_type, type.id() == LogicalTypeId::VARCHAR || type.IsNested()); logical_types.emplace_back(LogicalType::VARCHAR); } } @@ -76,7 +83,7 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m if (!projecting_columns) { for (idx_t j = logical_types.size(); j < number_of_columns; j++) { // This can happen if we have sneaky null columns at the end that we wish to ignore - parse_types[j] = {LogicalTypeId::VARCHAR, true}; + parse_types[j] = ParseTypeInfo(varchar_type, true); logical_types.emplace_back(LogicalType::VARCHAR); } } @@ -97,6 +104,9 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m null_str_ptr[i] = state_machine.options.null_str[i].c_str(); null_str_size[i] = state_machine.options.null_str[i].size(); } + date_format = state_machine.options.dialect_options.date_format.at(LogicalTypeId::DATE).GetValue(); + timestamp_format = state_machine.options.dialect_options.date_format.at(LogicalTypeId::TIMESTAMP).GetValue(); + decimal_separator = state_machine.options.decimal_separator[0]; } StringValueResult::~StringValueResult() { @@ -118,7 +128,31 @@ inline bool IsValueNull(const char *null_str_ptr, const char *value_ptr, const i return true; } +bool StringValueResult::HandleTooManyColumnsError(const char *value_ptr, const idx_t size) { + if (cur_col_id >= number_of_columns) { + bool error = true; + if (cur_col_id == number_of_columns && ((quoted && state_machine.options.allow_quoted_nulls) || !quoted)) { + // we make an exception if the first over-value is null + bool is_value_null = false; + for (idx_t i = 0; i < null_str_count; i++) { + is_value_null = is_value_null || IsValueNull(null_str_ptr[i], value_ptr, size); + } + error = !is_value_null; + } + if (error) { + // We error pointing to the current value error. + current_errors.Insert(CSVErrorType::TOO_MANY_COLUMNS, cur_col_id, chunk_col_id, last_position); + cur_col_id++; + } + // We had an error + return true; + } + return false; +} void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size, bool allocate) { + if (HandleTooManyColumnsError(value_ptr, size)) { + return; + } if (cur_col_id >= number_of_columns) { bool error = true; if (cur_col_id == number_of_columns && ((quoted && state_machine.options.allow_quoted_nulls) || !quoted)) { @@ -131,7 +165,7 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size } if (error) { // We error pointing to the current value error. - current_errors.push_back({CSVErrorType::TOO_MANY_COLUMNS, cur_col_id, last_position}); + current_errors.Insert(CSVErrorType::TOO_MANY_COLUMNS, cur_col_id, chunk_col_id, last_position); cur_col_id++; } return; @@ -152,9 +186,9 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size empty = state_machine.options.force_not_null[chunk_col_id]; } if (empty) { - if (parse_types[chunk_col_id].first != LogicalTypeId::VARCHAR) { + if (parse_types[chunk_col_id].type_id != LogicalTypeId::VARCHAR) { // If it is not a varchar, empty values are not accepted, we must error. - current_errors.push_back({CSVErrorType::CAST_ERROR, cur_col_id, last_position}); + current_errors.Insert(CSVErrorType::CAST_ERROR, cur_col_id, chunk_col_id, last_position); } static_cast(vector_ptr[chunk_col_id])[number_of_rows] = string_t(); } else { @@ -172,7 +206,7 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size } } bool success = true; - switch (parse_types[chunk_col_id].first) { + switch (parse_types[chunk_col_id].type_id) { case LogicalTypeId::TINYINT: success = TrySimpleIntegerCast(value_ptr, size, static_cast(vector_ptr[chunk_col_id])[number_of_rows], false); @@ -215,29 +249,105 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size false, state_machine.options.decimal_separator[0]); break; case LogicalTypeId::DATE: { + if (!date_format.Empty()) { + success = date_format.TryParseDate(value_ptr, size, + static_cast(vector_ptr[chunk_col_id])[number_of_rows]); + } else { + idx_t pos; + bool special; + success = Date::TryConvertDate( + value_ptr, size, pos, static_cast(vector_ptr[chunk_col_id])[number_of_rows], special, false); + } + break; + } + case LogicalTypeId::TIME: { idx_t pos; - bool special; - success = Date::TryConvertDate(value_ptr, size, pos, - static_cast(vector_ptr[chunk_col_id])[number_of_rows], special, false); + success = Time::TryConvertTime(value_ptr, size, pos, + static_cast(vector_ptr[chunk_col_id])[number_of_rows], false); break; } case LogicalTypeId::TIMESTAMP: { - success = Timestamp::TryConvertTimestamp( - value_ptr, size, static_cast(vector_ptr[chunk_col_id])[number_of_rows]) == - TimestampCastResult::SUCCESS; + if (!timestamp_format.Empty()) { + success = timestamp_format.TryParseTimestamp( + value_ptr, size, static_cast(vector_ptr[chunk_col_id])[number_of_rows]); + } else { + success = Timestamp::TryConvertTimestamp( + value_ptr, size, static_cast(vector_ptr[chunk_col_id])[number_of_rows]) == + TimestampCastResult::SUCCESS; + } + break; + } + case LogicalTypeId::DECIMAL: { + if (decimal_separator == ',') { + switch (parse_types[chunk_col_id].internal_type) { + case PhysicalType::INT16: + success = TryDecimalStringCast( + value_ptr, size, static_cast(vector_ptr[chunk_col_id])[number_of_rows], + parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale); + break; + case PhysicalType::INT32: + success = TryDecimalStringCast( + value_ptr, size, static_cast(vector_ptr[chunk_col_id])[number_of_rows], + parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale); + break; + case PhysicalType::INT64: + success = TryDecimalStringCast( + value_ptr, size, static_cast(vector_ptr[chunk_col_id])[number_of_rows], + parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale); + break; + case PhysicalType::INT128: + success = TryDecimalStringCast( + value_ptr, size, static_cast(vector_ptr[chunk_col_id])[number_of_rows], + parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale); + break; + default: + throw InternalException("Invalid Physical Type for Decimal Value. Physical Type: " + + TypeIdToString(parse_types[chunk_col_id].internal_type)); + } + + } else if (decimal_separator == '.') { + switch (parse_types[chunk_col_id].internal_type) { + case PhysicalType::INT16: + success = TryDecimalStringCast(value_ptr, size, + static_cast(vector_ptr[chunk_col_id])[number_of_rows], + parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale); + break; + case PhysicalType::INT32: + success = TryDecimalStringCast(value_ptr, size, + static_cast(vector_ptr[chunk_col_id])[number_of_rows], + parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale); + break; + case PhysicalType::INT64: + success = TryDecimalStringCast(value_ptr, size, + static_cast(vector_ptr[chunk_col_id])[number_of_rows], + parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale); + break; + case PhysicalType::INT128: + success = TryDecimalStringCast(value_ptr, size, + static_cast(vector_ptr[chunk_col_id])[number_of_rows], + parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale); + break; + default: + throw InternalException("Invalid Physical Type for Decimal Value. Physical Type: " + + TypeIdToString(parse_types[chunk_col_id].internal_type)); + } + } else { + throw InvalidInputException("Decimals can only have ',' and '.' as decimal separators"); + } break; } default: { // By default, we add a string // We only evaluate if a string is utf8 valid, if it's actually a varchar - if (parse_types[chunk_col_id].second && !Utf8Proc::IsValid(value_ptr, UnsafeNumericCast(size))) { + if (parse_types[chunk_col_id].validate_utf8 && + !Utf8Proc::IsValid(value_ptr, UnsafeNumericCast(size))) { bool force_error = !state_machine.options.ignore_errors.GetValue() && sniffing; // Invalid unicode, we must error if (force_error) { HandleUnicodeError(cur_col_id, last_position); } // If we got here, we are ingoring errors, hence we must ignore this line. - current_errors.push_back({CSVErrorType::INVALID_UNICODE, cur_col_id, last_position}); + current_errors.Insert(CSVErrorType::INVALID_UNICODE, cur_col_id, chunk_col_id, last_position); break; } if (allocate) { @@ -252,29 +362,20 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size } } if (!success) { - // We had a casting error, we push it here because we can only error when finishing the line read. - std::ostringstream error; - // Casting Error Message - error << "Could not convert string \"" << std::string(value_ptr, size) << "\" to \'" - << LogicalTypeIdToString(parse_types[cur_col_id].first) << "\'"; - current_errors.push_back({CSVErrorType::CAST_ERROR, cur_col_id, last_position}); - current_errors.back().error_message = error.str(); + current_errors.Insert(CSVErrorType::CAST_ERROR, cur_col_id, chunk_col_id, last_position); + if (!state_machine.options.IgnoreErrors()) { + // We have to write the cast error message. + std::ostringstream error; + // Casting Error Message + error << "Could not convert string \"" << std::string(value_ptr, size) << "\" to \'" + << LogicalTypeIdToString(parse_types[chunk_col_id].type_id) << "\'"; + current_errors.ModifyErrorMessageOfLastError(error.str()); + } } cur_col_id++; chunk_col_id++; } -Value StringValueResult::GetValue(idx_t row_idx, idx_t col_idx) { - if (validity_mask[col_idx]->AllValid()) { - return Value(static_cast(vector_ptr[col_idx])[row_idx]); - } else { - if (validity_mask[col_idx]->RowIsValid(row_idx)) { - return Value(static_cast(vector_ptr[col_idx])[row_idx]); - } else { - return Value(); - } - } -} DataChunk &StringValueResult::ToChunk() { parse_chunk.SetCardinality(number_of_rows); return parse_chunk; @@ -299,7 +400,8 @@ void StringValueResult::Reset() { if (cur_buffer) { buffer_handles[cur_buffer->buffer_idx] = cur_buffer; } - current_errors.clear(); + current_errors.Reset(); + borked_rows.clear(); } void StringValueResult::AddQuotedValue(StringValueResult &result, const idx_t buffer_pos) { @@ -312,12 +414,15 @@ void StringValueResult::AddQuotedValue(StringValueResult &result, const idx_t bu return; } } - // If it's an escaped value we have to remove all the escapes, this is not really great - auto value = StringValueScanner::RemoveEscape( - result.buffer_ptr + result.quoted_position + 1, buffer_pos - result.quoted_position - 2, - result.state_machine.dialect_options.state_machine_options.escape.GetValue(), - result.parse_chunk.data[result.chunk_col_id]); - result.AddValueToVector(value.GetData(), value.GetSize()); + if (!result.HandleTooManyColumnsError(result.buffer_ptr + result.quoted_position + 1, + buffer_pos - result.quoted_position - 2)) { + // If it's an escaped value we have to remove all the escapes, this is not really great + auto value = StringValueScanner::RemoveEscape( + result.buffer_ptr + result.quoted_position + 1, buffer_pos - result.quoted_position - 2, + result.state_machine.dialect_options.state_machine_options.escape.GetValue(), + result.parse_chunk.data[result.chunk_col_id]); + result.AddValueToVector(value.GetData(), value.GetSize()); + } } else { if (buffer_pos < result.last_position.buffer_pos + 2) { // empty value @@ -346,6 +451,7 @@ void StringValueResult::AddValue(StringValueResult &result, const idx_t buffer_p } void StringValueResult::HandleUnicodeError(idx_t col_idx, LinePosition &error_position) { + bool first_nl; auto borked_line = current_line_position.ReconstructCurrentLine(first_nl, buffer_handles); LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), lines_read); @@ -362,12 +468,19 @@ void StringValueResult::HandleUnicodeError(idx_t col_idx, LinePosition &error_po } } -bool StringValueResult::HandleError() { +bool LineError::HandleErrors(StringValueResult &result) { + if (ignore_errors && is_error_in_line && !result.figure_out_new_line) { + result.cur_col_id = 0; + result.chunk_col_id = 0; + result.number_of_rows--; + Reset(); + return true; + } // Reconstruct CSV Line for (auto &cur_error : current_errors) { - LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), lines_read); + LinesPerBoundary lines_per_batch(result.iterator.GetBoundaryIdx(), result.lines_read); bool first_nl; - auto borked_line = current_line_position.ReconstructCurrentLine(first_nl, buffer_handles); + auto borked_line = result.current_line_position.ReconstructCurrentLine(first_nl, result.buffer_handles); CSVError csv_error; auto col_idx = cur_error.col_idx; auto &line_pos = cur_error.error_position; @@ -375,74 +488,76 @@ bool StringValueResult::HandleError() { switch (cur_error.type) { case CSVErrorType::TOO_MANY_COLUMNS: case CSVErrorType::TOO_FEW_COLUMNS: - if (current_line_position.begin == line_pos) { + if (result.current_line_position.begin == line_pos) { csv_error = CSVError::IncorrectColumnAmountError( - state_machine.options, col_idx, lines_per_batch, borked_line, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl), - line_pos.GetGlobalPosition(requested_size, first_nl)); + result.state_machine.options, col_idx, lines_per_batch, borked_line, + result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl), + line_pos.GetGlobalPosition(result.requested_size, first_nl)); } else { csv_error = CSVError::IncorrectColumnAmountError( - state_machine.options, col_idx, lines_per_batch, borked_line, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl), - line_pos.GetGlobalPosition(requested_size)); + result.state_machine.options, col_idx, lines_per_batch, borked_line, + result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl), + line_pos.GetGlobalPosition(result.requested_size)); } break; case CSVErrorType::INVALID_UNICODE: { - if (current_line_position.begin == line_pos) { - csv_error = - CSVError::InvalidUTF8(state_machine.options, col_idx, lines_per_batch, borked_line, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl), - line_pos.GetGlobalPosition(requested_size, first_nl)); + if (result.current_line_position.begin == line_pos) { + csv_error = CSVError::InvalidUTF8( + result.state_machine.options, col_idx, lines_per_batch, borked_line, + result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl), + line_pos.GetGlobalPosition(result.requested_size, first_nl)); } else { - csv_error = - CSVError::InvalidUTF8(state_machine.options, col_idx, lines_per_batch, borked_line, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl), - line_pos.GetGlobalPosition(requested_size)); + csv_error = CSVError::InvalidUTF8( + result.state_machine.options, col_idx, lines_per_batch, borked_line, + result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl), + line_pos.GetGlobalPosition(result.requested_size)); } break; } case CSVErrorType::UNTERMINATED_QUOTES: - if (current_line_position.begin == line_pos) { + if (result.current_line_position.begin == line_pos) { csv_error = CSVError::UnterminatedQuotesError( - state_machine.options, col_idx, lines_per_batch, borked_line, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl), - line_pos.GetGlobalPosition(requested_size, first_nl)); + result.state_machine.options, col_idx, lines_per_batch, borked_line, + result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl), + line_pos.GetGlobalPosition(result.requested_size, first_nl)); } else { csv_error = CSVError::UnterminatedQuotesError( - state_machine.options, col_idx, lines_per_batch, borked_line, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl), - line_pos.GetGlobalPosition(requested_size)); + result.state_machine.options, col_idx, lines_per_batch, borked_line, + result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl), + line_pos.GetGlobalPosition(result.requested_size)); } break; case CSVErrorType::CAST_ERROR: - if (current_line_position.begin == line_pos) { + if (result.current_line_position.begin == line_pos) { csv_error = CSVError::CastError( - state_machine.options, names[cur_error.col_idx], cur_error.error_message, cur_error.col_idx, - borked_line, lines_per_batch, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl), - line_pos.GetGlobalPosition(requested_size, first_nl), parse_types[cur_error.col_idx].first); + result.state_machine.options, result.names[cur_error.col_idx], cur_error.error_message, + cur_error.col_idx, borked_line, lines_per_batch, + result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl), + line_pos.GetGlobalPosition(result.requested_size, first_nl), + result.parse_types[cur_error.chunk_idx].type_id); } else { csv_error = CSVError::CastError( - state_machine.options, names[cur_error.col_idx], cur_error.error_message, cur_error.col_idx, - borked_line, lines_per_batch, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl), - line_pos.GetGlobalPosition(requested_size), parse_types[cur_error.col_idx].first); + result.state_machine.options, result.names[cur_error.col_idx], cur_error.error_message, + cur_error.col_idx, borked_line, lines_per_batch, + result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl), + line_pos.GetGlobalPosition(result.requested_size), result.parse_types[cur_error.chunk_idx].type_id); } break; case CSVErrorType::MAXIMUM_LINE_SIZE: csv_error = CSVError::LineSizeError( - state_machine.options, cur_error.current_line_size, lines_per_batch, borked_line, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl)); + result.state_machine.options, cur_error.current_line_size, lines_per_batch, borked_line, + result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl)); break; default: throw InvalidInputException("CSV Error not allowed when inserting row"); } - error_handler.Error(csv_error); + result.error_handler.Error(csv_error); } - if (!current_errors.empty()) { - current_errors.clear(); - cur_col_id = 0; - chunk_col_id = 0; + if (is_error_in_line) { + result.borked_rows.insert(result.number_of_rows); + result.cur_col_id = 0; + result.chunk_col_id = 0; + Reset(); return true; } return false; @@ -510,16 +625,21 @@ bool StringValueResult::AddRowInternal() { current_line_position.begin = current_line_position.end; current_line_position.end = current_line_start; if (current_line_size > state_machine.options.maximum_line_size) { - current_errors.push_back({CSVErrorType::MAXIMUM_LINE_SIZE, 1, last_position}); - current_errors.back().current_line_size = current_line_size; + current_errors.Insert(CSVErrorType::MAXIMUM_LINE_SIZE, 1, chunk_col_id, last_position, current_line_size); } - if (!current_errors.empty()) { - // We need to add a few columns error + if (!state_machine.options.null_padding) { for (idx_t col_idx = cur_col_id; col_idx < number_of_columns; col_idx++) { - current_errors.push_back({CSVErrorType::TOO_FEW_COLUMNS, col_idx - 1, last_position}); + current_errors.Insert(CSVErrorType::TOO_FEW_COLUMNS, col_idx - 1, chunk_col_id, last_position); } } - if (HandleError()) { + + if (current_errors.HandleErrors(*this)) { + line_positions_per_row[number_of_rows] = current_line_position; + number_of_rows++; + if (number_of_rows >= result_size) { + // We have a full chunk + return true; + } return false; } NullPaddingQuotedNewlineCheck(); @@ -550,21 +670,23 @@ bool StringValueResult::AddRowInternal() { } } else { // If we are not null-padding this is an error - bool first_nl; - auto borked_line = current_line_position.ReconstructCurrentLine(first_nl, buffer_handles); - LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), lines_read); - if (current_line_position.begin == last_position) { - auto csv_error = CSVError::IncorrectColumnAmountError( - state_machine.options, cur_col_id - 1, lines_per_batch, borked_line, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl), - last_position.GetGlobalPosition(requested_size, first_nl)); - error_handler.Error(csv_error); - } else { - auto csv_error = CSVError::IncorrectColumnAmountError( - state_machine.options, cur_col_id - 1, lines_per_batch, borked_line, - current_line_position.begin.GetGlobalPosition(requested_size, first_nl), - last_position.GetGlobalPosition(requested_size)); - error_handler.Error(csv_error); + if (!state_machine.options.IgnoreErrors()) { + bool first_nl; + auto borked_line = current_line_position.ReconstructCurrentLine(first_nl, buffer_handles); + LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), lines_read); + if (current_line_position.begin == last_position) { + auto csv_error = CSVError::IncorrectColumnAmountError( + state_machine.options, cur_col_id - 1, lines_per_batch, borked_line, + current_line_position.begin.GetGlobalPosition(requested_size, first_nl), + last_position.GetGlobalPosition(requested_size, first_nl)); + error_handler.Error(csv_error); + } else { + auto csv_error = CSVError::IncorrectColumnAmountError( + state_machine.options, cur_col_id - 1, lines_per_batch, borked_line, + current_line_position.begin.GetGlobalPosition(requested_size, first_nl), + last_position.GetGlobalPosition(requested_size)); + error_handler.Error(csv_error); + } } // If we are here we ignore_errors, so we delete this line number_of_rows--; @@ -612,7 +734,8 @@ void StringValueResult::InvalidState(StringValueResult &result) { if (force_error) { result.HandleUnicodeError(result.cur_col_id, result.last_position); } - result.current_errors.push_back({CSVErrorType::UNTERMINATED_QUOTES, result.cur_col_id, result.last_position}); + result.current_errors.Insert(CSVErrorType::UNTERMINATED_QUOTES, result.cur_col_id, result.chunk_col_id, + result.last_position); } bool StringValueResult::EmptyLine(StringValueResult &result, const idx_t buffer_pos) { @@ -649,10 +772,10 @@ StringValueScanner::StringValueScanner(idx_t scanner_idx_p, const shared_ptr &state_machine, const shared_ptr &error_handler, const shared_ptr &csv_file_scan, bool sniffing, - CSVIterator boundary, idx_t result_size) + CSVIterator boundary, bool figure_out_nl) : BaseScanner(buffer_manager, state_machine, error_handler, sniffing, csv_file_scan, boundary), scanner_idx(scanner_idx_p), - result(states, *state_machine, cur_buffer_handle, BufferAllocator::Get(buffer_manager->context), result_size, + result(states, *state_machine, cur_buffer_handle, BufferAllocator::Get(buffer_manager->context), figure_out_nl, iterator.pos.buffer_pos, *error_handler, iterator, buffer_manager->context.client_data->debug_set_max_line_length, csv_file_scan, lines_read, sniffing) { } @@ -661,20 +784,20 @@ StringValueScanner::StringValueScanner(const shared_ptr &buffe const shared_ptr &state_machine, const shared_ptr &error_handler) : BaseScanner(buffer_manager, state_machine, error_handler, false, nullptr, {}), scanner_idx(0), - result(states, *state_machine, cur_buffer_handle, Allocator::DefaultAllocator(), STANDARD_VECTOR_SIZE, - iterator.pos.buffer_pos, *error_handler, iterator, - buffer_manager->context.client_data->debug_set_max_line_length, csv_file_scan, lines_read, sniffing) { + result(states, *state_machine, cur_buffer_handle, Allocator::DefaultAllocator(), false, iterator.pos.buffer_pos, + *error_handler, iterator, buffer_manager->context.client_data->debug_set_max_line_length, csv_file_scan, + lines_read, sniffing) { } unique_ptr StringValueScanner::GetCSVScanner(ClientContext &context, CSVReaderOptions &options) { - auto state_machine = make_shared(options, options.dialect_options.state_machine_options, - CSVStateMachineCache::Get(context)); + auto state_machine = make_shared_ptr(options, options.dialect_options.state_machine_options, + CSVStateMachineCache::Get(context)); state_machine->dialect_options.num_cols = options.dialect_options.num_cols; state_machine->dialect_options.header = options.dialect_options.header; - auto buffer_manager = make_shared(context, options, options.file_path, 0); - auto scanner = make_uniq(buffer_manager, state_machine, make_shared()); - scanner->csv_file_scan = make_shared(context, options.file_path, options); + auto buffer_manager = make_shared_ptr(context, options, options.file_path, 0); + auto scanner = make_uniq(buffer_manager, state_machine, make_shared_ptr()); + scanner->csv_file_scan = make_shared_ptr(context, options.file_path, options); scanner->csv_file_scan->InitializeProjection(); return scanner; } @@ -695,7 +818,6 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) { auto &parse_chunk = process_result.ToChunk(); // We have to check if we got to error error_handler->ErrorIfNeeded(); - if (parse_chunk.size() == 0) { return; } @@ -703,7 +825,6 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) { insert_chunk.SetCardinality(parse_chunk); // We keep track of the borked lines, in case we are ignoring errors - unordered_set borked_lines; D_ASSERT(csv_file_scan); auto &reader_data = csv_file_scan->reader_data; @@ -726,41 +847,9 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) { result_vector.Reinterpret(parse_vector); } else { string error_message; - CastParameters parameters(false, &error_message); - bool success; idx_t line_error = 0; - bool line_error_set = true; - - if (!state_machine->options.dialect_options.date_format.at(LogicalTypeId::DATE).GetValue().Empty() && - type.id() == LogicalTypeId::DATE) { - // use the date format to cast the chunk - success = CSVCast::TryCastDateVector(state_machine->options.dialect_options.date_format, parse_vector, - result_vector, parse_chunk.size(), parameters, line_error, true); - } else if (!state_machine->options.dialect_options.date_format.at(LogicalTypeId::TIMESTAMP) - .GetValue() - .Empty() && - type.id() == LogicalTypeId::TIMESTAMP) { - // use the date format to cast the chunk - success = - CSVCast::TryCastTimestampVector(state_machine->options.dialect_options.date_format, parse_vector, - result_vector, parse_chunk.size(), parameters, true); - } else if (state_machine->options.decimal_separator != "." && - (type.id() == LogicalTypeId::FLOAT || type.id() == LogicalTypeId::DOUBLE)) { - success = - CSVCast::TryCastFloatingVectorCommaSeparated(state_machine->options, parse_vector, result_vector, - parse_chunk.size(), parameters, type, line_error); - } else if (state_machine->options.decimal_separator != "." && type.id() == LogicalTypeId::DECIMAL) { - success = - CSVCast::TryCastDecimalVectorCommaSeparated(state_machine->options, parse_vector, result_vector, - parse_chunk.size(), parameters, type, line_error); - - } else { - // target type is not varchar: perform a cast - success = VectorOperations::TryCast(buffer_manager->context, parse_vector, result_vector, - parse_chunk.size(), &error_message, false, true); - line_error_set = false; - } - if (success) { + if (VectorOperations::TryCast(buffer_manager->context, parse_vector, result_vector, parse_chunk.size(), + &error_message, false, true)) { continue; } // An error happened, to propagate it we need to figure out the exact line where the casting failed. @@ -768,12 +857,11 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) { result_vector.ToUnifiedFormat(parse_chunk.size(), inserted_column_data); UnifiedVectorFormat parse_column_data; parse_vector.ToUnifiedFormat(parse_chunk.size(), parse_column_data); - if (!line_error_set) { - for (; line_error < parse_chunk.size(); line_error++) { - if (!inserted_column_data.validity.RowIsValid(line_error) && - parse_column_data.validity.RowIsValid(line_error)) { - break; - } + + for (; line_error < parse_chunk.size(); line_error++) { + if (!inserted_column_data.validity.RowIsValid(line_error) && + parse_column_data.validity.RowIsValid(line_error)) { + break; } } { @@ -784,52 +872,64 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) { row.push_back(parse_chunk.GetValue(col, line_error)); } } - - LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), - lines_read - parse_chunk.size() + line_error); - bool first_nl; - auto borked_line = - result.line_positions_per_row[line_error].ReconstructCurrentLine(first_nl, result.buffer_handles); - auto csv_error = CSVError::CastError( - state_machine->options, csv_file_scan->names[col_idx], error_message, col_idx, borked_line, - lines_per_batch, - result.line_positions_per_row[line_error].begin.GetGlobalPosition(result.result_size, first_nl), -1, - result_vector.GetType().id()); - - error_handler->Error(csv_error); + if (!state_machine->options.IgnoreErrors()) { + LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), + lines_read - parse_chunk.size() + line_error); + bool first_nl; + auto borked_line = result.line_positions_per_row[line_error].ReconstructCurrentLine( + first_nl, result.buffer_handles); + std::ostringstream error; + error << "Could not convert string \"" << parse_vector.GetValue(line_error) << "\" to \'" + << LogicalTypeIdToString(type.id()) << "\'"; + string error_msg = error.str(); + auto csv_error = CSVError::CastError( + state_machine->options, csv_file_scan->names[col_idx], error_msg, col_idx, borked_line, + lines_per_batch, + result.line_positions_per_row[line_error].begin.GetGlobalPosition(result.result_size, first_nl), + optional_idx::Invalid(), result_vector.GetType().id()); + error_handler->Error(csv_error); + } } - borked_lines.insert(line_error++); + result.borked_rows.insert(line_error++); D_ASSERT(state_machine->options.ignore_errors.GetValue()); // We are ignoring errors. We must continue but ignoring borked rows for (; line_error < parse_chunk.size(); line_error++) { if (!inserted_column_data.validity.RowIsValid(line_error) && parse_column_data.validity.RowIsValid(line_error)) { - borked_lines.insert(line_error); + result.borked_rows.insert(line_error); vector row; for (idx_t col = 0; col < parse_chunk.ColumnCount(); col++) { row.push_back(parse_chunk.GetValue(col, line_error)); } - LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), - lines_read - parse_chunk.size() + line_error); - bool first_nl; - auto borked_line = result.line_positions_per_row[line_error].ReconstructCurrentLine( - first_nl, result.buffer_handles); - auto csv_error = CSVError::CastError( - state_machine->options, csv_file_scan->names[col_idx], error_message, col_idx, borked_line, - lines_per_batch, - result.line_positions_per_row[line_error].begin.GetGlobalPosition(result.result_size, first_nl), - -1, result_vector.GetType().id()); - error_handler->Error(csv_error); + if (!state_machine->options.IgnoreErrors()) { + LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), + lines_read - parse_chunk.size() + line_error); + bool first_nl; + auto borked_line = result.line_positions_per_row[line_error].ReconstructCurrentLine( + first_nl, result.buffer_handles); + std::ostringstream error; + // Casting Error Message + error << "Could not convert string \"" << parse_vector.GetValue(line_error) << "\" to \'" + << LogicalTypeIdToString(type.id()) << "\'"; + string error_msg = error.str(); + auto csv_error = + CSVError::CastError(state_machine->options, csv_file_scan->names[col_idx], error_msg, + col_idx, borked_line, lines_per_batch, + result.line_positions_per_row[line_error].begin.GetGlobalPosition( + result.result_size, first_nl), + optional_idx::Invalid(), result_vector.GetType().id()); + error_handler->Error(csv_error); + } } } } } - if (!borked_lines.empty()) { + if (!result.borked_rows.empty()) { // We must remove the borked lines from our chunk - SelectionVector succesful_rows(parse_chunk.size() - borked_lines.size()); + SelectionVector succesful_rows(parse_chunk.size()); idx_t sel_idx = 0; for (idx_t row_idx = 0; row_idx < parse_chunk.size(); row_idx++) { - if (borked_lines.find(row_idx) == borked_lines.end()) { + if (result.borked_rows.find(row_idx) == result.borked_rows.end()) { succesful_rows.set_index(sel_idx++, row_idx); } } @@ -1131,26 +1231,6 @@ void StringValueScanner::SkipBOM() { } } -void StringValueScanner::SkipCSVRows() { - idx_t rows_to_skip = - state_machine->dialect_options.skip_rows.GetValue() + state_machine->dialect_options.header.GetValue(); - if (rows_to_skip == 0) { - return; - } - SkipScanner row_skipper(buffer_manager, state_machine, error_handler, rows_to_skip); - row_skipper.ParseChunk(); - iterator.pos.buffer_pos = row_skipper.GetIteratorPosition(); - if (row_skipper.state_machine->options.dialect_options.state_machine_options.new_line == - NewLineIdentifier::CARRY_ON && - row_skipper.states.states[1] == CSVState::CARRIAGE_RETURN) { - iterator.pos.buffer_pos++; - } - if (result.store_line_size) { - result.error_handler.NewMaxLineSize(iterator.pos.buffer_pos); - } - lines_read += row_skipper.GetLinesRead(); -} - void StringValueScanner::SkipUntilNewLine() { // Now skip until next newline if (state_machine->options.dialect_options.state_machine_options.new_line.GetValue() == @@ -1181,11 +1261,9 @@ void StringValueScanner::SkipUntilNewLine() { } } -bool StringValueScanner::CanDirectlyCast(const LogicalType &type, - const map> &format_options) { +bool StringValueScanner::CanDirectlyCast(const LogicalType &type) { switch (type.id()) { - // All Integers (Except HugeInt) case LogicalTypeId::TINYINT: case LogicalTypeId::SMALLINT: case LogicalTypeId::INTEGER: @@ -1196,20 +1274,10 @@ bool StringValueScanner::CanDirectlyCast(const LogicalType &type, case LogicalTypeId::UBIGINT: case LogicalTypeId::DOUBLE: case LogicalTypeId::FLOAT: - return true; case LogicalTypeId::DATE: - // We can only internally cast YYYY-MM-DD - if (format_options.at(LogicalTypeId::DATE).GetValue().format_specifier == "%Y-%m-%d") { - return true; - } else { - return false; - } case LogicalTypeId::TIMESTAMP: - if (format_options.at(LogicalTypeId::TIMESTAMP).GetValue().format_specifier == "%Y-%m-%d %H:%M:%S") { - return true; - } else { - return false; - } + case LogicalTypeId::TIME: + case LogicalTypeId::DECIMAL: case LogicalType::VARCHAR: return true; default: @@ -1223,7 +1291,11 @@ void StringValueScanner::SetStart() { // This CSV is not from auto-detect, so we don't know where exactly it starts // Hence we potentially have to skip empty lines and headers. SkipBOM(); - SkipCSVRows(); + SkipCSVRows(state_machine->dialect_options.skip_rows.GetValue() + + state_machine->dialect_options.header.GetValue()); + if (result.store_line_size) { + result.error_handler.NewMaxLineSize(iterator.pos.buffer_pos); + } return; } // We have to look for a new line that fits our schema @@ -1236,12 +1308,13 @@ void StringValueScanner::SetStart() { // When Null Padding, we assume we start from the correct new-line return; } - - scan_finder = make_uniq( - 0, buffer_manager, state_machine, make_shared(true), csv_file_scan, false, iterator, 1); + scan_finder = + make_uniq(0U, buffer_manager, state_machine, make_shared_ptr(true), + csv_file_scan, false, iterator, true); auto &tuples = scan_finder->ParseChunk(); line_found = true; - if (tuples.number_of_rows != 1) { + if (tuples.number_of_rows != 1 || + (!tuples.borked_rows.empty() && !state_machine->options.ignore_errors.GetValue())) { line_found = false; // If no tuples were parsed, this is not the correct start, we need to skip until the next new line // Or if columns don't match, this is not the correct start, we need to skip until the next new line @@ -1256,16 +1329,7 @@ void StringValueScanner::SetStart() { } } if (iterator.pos.buffer_pos == cur_buffer_handle->actual_size || - scan_finder->iterator.GetBufferIdx() >= iterator.GetBufferIdx()) { - // Propagate any errors - if (!scan_finder->error_handler->errors.empty() && state_machine->options.ignore_errors.GetValue()) { - for (auto &error_vector : scan_finder->error_handler->errors) { - for (auto &error : error_vector.second) { - error_handler->Error(error); - } - } - result.lines_read++; - } + scan_finder->iterator.GetBufferIdx() > iterator.GetBufferIdx()) { // If things go terribly wrong, we never loop indefinetly. iterator.pos.buffer_idx = scan_finder->iterator.pos.buffer_idx; iterator.pos.buffer_pos = scan_finder->iterator.pos.buffer_pos; @@ -1275,15 +1339,6 @@ void StringValueScanner::SetStart() { } } } while (!line_found); - // Propagate any errors - if (!scan_finder->error_handler->errors.empty() && state_machine->options.ignore_errors.GetValue()) { - for (auto &error_vector : scan_finder->error_handler->errors) { - for (auto &error : error_vector.second) { - error_handler->Error(error); - } - } - result.lines_read++; - } iterator.pos.buffer_idx = scan_finder->result.current_line_position.begin.buffer_idx; iterator.pos.buffer_pos = scan_finder->result.current_line_position.begin.buffer_pos; result.last_position = {iterator.pos.buffer_idx, iterator.pos.buffer_pos, result.buffer_size}; @@ -1303,12 +1358,9 @@ void StringValueScanner::FinalizeChunkProcess() { // If we are not done we have two options. // 1) If a boundary is set. if (iterator.IsBoundarySet()) { - for (auto &cur_error : result.current_errors) { - if (!(cur_error == CSVErrorType::UNTERMINATED_QUOTES)) { - iterator.done = true; - } + if (!result.current_errors.HasErrorType(CSVErrorType::UNTERMINATED_QUOTES)) { + iterator.done = true; } - // We read until the next line or until we have nothing else to read. // Move to next buffer if (!cur_buffer_handle) { @@ -1325,7 +1377,7 @@ void StringValueScanner::FinalizeChunkProcess() { MoveToNextBuffer(); } } else { - result.HandleError(); + result.current_errors.HandleErrors(result); } if (!iterator.done) { if (iterator.pos.buffer_pos >= iterator.GetEndPos() || iterator.pos.buffer_idx > iterator.GetBufferIdx() || diff --git a/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp b/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp index 95308c3e..da1c93ce 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp @@ -13,8 +13,8 @@ CSVSniffer::CSVSniffer(CSVReaderOptions &options_p, shared_ptr } // Initialize max columns found to either 0 or however many were set max_columns_found = set_columns.Size(); - error_handler = make_shared(options.ignore_errors.GetValue()); - detection_error_handler = make_shared(true); + error_handler = make_shared_ptr(options.ignore_errors.GetValue()); + detection_error_handler = make_shared_ptr(true); } bool SetColumns::IsSet() { diff --git a/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp b/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp index e6ffae7e..b167cbed 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp @@ -1,5 +1,6 @@ #include "duckdb/execution/operator/csv_scanner/csv_sniffer.hpp" #include "duckdb/main/client_data.hpp" +#include "duckdb/common/shared_ptr.hpp" namespace duckdb { @@ -89,13 +90,13 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, idx_t &best_consistent_rows, idx_t &prev_padding_count) { // The sniffed_column_counts variable keeps track of the number of columns found for each row auto &sniffed_column_counts = scanner->ParseChunk(); + idx_t dirty_notes = 0; if (sniffed_column_counts.error) { // This candidate has an error (i.e., over maximum line size or never unquoting quoted values) return; } - idx_t start_row = options.dialect_options.skip_rows.GetValue(); idx_t consistent_rows = 0; - idx_t num_cols = sniffed_column_counts.result_position == 0 ? 1 : sniffed_column_counts[start_row]; + idx_t num_cols = sniffed_column_counts.result_position == 0 ? 1 : sniffed_column_counts[0]; idx_t padding_count = 0; bool allow_padding = options.null_padding; if (sniffed_column_counts.result_position > rows_read) { @@ -106,7 +107,7 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, // Not acceptable return; } - for (idx_t row = start_row; row < sniffed_column_counts.result_position; row++) { + for (idx_t row = 0; row < sniffed_column_counts.result_position; row++) { if (set_columns.IsCandidateUnacceptable(sniffed_column_counts[row], options.null_padding, options.ignore_errors.GetValue(), sniffed_column_counts.last_value_always_empty)) { @@ -121,7 +122,7 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, padding_count = 0; // we use the maximum amount of num_cols that we find num_cols = sniffed_column_counts[row]; - start_row = row; + dirty_notes = row; consistent_rows = 1; } else if (num_cols >= sniffed_column_counts[row]) { @@ -147,7 +148,7 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, // If the number of rows is consistent with the calculated value after accounting for skipped rows and the // start row. - bool rows_consistent = consistent_rows + (start_row - options.dialect_options.skip_rows.GetValue()) == + bool rows_consistent = consistent_rows + (dirty_notes - options.dialect_options.skip_rows.GetValue()) == sniffed_column_counts.result_position - options.dialect_options.skip_rows.GetValue(); // If there are more than one consistent row. bool more_than_one_row = (consistent_rows > 1); @@ -157,7 +158,7 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, // If the start position is valid. bool start_good = !candidates.empty() && - (start_row <= candidates.front()->GetStateMachine().dialect_options.skip_rows.GetValue()); + (dirty_notes <= candidates.front()->GetStateMachine().dialect_options.skip_rows.GetValue()); // If padding happened but it is not allowed. bool invalid_padding = !allow_padding && padding_count > 0; @@ -185,11 +186,17 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, best_consistent_rows = consistent_rows; max_columns_found = num_cols; prev_padding_count = padding_count; - if (!options.null_padding && !options.ignore_errors.GetValue()) { - sniffing_state_machine.dialect_options.skip_rows = start_row; - } else { + if (options.dialect_options.skip_rows.IsSetByUser()) { + // If skip rows is set by user, and we found dirty notes, we only accept it if either null_padding or + // ignore_errors is set + if (dirty_notes != 0 && !options.null_padding && !options.ignore_errors.GetValue()) { + return; + } sniffing_state_machine.dialect_options.skip_rows = options.dialect_options.skip_rows.GetValue(); + } else if (!options.null_padding && !options.ignore_errors.GetValue()) { + sniffing_state_machine.dialect_options.skip_rows = dirty_notes; } + candidates.clear(); sniffing_state_machine.dialect_options.num_cols = num_cols; candidates.emplace_back(std::move(scanner)); @@ -210,11 +217,17 @@ void CSVSniffer::AnalyzeDialectCandidate(unique_ptr scanner, } } if (!same_quote_is_candidate) { - if (!options.null_padding && !options.ignore_errors.GetValue()) { - sniffing_state_machine.dialect_options.skip_rows = start_row; - } else { + if (options.dialect_options.skip_rows.IsSetByUser()) { + // If skip rows is set by user, and we found dirty notes, we only accept it if either null_padding or + // ignore_errors is set + if (dirty_notes != 0 && !options.null_padding && !options.ignore_errors.GetValue()) { + return; + } sniffing_state_machine.dialect_options.skip_rows = options.dialect_options.skip_rows.GetValue(); + } else if (!options.null_padding && !options.ignore_errors.GetValue()) { + sniffing_state_machine.dialect_options.skip_rows = dirty_notes; } + sniffing_state_machine.dialect_options.num_cols = num_cols; candidates.emplace_back(std::move(scanner)); } @@ -277,9 +290,7 @@ void CSVSniffer::RefineCandidates() { candidates.push_back(std::move(cc_best_candidate)); return; } - if (cc_best_candidate->state_machine->state_machine_options.quote == '\0') { - candidates.push_back(std::move(cc_best_candidate)); - } + candidates.push_back(std::move(cc_best_candidate)); } return; } @@ -308,6 +319,24 @@ NewLineIdentifier CSVSniffer::DetectNewLineDelimiter(CSVBufferManager &buffer_ma return NewLineIdentifier::SINGLE; } +void CSVSniffer::SkipLines(vector> &csv_state_machines) { + if (csv_state_machines.empty()) { + return; + } + auto &first_scanner = *csv_state_machines[0]; + // We figure out the iterator position for the first scanner + if (options.dialect_options.skip_rows.IsSetByUser()) { + first_scanner.SkipCSVRows(options.dialect_options.skip_rows.GetValue()); + } + // The iterator position is the same regardless of the scanner configuration, hence we apply the same iterator + // To the remaining scanners + const auto first_iterator = first_scanner.GetIterator(); + for (idx_t i = 1; i < csv_state_machines.size(); i++) { + auto &cur_scanner = *csv_state_machines[i]; + cur_scanner.SetIterator(first_iterator); + } +} + // Dialect Detection consists of five steps: // 1. Generate a search space of all possible dialects // 2. Generate a state machine for each dialect @@ -341,9 +370,9 @@ void CSVSniffer::DetectDialect() { // Step 2: Generate state machines GenerateStateMachineSearchSpace(csv_state_machines, delim_candidates, quoterule_candidates, quote_candidates_map, escape_candidates_map); + SkipLines(csv_state_machines); // Step 3: Analyze all candidates on the first chunk for (auto &state_machine : csv_state_machines) { - state_machine->Reset(); AnalyzeDialectCandidate(std::move(state_machine), rows_read, best_consistent_rows, prev_padding_count); } // Step 4: Loop over candidates and find if they can still produce good results for the remaining chunks diff --git a/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp b/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp index a52e2aea..e5498a57 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp @@ -1,15 +1,17 @@ #include "duckdb/common/types/cast_helpers.hpp" #include "duckdb/execution/operator/csv_scanner/csv_sniffer.hpp" #include "duckdb/execution/operator/csv_scanner/csv_reader_options.hpp" +#include "duckdb/common/types/value.hpp" + #include "utf8proc.hpp" namespace duckdb { // Helper function to generate column names static string GenerateColumnName(const idx_t total_cols, const idx_t col_number, const string &prefix = "column") { - int max_digits = NumericHelper::UnsignedLength(total_cols - 1); - int digits = NumericHelper::UnsignedLength(col_number); - string leading_zeros = string(max_digits - digits, '0'); + auto max_digits = NumericHelper::UnsignedLength(total_cols - 1); + auto digits = NumericHelper::UnsignedLength(col_number); + string leading_zeros = string(NumericCast(max_digits - digits), '0'); string value = to_string(col_number); return string(prefix + leading_zeros + value); } @@ -22,21 +24,21 @@ static string TrimWhitespace(const string &col_name) { // Find the first character that is not left trimmed idx_t begin = 0; while (begin < size) { - auto bytes = utf8proc_iterate(str + begin, size - begin, &codepoint); + auto bytes = utf8proc_iterate(str + begin, NumericCast(size - begin), &codepoint); D_ASSERT(bytes > 0); if (utf8proc_category(codepoint) != UTF8PROC_CATEGORY_ZS) { break; } - begin += bytes; + begin += NumericCast(bytes); } // Find the last character that is not right trimmed idx_t end; end = begin; for (auto next = begin; next < col_name.size();) { - auto bytes = utf8proc_iterate(str + next, size - next, &codepoint); + auto bytes = utf8proc_iterate(str + next, NumericCast(size - next), &codepoint); D_ASSERT(bytes > 0); - next += bytes; + next += NumericCast(bytes); if (utf8proc_category(codepoint) != UTF8PROC_CATEGORY_ZS) { end = next; } @@ -48,7 +50,8 @@ static string TrimWhitespace(const string &col_name) { static string NormalizeColumnName(const string &col_name) { // normalize UTF8 characters to NFKD - auto nfkd = utf8proc_NFKD(reinterpret_cast(col_name.c_str()), col_name.size()); + auto nfkd = utf8proc_NFKD(reinterpret_cast(col_name.c_str()), + NumericCast(col_name.size())); const string col_name_nfkd = string(const_char_ptr_cast(nfkd), strlen(const_char_ptr_cast(nfkd))); free(nfkd); @@ -109,7 +112,7 @@ bool CSVSniffer::DetectHeaderWithSetColumn() { if (best_header_row[i].IsNull()) { return false; } - if (best_header_row[i] != (*set_columns.names)[i]) { + if (best_header_row[i].value.GetString() != (*set_columns.names)[i]) { has_header = false; break; } @@ -118,12 +121,12 @@ bool CSVSniffer::DetectHeaderWithSetColumn() { if (!has_header) { // We verify if the types are consistent for (idx_t col = 0; col < set_columns.Size(); col++) { - auto dummy_val = best_header_row[col]; // try cast to sql_type of column const auto &sql_type = (*set_columns.types)[col]; if (sql_type != LogicalType::VARCHAR) { all_varchar = false; - if (!TryCastValue(options.dialect_options, options.decimal_separator, dummy_val, sql_type)) { + if (!CanYouCastIt(best_header_row[col].value, sql_type, options.dialect_options, + best_header_row[col].IsNull(), options.decimal_separator[0])) { first_row_consistent = false; } } @@ -167,16 +170,15 @@ void CSVSniffer::DetectHeader() { has_header = DetectHeaderWithSetColumn(); } else { for (idx_t col = 0; col < best_header_row.size(); col++) { - auto dummy_val = best_header_row[col]; - if (!dummy_val.IsNull()) { + if (!best_header_row[col].IsNull()) { first_row_nulls = false; } // try cast to sql_type of column const auto &sql_type = best_sql_types_candidates_per_column_idx[col].back(); if (sql_type != LogicalType::VARCHAR) { all_varchar = false; - if (!TryCastValue(sniffer_state_machine.dialect_options, - sniffer_state_machine.options.decimal_separator, dummy_val, sql_type)) { + if (!CanYouCastIt(best_header_row[col].value, sql_type, sniffer_state_machine.dialect_options, + best_header_row[col].IsNull(), options.decimal_separator[0])) { first_row_consistent = false; } } @@ -207,11 +209,10 @@ void CSVSniffer::DetectHeader() { // get header names from CSV for (idx_t col = 0; col < best_header_row.size(); col++) { - const auto &val = best_header_row[col]; - string col_name = val.ToString(); + string col_name = best_header_row[col].value.GetString(); // generate name if field is empty - if (col_name.empty() || val.IsNull()) { + if (col_name.empty() || best_header_row[col].IsNull()) { col_name = GenerateColumnName(sniffer_state_machine.dialect_options.num_cols, col); } diff --git a/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp b/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp index 0572bb62..807449ba 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp @@ -1,7 +1,10 @@ -#include "duckdb/common/operator/decimal_cast_operators.hpp" -#include "duckdb/execution/operator/csv_scanner/csv_sniffer.hpp" #include "duckdb/common/algorithm.hpp" +#include "duckdb/common/operator/decimal_cast_operators.hpp" +#include "duckdb/common/operator/double_cast_operator.hpp" +#include "duckdb/common/operator/integer_cast_operator.hpp" #include "duckdb/common/string.hpp" +#include "duckdb/common/types/time.hpp" +#include "duckdb/execution/operator/csv_scanner/csv_sniffer.hpp" namespace duckdb { struct TryCastFloatingOperator { @@ -14,9 +17,9 @@ struct TryCastFloatingOperator { } }; -static bool StartsWithNumericDate(string &separator, const string &value) { - auto begin = value.c_str(); - auto end = begin + value.size(); +static bool StartsWithNumericDate(string &separator, const string_t &value) { + auto begin = value.GetData(); + auto end = begin + value.GetSize(); // StrpTimeFormat::Parse will skip whitespace, so we can too auto field1 = std::find_if_not(begin, end, StringUtil::CharacterIsSpace); @@ -50,7 +53,8 @@ static bool StartsWithNumericDate(string &separator, const string &value) { } // second literal must match first - if (((field3 - literal2) != (field2 - literal1)) || strncmp(literal1, literal2, (field2 - literal1)) != 0) { + if (((field3 - literal2) != (field2 - literal1)) || + strncmp(literal1, literal2, NumericCast((field2 - literal1))) != 0) { return false; } @@ -69,7 +73,7 @@ static bool StartsWithNumericDate(string &separator, const string &value) { string GenerateDateFormat(const string &separator, const char *format_template) { string format_specifier = format_template; - auto amount_of_dashes = std::count(format_specifier.begin(), format_specifier.end(), '-'); + auto amount_of_dashes = NumericCast(std::count(format_specifier.begin(), format_specifier.end(), '-')); // All our date formats must have at least one - D_ASSERT(amount_of_dashes); string result; @@ -84,40 +88,161 @@ string GenerateDateFormat(const string &separator, const char *format_template) return result; } -bool CSVSniffer::TryCastValue(const DialectOptions &dialect_options, const string &decimal_separator, - const Value &value, const LogicalType &sql_type) { - if (value.IsNull()) { +void CSVSniffer::SetDateFormat(CSVStateMachine &candidate, const string &format_specifier, + const LogicalTypeId &sql_type) { + StrpTimeFormat strpformat; + StrTimeFormat::ParseFormatSpecifier(format_specifier, strpformat); + candidate.dialect_options.date_format[sql_type].Set(strpformat, false); +} + +bool CSVSniffer::CanYouCastIt(const string_t value, const LogicalType &type, const DialectOptions &dialect_options, + const bool is_null, const char decimal_separator) { + if (is_null) { return true; } - if (!dialect_options.date_format.find(LogicalTypeId::DATE)->second.GetValue().Empty() && - sql_type.id() == LogicalTypeId::DATE) { - date_t result; - string error_message; - return dialect_options.date_format.find(LogicalTypeId::DATE) - ->second.GetValue() - .TryParseDate(string_t(StringValue::Get(value)), result, error_message); + auto value_ptr = value.GetData(); + auto value_size = value.GetSize(); + switch (type.id()) { + case LogicalTypeId::TINYINT: { + int8_t dummy_value; + return TrySimpleIntegerCast(value_ptr, value_size, dummy_value, false); } - if (!dialect_options.date_format.find(LogicalTypeId::TIMESTAMP)->second.GetValue().Empty() && - sql_type.id() == LogicalTypeId::TIMESTAMP) { - timestamp_t result; - string error_message; - return dialect_options.date_format.find(LogicalTypeId::TIMESTAMP) - ->second.GetValue() - .TryParseTimestamp(string_t(StringValue::Get(value)), result, error_message); + case LogicalTypeId::SMALLINT: { + int16_t dummy_value; + return TrySimpleIntegerCast(value_ptr, value_size, dummy_value, true); } - if (decimal_separator != "." && (sql_type.id() == LogicalTypeId::DOUBLE)) { - return TryCastFloatingOperator::Operation(StringValue::Get(value)); + case LogicalTypeId::INTEGER: { + int32_t dummy_value; + return TrySimpleIntegerCast(value_ptr, value_size, dummy_value, true); } - Value new_value; - string error_message; - return value.TryCastAs(buffer_manager->context, sql_type, new_value, &error_message, true); -} + case LogicalTypeId::BIGINT: { + int64_t dummy_value; + return TrySimpleIntegerCast(value_ptr, value_size, dummy_value, true); + } + case LogicalTypeId::UTINYINT: { + uint8_t dummy_value; + return TrySimpleIntegerCast(value_ptr, value_size, dummy_value, true); + } + case LogicalTypeId::USMALLINT: { + uint16_t dummy_value; + return TrySimpleIntegerCast(value_ptr, value_size, dummy_value, true); + } + case LogicalTypeId::UINTEGER: { + uint32_t dummy_value; + return TrySimpleIntegerCast(value_ptr, value_size, dummy_value, true); + } + case LogicalTypeId::UBIGINT: { + uint64_t dummy_value; + return TrySimpleIntegerCast(value_ptr, value_size, dummy_value, true); + } + case LogicalTypeId::DOUBLE: { + double dummy_value; + return TryDoubleCast(value_ptr, value_size, dummy_value, true, options.decimal_separator[0]); + } + case LogicalTypeId::FLOAT: { + float dummy_value; + return TryDoubleCast(value_ptr, value_size, dummy_value, true, options.decimal_separator[0]); + } + case LogicalTypeId::DATE: { + if (!dialect_options.date_format.find(LogicalTypeId::DATE)->second.GetValue().Empty()) { + date_t result; + string error_message; + return dialect_options.date_format.find(LogicalTypeId::DATE) + ->second.GetValue() + .TryParseDate(value, result, error_message); + } else { + idx_t pos; + bool special; + date_t dummy_value; + return Date::TryConvertDate(value_ptr, value_size, pos, dummy_value, special, true); + } + } + case LogicalTypeId::TIMESTAMP: { + timestamp_t dummy_value; + if (!dialect_options.date_format.find(LogicalTypeId::TIMESTAMP)->second.GetValue().Empty()) { + string error_message; + return dialect_options.date_format.find(LogicalTypeId::TIMESTAMP) + ->second.GetValue() + .TryParseTimestamp(value, dummy_value, error_message); + } else { + return Timestamp::TryConvertTimestamp(value_ptr, value_size, dummy_value) == TimestampCastResult::SUCCESS; + } + } + case LogicalTypeId::TIME: { + idx_t pos; + dtime_t dummy_value; + return Time::TryConvertTime(value_ptr, value_size, pos, dummy_value, true); + } + case LogicalTypeId::DECIMAL: { + uint8_t width, scale; + type.GetDecimalProperties(width, scale); + if (decimal_separator == ',') { + switch (type.InternalType()) { + case PhysicalType::INT16: { + int16_t dummy_value; + return TryDecimalStringCast(value_ptr, value_size, dummy_value, width, scale); + } -void CSVSniffer::SetDateFormat(CSVStateMachine &candidate, const string &format_specifier, - const LogicalTypeId &sql_type) { - StrpTimeFormat strpformat; - StrTimeFormat::ParseFormatSpecifier(format_specifier, strpformat); - candidate.dialect_options.date_format[sql_type].Set(strpformat, false); + case PhysicalType::INT32: { + int32_t dummy_value; + return TryDecimalStringCast(value_ptr, value_size, dummy_value, width, scale); + } + + case PhysicalType::INT64: { + int64_t dummy_value; + return TryDecimalStringCast(value_ptr, value_size, dummy_value, width, scale); + } + + case PhysicalType::INT128: { + hugeint_t dummy_value; + return TryDecimalStringCast(value_ptr, value_size, dummy_value, width, scale); + } + + default: + throw InternalException("Invalid Physical Type for Decimal Value. Physical Type: " + + TypeIdToString(type.InternalType())); + } + + } else if (decimal_separator == '.') { + switch (type.InternalType()) { + case PhysicalType::INT16: { + int16_t dummy_value; + return TryDecimalStringCast(value_ptr, value_size, dummy_value, width, scale); + } + + case PhysicalType::INT32: { + int32_t dummy_value; + return TryDecimalStringCast(value_ptr, value_size, dummy_value, width, scale); + } + + case PhysicalType::INT64: { + int64_t dummy_value; + return TryDecimalStringCast(value_ptr, value_size, dummy_value, width, scale); + } + + case PhysicalType::INT128: { + hugeint_t dummy_value; + return TryDecimalStringCast(value_ptr, value_size, dummy_value, width, scale); + } + + default: + throw InternalException("Invalid Physical Type for Decimal Value. Physical Type: " + + TypeIdToString(type.InternalType())); + } + } else { + throw InvalidInputException("Decimals can only have ',' and '.' as decimal separators"); + } + } + case LogicalTypeId::VARCHAR: + return true; + default: { + // We do Value Try Cast for non-basic types. + Value new_value; + string error_message; + Value str_value(value); + return str_value.TryCastAs(buffer_manager->context, type, new_value, &error_message, true); + } + } } void CSVSniffer::InitializeDateAndTimeStampDetection(CSVStateMachine &candidate, const string &separator, @@ -142,6 +267,7 @@ void CSVSniffer::InitializeDateAndTimeStampDetection(CSVStateMachine &candidate, } } } + original_format_candidates = format_candidates; } // initialise the first candidate // all formats are constructed to be valid @@ -149,8 +275,8 @@ void CSVSniffer::InitializeDateAndTimeStampDetection(CSVStateMachine &candidate, } void CSVSniffer::DetectDateAndTimeStampFormats(CSVStateMachine &candidate, const LogicalType &sql_type, - const string &separator, Value &dummy_val) { - // If it is the first time running date/timestamp detection we must initilize the format variables + const string &separator, string_t &dummy_val) { + // If it is the first time running date/timestamp detection we must initialize the format variables InitializeDateAndTimeStampDetection(candidate, separator, sql_type); // generate date format candidates the first time through auto &type_format_candidates = format_candidates[sql_type.id()].format; @@ -159,11 +285,12 @@ void CSVSniffer::DetectDateAndTimeStampFormats(CSVStateMachine &candidate, const auto save_format_candidates = type_format_candidates; bool had_format_candidates = !save_format_candidates.empty(); bool initial_format_candidates = - save_format_candidates.size() == format_template_candidates.at(sql_type.id()).size(); + save_format_candidates.size() == original_format_candidates.at(sql_type.id()).format.size(); while (!type_format_candidates.empty()) { // avoid using exceptions for flow control... auto ¤t_format = candidate.dialect_options.date_format[sql_type.id()].GetValue(); - if (current_format.Parse(StringValue::Get(dummy_val), result)) { + if (current_format.Parse(dummy_val, result)) { + format_candidates[sql_type.id()].had_match = true; break; } // doesn't work - move to the next one @@ -177,14 +304,15 @@ void CSVSniffer::DetectDateAndTimeStampFormats(CSVStateMachine &candidate, const // so restore the candidates that did work. // or throw them out if they were generated by this value. if (had_format_candidates) { - if (initial_format_candidates) { + if (initial_format_candidates && !format_candidates[sql_type.id()].had_match) { // we reset the whole thing because we tried to sniff the wrong type. format_candidates[sql_type.id()].initialized = false; format_candidates[sql_type.id()].format.clear(); + SetDateFormat(candidate, "", sql_type.id()); return; } type_format_candidates.swap(save_format_candidates); - SetDateFormat(candidate, "", sql_type.id()); + SetDateFormat(candidate, type_format_candidates.back(), sql_type.id()); } } } @@ -210,9 +338,10 @@ void CSVSniffer::DetectTypes() { auto candidate = candidate_cc->UpgradeToStringValueScanner(); // Parse chunk and read csv with info candidate - auto &tuples = candidate->ParseChunk(); + auto &data_chunk = candidate->ParseChunk().ToChunk(); idx_t row_idx = 0; - if (tuples.number_of_rows > 1 && + idx_t chunk_size = data_chunk.size(); + if (chunk_size > 1 && (!options.dialect_options.header.IsSetByUser() || (options.dialect_options.header.IsSetByUser() && options.dialect_options.header.GetValue()))) { // This means we have more than one row, hence we can use the first row to detect if we have a header @@ -220,14 +349,19 @@ void CSVSniffer::DetectTypes() { } // First line where we start our type detection const idx_t start_idx_detection = row_idx; - for (; row_idx < tuples.number_of_rows; row_idx++) { - for (idx_t col_idx = 0; col_idx < tuples.number_of_columns; col_idx++) { - auto &col_type_candidates = info_sql_types_candidates[col_idx]; + + for (idx_t col_idx = 0; col_idx < data_chunk.ColumnCount(); col_idx++) { + auto &cur_vector = data_chunk.data[col_idx]; + D_ASSERT(cur_vector.GetVectorType() == VectorType::FLAT_VECTOR); + D_ASSERT(cur_vector.GetType() == LogicalType::VARCHAR); + auto vector_data = FlatVector::GetData(cur_vector); + auto null_mask = FlatVector::Validity(cur_vector); + auto &col_type_candidates = info_sql_types_candidates[col_idx]; + for (row_idx = start_idx_detection; row_idx < chunk_size; row_idx++) { // col_type_candidates can't be empty since anything in a CSV file should at least be a string // and we validate utf-8 compatibility when creating the type D_ASSERT(!col_type_candidates.empty()); auto cur_top_candidate = col_type_candidates.back(); - auto dummy_val = tuples.GetValue(row_idx, col_idx); // try cast from string to sql_type while (col_type_candidates.size() > 1) { const auto &sql_type = col_type_candidates.back(); @@ -236,18 +370,20 @@ void CSVSniffer::DetectTypes() { string separator; // If Value is not Null, Has a numeric date format, and the current investigated candidate is // either a timestamp or a date - if (!dummy_val.IsNull() && StartsWithNumericDate(separator, StringValue::Get(dummy_val)) && + if (null_mask.RowIsValid(row_idx) && StartsWithNumericDate(separator, vector_data[row_idx]) && (col_type_candidates.back().id() == LogicalTypeId::TIMESTAMP || col_type_candidates.back().id() == LogicalTypeId::DATE)) { - DetectDateAndTimeStampFormats(candidate->GetStateMachine(), sql_type, separator, dummy_val); + DetectDateAndTimeStampFormats(candidate->GetStateMachine(), sql_type, separator, + vector_data[row_idx]); } // try cast from string to sql_type if (sql_type == LogicalType::VARCHAR) { // Nothing to convert it to continue; } - if (TryCastValue(sniffing_state_machine.dialect_options, - sniffing_state_machine.options.decimal_separator, dummy_val, sql_type)) { + if (CanYouCastIt(vector_data[row_idx], sql_type, sniffing_state_machine.dialect_options, + !null_mask.RowIsValid(row_idx), + sniffing_state_machine.options.decimal_separator[0])) { break; } else { if (row_idx != start_idx_detection && cur_top_candidate == LogicalType::BOOLEAN) { @@ -277,7 +413,8 @@ void CSVSniffer::DetectTypes() { // it's good if the dialect creates more non-varchar columns, but only if we sacrifice < 30% of // best_num_cols. - if (varchar_cols < min_varchar_cols && info_sql_types_candidates.size() > (max_columns_found * 0.7) && + if (varchar_cols(info_sql_types_candidates.size())>( + static_cast(max_columns_found) * 0.7) && (!options.ignore_errors.GetValue() || candidate->error_handler->errors.size() < min_errors)) { min_errors = candidate->error_handler->errors.size(); best_header_row.clear(); @@ -288,9 +425,17 @@ void CSVSniffer::DetectTypes() { for (auto &format_candidate : format_candidates) { best_format_candidates[format_candidate.first] = format_candidate.second.format; } - if (tuples.number_of_rows > 0) { - for (idx_t col_idx = 0; col_idx < tuples.number_of_columns; col_idx++) { - best_header_row.emplace_back(tuples.GetValue(0, col_idx)); + if (chunk_size > 0) { + for (idx_t col_idx = 0; col_idx < data_chunk.ColumnCount(); col_idx++) { + auto &cur_vector = data_chunk.data[col_idx]; + auto vector_data = FlatVector::GetData(cur_vector); + auto null_mask = FlatVector::Validity(cur_vector); + if (null_mask.RowIsValid(0)) { + auto value = HeaderValue(vector_data[0]); + best_header_row.push_back(value); + } else { + best_header_row.push_back({}); + } } } } diff --git a/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp b/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp index 1af53304..c0227041 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp @@ -10,31 +10,33 @@ CSVFileScan::CSVFileScan(ClientContext &context, shared_ptr bu vector &file_schema) : file_path(options_p.file_path), file_idx(0), buffer_manager(std::move(buffer_manager_p)), state_machine(std::move(state_machine_p)), file_size(buffer_manager->file_handle->FileSize()), - error_handler(make_shared(options_p.ignore_errors.GetValue())), + error_handler(make_shared_ptr(options_p.ignore_errors.GetValue())), on_disk_file(buffer_manager->file_handle->OnDiskFile()), options(options_p) { + + auto multi_file_reader = MultiFileReader::CreateDefault("CSV Scan"); if (bind_data.initial_reader.get()) { auto &union_reader = *bind_data.initial_reader; names = union_reader.GetNames(); options = union_reader.options; types = union_reader.GetTypes(); - MultiFileReader::InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, + bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); return; } else if (!bind_data.column_info.empty()) { // Serialized Union By name names = bind_data.column_info[0].names; types = bind_data.column_info[0].types; - MultiFileReader::InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, + bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); return; } names = bind_data.return_names; types = bind_data.return_types; file_schema = bind_data.return_types; - MultiFileReader::InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, + bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); } @@ -43,7 +45,8 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, cons const idx_t file_idx_p, const ReadCSVData &bind_data, const vector &column_ids, const vector &file_schema) : file_path(file_path_p), file_idx(file_idx_p), - error_handler(make_shared(options_p.ignore_errors.GetValue())), options(options_p) { + error_handler(make_shared_ptr(options_p.ignore_errors.GetValue())), options(options_p) { + auto multi_file_reader = MultiFileReader::CreateDefault("CSV Scan"); if (file_idx < bind_data.union_readers.size()) { // we are doing UNION BY NAME - fetch the options from the union reader for this file optional_ptr union_reader_ptr; @@ -63,9 +66,9 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, cons options = union_reader.options; types = union_reader.GetTypes(); state_machine = union_reader.state_machine; - MultiFileReader::InitializeReader(*this, options.file_options, bind_data.reader_bind, - bind_data.return_types, bind_data.return_names, column_ids, nullptr, - file_path, context); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, + bind_data.return_types, bind_data.return_names, column_ids, nullptr, + file_path, context, nullptr); InitializeFileNamesTypes(); return; @@ -73,7 +76,7 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, cons } // Initialize Buffer Manager - buffer_manager = make_shared(context, options, file_path, file_idx); + buffer_manager = make_shared_ptr(context, options, file_path, file_idx); // Initialize On Disk and Size of file on_disk_file = buffer_manager->file_handle->OnDiskFile(); file_size = buffer_manager->file_handle->FileSize(); @@ -89,11 +92,11 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, cons CSVSniffer sniffer(options, buffer_manager, state_machine_cache); sniffer.SniffCSV(); } - state_machine = make_shared( + state_machine = make_shared_ptr( state_machine_cache.Get(options.dialect_options.state_machine_options), options); - MultiFileReader::InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, + bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); return; } @@ -120,18 +123,18 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_path_p, cons names = bind_data.csv_names; types = bind_data.csv_types; - state_machine = - make_shared(state_machine_cache.Get(options.dialect_options.state_machine_options), options); + state_machine = make_shared_ptr( + state_machine_cache.Get(options.dialect_options.state_machine_options), options); - MultiFileReader::InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, - bind_data.return_names, column_ids, nullptr, file_path, context); + multi_file_reader->InitializeReader(*this, options.file_options, bind_data.reader_bind, bind_data.return_types, + bind_data.return_names, column_ids, nullptr, file_path, context, nullptr); InitializeFileNamesTypes(); } CSVFileScan::CSVFileScan(ClientContext &context, const string &file_name, CSVReaderOptions &options_p) : file_path(file_name), file_idx(0), - error_handler(make_shared(options_p.ignore_errors.GetValue())), options(options_p) { - buffer_manager = make_shared(context, options, file_path, file_idx); + error_handler(make_shared_ptr(options_p.ignore_errors.GetValue())), options(options_p) { + buffer_manager = make_shared_ptr(context, options, file_path, file_idx); // Initialize On Disk and Size of file on_disk_file = buffer_manager->file_handle->OnDiskFile(); file_size = buffer_manager->file_handle->FileSize(); @@ -151,8 +154,8 @@ CSVFileScan::CSVFileScan(ClientContext &context, const string &file_name, CSVRea options.dialect_options.num_cols = options.sql_type_list.size(); } // Initialize State Machine - state_machine = - make_shared(state_machine_cache.Get(options.dialect_options.state_machine_options), options); + state_machine = make_shared_ptr( + state_machine_cache.Get(options.dialect_options.state_machine_options), options); } void CSVFileScan::InitializeFileNamesTypes() { diff --git a/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp b/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp index dd01d097..acf19eff 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp @@ -14,7 +14,7 @@ CSVGlobalState::CSVGlobalState(ClientContext &context_p, const shared_ptrGetFilePath() == files[0]) { - auto state_machine = make_shared( + auto state_machine = make_shared_ptr( CSVStateMachineCache::Get(context).Get(options.dialect_options.state_machine_options), options); // If we already have a buffer manager, we don't need to reconstruct it to the first file file_scans.emplace_back(make_uniq(context, buffer_manager, state_machine, options, bind_data, @@ -22,7 +22,7 @@ CSVGlobalState::CSVGlobalState(ClientContext &context_p, const shared_ptr(context, files[0], options, 0, bind_data, column_ids, file_schema)); + make_uniq(context, files[0], options, 0U, bind_data, column_ids, file_schema)); }; // There are situations where we only support single threaded scanning bool many_csv_files = files.size() > 1 && files.size() > system_threads * 2; @@ -36,7 +36,7 @@ CSVGlobalState::CSVGlobalState(ClientContext &context_p, const shared_ptrbuffer_manager->GetBuffer(0)->actual_size; current_boundary = CSVIterator(0, 0, 0, 0, buffer_size); } - current_buffer_in_use = make_shared(*file_scans.back()->buffer_manager, 0); + current_buffer_in_use = make_shared_ptr(*file_scans.back()->buffer_manager, 0); } double CSVGlobalState::GetProgress(const ReadCSVData &bind_data_p) const { @@ -67,8 +67,8 @@ unique_ptr CSVGlobalState::Next(optional_ptr parallel_lock(main_mutex); - file_scans.emplace_back(make_shared(context, bind_data.files[cur_idx], bind_data.options, - cur_idx, bind_data, column_ids, file_schema)); + file_scans.emplace_back(make_shared_ptr(context, bind_data.files[cur_idx], bind_data.options, + cur_idx, bind_data, column_ids, file_schema)); current_file = file_scans.back(); } if (previous_scanner) { @@ -88,7 +88,7 @@ unique_ptr CSVGlobalState::Next(optional_ptrbuffer_idx != current_boundary.GetBufferIdx()) { current_buffer_in_use = - make_shared(*file_scans.back()->buffer_manager, current_boundary.GetBufferIdx()); + make_shared_ptr(*file_scans.back()->buffer_manager, current_boundary.GetBufferIdx()); } // We first create the scanner for the current boundary auto ¤t_file = *file_scans.back(); @@ -111,13 +111,13 @@ unique_ptr CSVGlobalState::Next(optional_ptr(context, bind_data.files[current_file_idx], - bind_data.options, current_file_idx, bind_data, column_ids, - file_schema)); + file_scans.emplace_back(make_shared_ptr(context, bind_data.files[current_file_idx], + bind_data.options, current_file_idx, bind_data, + column_ids, file_schema)); // And re-start the boundary-iterator auto buffer_size = file_scans.back()->buffer_manager->GetBuffer(0)->actual_size; current_boundary = CSVIterator(current_file_idx, 0, 0, 0, buffer_size); - current_buffer_in_use = make_shared(*file_scans.back()->buffer_manager, 0); + current_buffer_in_use = make_shared_ptr(*file_scans.back()->buffer_manager, 0); } else { // If not we are done with this CSV Scanning finished = true; @@ -289,12 +289,12 @@ void CSVGlobalState::FillRejectsTable() { // 4. Byte Position of the row error errors_appender.Append(error.row_byte_position + 1); // 5. Byte Position where error occurred - if (error.byte_position == -1) { + if (!error.byte_position.IsValid()) { // This means this error comes from a flush, and we don't support this yet, so we give it // a null errors_appender.Append(Value()); } else { - errors_appender.Append(error.byte_position + 1); + errors_appender.Append(error.byte_position.GetIndex() + 1); } // 6. Column Index if (error.type == CSVErrorType::MAXIMUM_LINE_SIZE) { diff --git a/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp b/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp index d22738f2..208c2337 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp @@ -87,7 +87,7 @@ CSVError::CSVError(string error_message_p, CSVErrorType type_p, LinesPerBoundary } CSVError::CSVError(string error_message_p, CSVErrorType type_p, idx_t column_idx_p, string csv_row_p, - LinesPerBoundary error_info_p, idx_t row_byte_position, int64_t byte_position_p, + LinesPerBoundary error_info_p, idx_t row_byte_position, optional_idx byte_position_p, const CSVReaderOptions &reader_options, const string &fixes) : error_message(std::move(error_message_p)), type(type_p), column_idx(column_idx_p), csv_row(std::move(csv_row_p)), error_info(error_info_p), row_byte_position(row_byte_position), byte_position(byte_position_p) { @@ -129,7 +129,7 @@ void CSVError::RemoveNewLine(string &error) { CSVError CSVError::CastError(const CSVReaderOptions &options, string &column_name, string &cast_error, idx_t column_idx, string &csv_row, LinesPerBoundary error_info, idx_t row_byte_position, - int64_t byte_position, LogicalTypeId type) { + optional_idx byte_position, LogicalTypeId type) { std::ostringstream error; // Which column error << "Error when converting column \"" << column_name << "\". "; @@ -192,7 +192,7 @@ CSVError CSVError::NullPaddingFail(const CSVReaderOptions &options, LinesPerBoun CSVError CSVError::UnterminatedQuotesError(const CSVReaderOptions &options, idx_t current_column, LinesPerBoundary error_info, string &csv_row, idx_t row_byte_position, - int64_t byte_position) { + optional_idx byte_position) { std::ostringstream error; error << "Value with unterminated quote found." << '\n'; std::ostringstream how_to_fix_it; @@ -203,7 +203,7 @@ CSVError CSVError::UnterminatedQuotesError(const CSVReaderOptions &options, idx_ CSVError CSVError::IncorrectColumnAmountError(const CSVReaderOptions &options, idx_t actual_columns, LinesPerBoundary error_info, string &csv_row, idx_t row_byte_position, - int64_t byte_position) { + optional_idx byte_position) { std::ostringstream error; // We don't have a fix for this std::ostringstream how_to_fix_it; @@ -218,15 +218,15 @@ CSVError CSVError::IncorrectColumnAmountError(const CSVReaderOptions &options, i error << "Expected Number of Columns: " << options.dialect_options.num_cols << " Found: " << actual_columns + 1; if (actual_columns >= options.dialect_options.num_cols) { return CSVError(error.str(), CSVErrorType::TOO_MANY_COLUMNS, actual_columns, csv_row, error_info, - row_byte_position, byte_position - 1, options, how_to_fix_it.str()); + row_byte_position, byte_position.GetIndex() - 1, options, how_to_fix_it.str()); } else { return CSVError(error.str(), CSVErrorType::TOO_FEW_COLUMNS, actual_columns, csv_row, error_info, - row_byte_position, byte_position - 1, options, how_to_fix_it.str()); + row_byte_position, byte_position.GetIndex() - 1, options, how_to_fix_it.str()); } } CSVError CSVError::InvalidUTF8(const CSVReaderOptions &options, idx_t current_column, LinesPerBoundary error_info, - string &csv_row, idx_t row_byte_position, int64_t byte_position) { + string &csv_row, idx_t row_byte_position, optional_idx byte_position) { std::ostringstream error; // How many columns were expected and how many were found error << "Invalid unicode (byte sequence mismatch) detected." << '\n'; diff --git a/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp b/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp index 82a740b2..ded31aee 100644 --- a/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +++ b/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp @@ -90,11 +90,14 @@ void CSVReaderOptions::SetEscape(const string &input) { } int64_t CSVReaderOptions::GetSkipRows() const { - return this->dialect_options.skip_rows.GetValue(); + return NumericCast(this->dialect_options.skip_rows.GetValue()); } void CSVReaderOptions::SetSkipRows(int64_t skip_rows) { - dialect_options.skip_rows.Set(skip_rows); + if (skip_rows < 0) { + throw InvalidInputException("skip_rows option from read_csv scanner, must be equal or higher than 0"); + } + dialect_options.skip_rows.Set(NumericCast(skip_rows)); } string CSVReaderOptions::GetDelimiter() const { @@ -141,6 +144,10 @@ void CSVReaderOptions::SetNewline(const string &input) { } } +bool CSVReaderOptions::IgnoreErrors() const { + return ignore_errors.GetValue() && !store_rejects.GetValue(); +} + void CSVReaderOptions::SetDateFormat(LogicalTypeId type, const string &format, bool read_format) { string error; if (read_format) { @@ -148,7 +155,7 @@ void CSVReaderOptions::SetDateFormat(LogicalTypeId type, const string &format, b error = StrTimeFormat::ParseFormatSpecifier(format, strpformat); dialect_options.date_format[type].Set(strpformat); } else { - error = StrTimeFormat::ParseFormatSpecifier(format, write_date_format[type]); + write_date_format[type] = Value(format); } if (!error.empty()) { throw InvalidInputException("Could not parse DATEFORMAT: %s", error.c_str()); @@ -162,7 +169,7 @@ void CSVReaderOptions::SetReadOption(const string &loption, const Value &value, if (loption == "auto_detect") { auto_detect = ParseBoolean(value, loption); } else if (loption == "sample_size") { - int64_t sample_size_option = ParseInteger(value, loption); + auto sample_size_option = ParseInteger(value, loption); if (sample_size_option < 1 && sample_size_option != -1) { throw BinderException("Unsupported parameter for SAMPLE_SIZE: cannot be smaller than 1"); } @@ -170,7 +177,7 @@ void CSVReaderOptions::SetReadOption(const string &loption, const Value &value, // If -1, we basically read the whole thing sample_size_chunks = NumericLimits().Maximum(); } else { - sample_size_chunks = sample_size_option / STANDARD_VECTOR_SIZE; + sample_size_chunks = NumericCast(sample_size_option / STANDARD_VECTOR_SIZE); if (sample_size_option % STANDARD_VECTOR_SIZE != 0) { sample_size_chunks++; } @@ -179,7 +186,7 @@ void CSVReaderOptions::SetReadOption(const string &loption, const Value &value, } else if (loption == "skip") { SetSkipRows(ParseInteger(value, loption)); } else if (loption == "max_line_size" || loption == "maximum_line_size") { - maximum_line_size = ParseInteger(value, loption); + maximum_line_size = NumericCast(ParseInteger(value, loption)); } else if (loption == "date_format" || loption == "dateformat") { string format = ParseString(value, loption); SetDateFormat(LogicalTypeId::DATE, format, true); @@ -189,7 +196,7 @@ void CSVReaderOptions::SetReadOption(const string &loption, const Value &value, } else if (loption == "ignore_errors") { ignore_errors.Set(ParseBoolean(value, loption)); } else if (loption == "buffer_size") { - buffer_size = ParseInteger(value, loption); + buffer_size = NumericCast(ParseInteger(value, loption)); if (buffer_size == 0) { throw InvalidInputException("Buffer Size option must be higher than 0"); } @@ -233,11 +240,11 @@ void CSVReaderOptions::SetReadOption(const string &loption, const Value &value, } rejects_scan_name.Set(table_name); } else if (loption == "rejects_limit") { - int64_t limit = ParseInteger(value, loption); + auto limit = ParseInteger(value, loption); if (limit < 0) { throw BinderException("Unsupported parameter for REJECTS_LIMIT: cannot be negative"); } - rejects_limit = limit; + rejects_limit = NumericCast(limit); } else { throw BinderException("Unrecognized option for CSV reader \"%s\"", loption); } @@ -412,12 +419,12 @@ static Value StringVectorToValue(const vector &vec) { static uint8_t GetCandidateSpecificity(const LogicalType &candidate_type) { //! Const ht with accepted auto_types and their weights in specificity const duckdb::unordered_map auto_type_candidates_specificity { - {(uint8_t)LogicalTypeId::VARCHAR, 0}, {(uint8_t)LogicalTypeId::TIMESTAMP, 1}, - {(uint8_t)LogicalTypeId::DATE, 2}, {(uint8_t)LogicalTypeId::TIME, 3}, - {(uint8_t)LogicalTypeId::DOUBLE, 4}, {(uint8_t)LogicalTypeId::FLOAT, 5}, - {(uint8_t)LogicalTypeId::DECIMAL, 6}, {(uint8_t)LogicalTypeId::BIGINT, 7}, - {(uint8_t)LogicalTypeId::INTEGER, 8}, {(uint8_t)LogicalTypeId::SMALLINT, 9}, - {(uint8_t)LogicalTypeId::TINYINT, 10}, {(uint8_t)LogicalTypeId::BOOLEAN, 11}, + {(uint8_t)LogicalTypeId::VARCHAR, 0}, {(uint8_t)LogicalTypeId::DOUBLE, 1}, + {(uint8_t)LogicalTypeId::FLOAT, 2}, {(uint8_t)LogicalTypeId::DECIMAL, 3}, + {(uint8_t)LogicalTypeId::BIGINT, 4}, {(uint8_t)LogicalTypeId::INTEGER, 5}, + {(uint8_t)LogicalTypeId::SMALLINT, 6}, {(uint8_t)LogicalTypeId::TINYINT, 7}, + {(uint8_t)LogicalTypeId::TIMESTAMP, 8}, {(uint8_t)LogicalTypeId::DATE, 9}, + {(uint8_t)LogicalTypeId::TIME, 10}, {(uint8_t)LogicalTypeId::BOOLEAN, 11}, {(uint8_t)LogicalTypeId::SQLNULL, 12}}; auto id = (uint8_t)candidate_type.id(); @@ -441,7 +448,7 @@ void CSVReaderOptions::FromNamedParameters(named_parameter_map_t &in, ClientCont vector &return_types, vector &names) { map ordered_user_defined_parameters; for (auto &kv : in) { - if (MultiFileReader::ParseOption(kv.first, kv.second, file_options, context)) { + if (MultiFileReader().ParseOption(kv.first, kv.second, file_options, context)) { continue; } auto loption = StringUtil::Lower(kv.first); @@ -582,17 +589,19 @@ void CSVReaderOptions::ToNamedParameters(named_parameter_map_t &named_params) { if (header.IsSetByUser()) { named_params["header"] = Value(GetHeader()); } - named_params["max_line_size"] = Value::BIGINT(maximum_line_size); + named_params["max_line_size"] = Value::BIGINT(NumericCast(maximum_line_size)); if (dialect_options.skip_rows.IsSetByUser()) { named_params["skip"] = Value::BIGINT(GetSkipRows()); } named_params["null_padding"] = Value::BOOLEAN(null_padding); named_params["parallel"] = Value::BOOLEAN(parallel); - if (!date_format.at(LogicalType::DATE).format_specifier.empty()) { - named_params["dateformat"] = Value(date_format.at(LogicalType::DATE).format_specifier); + if (!dialect_options.date_format.at(LogicalType::DATE).GetValue().format_specifier.empty()) { + named_params["dateformat"] = + Value(dialect_options.date_format.at(LogicalType::DATE).GetValue().format_specifier); } - if (!date_format.at(LogicalType::TIMESTAMP).format_specifier.empty()) { - named_params["timestampformat"] = Value(date_format.at(LogicalType::TIMESTAMP).format_specifier); + if (!dialect_options.date_format.at(LogicalType::TIMESTAMP).GetValue().format_specifier.empty()) { + named_params["timestampformat"] = + Value(dialect_options.date_format.at(LogicalType::TIMESTAMP).GetValue().format_specifier); } named_params["normalize_names"] = Value::BOOLEAN(normalize_names); @@ -600,7 +609,7 @@ void CSVReaderOptions::ToNamedParameters(named_parameter_map_t &named_params) { named_params["column_names"] = StringVectorToValue(name_list); } named_params["all_varchar"] = Value::BOOLEAN(all_varchar); - named_params["maximum_line_size"] = Value::BIGINT(maximum_line_size); + named_params["maximum_line_size"] = Value::BIGINT(NumericCast(maximum_line_size)); } } // namespace duckdb diff --git a/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp b/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp index fcf75496..9f2ac70d 100644 --- a/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp +++ b/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp @@ -55,7 +55,7 @@ SinkCombineResultType PhysicalBufferedCollector::Combine(ExecutionContext &conte unique_ptr PhysicalBufferedCollector::GetGlobalSinkState(ClientContext &context) const { auto state = make_uniq(); state->context = context.shared_from_this(); - state->buffered_data = make_shared(state->context); + state->buffered_data = make_shared_ptr(state->context); return std::move(state); } diff --git a/src/duckdb/src/execution/operator/helper/physical_execute.cpp b/src/duckdb/src/execution/operator/helper/physical_execute.cpp index 4a076921..22cab9be 100644 --- a/src/duckdb/src/execution/operator/helper/physical_execute.cpp +++ b/src/duckdb/src/execution/operator/helper/physical_execute.cpp @@ -5,7 +5,7 @@ namespace duckdb { PhysicalExecute::PhysicalExecute(PhysicalOperator &plan) - : PhysicalOperator(PhysicalOperatorType::EXECUTE, plan.types, -1), plan(plan) { + : PhysicalOperator(PhysicalOperatorType::EXECUTE, plan.types, idx_t(-1)), plan(plan) { } vector> PhysicalExecute::GetChildren() const { diff --git a/src/duckdb/src/execution/operator/helper/physical_load.cpp b/src/duckdb/src/execution/operator/helper/physical_load.cpp index 62054206..1c28406a 100644 --- a/src/duckdb/src/execution/operator/helper/physical_load.cpp +++ b/src/duckdb/src/execution/operator/helper/physical_load.cpp @@ -3,10 +3,32 @@ namespace duckdb { +static void InstallFromRepository(ClientContext &context, const LoadInfo &info) { + ExtensionRepository repository; + if (!info.repository.empty() && info.repo_is_alias) { + auto repository_url = ExtensionRepository::TryGetRepositoryUrl(info.repository); + // This has been checked during bind, so it should not fail here + if (repository_url.empty()) { + throw InternalException("The repository alias failed to resolve"); + } + repository = ExtensionRepository(info.repository, repository_url); + } else if (!info.repository.empty()) { + repository = ExtensionRepository::GetRepositoryByUrl(info.repository); + } + + ExtensionHelper::InstallExtension(context, info.filename, info.load_type == LoadType::FORCE_INSTALL, repository, + info.version); +} + SourceResultType PhysicalLoad::GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const { if (info->load_type == LoadType::INSTALL || info->load_type == LoadType::FORCE_INSTALL) { - ExtensionHelper::InstallExtension(context.client, info->filename, info->load_type == LoadType::FORCE_INSTALL, - info->repository); + if (info->repository.empty()) { + ExtensionHelper::InstallExtension(context.client, info->filename, + info->load_type == LoadType::FORCE_INSTALL, nullptr, info->version); + } else { + InstallFromRepository(context.client, *info); + } + } else { ExtensionHelper::LoadExternalExtension(context.client, info->filename); } diff --git a/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp b/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp index 1bc87d25..b253025f 100644 --- a/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp +++ b/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp @@ -17,7 +17,7 @@ class SampleGlobalSinkState : public GlobalSinkState { } sample = make_uniq(allocator, percentage, options.seed); } else { - auto size = options.sample_size.GetValue(); + auto size = NumericCast(options.sample_size.GetValue()); if (size == 0) { return; } diff --git a/src/duckdb/src/execution/operator/helper/physical_update_extensions.cpp b/src/duckdb/src/execution/operator/helper/physical_update_extensions.cpp new file mode 100644 index 00000000..d29632d1 --- /dev/null +++ b/src/duckdb/src/execution/operator/helper/physical_update_extensions.cpp @@ -0,0 +1,57 @@ +#include "duckdb/execution/operator/helper/physical_update_extensions.hpp" +#include "duckdb/main/extension_helper.hpp" + +namespace duckdb { + +SourceResultType PhysicalUpdateExtensions::GetData(ExecutionContext &context, DataChunk &chunk, + OperatorSourceInput &input) const { + auto &data = input.global_state.Cast(); + + if (data.offset >= data.update_result_entries.size()) { + // finished returning values + return SourceResultType::FINISHED; + } + + idx_t count = 0; + while (data.offset < data.update_result_entries.size() && count < STANDARD_VECTOR_SIZE) { + auto &entry = data.update_result_entries[data.offset]; + + // return values: + idx_t col = 0; + // extension_name LogicalType::VARCHAR + chunk.SetValue(col++, count, Value(entry.extension_name)); + // repository LogicalType::VARCHAR + chunk.SetValue(col++, count, Value(entry.repository)); + // update_result + chunk.SetValue(col++, count, Value(EnumUtil::ToString(entry.tag))); + // previous_version LogicalType::VARCHAR + chunk.SetValue(col++, count, Value(entry.prev_version)); + // current_version LogicalType::VARCHAR + chunk.SetValue(col++, count, Value(entry.installed_version)); + + data.offset++; + count++; + } + chunk.SetCardinality(count); + + return data.offset >= data.update_result_entries.size() ? SourceResultType::FINISHED + : SourceResultType::HAVE_MORE_OUTPUT; +} + +unique_ptr PhysicalUpdateExtensions::GetGlobalSourceState(ClientContext &context) const { + auto res = make_uniq(); + + if (info->extensions_to_update.empty()) { + // Update all + res->update_result_entries = ExtensionHelper::UpdateExtensions(context); + } else { + // Update extensions in extensions_to_update + for (const auto &ext : info->extensions_to_update) { + res->update_result_entries.emplace_back(ExtensionHelper::UpdateExtension(context, ext)); + } + } + + return std::move(res); +} + +} // namespace duckdb diff --git a/src/duckdb/src/execution/operator/helper/physical_verify_vector.cpp b/src/duckdb/src/execution/operator/helper/physical_verify_vector.cpp index 080ab1e3..5fc627c9 100644 --- a/src/duckdb/src/execution/operator/helper/physical_verify_vector.cpp +++ b/src/duckdb/src/execution/operator/helper/physical_verify_vector.cpp @@ -18,25 +18,30 @@ class VerifyVectorState : public OperatorState { idx_t const_idx; }; -OperatorResultType VerifyEmitConstantVectors(DataChunk &input, DataChunk &chunk, OperatorState &state_p) { +OperatorResultType VerifyEmitConstantVectors(const DataChunk &input, DataChunk &chunk, OperatorState &state_p) { auto &state = state_p.Cast(); D_ASSERT(state.const_idx < input.size()); + // Ensure that we don't alter the input data while another thread is still using it. + DataChunk copied_input; + copied_input.Initialize(Allocator::DefaultAllocator(), input.GetTypes()); + input.Copy(copied_input); + // emit constant vectors at the current index for (idx_t c = 0; c < chunk.ColumnCount(); c++) { - ConstantVector::Reference(chunk.data[c], input.data[c], state.const_idx, 1); + ConstantVector::Reference(chunk.data[c], copied_input.data[c], state.const_idx, 1); } chunk.SetCardinality(1); state.const_idx++; - if (state.const_idx >= input.size()) { + if (state.const_idx >= copied_input.size()) { state.const_idx = 0; return OperatorResultType::NEED_MORE_INPUT; } return OperatorResultType::HAVE_MORE_OUTPUT; } -OperatorResultType VerifyEmitDictionaryVectors(DataChunk &input, DataChunk &chunk, OperatorState &state) { - chunk.Reference(input); +OperatorResultType VerifyEmitDictionaryVectors(const DataChunk &input, DataChunk &chunk, OperatorState &state) { + input.Copy(chunk); for (idx_t c = 0; c < chunk.ColumnCount(); c++) { Vector::DebugTransformToDictionary(chunk.data[c], chunk.size()); } @@ -48,7 +53,7 @@ struct ConstantOrSequenceInfo { bool is_constant = true; }; -OperatorResultType VerifyEmitSequenceVector(DataChunk &input, DataChunk &chunk, OperatorState &state_p) { +OperatorResultType VerifyEmitSequenceVector(const DataChunk &input, DataChunk &chunk, OperatorState &state_p) { auto &state = state_p.Cast(); D_ASSERT(state.const_idx < input.size()); @@ -189,8 +194,8 @@ OperatorResultType VerifyEmitSequenceVector(DataChunk &input, DataChunk &chunk, return OperatorResultType::HAVE_MORE_OUTPUT; } -OperatorResultType VerifyEmitNestedShuffleVector(DataChunk &input, DataChunk &chunk, OperatorState &state) { - chunk.Reference(input); +OperatorResultType VerifyEmitNestedShuffleVector(const DataChunk &input, DataChunk &chunk, OperatorState &state) { + input.Copy(chunk); for (idx_t c = 0; c < chunk.ColumnCount(); c++) { Vector::DebugShuffleNestedVector(chunk.data[c], chunk.size()); } diff --git a/src/duckdb/src/execution/operator/join/physical_asof_join.cpp b/src/duckdb/src/execution/operator/join/physical_asof_join.cpp index 39960633..b0e4dcc4 100644 --- a/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +++ b/src/duckdb/src/execution/operator/join/physical_asof_join.cpp @@ -159,7 +159,7 @@ SinkFinalizeType PhysicalAsOfJoin::Finalize(Pipeline &pipeline, Event &event, Cl // The data is all in so we can initialise the left partitioning. const vector> partitions_stats; gstate.lhs_sink = make_uniq(context, lhs_partitions, lhs_orders, children[0]->types, - partitions_stats, 0); + partitions_stats, 0U); gstate.lhs_sink->SyncPartitioning(gstate.rhs_sink); // Find the first group to sort @@ -169,7 +169,7 @@ SinkFinalizeType PhysicalAsOfJoin::Finalize(Pipeline &pipeline, Event &event, Cl } // Schedule all the sorts for maximum thread utilisation - auto new_event = make_shared(gstate.rhs_sink, pipeline); + auto new_event = make_shared_ptr(gstate.rhs_sink, pipeline); event.InsertEvent(std::move(new_event)); return SinkFinalizeType::READY; diff --git a/src/duckdb/src/execution/operator/join/physical_hash_join.cpp b/src/duckdb/src/execution/operator/join/physical_hash_join.cpp index 1e1e9fd1..e9d880ec 100644 --- a/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +++ b/src/duckdb/src/execution/operator/join/physical_hash_join.cpp @@ -88,7 +88,7 @@ PhysicalHashJoin::PhysicalHashJoin(LogicalOperator &op, unique_ptr(TaskScheduler::GetScheduler(context).NumberOfThreads())), temporary_memory_update_count(0), temporary_memory_state(TemporaryMemoryManager::Get(context).Register(context)), finalized(false), scanned_data(false) { @@ -206,7 +206,7 @@ unique_ptr PhysicalHashJoin::InitializeHashTable(ClientContext &c auto count_fun = CountFun::GetFunction(); vector> children; // this is a dummy but we need it to make the hash table understand whats going on - children.push_back(make_uniq_base(count_fun.return_type, 0)); + children.push_back(make_uniq_base(count_fun.return_type, 0U)); aggr = function_binder.BindAggregateFunction(count_fun, std::move(children), nullptr, AggregateType::NON_DISTINCT); correlated_aggregates.push_back(&*aggr); @@ -321,11 +321,11 @@ class HashJoinFinalizeEvent : public BasePipelineEvent { vector> finalize_tasks; auto &ht = *sink.hash_table; const auto chunk_count = ht.GetDataCollection().ChunkCount(); - const idx_t num_threads = TaskScheduler::GetScheduler(context).NumberOfThreads(); + const auto num_threads = NumericCast(TaskScheduler::GetScheduler(context).NumberOfThreads()); if (num_threads == 1 || (ht.Count() < PARALLEL_CONSTRUCT_THRESHOLD && !context.config.verify_parallelism)) { // Single-threaded finalize finalize_tasks.push_back( - make_uniq(shared_from_this(), context, sink, 0, chunk_count, false)); + make_uniq(shared_from_this(), context, sink, 0U, chunk_count, false)); } else { // Parallel finalize auto chunks_per_thread = MaxValue((chunk_count + num_threads - 1) / num_threads, 1); @@ -359,7 +359,7 @@ void HashJoinGlobalSinkState::ScheduleFinalize(Pipeline &pipeline, Event &event) return; } hash_table->InitializePointerTable(); - auto new_event = make_shared(pipeline, *this); + auto new_event = make_shared_ptr(pipeline, *this); event.InsertEvent(std::move(new_event)); } @@ -409,7 +409,7 @@ class HashJoinRepartitionEvent : public BasePipelineEvent { total_size += sink_collection.SizeInBytes(); total_count += sink_collection.Count(); } - auto total_blocks = (double(total_size) + Storage::BLOCK_SIZE - 1) / Storage::BLOCK_SIZE; + auto total_blocks = NumericCast((double(total_size) + Storage::BLOCK_SIZE - 1) / Storage::BLOCK_SIZE); auto count_per_block = total_count / total_blocks; auto blocks_per_vector = MaxValue(STANDARD_VECTOR_SIZE / count_per_block, 2); @@ -474,7 +474,7 @@ SinkFinalizeType PhysicalHashJoin::Finalize(Pipeline &pipeline, Event &event, Cl // We have to repartition ht.SetRepartitionRadixBits(sink.local_hash_tables, sink.temporary_memory_state->GetReservation(), max_partition_size, max_partition_count); - auto new_event = make_shared(pipeline, sink, sink.local_hash_tables); + auto new_event = make_shared_ptr(pipeline, sink, sink.local_hash_tables); event.InsertEvent(std::move(new_event)); } else { // No repartitioning! @@ -816,7 +816,7 @@ void HashJoinGlobalSourceState::PrepareBuild(HashJoinGlobalSinkState &sink) { build_chunk_count = data_collection.ChunkCount(); build_chunk_done = 0; - auto num_threads = TaskScheduler::GetScheduler(sink.context).NumberOfThreads(); + auto num_threads = NumericCast(TaskScheduler::GetScheduler(sink.context).NumberOfThreads()); build_chunks_per_thread = MaxValue((build_chunk_count + num_threads - 1) / num_threads, 1); ht.InitializePointerTable(); @@ -847,7 +847,7 @@ void HashJoinGlobalSourceState::PrepareScanHT(HashJoinGlobalSinkState &sink) { full_outer_chunk_count = data_collection.ChunkCount(); full_outer_chunk_done = 0; - auto num_threads = TaskScheduler::GetScheduler(sink.context).NumberOfThreads(); + auto num_threads = NumericCast(TaskScheduler::GetScheduler(sink.context).NumberOfThreads()); full_outer_chunks_per_thread = MaxValue((full_outer_chunk_count + num_threads - 1) / num_threads, 1); global_stage = HashJoinSourceStage::SCAN_HT; diff --git a/src/duckdb/src/execution/operator/join/physical_iejoin.cpp b/src/duckdb/src/execution/operator/join/physical_iejoin.cpp index 6e21b860..8c89195b 100644 --- a/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +++ b/src/duckdb/src/execution/operator/join/physical_iejoin.cpp @@ -325,7 +325,7 @@ idx_t IEJoinUnion::AppendKey(SortedTable &table, ExpressionExecutor &executor, S payload.data[0].Sequence(rid, increment, scan_count); payload.SetCardinality(scan_count); keys.Fuse(payload); - rid += increment * scan_count; + rid += increment * UnsafeNumericCast(scan_count); // Sort on the sort columns (which will no longer be needed) keys.Split(payload, payload_idx); @@ -385,7 +385,7 @@ IEJoinUnion::IEJoinUnion(ClientContext &context, const PhysicalIEJoin &op, Sorte payload_layout.Initialize(types); // Sort on the first expression - auto ref = make_uniq(order1.expression->return_type, 0); + auto ref = make_uniq(order1.expression->return_type, 0U); vector orders; orders.emplace_back(order1.type, order1.null_order, std::move(ref)); @@ -426,7 +426,7 @@ IEJoinUnion::IEJoinUnion(ClientContext &context, const PhysicalIEJoin &op, Sorte // Sort on the first expression orders.clear(); - ref = make_uniq(order2.expression->return_type, 0); + ref = make_uniq(order2.expression->return_type, 0U); orders.emplace_back(order2.type, order2.null_order, std::move(ref)); ExpressionExecutor executor(context); @@ -434,7 +434,7 @@ IEJoinUnion::IEJoinUnion(ClientContext &context, const PhysicalIEJoin &op, Sorte l2 = make_uniq(context, orders, payload_layout); for (idx_t base = 0, block_idx = 0; block_idx < l1->BlockCount(); ++block_idx) { - base += AppendKey(*l1, executor, *l2, 1, base, block_idx); + base += AppendKey(*l1, executor, *l2, 1, NumericCast(base), block_idx); } Sort(*l2); diff --git a/src/duckdb/src/execution/operator/join/physical_left_delim_join.cpp b/src/duckdb/src/execution/operator/join/physical_left_delim_join.cpp index 04a6ce80..1d6972e0 100644 --- a/src/duckdb/src/execution/operator/join/physical_left_delim_join.cpp +++ b/src/duckdb/src/execution/operator/join/physical_left_delim_join.cpp @@ -23,7 +23,7 @@ PhysicalLeftDelimJoin::PhysicalLeftDelimJoin(vector types, unique_p // we replace it with a PhysicalColumnDataScan, that scans the ColumnDataCollection that we keep cached // the actual chunk collection to scan will be created in the LeftDelimJoinGlobalState auto cached_chunk_scan = make_uniq( - children[0]->GetTypes(), PhysicalOperatorType::COLUMN_DATA_SCAN, estimated_cardinality); + children[0]->GetTypes(), PhysicalOperatorType::COLUMN_DATA_SCAN, estimated_cardinality, nullptr); join->children[0] = std::move(cached_chunk_scan); } diff --git a/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp b/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp index 433ff329..287c7971 100644 --- a/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +++ b/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp @@ -105,7 +105,7 @@ unique_ptr PhysicalPiecewiseMergeJoin::GetGlobalSinkState(Clien unique_ptr PhysicalPiecewiseMergeJoin::GetLocalSinkState(ExecutionContext &context) const { // We only sink the RHS - return make_uniq(context.client, *this, 1); + return make_uniq(context.client, *this, 1U); } SinkResultType PhysicalPiecewiseMergeJoin::Sink(ExecutionContext &context, DataChunk &chunk, @@ -223,7 +223,7 @@ class PiecewiseMergeJoinState : public CachingOperatorState { void ResolveJoinKeys(DataChunk &input) { // sort by join key lhs_global_state = make_uniq(buffer_manager, lhs_order, lhs_layout); - lhs_local_table = make_uniq(context, op, 0); + lhs_local_table = make_uniq(context, op, 0U); lhs_local_table->Sink(input, *lhs_global_state); // Set external (can be forced with the PRAGMA) diff --git a/src/duckdb/src/execution/operator/join/physical_range_join.cpp b/src/duckdb/src/execution/operator/join/physical_range_join.cpp index 5d6d44f4..398242bd 100644 --- a/src/duckdb/src/execution/operator/join/physical_range_join.cpp +++ b/src/duckdb/src/execution/operator/join/physical_range_join.cpp @@ -126,7 +126,7 @@ class RangeJoinMergeEvent : public BasePipelineEvent { // Schedule tasks equal to the number of threads, which will each merge multiple partitions auto &ts = TaskScheduler::GetScheduler(context); - idx_t num_threads = ts.NumberOfThreads(); + auto num_threads = NumericCast(ts.NumberOfThreads()); vector> iejoin_tasks; for (idx_t tnum = 0; tnum < num_threads; tnum++) { @@ -149,7 +149,7 @@ class RangeJoinMergeEvent : public BasePipelineEvent { void PhysicalRangeJoin::GlobalSortedTable::ScheduleMergeTasks(Pipeline &pipeline, Event &event) { // Initialize global sort state for a round of merging global_sort_state.InitializeMergeRound(); - auto new_event = make_shared(*this, pipeline); + auto new_event = make_shared_ptr(*this, pipeline); event.InsertEvent(std::move(new_event)); } diff --git a/src/duckdb/src/execution/operator/order/physical_order.cpp b/src/duckdb/src/execution/operator/order/physical_order.cpp index ac933f3f..c916c7da 100644 --- a/src/duckdb/src/execution/operator/order/physical_order.cpp +++ b/src/duckdb/src/execution/operator/order/physical_order.cpp @@ -6,6 +6,7 @@ #include "duckdb/parallel/base_pipeline_event.hpp" #include "duckdb/parallel/executor_task.hpp" #include "duckdb/storage/buffer_manager.hpp" +#include "duckdb/common/shared_ptr.hpp" namespace duckdb { @@ -143,7 +144,7 @@ class OrderMergeEvent : public BasePipelineEvent { // Schedule tasks equal to the number of threads, which will each merge multiple partitions auto &ts = TaskScheduler::GetScheduler(context); - idx_t num_threads = ts.NumberOfThreads(); + auto num_threads = NumericCast(ts.NumberOfThreads()); vector> merge_tasks; for (idx_t tnum = 0; tnum < num_threads; tnum++) { @@ -186,7 +187,7 @@ SinkFinalizeType PhysicalOrder::Finalize(Pipeline &pipeline, Event &event, Clien void PhysicalOrder::ScheduleMergeTasks(Pipeline &pipeline, Event &event, OrderGlobalSinkState &state) { // Initialize global sort state for a round of merging state.global_sort_state.InitializeMergeRound(); - auto new_event = make_shared(state, pipeline); + auto new_event = make_shared_ptr(state, pipeline); event.InsertEvent(std::move(new_event)); } diff --git a/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp b/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp index 5447f433..17f4e0e4 100644 --- a/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +++ b/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp @@ -308,7 +308,7 @@ SinkFinalizeType PhysicalBatchCopyToFile::Finalize(Pipeline &pipeline, Event &ev FinalFlush(context, input.global_state); } else { // we have multiple tasks remaining - launch an event to execute the tasks in parallel - auto new_event = make_shared(*this, gstate, pipeline, context); + auto new_event = make_shared_ptr(*this, gstate, pipeline, context); event.InsertEvent(std::move(new_event)); } return SinkFinalizeType::READY; @@ -434,7 +434,7 @@ void PhysicalBatchCopyToFile::RepartitionBatches(ClientContext &context, GlobalS // create an empty collection auto new_collection = make_uniq(context, children[0]->types, ColumnDataAllocatorType::HYBRID); - append_batch = make_uniq(0, std::move(new_collection)); + append_batch = make_uniq(0U, std::move(new_collection)); } if (append_batch) { append_batch->collection->InitializeAppend(append_state); @@ -459,7 +459,7 @@ void PhysicalBatchCopyToFile::RepartitionBatches(ClientContext &context, GlobalS auto new_collection = make_uniq(context, children[0]->types, ColumnDataAllocatorType::HYBRID); - append_batch = make_uniq(0, std::move(new_collection)); + append_batch = make_uniq(0U, std::move(new_collection)); append_batch->collection->InitializeAppend(append_state); } } @@ -605,7 +605,7 @@ SourceResultType PhysicalBatchCopyToFile::GetData(ExecutionContext &context, Dat auto &g = sink_state->Cast(); chunk.SetCardinality(1); - chunk.SetValue(0, 0, Value::BIGINT(g.rows_copied)); + chunk.SetValue(0, 0, Value::BIGINT(NumericCast(g.rows_copied.load()))); return SourceResultType::FINISHED; } diff --git a/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp b/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp index 7ddd838f..a65d1cca 100644 --- a/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +++ b/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp @@ -13,12 +13,14 @@ namespace duckdb { -PhysicalBatchInsert::PhysicalBatchInsert(vector types, TableCatalogEntry &table, - physical_index_vector_t column_index_map, - vector> bound_defaults, idx_t estimated_cardinality) - : PhysicalOperator(PhysicalOperatorType::BATCH_INSERT, std::move(types), estimated_cardinality), - column_index_map(std::move(column_index_map)), insert_table(&table), insert_types(table.GetTypes()), - bound_defaults(std::move(bound_defaults)) { +PhysicalBatchInsert::PhysicalBatchInsert(vector types_p, TableCatalogEntry &table, + physical_index_vector_t column_index_map_p, + vector> bound_defaults_p, + vector> bound_constraints_p, + idx_t estimated_cardinality) + : PhysicalOperator(PhysicalOperatorType::BATCH_INSERT, std::move(types_p), estimated_cardinality), + column_index_map(std::move(column_index_map_p)), insert_table(&table), insert_types(table.GetTypes()), + bound_defaults(std::move(bound_defaults_p)), bound_constraints(std::move(bound_constraints_p)) { } PhysicalBatchInsert::PhysicalBatchInsert(LogicalOperator &op, SchemaCatalogEntry &schema, @@ -171,11 +173,13 @@ class BatchInsertLocalState : public LocalSinkState { TableAppendState current_append_state; unique_ptr current_collection; optional_ptr writer; + unique_ptr constraint_state; void CreateNewCollection(DuckTableEntry &table, const vector &insert_types) { - auto &table_info = table.GetStorage().info; + auto table_info = table.GetStorage().GetDataTableInfo(); auto &block_manager = TableIOManager::Get(table.GetStorage()).GetBlockManagerForRowData(); - current_collection = make_uniq(table_info, block_manager, insert_types, MAX_ROW_ID); + current_collection = make_uniq(std::move(table_info), block_manager, insert_types, + NumericCast(MAX_ROW_ID)); current_collection->InitializeEmpty(); current_collection->InitializeAppend(current_append_state); } @@ -312,8 +316,8 @@ void BatchInsertGlobalState::ScheduleMergeTasks(idx_t min_batch_index) { auto &scheduled_task = to_be_scheduled_tasks[i - 1]; if (scheduled_task.start_index + 1 < scheduled_task.end_index) { // erase all entries except the first one - collections.erase(collections.begin() + scheduled_task.start_index + 1, - collections.begin() + scheduled_task.end_index); + collections.erase(collections.begin() + NumericCast(scheduled_task.start_index) + 1, + collections.begin() + NumericCast(scheduled_task.end_index)); } } } @@ -493,7 +497,10 @@ SinkResultType PhysicalBatchInsert::Sink(ExecutionContext &context, DataChunk &c throw InternalException("Current batch differs from batch - but NextBatch was not called!?"); } - table.GetStorage().VerifyAppendConstraints(table, context.client, lstate.insert_chunk); + if (!lstate.constraint_state) { + lstate.constraint_state = table.GetStorage().InitializeConstraintState(table, bound_constraints); + } + table.GetStorage().VerifyAppendConstraints(*lstate.constraint_state, context.client, lstate.insert_chunk); auto new_row_group = lstate.current_collection->Append(lstate.insert_chunk, lstate.current_append_state); if (new_row_group) { @@ -594,7 +601,7 @@ SinkFinalizeType PhysicalBatchInsert::Finalize(Pipeline &pipeline, Event &event, auto &table = gstate.table; auto &storage = table.GetStorage(); LocalAppendState append_state; - storage.InitializeLocalAppend(append_state, context); + storage.InitializeLocalAppend(append_state, table, context, bound_constraints); auto &transaction = DuckTransaction::Get(context, table.catalog); for (auto &entry : gstate.collections) { if (entry.type != RowGroupBatchType::NOT_FLUSHED) { @@ -622,7 +629,7 @@ SourceResultType PhysicalBatchInsert::GetData(ExecutionContext &context, DataChu auto &insert_gstate = sink_state->Cast(); chunk.SetCardinality(1); - chunk.SetValue(0, 0, Value::BIGINT(insert_gstate.insert_count)); + chunk.SetValue(0, 0, Value::BIGINT(NumericCast(insert_gstate.insert_count))); return SourceResultType::FINISHED; } diff --git a/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp b/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp index 5925e9f0..9205067b 100644 --- a/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +++ b/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp @@ -52,21 +52,25 @@ class CopyToFunctionGlobalState : public GlobalSinkState { atomic rows_copied; atomic last_file_offset; unique_ptr global_state; - idx_t created_directories = 0; - + //! Created directories + unordered_set created_directories; //! shared state for HivePartitionedColumnData shared_ptr partition_state; - static void CreateDir(const string &dir_path, FileSystem &fs) { + void CreateDir(const string &dir_path, FileSystem &fs) { + if (created_directories.find(dir_path) != created_directories.end()) { + // already attempted to create this directory + return; + } if (!fs.DirectoryExists(dir_path)) { fs.CreateDirectory(dir_path); } + created_directories.insert(dir_path); } - static void CreateDirectories(const vector &cols, const vector &names, const vector &values, - string path, FileSystem &fs) { + string GetOrCreateDirectory(const vector &cols, const vector &names, const vector &values, + string path, FileSystem &fs) { CreateDir(path, fs); - for (idx_t i = 0; i < cols.size(); i++) { const auto &partition_col_name = names[cols[i]]; const auto &partition_value = values[i]; @@ -74,32 +78,6 @@ class CopyToFunctionGlobalState : public GlobalSinkState { path = fs.JoinPath(path, p_dir); CreateDir(path, fs); } - } - - void CreatePartitionDirectories(ClientContext &context, const PhysicalCopyToFile &op) { - auto &fs = FileSystem::GetFileSystem(context); - - auto trimmed_path = op.GetTrimmedPath(context); - - auto l = lock.GetExclusiveLock(); - lock_guard global_lock_on_partition_state(partition_state->lock); - const auto &global_partitions = partition_state->partitions; - // global_partitions have partitions added only at the back, so it's fine to only traverse the last part - - for (idx_t i = created_directories; i < global_partitions.size(); i++) { - CreateDirectories(op.partition_columns, op.names, global_partitions[i]->first.values, trimmed_path, fs); - } - created_directories = global_partitions.size(); - } - - static string GetDirectory(const vector &cols, const vector &names, const vector &values, - string path, FileSystem &fs) { - for (idx_t i = 0; i < cols.size(); i++) { - const auto &partition_col_name = names[cols[i]]; - const auto &partition_value = values[i]; - string p_dir = partition_col_name + "=" + partition_value.ToString(); - path = fs.JoinPath(path, p_dir); - } return path; } @@ -132,12 +110,8 @@ class CopyToFunctionGlobalState : public GlobalSinkState { auto &fs = FileSystem::GetFileSystem(context.client); // Create a writer for the current file auto trimmed_path = op.GetTrimmedPath(context.client); - string hive_path = GetDirectory(op.partition_columns, op.names, values, trimmed_path, fs); + string hive_path = GetOrCreateDirectory(op.partition_columns, op.names, values, trimmed_path, fs); string full_path(op.filename_pattern.CreateFilename(fs, hive_path, op.file_extension, 0)); - if (fs.FileExists(full_path) && !op.overwrite_or_ignore) { - throw IOException("failed to create %s, file exists! Enable OVERWRITE_OR_IGNORE option to force writing", - full_path); - } // initialize writes auto info = make_uniq(); info->global_state = op.function.copy_to_initialize_global(context.client, *op.bind_data, full_path); @@ -161,8 +135,7 @@ string PhysicalCopyToFile::GetTrimmedPath(ClientContext &context) const { class CopyToFunctionLocalState : public LocalSinkState { public: - explicit CopyToFunctionLocalState(unique_ptr local_state) - : local_state(std::move(local_state)), writer_offset(0) { + explicit CopyToFunctionLocalState(unique_ptr local_state) : local_state(std::move(local_state)) { } unique_ptr global_state; unique_ptr local_state; @@ -171,7 +144,6 @@ class CopyToFunctionLocalState : public LocalSinkState { unique_ptr part_buffer; unique_ptr part_buffer_append_state; - idx_t writer_offset; idx_t append_count = 0; void InitializeAppendState(ClientContext &context, const PhysicalCopyToFile &op, @@ -211,12 +183,13 @@ class CopyToFunctionLocalState : public LocalSinkState { auto &partitions = part_buffer->GetPartitions(); auto partition_key_map = part_buffer->GetReverseMap(); - // ensure all partition directories are created before we start writing - g.CreatePartitionDirectories(context.client, op); - for (idx_t i = 0; i < partitions.size(); i++) { + auto entry = partition_key_map.find(i); + if (entry == partition_key_map.end()) { + continue; + } // get the partition write info for this buffer - auto &info = g.GetPartitionWriteInfo(context, op, partition_key_map[i]->values); + auto &info = g.GetPartitionWriteInfo(context, op, entry->second->values); auto local_copy_state = op.function.copy_to_initialize_local(context, *op.bind_data); // push the chunks into the write state @@ -237,9 +210,6 @@ unique_ptr PhysicalCopyToFile::CreateFileState(ClientContext idx_t this_file_offset = g.last_file_offset++; auto &fs = FileSystem::GetFileSystem(context); string output_path(filename_pattern.CreateFilename(fs, file_path, file_extension, this_file_offset)); - if (fs.FileExists(output_path) && !overwrite_or_ignore) { - throw IOException("%s exists! Enable OVERWRITE_OR_IGNORE option to force writing", output_path); - } return function.copy_to_initialize_global(context, *bind_data, output_path); } @@ -248,7 +218,6 @@ unique_ptr PhysicalCopyToFile::GetLocalSinkState(ExecutionContex auto &g = sink_state->Cast(); auto state = make_uniq(nullptr); - state->writer_offset = g.last_file_offset++; state->InitializeAppendState(context.client, *this, g); return std::move(state); } @@ -259,23 +228,64 @@ unique_ptr PhysicalCopyToFile::GetLocalSinkState(ExecutionContex return std::move(res); } +void CheckDirectory(FileSystem &fs, const string &file_path, bool overwrite) { + if (fs.IsRemoteFile(file_path) && overwrite) { + // we only remove files for local file systems + // as remote file systems (e.g. S3) do not support RemoveFile + return; + } + vector file_list; + vector directory_list; + directory_list.push_back(file_path); + for (idx_t dir_idx = 0; dir_idx < directory_list.size(); dir_idx++) { + auto directory = directory_list[dir_idx]; + fs.ListFiles(directory, [&](const string &path, bool is_directory) { + auto full_path = fs.JoinPath(directory, path); + if (is_directory) { + directory_list.emplace_back(std::move(full_path)); + } else { + file_list.emplace_back(std::move(full_path)); + } + }); + } + if (file_list.empty()) { + return; + } + if (overwrite) { + for (auto &file : file_list) { + fs.RemoveFile(file); + } + } else { + throw IOException("Directory \"%s\" is not empty! Enable OVERWRITE_OR_IGNORE option to force writing", + file_path); + } +} + unique_ptr PhysicalCopyToFile::GetGlobalSinkState(ClientContext &context) const { if (partition_output || per_thread_output || file_size_bytes.IsValid()) { auto &fs = FileSystem::GetFileSystem(context); - - if (fs.FileExists(file_path) && !overwrite_or_ignore) { - throw IOException("%s exists! Enable OVERWRITE_OR_IGNORE option to force writing", file_path); + if (fs.FileExists(file_path)) { + // the target file exists AND is a file (not a directory) + if (fs.IsRemoteFile(file_path)) { + // for remote files we cannot do anything - as we cannot delete the file + throw IOException("Cannot write to \"%s\" - it exists and is a file, not a directory!", file_path); + } else { + // for local files we can remove the file if OVERWRITE_OR_IGNORE is enabled + if (overwrite_or_ignore) { + fs.RemoveFile(file_path); + } else { + throw IOException("Cannot write to \"%s\" - it exists and is a file, not a directory! Enable " + "OVERWRITE_OR_IGNORE option to force writing", + file_path); + } + } } + // what if the target exists and is a directory if (!fs.DirectoryExists(file_path)) { fs.CreateDirectory(file_path); - } else if (!overwrite_or_ignore) { - idx_t n_files = 0; - fs.ListFiles(file_path, [&n_files](const string &path, bool) { n_files++; }); - if (n_files > 0) { - throw IOException("Directory %s is not empty! Enable OVERWRITE_OR_IGNORE option to force writing", - file_path); - } + } else { + CheckDirectory(fs, file_path, overwrite_or_ignore); } auto state = make_uniq(nullptr); @@ -284,7 +294,7 @@ unique_ptr PhysicalCopyToFile::GetGlobalSinkState(ClientContext } if (partition_output) { - state->partition_state = make_shared(); + state->partition_state = make_shared_ptr(); } return std::move(state); @@ -423,7 +433,7 @@ SourceResultType PhysicalCopyToFile::GetData(ExecutionContext &context, DataChun auto &g = sink_state->Cast(); chunk.SetCardinality(1); - chunk.SetValue(0, 0, Value::BIGINT(g.rows_copied)); + chunk.SetValue(0, 0, Value::BIGINT(NumericCast(g.rows_copied.load()))); return SourceResultType::FINISHED; } diff --git a/src/duckdb/src/execution/operator/persistent/physical_delete.cpp b/src/duckdb/src/execution/operator/persistent/physical_delete.cpp index 42085f0e..ec832aa2 100644 --- a/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +++ b/src/duckdb/src/execution/operator/persistent/physical_delete.cpp @@ -6,9 +6,18 @@ #include "duckdb/storage/data_table.hpp" #include "duckdb/storage/table/scan_state.hpp" #include "duckdb/transaction/duck_transaction.hpp" +#include "duckdb/storage/table/delete_state.hpp" +#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp" namespace duckdb { +PhysicalDelete::PhysicalDelete(vector types, TableCatalogEntry &tableref, DataTable &table, + vector> bound_constraints, idx_t row_id_index, + idx_t estimated_cardinality, bool return_chunk) + : PhysicalOperator(PhysicalOperatorType::DELETE_OPERATOR, std::move(types), estimated_cardinality), + tableref(tableref), table(table), bound_constraints(std::move(bound_constraints)), row_id_index(row_id_index), + return_chunk(return_chunk) { +} //===--------------------------------------------------------------------===// // Sink //===--------------------------------------------------------------------===// @@ -25,10 +34,13 @@ class DeleteGlobalState : public GlobalSinkState { class DeleteLocalState : public LocalSinkState { public: - DeleteLocalState(Allocator &allocator, const vector &table_types) { - delete_chunk.Initialize(allocator, table_types); + DeleteLocalState(ClientContext &context, TableCatalogEntry &table, + const vector> &bound_constraints) { + delete_chunk.Initialize(Allocator::Get(context), table.GetTypes()); + delete_state = table.GetStorage().InitializeDelete(table, context, bound_constraints); } DataChunk delete_chunk; + unique_ptr delete_state; }; SinkResultType PhysicalDelete::Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const { @@ -40,7 +52,7 @@ SinkResultType PhysicalDelete::Sink(ExecutionContext &context, DataChunk &chunk, auto &row_identifiers = chunk.data[row_id_index]; vector column_ids; - for (idx_t i = 0; i < table.column_definitions.size(); i++) { + for (idx_t i = 0; i < table.ColumnCount(); i++) { column_ids.emplace_back(i); }; auto cfs = ColumnFetchState(); @@ -52,8 +64,7 @@ SinkResultType PhysicalDelete::Sink(ExecutionContext &context, DataChunk &chunk, table.Fetch(transaction, ustate.delete_chunk, column_ids, row_identifiers, chunk.size(), cfs); gstate.return_collection.Append(ustate.delete_chunk); } - gstate.deleted_count += table.Delete(tableref, context.client, row_identifiers, chunk.size()); - + gstate.deleted_count += table.Delete(*ustate.delete_state, context.client, row_identifiers, chunk.size()); return SinkResultType::NEED_MORE_INPUT; } @@ -62,7 +73,7 @@ unique_ptr PhysicalDelete::GetGlobalSinkState(ClientContext &co } unique_ptr PhysicalDelete::GetLocalSinkState(ExecutionContext &context) const { - return make_uniq(Allocator::Get(context.client), table.GetTypes()); + return make_uniq(context.client, tableref, bound_constraints); } //===--------------------------------------------------------------------===// @@ -91,7 +102,7 @@ SourceResultType PhysicalDelete::GetData(ExecutionContext &context, DataChunk &c auto &g = sink_state->Cast(); if (!return_chunk) { chunk.SetCardinality(1); - chunk.SetValue(0, 0, Value::BIGINT(g.deleted_count)); + chunk.SetValue(0, 0, Value::BIGINT(NumericCast(g.deleted_count))); return SourceResultType::FINISHED; } diff --git a/src/duckdb/src/execution/operator/persistent/physical_export.cpp b/src/duckdb/src/execution/operator/persistent/physical_export.cpp index 3979a88e..ccb9cd31 100644 --- a/src/duckdb/src/execution/operator/persistent/physical_export.cpp +++ b/src/duckdb/src/execution/operator/persistent/physical_export.cpp @@ -17,12 +17,23 @@ namespace duckdb { using std::stringstream; -static void WriteCatalogEntries(stringstream &ss, vector> &entries) { +void ReorderTableEntries(catalog_entry_vector_t &tables); + +static void WriteCatalogEntries(stringstream &ss, catalog_entry_vector_t &entries) { for (auto &entry : entries) { if (entry.get().internal) { continue; } - ss << entry.get().ToSQL() << '\n'; + auto create_info = entry.get().GetInfo(); + try { + // Strip the catalog from the info + create_info->catalog.clear(); + auto to_string = create_info->ToString(); + ss << to_string; + } catch (const NotImplementedException &) { + ss << entry.get().ToSQL(); + } + ss << '\n'; } ss << '\n'; } @@ -31,7 +42,7 @@ static void WriteStringStreamToFile(FileSystem &fs, stringstream &ss, const stri auto ss_string = ss.str(); auto handle = fs.OpenFile(path, FileFlags::FILE_FLAGS_WRITE | FileFlags::FILE_FLAGS_FILE_CREATE_NEW | FileLockType::WRITE_LOCK); - fs.Write(*handle, (void *)ss_string.c_str(), ss_string.size()); + fs.Write(*handle, (void *)ss_string.c_str(), NumericCast(ss_string.size())); handle.reset(); } @@ -39,13 +50,13 @@ static void WriteCopyStatement(FileSystem &fs, stringstream &ss, CopyInfo &info, CopyFunction const &function) { ss << "COPY "; - if (exported_table.schema_name != DEFAULT_SCHEMA) { + //! NOTE: The catalog is explicitly not set here + if (exported_table.schema_name != DEFAULT_SCHEMA && !exported_table.schema_name.empty()) { ss << KeywordHelper::WriteOptionallyQuoted(exported_table.schema_name) << "."; } auto file_path = StringUtil::Replace(exported_table.file_path, "\\", "/"); ss << StringUtil::Format("%s FROM %s (", SQLIdentifier(exported_table.table_name), SQLString(file_path)); - // write the copy options ss << "FORMAT '" << info.format << "'"; if (info.format == "csv") { @@ -60,6 +71,10 @@ static void WriteCopyStatement(FileSystem &fs, stringstream &ss, CopyInfo &info, if (info.options.find("quote") == info.options.end()) { info.options["quote"].push_back(Value("\"")); } + info.options.erase("force_not_null"); + for (auto ¬_null_column : exported_table.not_null_columns) { + info.options["force_not_null"].push_back(not_null_column); + } } for (auto ©_option : info.options) { if (copy_option.first == "force_quote") { @@ -73,8 +88,15 @@ static void WriteCopyStatement(FileSystem &fs, stringstream &ss, CopyInfo &info, if (copy_option.second.size() == 1) { ss << copy_option.second[0].ToSQLString(); } else { - // FIXME handle multiple options - throw NotImplementedException("FIXME: serialize list of options"); + // For Lists + ss << "("; + for (idx_t i = 0; i < copy_option.second.size(); i++) { + ss << copy_option.second[i].ToSQLString(); + if (i != copy_option.second.size() - 1) { + ss << ", "; + } + } + ss << ")"; } } ss << ");" << '\n'; @@ -113,11 +135,24 @@ void PhysicalExport::ExtractEntries(ClientContext &context, vector &lhs, const reference &rhs) { + return lhs.get().oid < rhs.get().oid; + }); + + catalog_entry_vector_t catalog_entries; + idx_t size = 0; + size += entries.schemas.size(); + size += entries.custom_types.size(); + size += entries.sequences.size(); + size += entries.tables.size(); + size += entries.views.size(); + size += entries.indexes.size(); + size += entries.macros.size(); + catalog_entries.reserve(size); + AddEntries(catalog_entries, entries.schemas); + AddEntries(catalog_entries, entries.sequences); + AddEntries(catalog_entries, entries.custom_types); + AddEntries(catalog_entries, entries.tables); + AddEntries(catalog_entries, entries.macros); + AddEntries(catalog_entries, entries.views); + AddEntries(catalog_entries, entries.indexes); + return catalog_entries; +} + SourceResultType PhysicalExport::GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const { auto &state = input.global_state.Cast(); diff --git a/src/duckdb/src/execution/operator/persistent/physical_insert.cpp b/src/duckdb/src/execution/operator/persistent/physical_insert.cpp index fd17fbb8..25ab4819 100644 --- a/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +++ b/src/duckdb/src/execution/operator/persistent/physical_insert.cpp @@ -17,25 +17,24 @@ #include "duckdb/execution/index/art/art.hpp" #include "duckdb/transaction/duck_transaction.hpp" #include "duckdb/storage/table/append_state.hpp" +#include "duckdb/storage/table/update_state.hpp" namespace duckdb { -PhysicalInsert::PhysicalInsert(vector types_p, TableCatalogEntry &table, - physical_index_vector_t column_index_map, - vector> bound_defaults, - vector> set_expressions, vector set_columns, - vector set_types, idx_t estimated_cardinality, bool return_chunk, - bool parallel, OnConflictAction action_type, - unique_ptr on_conflict_condition_p, - unique_ptr do_update_condition_p, unordered_set conflict_target_p, - vector columns_to_fetch_p) +PhysicalInsert::PhysicalInsert( + vector types_p, TableCatalogEntry &table, physical_index_vector_t column_index_map, + vector> bound_defaults, vector> bound_constraints_p, + vector> set_expressions, vector set_columns, vector set_types, + idx_t estimated_cardinality, bool return_chunk, bool parallel, OnConflictAction action_type, + unique_ptr on_conflict_condition_p, unique_ptr do_update_condition_p, + unordered_set conflict_target_p, vector columns_to_fetch_p) : PhysicalOperator(PhysicalOperatorType::INSERT, std::move(types_p), estimated_cardinality), column_index_map(std::move(column_index_map)), insert_table(&table), insert_types(table.GetTypes()), - bound_defaults(std::move(bound_defaults)), return_chunk(return_chunk), parallel(parallel), - action_type(action_type), set_expressions(std::move(set_expressions)), set_columns(std::move(set_columns)), - set_types(std::move(set_types)), on_conflict_condition(std::move(on_conflict_condition_p)), - do_update_condition(std::move(do_update_condition_p)), conflict_target(std::move(conflict_target_p)), - columns_to_fetch(std::move(columns_to_fetch_p)) { + bound_defaults(std::move(bound_defaults)), bound_constraints(std::move(bound_constraints_p)), + return_chunk(return_chunk), parallel(parallel), action_type(action_type), + set_expressions(std::move(set_expressions)), set_columns(std::move(set_columns)), set_types(std::move(set_types)), + on_conflict_condition(std::move(on_conflict_condition_p)), do_update_condition(std::move(do_update_condition_p)), + conflict_target(std::move(conflict_target_p)), columns_to_fetch(std::move(columns_to_fetch_p)) { if (action_type == OnConflictAction::THROW) { return; @@ -90,8 +89,9 @@ class InsertGlobalState : public GlobalSinkState { class InsertLocalState : public LocalSinkState { public: InsertLocalState(ClientContext &context, const vector &types, - const vector> &bound_defaults) - : default_executor(context, bound_defaults) { + const vector> &bound_defaults, + const vector> &bound_constraints) + : default_executor(context, bound_defaults), bound_constraints(bound_constraints) { insert_chunk.Initialize(Allocator::Get(context), types); } @@ -105,6 +105,15 @@ class InsertLocalState : public LocalSinkState { // Rows in the transaction-local storage that have been updated by a DO UPDATE conflict unordered_set updated_local_rows; idx_t update_count = 0; + unique_ptr constraint_state; + const vector> &bound_constraints; + + ConstraintState &GetConstraintState(DataTable &table, TableCatalogEntry &tableref) { + if (!constraint_state) { + constraint_state = table.InitializeConstraintState(tableref, bound_constraints); + } + return *constraint_state; + } }; unique_ptr PhysicalInsert::GetGlobalSinkState(ClientContext &context) const { @@ -125,7 +134,7 @@ unique_ptr PhysicalInsert::GetGlobalSinkState(ClientContext &co } unique_ptr PhysicalInsert::GetLocalSinkState(ExecutionContext &context) const { - return make_uniq(context.client, insert_types, bound_defaults); + return make_uniq(context.client, insert_types, bound_defaults, bound_constraints); } void PhysicalInsert::ResolveDefaults(const TableCatalogEntry &table, DataChunk &chunk, @@ -278,7 +287,8 @@ static idx_t PerformOnConflictAction(ExecutionContext &context, DataChunk &chunk auto &data_table = table.GetStorage(); // Perform the update, using the results of the SET expressions if (GLOBAL) { - data_table.Update(table, context.client, row_ids, set_columns, update_chunk); + auto update_state = data_table.InitializeUpdate(table, context.client, op.bound_constraints); + data_table.Update(*update_state, context.client, row_ids, set_columns, update_chunk); } else { auto &local_storage = LocalStorage::Get(context.client, data_table.db); // Perform the update, using the results of the SET expressions @@ -320,7 +330,8 @@ static idx_t HandleInsertConflicts(TableCatalogEntry &table, ExecutionContext &c ConflictInfo conflict_info(conflict_target); ConflictManager conflict_manager(VerifyExistenceType::APPEND, lstate.insert_chunk.size(), &conflict_info); if (GLOBAL) { - data_table.VerifyAppendConstraints(table, context.client, lstate.insert_chunk, &conflict_manager); + auto &constraint_state = lstate.GetConstraintState(data_table, table); + data_table.VerifyAppendConstraints(constraint_state, context.client, lstate.insert_chunk, &conflict_manager); } else { DataTable::VerifyUniqueIndexes(local_storage.GetIndexes(data_table), context.client, lstate.insert_chunk, &conflict_manager); @@ -380,7 +391,8 @@ static idx_t HandleInsertConflicts(TableCatalogEntry &table, ExecutionContext &c combined_chunk.Slice(sel.Selection(), sel.Count()); row_ids.Slice(sel.Selection(), sel.Count()); if (GLOBAL) { - data_table.VerifyAppendConstraints(table, context.client, combined_chunk, nullptr); + auto &constraint_state = lstate.GetConstraintState(data_table, table); + data_table.VerifyAppendConstraints(constraint_state, context.client, combined_chunk, nullptr); } else { DataTable::VerifyUniqueIndexes(local_storage.GetIndexes(data_table), context.client, lstate.insert_chunk, nullptr); @@ -406,7 +418,8 @@ idx_t PhysicalInsert::OnConflictHandling(TableCatalogEntry &table, ExecutionCont InsertLocalState &lstate) const { auto &data_table = table.GetStorage(); if (action_type == OnConflictAction::THROW) { - data_table.VerifyAppendConstraints(table, context.client, lstate.insert_chunk, nullptr); + auto &constraint_state = lstate.GetConstraintState(data_table, table); + data_table.VerifyAppendConstraints(constraint_state, context.client, lstate.insert_chunk, nullptr); return 0; } // Check whether any conflicts arise, and if they all meet the conflict_target + condition @@ -429,7 +442,7 @@ SinkResultType PhysicalInsert::Sink(ExecutionContext &context, DataChunk &chunk, if (!parallel) { if (!gstate.initialized) { - storage.InitializeLocalAppend(gstate.append_state, context.client); + storage.InitializeLocalAppend(gstate.append_state, table, context.client, bound_constraints); gstate.initialized = true; } @@ -440,15 +453,22 @@ SinkResultType PhysicalInsert::Sink(ExecutionContext &context, DataChunk &chunk, gstate.insert_count += lstate.insert_chunk.size(); gstate.insert_count += updated_tuples; storage.LocalAppend(gstate.append_state, table, context.client, lstate.insert_chunk, true); + + // We finalize the local append to write the segment node count. + if (action_type != OnConflictAction::THROW) { + storage.FinalizeLocalAppend(gstate.append_state); + gstate.initialized = false; + } + } else { D_ASSERT(!return_chunk); // parallel append if (!lstate.local_collection) { lock_guard l(gstate.lock); - auto &table_info = storage.info; + auto table_info = storage.GetDataTableInfo(); auto &block_manager = TableIOManager::Get(storage).GetBlockManagerForRowData(); - lstate.local_collection = - make_uniq(table_info, block_manager, insert_types, MAX_ROW_ID); + lstate.local_collection = make_uniq(std::move(table_info), block_manager, insert_types, + NumericCast(MAX_ROW_ID)); lstate.local_collection->InitializeEmpty(); lstate.local_collection->InitializeAppend(lstate.local_append_state); lstate.writer = &gstate.table.GetStorage().CreateOptimisticWriter(context.client); @@ -487,7 +507,7 @@ SinkCombineResultType PhysicalInsert::Combine(ExecutionContext &context, Operato // we have few rows - append to the local storage directly auto &table = gstate.table; auto &storage = table.GetStorage(); - storage.InitializeLocalAppend(gstate.append_state, context.client); + storage.InitializeLocalAppend(gstate.append_state, table, context.client, bound_constraints); auto &transaction = DuckTransaction::Get(context.client, table.catalog); lstate.local_collection->Scan(transaction, [&](DataChunk &insert_chunk) { storage.LocalAppend(gstate.append_state, table, context.client, insert_chunk); @@ -540,7 +560,7 @@ SourceResultType PhysicalInsert::GetData(ExecutionContext &context, DataChunk &c auto &insert_gstate = sink_state->Cast(); if (!return_chunk) { chunk.SetCardinality(1); - chunk.SetValue(0, 0, Value::BIGINT(insert_gstate.insert_count)); + chunk.SetValue(0, 0, Value::BIGINT(NumericCast(insert_gstate.insert_count))); return SourceResultType::FINISHED; } diff --git a/src/duckdb/src/execution/operator/persistent/physical_update.cpp b/src/duckdb/src/execution/operator/persistent/physical_update.cpp index fb7f1c30..8dc66343 100644 --- a/src/duckdb/src/execution/operator/persistent/physical_update.cpp +++ b/src/duckdb/src/execution/operator/persistent/physical_update.cpp @@ -8,16 +8,20 @@ #include "duckdb/parallel/thread_context.hpp" #include "duckdb/planner/expression/bound_reference_expression.hpp" #include "duckdb/storage/data_table.hpp" +#include "duckdb/storage/table/delete_state.hpp" +#include "duckdb/storage/table/update_state.hpp" namespace duckdb { PhysicalUpdate::PhysicalUpdate(vector types, TableCatalogEntry &tableref, DataTable &table, vector columns, vector> expressions, - vector> bound_defaults, idx_t estimated_cardinality, + vector> bound_defaults, + vector> bound_constraints, idx_t estimated_cardinality, bool return_chunk) : PhysicalOperator(PhysicalOperatorType::UPDATE, std::move(types), estimated_cardinality), tableref(tableref), table(table), columns(std::move(columns)), expressions(std::move(expressions)), - bound_defaults(std::move(bound_defaults)), return_chunk(return_chunk) { + bound_defaults(std::move(bound_defaults)), bound_constraints(std::move(bound_constraints)), + return_chunk(return_chunk) { } //===--------------------------------------------------------------------===// @@ -38,8 +42,9 @@ class UpdateGlobalState : public GlobalSinkState { class UpdateLocalState : public LocalSinkState { public: UpdateLocalState(ClientContext &context, const vector> &expressions, - const vector &table_types, const vector> &bound_defaults) - : default_executor(context, bound_defaults) { + const vector &table_types, const vector> &bound_defaults, + const vector> &bound_constraints) + : default_executor(context, bound_defaults), bound_constraints(bound_constraints) { // initialize the update chunk auto &allocator = Allocator::Get(context); vector update_types; @@ -55,6 +60,23 @@ class UpdateLocalState : public LocalSinkState { DataChunk update_chunk; DataChunk mock_chunk; ExpressionExecutor default_executor; + unique_ptr delete_state; + unique_ptr update_state; + const vector> &bound_constraints; + + TableDeleteState &GetDeleteState(DataTable &table, TableCatalogEntry &tableref, ClientContext &context) { + if (!delete_state) { + delete_state = table.InitializeDelete(tableref, context, bound_constraints); + } + return *delete_state; + } + + TableUpdateState &GetUpdateState(DataTable &table, TableCatalogEntry &tableref, ClientContext &context) { + if (!update_state) { + update_state = table.InitializeUpdate(tableref, context, bound_constraints); + } + return *update_state; + } }; SinkResultType PhysicalUpdate::Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const { @@ -106,13 +128,14 @@ SinkResultType PhysicalUpdate::Sink(ExecutionContext &context, DataChunk &chunk, // we need to slice here update_chunk.Slice(sel, update_count); } - table.Delete(tableref, context.client, row_ids, update_chunk.size()); + auto &delete_state = lstate.GetDeleteState(table, tableref, context.client); + table.Delete(delete_state, context.client, row_ids, update_chunk.size()); // for the append we need to arrange the columns in a specific manner (namely the "standard table order") mock_chunk.SetCardinality(update_chunk); for (idx_t i = 0; i < columns.size(); i++) { mock_chunk.data[columns[i].index].Reference(update_chunk.data[i]); } - table.LocalAppend(tableref, context.client, mock_chunk); + table.LocalAppend(tableref, context.client, mock_chunk, bound_constraints); } else { if (return_chunk) { mock_chunk.SetCardinality(update_chunk); @@ -120,7 +143,8 @@ SinkResultType PhysicalUpdate::Sink(ExecutionContext &context, DataChunk &chunk, mock_chunk.data[columns[i].index].Reference(update_chunk.data[i]); } } - table.Update(tableref, context.client, row_ids, columns, update_chunk); + auto &update_state = lstate.GetUpdateState(table, tableref, context.client); + table.Update(update_state, context.client, row_ids, columns, update_chunk); } if (return_chunk) { @@ -137,7 +161,8 @@ unique_ptr PhysicalUpdate::GetGlobalSinkState(ClientContext &co } unique_ptr PhysicalUpdate::GetLocalSinkState(ExecutionContext &context) const { - return make_uniq(context.client, expressions, table.GetTypes(), bound_defaults); + return make_uniq(context.client, expressions, table.GetTypes(), bound_defaults, + bound_constraints); } SinkCombineResultType PhysicalUpdate::Combine(ExecutionContext &context, OperatorSinkCombineInput &input) const { @@ -175,7 +200,7 @@ SourceResultType PhysicalUpdate::GetData(ExecutionContext &context, DataChunk &c auto &g = sink_state->Cast(); if (!return_chunk) { chunk.SetCardinality(1); - chunk.SetValue(0, 0, Value::BIGINT(g.updated_count)); + chunk.SetValue(0, 0, Value::BIGINT(NumericCast(g.updated_count))); return SourceResultType::FINISHED; } diff --git a/src/duckdb/src/execution/operator/projection/physical_unnest.cpp b/src/duckdb/src/execution/operator/projection/physical_unnest.cpp index 356b2272..2d5421a7 100644 --- a/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +++ b/src/duckdb/src/execution/operator/projection/physical_unnest.cpp @@ -204,6 +204,9 @@ static void UnnestVector(UnifiedVectorFormat &child_vector_data, Vector &child_v } break; } + case PhysicalType::ARRAY: { + throw NotImplementedException("ARRAY type not supported for UNNEST."); + } default: throw InternalException("Unimplemented type for UNNEST."); } diff --git a/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp b/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp index ca689940..1db1d5f3 100644 --- a/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +++ b/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp @@ -10,9 +10,8 @@ namespace duckdb { PhysicalColumnDataScan::PhysicalColumnDataScan(vector types, PhysicalOperatorType op_type, idx_t estimated_cardinality, - unique_ptr owned_collection_p) - : PhysicalOperator(op_type, std::move(types), estimated_cardinality), collection(owned_collection_p.get()), - owned_collection(std::move(owned_collection_p)) { + optionally_owned_ptr collection_p) + : PhysicalOperator(op_type, std::move(types), estimated_cardinality), collection(std::move(collection_p)) { } PhysicalColumnDataScan::PhysicalColumnDataScan(vector types, PhysicalOperatorType op_type, diff --git a/src/duckdb/src/execution/operator/scan/physical_expression_scan.cpp b/src/duckdb/src/execution/operator/scan/physical_expression_scan.cpp index 5e08bc94..c0e91ae2 100644 --- a/src/duckdb/src/execution/operator/scan/physical_expression_scan.cpp +++ b/src/duckdb/src/execution/operator/scan/physical_expression_scan.cpp @@ -1,6 +1,7 @@ #include "duckdb/execution/operator/scan/physical_expression_scan.hpp" -#include "duckdb/parallel/thread_context.hpp" + #include "duckdb/execution/expression_executor.hpp" +#include "duckdb/parallel/thread_context.hpp" namespace duckdb { @@ -27,8 +28,7 @@ OperatorResultType PhysicalExpressionScan::Execute(ExecutionContext &context, Da for (; chunk.size() + input.size() <= STANDARD_VECTOR_SIZE && state.expression_index < expressions.size(); state.expression_index++) { state.temp_chunk.Reset(); - EvaluateExpression(context.client, state.expression_index, &input, state.temp_chunk); - chunk.Append(state.temp_chunk); + EvaluateExpression(context.client, state.expression_index, &input, chunk, &state.temp_chunk); } if (state.expression_index < expressions.size()) { return OperatorResultType::HAVE_MORE_OUTPUT; @@ -38,15 +38,30 @@ OperatorResultType PhysicalExpressionScan::Execute(ExecutionContext &context, Da } } -void PhysicalExpressionScan::EvaluateExpression(ClientContext &context, idx_t expression_idx, DataChunk *child_chunk, - DataChunk &result) const { +void PhysicalExpressionScan::EvaluateExpression(ClientContext &context, idx_t expression_idx, + optional_ptr child_chunk, DataChunk &result, + optional_ptr temp_chunk_ptr) const { + if (temp_chunk_ptr) { + EvaluateExpressionInternal(context, expression_idx, child_chunk, result, *temp_chunk_ptr); + } else { + DataChunk temp_chunk; + temp_chunk.Initialize(Allocator::Get(context), GetTypes()); + EvaluateExpressionInternal(context, expression_idx, child_chunk, result, temp_chunk); + } +} + +void PhysicalExpressionScan::EvaluateExpressionInternal(ClientContext &context, idx_t expression_idx, + optional_ptr child_chunk, DataChunk &result, + DataChunk &temp_chunk) const { ExpressionExecutor executor(context, expressions[expression_idx]); if (child_chunk) { child_chunk->Verify(); - executor.Execute(*child_chunk, result); + executor.Execute(*child_chunk, temp_chunk); } else { - executor.Execute(result); + executor.Execute(temp_chunk); } + // Need to append because "executor" might be holding state (e.g., strings), which go out of scope here + result.Append(temp_chunk); } bool PhysicalExpressionScan::IsFoldable() const { diff --git a/src/duckdb/src/execution/operator/schema/physical_attach.cpp b/src/duckdb/src/execution/operator/schema/physical_attach.cpp index c60e9b75..2c2b76a0 100644 --- a/src/duckdb/src/execution/operator/schema/physical_attach.cpp +++ b/src/duckdb/src/execution/operator/schema/physical_attach.cpp @@ -99,7 +99,7 @@ SourceResultType PhysicalAttach::GetData(ExecutionContext &context, DataChunk &c // get the database type and attach the database db_manager.GetDatabaseType(context.client, db_type, *info, config, unrecognized_option); auto attached_db = db_manager.AttachDatabase(context.client, *info, db_type, access_mode); - attached_db->Initialize(&context.client); + attached_db->Initialize(); return SourceResultType::FINISHED; } diff --git a/src/duckdb/src/execution/operator/schema/physical_create_art_index.cpp b/src/duckdb/src/execution/operator/schema/physical_create_art_index.cpp index e7325405..90eceacf 100644 --- a/src/duckdb/src/execution/operator/schema/physical_create_art_index.cpp +++ b/src/duckdb/src/execution/operator/schema/physical_create_art_index.cpp @@ -4,9 +4,9 @@ #include "duckdb/catalog/catalog_entry/duck_table_entry.hpp" #include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp" #include "duckdb/execution/index/art/art_key.hpp" +#include "duckdb/execution/index/bound_index.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/main/database_manager.hpp" -#include "duckdb/storage/index.hpp" #include "duckdb/storage/storage_manager.hpp" #include "duckdb/storage/table/append_state.hpp" #include "duckdb/common/exception/transaction_exception.hpp" @@ -34,14 +34,14 @@ PhysicalCreateARTIndex::PhysicalCreateARTIndex(LogicalOperator &op, TableCatalog class CreateARTIndexGlobalSinkState : public GlobalSinkState { public: //! Global index to be added to the table - unique_ptr global_index; + unique_ptr global_index; }; class CreateARTIndexLocalSinkState : public LocalSinkState { public: explicit CreateARTIndexLocalSinkState(ClientContext &context) : arena_allocator(Allocator::Get(context)) {}; - unique_ptr local_index; + unique_ptr local_index; ArenaAllocator arena_allocator; vector keys; DataChunk key_chunk; @@ -104,9 +104,9 @@ SinkResultType PhysicalCreateARTIndex::SinkSorted(Vector &row_identifiers, Opera auto &l_index = l_state.local_index; // create an ART from the chunk - auto art = - make_uniq(info->index_name, l_index->index_constraint_type, l_index->column_ids, l_index->table_io_manager, - l_index->unbound_expressions, storage.db, l_index->Cast().allocators); + auto art = make_uniq(info->index_name, l_index->GetConstraintType(), l_index->GetColumnIds(), + l_index->table_io_manager, l_index->unbound_expressions, storage.db, + l_index->Cast().allocators); if (!art->ConstructFromSorted(l_state.key_chunk.size(), l_state.keys, row_identifiers)) { throw ConstraintException("Data contains duplicates on indexed column(s)"); } @@ -169,7 +169,7 @@ SinkFinalizeType PhysicalCreateARTIndex::Finalize(Pipeline &pipeline, Event &eve auto &schema = table.schema; info->column_ids = storage_ids; - auto index_entry = schema.CreateIndex(context, *info, table).get(); + auto index_entry = schema.CreateIndex(schema.GetCatalogTransaction(context), *info, table).get(); if (!index_entry) { D_ASSERT(info->on_conflict == OnCreateConflict::IGNORE_ON_CONFLICT); // index already exists, but error ignored because of IF NOT EXISTS @@ -178,13 +178,13 @@ SinkFinalizeType PhysicalCreateARTIndex::Finalize(Pipeline &pipeline, Event &eve auto &index = index_entry->Cast(); index.initial_index_size = state.global_index->GetInMemorySize(); - index.info = make_shared(storage.info, index.name); + index.info = make_shared_ptr(storage.GetDataTableInfo(), index.name); for (auto &parsed_expr : info->parsed_expressions) { index.parsed_expressions.push_back(parsed_expr->Copy()); } // add index to storage - storage.info->indexes.AddIndex(std::move(state.global_index)); + storage.AddIndex(std::move(state.global_index)); return SinkFinalizeType::READY; } diff --git a/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp b/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp index 57a847dd..406299ac 100644 --- a/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +++ b/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp @@ -200,7 +200,7 @@ void PhysicalRecursiveCTE::BuildPipelines(Pipeline ¤t, MetaPipeline &meta_ initial_state_pipeline.Build(*children[0]); // the RHS is the recursive pipeline - recursive_meta_pipeline = make_shared(executor, state, this); + recursive_meta_pipeline = make_shared_ptr(executor, state, this); recursive_meta_pipeline->SetRecursiveCTE(); recursive_meta_pipeline->Build(*children[1]); diff --git a/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp b/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp index da7c2019..ba8e366e 100644 --- a/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +++ b/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp @@ -64,7 +64,7 @@ static void ComputeGroupLocationTemplated(UnifiedVectorFormat &group_data, Value // we only need to handle non-null values here if (group_data.validity.RowIsValid(index)) { D_ASSERT(data[index] >= min_val); - uintptr_t adjusted_value = (data[index] - min_val) + 1; + auto adjusted_value = UnsafeNumericCast((data[index] - min_val) + 1); address_data[i] += adjusted_value << current_shift; } } @@ -72,7 +72,7 @@ static void ComputeGroupLocationTemplated(UnifiedVectorFormat &group_data, Value // no null values: we can directly compute the addresses for (idx_t i = 0; i < count; i++) { auto index = group_data.sel->get_index(i); - uintptr_t adjusted_value = (data[index] - min_val) + 1; + auto adjusted_value = UnsafeNumericCast((data[index] - min_val) + 1); address_data[i] += adjusted_value << current_shift; } } @@ -149,7 +149,7 @@ void PerfectAggregateHashTable::AddChunk(DataChunk &groups, DataChunk &payload) } // move to the next aggregate payload_idx += input_count; - VectorOperations::AddInPlace(addresses, aggregate.payload_size, payload.size()); + VectorOperations::AddInPlace(addresses, UnsafeNumericCast(aggregate.payload_size), payload.size()); } } @@ -205,7 +205,8 @@ static void ReconstructGroupVectorTemplated(uint32_t group_values[], Value &min, validity_mask.SetInvalid(i); } else { // otherwise we add the value (minus 1) to the min value - data[i] = UnsafeNumericCast(min_data + group_index - 1); + data[i] = UnsafeNumericCast(UnsafeNumericCast(min_data) + + UnsafeNumericCast(group_index) - 1); } } } diff --git a/src/duckdb/src/execution/physical_operator.cpp b/src/duckdb/src/execution/physical_operator.cpp index ba5ba3e2..4934789e 100644 --- a/src/duckdb/src/execution/physical_operator.cpp +++ b/src/duckdb/src/execution/physical_operator.cpp @@ -122,8 +122,8 @@ unique_ptr PhysicalOperator::GetGlobalSinkState(ClientContext & idx_t PhysicalOperator::GetMaxThreadMemory(ClientContext &context) { // Memory usage per thread should scale with max mem / num threads // We take 1/4th of this, to be conservative - idx_t max_memory = BufferManager::GetBufferManager(context).GetQueryMaxMemory(); - idx_t num_threads = TaskScheduler::GetScheduler(context).NumberOfThreads(); + auto max_memory = BufferManager::GetBufferManager(context).GetQueryMaxMemory(); + auto num_threads = NumericCast(TaskScheduler::GetScheduler(context).NumberOfThreads()); return (max_memory / num_threads) / 4; } diff --git a/src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp b/src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp index 49e23c6f..46305675 100644 --- a/src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp @@ -8,10 +8,8 @@ unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalColumnData D_ASSERT(op.children.size() == 0); D_ASSERT(op.collection); - // create a PhysicalChunkScan pointing towards the owned collection - auto chunk_scan = make_uniq(op.types, PhysicalOperatorType::COLUMN_DATA_SCAN, - op.estimated_cardinality, std::move(op.collection)); - return std::move(chunk_scan); + return make_uniq(op.types, PhysicalOperatorType::COLUMN_DATA_SCAN, op.estimated_cardinality, + std::move(op.collection)); } } // namespace duckdb diff --git a/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp b/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp index 3397a060..743f8189 100644 --- a/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp @@ -109,7 +109,7 @@ void CheckForPerfectJoinOpt(LogicalComparisonJoin &op, PerfectHashJoinStats &joi join_state.build_min = NumericStats::Min(stats_build); join_state.build_max = NumericStats::Max(stats_build); join_state.estimated_cardinality = op.estimated_cardinality; - join_state.build_range = build_range; + join_state.build_range = NumericCast(build_range); if (join_state.build_range > MAX_BUILD_SIZE) { return; } diff --git a/src/duckdb/src/execution/physical_plan/plan_create_table.cpp b/src/duckdb/src/execution/physical_plan/plan_create_table.cpp index be854e0d..06b728ee 100644 --- a/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_create_table.cpp @@ -22,10 +22,10 @@ unique_ptr DuckCatalog::PlanCreateTableAs(ClientContext &conte auto num_threads = TaskScheduler::GetScheduler(context).NumberOfThreads(); unique_ptr create; if (!parallel_streaming_insert && use_batch_index) { - create = make_uniq(op, op.schema, std::move(op.info), 0); + create = make_uniq(op, op.schema, std::move(op.info), 0U); } else { - create = make_uniq(op, op.schema, std::move(op.info), 0, + create = make_uniq(op, op.schema, std::move(op.info), 0U, parallel_streaming_insert && num_threads > 1); } diff --git a/src/duckdb/src/execution/physical_plan/plan_cte.cpp b/src/duckdb/src/execution/physical_plan/plan_cte.cpp index f323aed4..190cb931 100644 --- a/src/duckdb/src/execution/physical_plan/plan_cte.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_cte.cpp @@ -12,7 +12,7 @@ unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalMaterializ D_ASSERT(op.children.size() == 2); // Create the working_table that the PhysicalCTE will use for evaluation. - auto working_table = std::make_shared(context, op.children[0]->types); + auto working_table = make_shared_ptr(context, op.children[0]->types); // Add the ColumnDataCollection to the context of this PhysicalPlanGenerator recursive_cte_tables[op.table_index] = working_table; diff --git a/src/duckdb/src/execution/physical_plan/plan_delete.cpp b/src/duckdb/src/execution/physical_plan/plan_delete.cpp index 3a748c00..7550da08 100644 --- a/src/duckdb/src/execution/physical_plan/plan_delete.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_delete.cpp @@ -12,8 +12,8 @@ unique_ptr DuckCatalog::PlanDelete(ClientContext &context, Log // get the index of the row_id column auto &bound_ref = op.expressions[0]->Cast(); - auto del = make_uniq(op.types, op.table, op.table.GetStorage(), bound_ref.index, - op.estimated_cardinality, op.return_chunk); + auto del = make_uniq(op.types, op.table, op.table.GetStorage(), std::move(op.bound_constraints), + bound_ref.index, op.estimated_cardinality, op.return_chunk); del->children.push_back(std::move(plan)); return std::move(del); } diff --git a/src/duckdb/src/execution/physical_plan/plan_delim_get.cpp b/src/duckdb/src/execution/physical_plan/plan_delim_get.cpp index 32ddeb2f..1b45efe2 100644 --- a/src/duckdb/src/execution/physical_plan/plan_delim_get.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_delim_get.cpp @@ -8,8 +8,8 @@ unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalDelimGet & D_ASSERT(op.children.empty()); // create a PhysicalChunkScan without an owned_collection, the collection will be added later - auto chunk_scan = - make_uniq(op.types, PhysicalOperatorType::DELIM_SCAN, op.estimated_cardinality); + auto chunk_scan = make_uniq(op.types, PhysicalOperatorType::DELIM_SCAN, + op.estimated_cardinality, nullptr); return std::move(chunk_scan); } diff --git a/src/duckdb/src/execution/physical_plan/plan_distinct.cpp b/src/duckdb/src/execution/physical_plan/plan_distinct.cpp index e0bb12d6..355169c3 100644 --- a/src/duckdb/src/execution/physical_plan/plan_distinct.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_distinct.cpp @@ -67,6 +67,7 @@ unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalDistinct & bool changes_made = false; auto new_expr = OrderedAggregateOptimizer::Apply(context, *first_aggregate, groups, changes_made); if (new_expr) { + D_ASSERT(new_expr->return_type == first_aggregate->return_type); D_ASSERT(new_expr->type == ExpressionType::BOUND_AGGREGATE); first_aggregate = unique_ptr_cast(std::move(new_expr)); } diff --git a/src/duckdb/src/execution/physical_plan/plan_expression_get.cpp b/src/duckdb/src/execution/physical_plan/plan_expression_get.cpp index b0db627e..b6372674 100644 --- a/src/duckdb/src/execution/physical_plan/plan_expression_get.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_expression_get.cpp @@ -19,19 +19,18 @@ unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalExpression // simple expression scan (i.e. no subqueries to evaluate and no prepared statement parameters) // we can evaluate all the expressions right now and turn this into a chunk collection scan auto chunk_scan = make_uniq(op.types, PhysicalOperatorType::COLUMN_DATA_SCAN, - expr_scan->expressions.size()); - chunk_scan->owned_collection = make_uniq(context, op.types); - chunk_scan->collection = chunk_scan->owned_collection.get(); + expr_scan->expressions.size(), + make_uniq(context, op.types)); DataChunk chunk; chunk.Initialize(allocator, op.types); ColumnDataAppendState append_state; - chunk_scan->owned_collection->InitializeAppend(append_state); + chunk_scan->collection->InitializeAppend(append_state); for (idx_t expression_idx = 0; expression_idx < expr_scan->expressions.size(); expression_idx++) { chunk.Reset(); expr_scan->EvaluateExpression(context, expression_idx, nullptr, chunk); - chunk_scan->owned_collection->Append(append_state, chunk); + chunk_scan->collection->Append(append_state, chunk); } return std::move(chunk_scan); } diff --git a/src/duckdb/src/execution/physical_plan/plan_insert.cpp b/src/duckdb/src/execution/physical_plan/plan_insert.cpp index 3aa87d9a..0ce031d0 100644 --- a/src/duckdb/src/execution/physical_plan/plan_insert.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_insert.cpp @@ -94,13 +94,14 @@ unique_ptr DuckCatalog::PlanInsert(ClientContext &context, Log unique_ptr insert; if (use_batch_index && !parallel_streaming_insert) { insert = make_uniq(op.types, op.table, op.column_index_map, std::move(op.bound_defaults), - op.estimated_cardinality); + std::move(op.bound_constraints), op.estimated_cardinality); } else { insert = make_uniq( - op.types, op.table, op.column_index_map, std::move(op.bound_defaults), std::move(op.expressions), - std::move(op.set_columns), std::move(op.set_types), op.estimated_cardinality, op.return_chunk, - parallel_streaming_insert && num_threads > 1, op.action_type, std::move(op.on_conflict_condition), - std::move(op.do_update_condition), std::move(op.on_conflict_filter), std::move(op.columns_to_fetch)); + op.types, op.table, op.column_index_map, std::move(op.bound_defaults), std::move(op.bound_constraints), + std::move(op.expressions), std::move(op.set_columns), std::move(op.set_types), op.estimated_cardinality, + op.return_chunk, parallel_streaming_insert && num_threads > 1, op.action_type, + std::move(op.on_conflict_condition), std::move(op.do_update_condition), std::move(op.on_conflict_filter), + std::move(op.columns_to_fetch)); } D_ASSERT(plan); insert->children.push_back(std::move(plan)); diff --git a/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp b/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp index 82ddd9c2..7933dd16 100644 --- a/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp @@ -12,7 +12,7 @@ unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalRecursiveC D_ASSERT(op.children.size() == 2); // Create the working_table that the PhysicalRecursiveCTE will use for evaluation. - auto working_table = std::make_shared(context, op.types); + auto working_table = make_shared_ptr(context, op.types); // Add the ColumnDataCollection to the context of this PhysicalPlanGenerator recursive_cte_tables[op.table_index] = working_table; diff --git a/src/duckdb/src/execution/physical_plan/plan_simple.cpp b/src/duckdb/src/execution/physical_plan/plan_simple.cpp index 3a7c2f96..a13b607c 100644 --- a/src/duckdb/src/execution/physical_plan/plan_simple.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_simple.cpp @@ -1,6 +1,7 @@ #include "duckdb/execution/operator/helper/physical_load.hpp" #include "duckdb/execution/operator/helper/physical_transaction.hpp" #include "duckdb/execution/operator/helper/physical_vacuum.hpp" +#include "duckdb/execution/operator/helper/physical_update_extensions.hpp" #include "duckdb/execution/operator/schema/physical_alter.hpp" #include "duckdb/execution/operator/schema/physical_attach.hpp" #include "duckdb/execution/operator/schema/physical_create_schema.hpp" @@ -34,6 +35,9 @@ unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalSimple &op case LogicalOperatorType::LOGICAL_DETACH: return make_uniq(unique_ptr_cast(std::move(op.info)), op.estimated_cardinality); + case LogicalOperatorType::LOGICAL_UPDATE_EXTENSIONS: + return make_uniq(unique_ptr_cast(std::move(op.info)), + op.estimated_cardinality); default: throw NotImplementedException("Unimplemented type for logical simple operator"); } diff --git a/src/duckdb/src/execution/physical_plan/plan_top_n.cpp b/src/duckdb/src/execution/physical_plan/plan_top_n.cpp index b3043440..9748904c 100644 --- a/src/duckdb/src/execution/physical_plan/plan_top_n.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_top_n.cpp @@ -9,8 +9,8 @@ unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalTopN &op) auto plan = CreatePlan(*op.children[0]); - auto top_n = - make_uniq(op.types, std::move(op.orders), (idx_t)op.limit, op.offset, op.estimated_cardinality); + auto top_n = make_uniq(op.types, std::move(op.orders), NumericCast(op.limit), + NumericCast(op.offset), op.estimated_cardinality); top_n->children.push_back(std::move(plan)); return std::move(top_n); } diff --git a/src/duckdb/src/execution/physical_plan/plan_update.cpp b/src/duckdb/src/execution/physical_plan/plan_update.cpp index 27890083..b3591423 100644 --- a/src/duckdb/src/execution/physical_plan/plan_update.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_update.cpp @@ -8,9 +8,9 @@ namespace duckdb { unique_ptr DuckCatalog::PlanUpdate(ClientContext &context, LogicalUpdate &op, unique_ptr plan) { - auto update = - make_uniq(op.types, op.table, op.table.GetStorage(), op.columns, std::move(op.expressions), - std::move(op.bound_defaults), op.estimated_cardinality, op.return_chunk); + auto update = make_uniq(op.types, op.table, op.table.GetStorage(), op.columns, + std::move(op.expressions), std::move(op.bound_defaults), + std::move(op.bound_constraints), op.estimated_cardinality, op.return_chunk); update->update_is_del_and_insert = op.update_is_del_and_insert; update->children.push_back(std::move(plan)); diff --git a/src/duckdb/src/execution/physical_plan/plan_window.cpp b/src/duckdb/src/execution/physical_plan/plan_window.cpp index 69f505ec..bab25f64 100644 --- a/src/duckdb/src/execution/physical_plan/plan_window.cpp +++ b/src/duckdb/src/execution/physical_plan/plan_window.cpp @@ -10,29 +10,6 @@ namespace duckdb { -static bool IsStreamingWindow(unique_ptr &expr) { - auto &wexpr = expr->Cast(); - if (!wexpr.partitions.empty() || !wexpr.orders.empty() || wexpr.ignore_nulls || - wexpr.exclude_clause != WindowExcludeMode::NO_OTHER) { - return false; - } - switch (wexpr.type) { - // TODO: add more expression types here? - case ExpressionType::WINDOW_AGGREGATE: - // We can stream aggregates if they are "running totals" and don't use filters - return wexpr.start == WindowBoundary::UNBOUNDED_PRECEDING && wexpr.end == WindowBoundary::CURRENT_ROW_ROWS && - !wexpr.filter_expr; - case ExpressionType::WINDOW_FIRST_VALUE: - case ExpressionType::WINDOW_PERCENT_RANK: - case ExpressionType::WINDOW_RANK: - case ExpressionType::WINDOW_RANK_DENSE: - case ExpressionType::WINDOW_ROW_NUMBER: - return true; - default: - return false; - } -} - unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalWindow &op) { D_ASSERT(op.children.size() == 1); @@ -54,7 +31,7 @@ unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalWindow &op vector blocking_windows; vector streaming_windows; for (idx_t expr_idx = 0; expr_idx < op.expressions.size(); expr_idx++) { - if (IsStreamingWindow(op.expressions[expr_idx])) { + if (PhysicalStreamingWindow::IsStreamingFunction(op.expressions[expr_idx])) { streaming_windows.push_back(expr_idx); } else { blocking_windows.push_back(expr_idx); diff --git a/src/duckdb/src/execution/physical_plan_generator.cpp b/src/duckdb/src/execution/physical_plan_generator.cpp index 4f88c00c..6b223f72 100644 --- a/src/duckdb/src/execution/physical_plan_generator.cpp +++ b/src/duckdb/src/execution/physical_plan_generator.cpp @@ -211,6 +211,9 @@ unique_ptr PhysicalPlanGenerator::CreatePlan(LogicalOperator & case LogicalOperatorType::LOGICAL_COPY_DATABASE: plan = CreatePlan(op.Cast()); break; + case LogicalOperatorType::LOGICAL_UPDATE_EXTENSIONS: + plan = CreatePlan(op.Cast()); + break; case LogicalOperatorType::LOGICAL_EXTENSION_OPERATOR: plan = op.Cast().CreatePlan(context, *this); diff --git a/src/duckdb/src/execution/radix_partitioned_hashtable.cpp b/src/duckdb/src/execution/radix_partitioned_hashtable.cpp index acad77d0..a204bd7c 100644 --- a/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +++ b/src/duckdb/src/execution/radix_partitioned_hashtable.cpp @@ -167,6 +167,8 @@ class RadixHTGlobalSinkState : public GlobalSinkState { atomic external; //! Threads that have called Sink atomic active_threads; + //! Number of threads (from TaskScheduler) + const idx_t number_of_threads; //! If any thread has called combine atomic any_combined; @@ -193,18 +195,20 @@ class RadixHTGlobalSinkState : public GlobalSinkState { RadixHTGlobalSinkState::RadixHTGlobalSinkState(ClientContext &context_p, const RadixPartitionedHashTable &radix_ht_p) : context(context_p), temporary_memory_state(TemporaryMemoryManager::Get(context).Register(context)), radix_ht(radix_ht_p), config(context, *this), finalized(false), external(false), active_threads(0), + number_of_threads(NumericCast(TaskScheduler::GetScheduler(context).NumberOfThreads())), any_combined(false), finalize_done(0), scan_pin_properties(TupleDataPinProperties::DESTROY_AFTER_DONE), count_before_combining(0), max_partition_size(0) { auto tuples_per_block = Storage::BLOCK_ALLOC_SIZE / radix_ht.GetLayout().GetRowWidth(); - idx_t ht_count = config.sink_capacity / GroupedAggregateHashTable::LOAD_FACTOR; + idx_t ht_count = + NumericCast(static_cast(config.sink_capacity) / GroupedAggregateHashTable::LOAD_FACTOR); auto num_partitions = RadixPartitioning::NumberOfPartitions(config.GetRadixBits()); auto count_per_partition = ht_count / num_partitions; auto blocks_per_partition = (count_per_partition + tuples_per_block) / tuples_per_block + 1; auto ht_size = blocks_per_partition * Storage::BLOCK_ALLOC_SIZE + config.sink_capacity * sizeof(aggr_ht_entry_t); // This really is the minimum reservation that we can do - idx_t num_threads = TaskScheduler::GetScheduler(context).NumberOfThreads(); + auto num_threads = NumericCast(TaskScheduler::GetScheduler(context).NumberOfThreads()); auto minimum_reservation = num_threads * ht_size; temporary_memory_state->SetMinimumReservation(minimum_reservation); @@ -229,6 +233,7 @@ void RadixHTGlobalSinkState::Destroy() { } // There are aggregates with destructors: Call the destructor for each of the aggregates + lock_guard guard(lock); RowOperationsState row_state(*stored_allocators.back()); for (auto &partition : partitions) { auto &data_collection = *partition->data; @@ -282,12 +287,12 @@ void RadixHTConfig::SetRadixBitsInternal(const idx_t radix_bits_p, bool external } idx_t RadixHTConfig::InitialSinkRadixBits(ClientContext &context) { - const idx_t active_threads = TaskScheduler::GetScheduler(context).NumberOfThreads(); + const auto active_threads = NumericCast(TaskScheduler::GetScheduler(context).NumberOfThreads()); return MinValue(RadixPartitioning::RadixBits(NextPowerOfTwo(active_threads)), MAXIMUM_INITIAL_SINK_RADIX_BITS); } idx_t RadixHTConfig::MaximumSinkRadixBits(ClientContext &context) { - const idx_t active_threads = TaskScheduler::GetScheduler(context).NumberOfThreads(); + const auto active_threads = NumericCast(TaskScheduler::GetScheduler(context).NumberOfThreads()); return MinValue(RadixPartitioning::RadixBits(NextPowerOfTwo(active_threads)), MAXIMUM_FINAL_SINK_RADIX_BITS); } @@ -297,7 +302,7 @@ idx_t RadixHTConfig::ExternalRadixBits(const idx_t &maximum_sink_radix_bits_p) { idx_t RadixHTConfig::SinkCapacity(ClientContext &context) { // Get active and maximum number of threads - const idx_t active_threads = TaskScheduler::GetScheduler(context).NumberOfThreads(); + const auto active_threads = NumericCast(TaskScheduler::GetScheduler(context).NumberOfThreads()); // Compute cache size per active thread (assuming cache is shared) const auto total_shared_cache_size = active_threads * L3_CACHE_SIZE; @@ -305,7 +310,8 @@ idx_t RadixHTConfig::SinkCapacity(ClientContext &context) { // Divide cache per active thread by entry size, round up to next power of two, to get capacity const auto size_per_entry = sizeof(aggr_ht_entry_t) * GroupedAggregateHashTable::LOAD_FACTOR; - const auto capacity = NextPowerOfTwo(cache_per_active_thread / size_per_entry); + const auto capacity = + NextPowerOfTwo(NumericCast(static_cast(cache_per_active_thread) / size_per_entry)); // Capacity must be at least the minimum capacity return MaxValue(capacity, GroupedAggregateHashTable::InitialCapacity()); @@ -356,8 +362,7 @@ void RadixPartitionedHashTable::PopulateGroupChunk(DataChunk &group_chunk, DataC group_chunk.Verify(); } -bool MaybeRepartition(ClientContext &context, RadixHTGlobalSinkState &gstate, RadixHTLocalSinkState &lstate, - const idx_t &active_threads) { +bool MaybeRepartition(ClientContext &context, RadixHTGlobalSinkState &gstate, RadixHTLocalSinkState &lstate) { auto &config = gstate.config; auto &ht = *lstate.ht; auto &partitioned_data = ht.GetPartitionedData(); @@ -365,19 +370,19 @@ bool MaybeRepartition(ClientContext &context, RadixHTGlobalSinkState &gstate, Ra // Check if we're approaching the memory limit auto &temporary_memory_state = *gstate.temporary_memory_state; const auto total_size = partitioned_data->SizeInBytes() + ht.Capacity() * sizeof(aggr_ht_entry_t); - idx_t thread_limit = temporary_memory_state.GetReservation() / active_threads; + idx_t thread_limit = temporary_memory_state.GetReservation() / gstate.number_of_threads; if (total_size > thread_limit) { // We're over the thread memory limit if (!gstate.external) { // We haven't yet triggered out-of-core behavior, but maybe we don't have to, grab the lock and check again lock_guard guard(gstate.lock); - thread_limit = temporary_memory_state.GetReservation() / active_threads; + thread_limit = temporary_memory_state.GetReservation() / gstate.number_of_threads; if (total_size > thread_limit) { // Out-of-core would be triggered below, try to increase the reservation auto remaining_size = - MaxValue(active_threads * total_size, temporary_memory_state.GetRemainingSize()); + MaxValue(gstate.number_of_threads * total_size, temporary_memory_state.GetRemainingSize()); temporary_memory_state.SetRemainingSize(context, 2 * remaining_size); - thread_limit = temporary_memory_state.GetReservation() / active_threads; + thread_limit = temporary_memory_state.GetReservation() / gstate.number_of_threads; } } } @@ -400,7 +405,7 @@ bool MaybeRepartition(ClientContext &context, RadixHTGlobalSinkState &gstate, Ra } // We can go external when there is only one active thread, but we shouldn't repartition here - if (active_threads < 2) { + if (gstate.number_of_threads < 2) { return false; } @@ -410,7 +415,7 @@ bool MaybeRepartition(ClientContext &context, RadixHTGlobalSinkState &gstate, Ra const auto row_size_per_partition = partitioned_data->Count() * partitioned_data->GetLayout().GetRowWidth() / partition_count; - if (row_size_per_partition > config.BLOCK_FILL_FACTOR * Storage::BLOCK_SIZE) { + if (row_size_per_partition > NumericCast(config.BLOCK_FILL_FACTOR * Storage::BLOCK_SIZE)) { // We crossed our block filling threshold, try to increment radix bits config.SetRadixBits(current_radix_bits + config.REPARTITION_RADIX_BITS); } @@ -448,8 +453,7 @@ void RadixPartitionedHashTable::Sink(ExecutionContext &context, DataChunk &chunk return; // We can fit another chunk } - const idx_t active_threads = gstate.active_threads; - if (active_threads > 2) { + if (gstate.number_of_threads > 2) { // 'Reset' the HT without taking its data, we can just keep appending to the same collection // This only works because we never resize the HT ht.ClearPointerTable(); @@ -458,7 +462,7 @@ void RadixPartitionedHashTable::Sink(ExecutionContext &context, DataChunk &chunk } // Check if we need to repartition - auto repartitioned = MaybeRepartition(context.client, gstate, lstate, active_threads); + auto repartitioned = MaybeRepartition(context.client, gstate, lstate); if (repartitioned && ht.Count() != 0) { // We repartitioned, but we didn't clear the pointer table / reset the count because we're on 1 or 2 threads @@ -479,7 +483,7 @@ void RadixPartitionedHashTable::Combine(ExecutionContext &context, GlobalSinkSta // Set any_combined, then check one last time whether we need to repartition gstate.any_combined = true; - MaybeRepartition(context.client, gstate, lstate, gstate.active_threads); + MaybeRepartition(context.client, gstate, lstate); auto &ht = *lstate.ht; ht.UnpinData(); @@ -511,7 +515,7 @@ void RadixPartitionedHashTable::Finalize(ClientContext &context, GlobalSinkState gstate.count_before_combining = uncombined_data.Count(); // If true there is no need to combine, it was all done by a single thread in a single HT - const auto single_ht = !gstate.external && gstate.active_threads == 1; + const auto single_ht = !gstate.external && gstate.active_threads == 1 && gstate.number_of_threads == 1; auto &uncombined_partition_data = uncombined_data.GetPartitions(); const auto n_partitions = uncombined_partition_data.size(); @@ -537,8 +541,8 @@ void RadixPartitionedHashTable::Finalize(ClientContext &context, GlobalSinkState // Minimum of combining one partition at a time gstate.temporary_memory_state->SetMinimumReservation(gstate.max_partition_size); // Maximum of combining all partitions - auto max_threads = - MinValue(TaskScheduler::GetScheduler(context).NumberOfThreads(), gstate.partitions.size()); + auto max_threads = MinValue(NumericCast(TaskScheduler::GetScheduler(context).NumberOfThreads()), + gstate.partitions.size()); gstate.temporary_memory_state->SetRemainingSize(context, max_threads * gstate.max_partition_size); gstate.finalized = true; } @@ -555,8 +559,8 @@ idx_t RadixPartitionedHashTable::MaxThreads(GlobalSinkState &sink_p) const { // This many partitions will fit given our reservation (at least 1)) auto partitions_fit = MaxValue(sink.temporary_memory_state->GetReservation() / sink.max_partition_size, 1); // Maximum is either the number of partitions, or the number of threads - auto max_possible = - MinValue(sink.partitions.size(), TaskScheduler::GetScheduler(sink.context).NumberOfThreads()); + auto max_possible = MinValue( + sink.partitions.size(), NumericCast(TaskScheduler::GetScheduler(sink.context).NumberOfThreads())); // Mininum of the two return MinValue(partitions_fit, max_possible); @@ -589,7 +593,6 @@ class RadixHTGlobalSourceState : public GlobalSourceState { vector column_ids; //! For synchronizing tasks - mutex lock; idx_t task_idx; atomic task_done; }; @@ -649,7 +652,7 @@ RadixHTGlobalSourceState::RadixHTGlobalSourceState(ClientContext &context_p, con SourceResultType RadixHTGlobalSourceState::AssignTask(RadixHTGlobalSinkState &sink, RadixHTLocalSourceState &lstate, InterruptState &interrupt_state) { // First, try to get a partition index - lock_guard gstate_guard(lock); + lock_guard gstate_guard(sink.lock); if (finished) { return SourceResultType::FINISHED; } @@ -716,13 +719,15 @@ void RadixHTLocalSourceState::Finalize(RadixHTGlobalSinkState &sink, RadixHTGlob const auto capacity = GroupedAggregateHashTable::GetCapacityForCount(partition.data->Count()); // However, we will limit the initial capacity so we don't do a huge over-allocation - const idx_t n_threads = TaskScheduler::GetScheduler(gstate.context).NumberOfThreads(); - const idx_t memory_limit = BufferManager::GetBufferManager(gstate.context).GetMaxMemory(); - const idx_t thread_limit = 0.6 * memory_limit / n_threads; + const auto n_threads = NumericCast(TaskScheduler::GetScheduler(gstate.context).NumberOfThreads()); + const auto memory_limit = BufferManager::GetBufferManager(gstate.context).GetMaxMemory(); + const idx_t thread_limit = NumericCast(0.6 * double(memory_limit) / double(n_threads)); const idx_t size_per_entry = partition.data->SizeInBytes() / MaxValue(partition.data->Count(), 1) + idx_t(GroupedAggregateHashTable::LOAD_FACTOR * sizeof(aggr_ht_entry_t)); - const auto capacity_limit = NextPowerOfTwo(thread_limit / size_per_entry); + // but not lower than the initial capacity + const auto capacity_limit = + MaxValue(NextPowerOfTwo(thread_limit / size_per_entry), GroupedAggregateHashTable::InitialCapacity()); ht = sink.radix_ht.CreateHT(gstate.context, MinValue(capacity, capacity_limit), 0); } else { @@ -743,7 +748,7 @@ void RadixHTLocalSourceState::Finalize(RadixHTGlobalSinkState &sink, RadixHTGlob partition.data->Combine(*ht->GetPartitionedData()->GetPartitions()[0]); // Update thread-global state - lock_guard global_guard(gstate.lock); + lock_guard global_guard(sink.lock); sink.stored_allocators.emplace_back(ht->GetAggregateAllocator()); const auto finalizes_done = ++sink.finalize_done; D_ASSERT(finalizes_done <= sink.partitions.size()); @@ -783,7 +788,7 @@ void RadixHTLocalSourceState::Scan(RadixHTGlobalSinkState &sink, RadixHTGlobalSo data_collection.Reset(); } scan_status = RadixHTScanStatus::DONE; - lock_guard gstate_guard(gstate.lock); + lock_guard gstate_guard(sink.lock); if (++gstate.task_done == sink.partitions.size()) { gstate.finished = true; } @@ -910,10 +915,10 @@ double RadixPartitionedHashTable::GetProgress(ClientContext &, GlobalSinkState & } // Get scan progress, weigh it 1x - total_progress += 1.0 * gstate.task_done; + total_progress += 1.0 * double(gstate.task_done); // Divide by 3x for the weights, and the number of partitions to get a value between 0 and 1 again - total_progress /= 3.0 * sink.partitions.size(); + total_progress /= 3.0 * double(sink.partitions.size()); // Multiply by 100 to get a percentage return 100.0 * total_progress; diff --git a/src/duckdb/src/execution/reservoir_sample.cpp b/src/duckdb/src/execution/reservoir_sample.cpp index 0aba8bf7..fc711d91 100644 --- a/src/duckdb/src/execution/reservoir_sample.cpp +++ b/src/duckdb/src/execution/reservoir_sample.cpp @@ -4,48 +4,55 @@ namespace duckdb { -void BlockingSample::Serialize(Serializer &serializer) const { +void ReservoirChunk::Serialize(Serializer &serializer) const { + chunk.Serialize(serializer); } -unique_ptr BlockingSample::Deserialize(Deserializer &deserializer) { - return nullptr; +unique_ptr ReservoirChunk::Deserialize(Deserializer &deserializer) { + auto result = make_uniq(); + result->chunk.Deserialize(deserializer); + return result; } ReservoirSample::ReservoirSample(Allocator &allocator, idx_t sample_count, int64_t seed) : BlockingSample(seed), allocator(allocator), sample_count(sample_count), reservoir_initialized(false) { } +ReservoirSample::ReservoirSample(idx_t sample_count, int64_t seed) + : ReservoirSample(Allocator::DefaultAllocator(), sample_count, seed) { +} + void ReservoirSample::AddToReservoir(DataChunk &input) { if (sample_count == 0) { // sample count is 0, means no samples were requested return; } - base_reservoir_sample.num_entries_seen_total += input.size(); + old_base_reservoir_sample.num_entries_seen_total += input.size(); // Input: A population V of n weighted items // Output: A reservoir R with a size m // 1: The first m items of V are inserted into R // first we need to check if the reservoir already has "m" elements - if (!reservoir_chunk || reservoir_chunk->size() < sample_count) { + if (!reservoir_data_chunk || reservoir_data_chunk->size() < sample_count) { if (FillReservoir(input) == 0) { // entire chunk was consumed by reservoir return; } } - D_ASSERT(reservoir_chunk); - D_ASSERT(reservoir_chunk->size() == sample_count); + D_ASSERT(reservoir_data_chunk); + D_ASSERT(reservoir_data_chunk->size() == sample_count); // Initialize the weights if they have not been already - if (base_reservoir_sample.reservoir_weights.empty()) { - base_reservoir_sample.InitializeReservoir(reservoir_chunk->size(), sample_count); + if (old_base_reservoir_sample.reservoir_weights.empty()) { + old_base_reservoir_sample.InitializeReservoir(reservoir_data_chunk->size(), sample_count); } // find the position of next_index_to_sample relative to number of seen entries (num_entries_to_skip_b4_next_sample) idx_t remaining = input.size(); idx_t base_offset = 0; while (true) { - idx_t offset = - base_reservoir_sample.next_index_to_sample - base_reservoir_sample.num_entries_to_skip_b4_next_sample; + idx_t offset = old_base_reservoir_sample.next_index_to_sample - + old_base_reservoir_sample.num_entries_to_skip_b4_next_sample; if (offset >= remaining) { // not in this chunk! increment current count and go to the next chunk - base_reservoir_sample.num_entries_to_skip_b4_next_sample += remaining; + old_base_reservoir_sample.num_entries_to_skip_b4_next_sample += remaining; return; } // in this chunk! replace the element @@ -57,47 +64,47 @@ void ReservoirSample::AddToReservoir(DataChunk &input) { } unique_ptr ReservoirSample::GetChunk() { - if (!reservoir_chunk || reservoir_chunk->size() == 0) { + if (!reservoir_data_chunk || reservoir_data_chunk->size() == 0) { return nullptr; } - auto collected_sample_count = reservoir_chunk->size(); + auto collected_sample_count = reservoir_data_chunk->size(); if (collected_sample_count > STANDARD_VECTOR_SIZE) { // get from the back to avoid creating two selection vectors // one to return the first STANDARD_VECTOR_SIZE - // another to replace the reservoir_chunk with the first STANDARD VECTOR SIZE missing + // another to replace the reservoir_data_chunk with the first STANDARD VECTOR SIZE missing auto ret = make_uniq(); auto samples_remaining = collected_sample_count - STANDARD_VECTOR_SIZE; - auto reservoir_types = reservoir_chunk->GetTypes(); + auto reservoir_types = reservoir_data_chunk->GetTypes(); SelectionVector sel(STANDARD_VECTOR_SIZE); for (idx_t i = samples_remaining; i < collected_sample_count; i++) { sel.set_index(i - samples_remaining, i); } ret->Initialize(allocator, reservoir_types.begin(), reservoir_types.end(), STANDARD_VECTOR_SIZE); - ret->Slice(*reservoir_chunk, sel, STANDARD_VECTOR_SIZE); + ret->Slice(*reservoir_data_chunk, sel, STANDARD_VECTOR_SIZE); ret->SetCardinality(STANDARD_VECTOR_SIZE); // reduce capacity and cardinality of the sample data chunk - reservoir_chunk->SetCardinality(samples_remaining); + reservoir_data_chunk->SetCardinality(samples_remaining); return ret; } - return std::move(reservoir_chunk); + return std::move(reservoir_data_chunk); } void ReservoirSample::ReplaceElement(DataChunk &input, idx_t index_in_chunk, double with_weight) { // replace the entry in the reservoir // 8. The item in R with the minimum key is replaced by item vi - D_ASSERT(input.ColumnCount() == reservoir_chunk->ColumnCount()); + D_ASSERT(input.ColumnCount() == reservoir_data_chunk->ColumnCount()); for (idx_t col_idx = 0; col_idx < input.ColumnCount(); col_idx++) { - reservoir_chunk->SetValue(col_idx, base_reservoir_sample.min_weighted_entry_index, - input.GetValue(col_idx, index_in_chunk)); + reservoir_data_chunk->SetValue(col_idx, old_base_reservoir_sample.min_weighted_entry_index, + input.GetValue(col_idx, index_in_chunk)); } - base_reservoir_sample.ReplaceElement(with_weight); + old_base_reservoir_sample.ReplaceElement(with_weight); } void ReservoirSample::InitializeReservoir(DataChunk &input) { - reservoir_chunk = make_uniq(); - reservoir_chunk->Initialize(allocator, input.GetTypes(), sample_count); - for (idx_t col_idx = 0; col_idx < reservoir_chunk->ColumnCount(); col_idx++) { - FlatVector::Validity(reservoir_chunk->data[col_idx]).Initialize(sample_count); + reservoir_data_chunk = make_uniq(); + reservoir_data_chunk->Initialize(allocator, input.GetTypes(), sample_count); + for (idx_t col_idx = 0; col_idx < reservoir_data_chunk->ColumnCount(); col_idx++) { + FlatVector::Validity(reservoir_data_chunk->data[col_idx]).Initialize(sample_count); } reservoir_initialized = true; } @@ -105,7 +112,7 @@ void ReservoirSample::InitializeReservoir(DataChunk &input) { idx_t ReservoirSample::FillReservoir(DataChunk &input) { idx_t chunk_count = input.size(); input.Flatten(); - auto num_added_samples = reservoir_chunk ? reservoir_chunk->size() : 0; + auto num_added_samples = reservoir_data_chunk ? reservoir_data_chunk->size() : 0; D_ASSERT(num_added_samples <= sample_count); // required count is what we still need to add to the reservoir @@ -123,8 +130,8 @@ idx_t ReservoirSample::FillReservoir(DataChunk &input) { if (!reservoir_initialized) { InitializeReservoir(input); } - reservoir_chunk->Append(input, false, nullptr, required_count); - base_reservoir_sample.InitializeReservoir(required_count, sample_count); + reservoir_data_chunk->Append(input, false, nullptr, required_count); + old_base_reservoir_sample.InitializeReservoir(required_count, sample_count); // check if there are still elements remaining in the Input data chunk that should be // randomly sampled and potentially added. This happens if we are on a boundary @@ -155,8 +162,12 @@ ReservoirSamplePercentage::ReservoirSamplePercentage(Allocator &allocator, doubl current_sample = make_uniq(allocator, reservoir_sample_size, random.NextRandomInteger()); } +ReservoirSamplePercentage::ReservoirSamplePercentage(double percentage, int64_t seed) + : ReservoirSamplePercentage(Allocator::DefaultAllocator(), percentage, seed) { +} + void ReservoirSamplePercentage::AddToReservoir(DataChunk &input) { - base_reservoir_sample.num_entries_seen_total += input.size(); + old_base_reservoir_sample.num_entries_seen_total += input.size(); if (current_count + input.size() > RESERVOIR_THRESHOLD) { // we don't have enough space in our current reservoir // first check what we still need to append to the current sample diff --git a/src/duckdb/src/execution/window_executor.cpp b/src/duckdb/src/execution/window_executor.cpp index 627e8df6..4d6b9b09 100644 --- a/src/duckdb/src/execution/window_executor.cpp +++ b/src/duckdb/src/execution/window_executor.cpp @@ -139,11 +139,11 @@ struct WindowColumnIterator { // Random Access inline iterator &operator+=(difference_type n) { - pos += n; + pos += UnsafeNumericCast(n); return *this; } inline iterator &operator-=(difference_type n) { - pos -= n; + pos -= UnsafeNumericCast(n); return *this; } @@ -232,7 +232,7 @@ static idx_t FindTypedRangeBound(const WindowInputColumn &over, const idx_t orde const auto first = over.GetCell(prev.start); if (!comp(val, first)) { // prev.first <= val, so we can start further forward - begin += (prev.start - order_begin); + begin += UnsafeNumericCast(prev.start - order_begin); } } if (order_begin < prev.end && prev.end < order_end) { @@ -240,7 +240,7 @@ static idx_t FindTypedRangeBound(const WindowInputColumn &over, const idx_t orde if (!comp(second, val)) { // val <= prev.second, so we can end further back // (prev.second is the largest peer) - end -= (order_end - prev.end - 1); + end -= UnsafeNumericCast(order_end - prev.end - 1); } } } @@ -452,13 +452,13 @@ void WindowBoundariesState::Update(const idx_t row_idx, const WindowInputColumn switch (start_boundary) { case WindowBoundary::UNBOUNDED_PRECEDING: - window_start = partition_start; + window_start = NumericCast(partition_start); break; case WindowBoundary::CURRENT_ROW_ROWS: - window_start = row_idx; + window_start = NumericCast(row_idx); break; case WindowBoundary::CURRENT_ROW_RANGE: - window_start = peer_start; + window_start = NumericCast(peer_start); break; case WindowBoundary::EXPR_PRECEDING_ROWS: { if (!TrySubtractOperator::Operation(int64_t(row_idx), boundary_start.GetCell(chunk_idx), @@ -475,21 +475,21 @@ void WindowBoundariesState::Update(const idx_t row_idx, const WindowInputColumn } case WindowBoundary::EXPR_PRECEDING_RANGE: { if (boundary_start.CellIsNull(chunk_idx)) { - window_start = peer_start; + window_start = NumericCast(peer_start); } else { prev.start = FindOrderedRangeBound(range_collection, range_sense, valid_start, row_idx, start_boundary, boundary_start, chunk_idx, prev); - window_start = prev.start; + window_start = NumericCast(prev.start); } break; } case WindowBoundary::EXPR_FOLLOWING_RANGE: { if (boundary_start.CellIsNull(chunk_idx)) { - window_start = peer_start; + window_start = NumericCast(peer_start); } else { prev.start = FindOrderedRangeBound(range_collection, range_sense, row_idx, valid_end, start_boundary, boundary_start, chunk_idx, prev); - window_start = prev.start; + window_start = NumericCast(prev.start); } break; } @@ -499,13 +499,13 @@ void WindowBoundariesState::Update(const idx_t row_idx, const WindowInputColumn switch (end_boundary) { case WindowBoundary::CURRENT_ROW_ROWS: - window_end = row_idx + 1; + window_end = NumericCast(row_idx + 1); break; case WindowBoundary::CURRENT_ROW_RANGE: - window_end = peer_end; + window_end = NumericCast(peer_end); break; case WindowBoundary::UNBOUNDED_FOLLOWING: - window_end = partition_end; + window_end = NumericCast(partition_end); break; case WindowBoundary::EXPR_PRECEDING_ROWS: if (!TrySubtractOperator::Operation(int64_t(row_idx + 1), boundary_end.GetCell(chunk_idx), @@ -520,21 +520,21 @@ void WindowBoundariesState::Update(const idx_t row_idx, const WindowInputColumn break; case WindowBoundary::EXPR_PRECEDING_RANGE: { if (boundary_end.CellIsNull(chunk_idx)) { - window_end = peer_end; + window_end = NumericCast(peer_end); } else { prev.end = FindOrderedRangeBound(range_collection, range_sense, valid_start, row_idx, end_boundary, boundary_end, chunk_idx, prev); - window_end = prev.end; + window_end = NumericCast(prev.end); } break; } case WindowBoundary::EXPR_FOLLOWING_RANGE: { if (boundary_end.CellIsNull(chunk_idx)) { - window_end = peer_end; + window_end = NumericCast(peer_end); } else { prev.end = FindOrderedRangeBound(range_collection, range_sense, row_idx, valid_end, end_boundary, boundary_end, chunk_idx, prev); - window_end = prev.end; + window_end = NumericCast(prev.end); } break; } @@ -543,17 +543,17 @@ void WindowBoundariesState::Update(const idx_t row_idx, const WindowInputColumn } // clamp windows to partitions if they should exceed - if (window_start < (int64_t)partition_start) { - window_start = partition_start; + if (window_start < NumericCast(partition_start)) { + window_start = NumericCast(partition_start); } - if (window_start > (int64_t)partition_end) { - window_start = partition_end; + if (window_start > NumericCast(partition_end)) { + window_start = NumericCast(partition_end); } - if (window_end < (int64_t)partition_start) { - window_end = partition_start; + if (window_end < NumericCast(partition_start)) { + window_end = NumericCast(partition_start); } - if (window_end > (int64_t)partition_end) { - window_end = partition_end; + if (window_end > NumericCast(partition_end)) { + window_end = NumericCast(partition_end); } if (window_start < 0 || window_end < 0) { @@ -1029,7 +1029,7 @@ void WindowAggregateExecutor::Finalize() { // Estimate the frame statistics // Default to the entire partition if we don't know anything FrameStats stats; - const int64_t count = aggregator->GetInputs().size(); + const auto count = NumericCast(aggregator->GetInputs().size()); // First entry is the frame start stats[0] = FrameDelta(-count, count); @@ -1090,7 +1090,7 @@ void WindowRowNumberExecutor::EvaluateInternal(WindowExecutorState &lstate, Vect auto partition_begin = FlatVector::GetData(lbstate.bounds.data[PARTITION_BEGIN]); auto rdata = FlatVector::GetData(result); for (idx_t i = 0; i < count; ++i, ++row_idx) { - rdata[i] = row_idx - partition_begin[i] + 1; + rdata[i] = NumericCast(row_idx - partition_begin[i] + 1); } } @@ -1147,7 +1147,7 @@ void WindowRankExecutor::EvaluateInternal(WindowExecutorState &lstate, Vector &r for (idx_t i = 0; i < count; ++i, ++row_idx) { lpeer.NextRank(partition_begin[i], peer_begin[i], row_idx); - rdata[i] = lpeer.rank; + rdata[i] = NumericCast(lpeer.rank); } } @@ -1209,7 +1209,7 @@ void WindowDenseRankExecutor::EvaluateInternal(WindowExecutorState &lstate, Vect for (idx_t i = 0; i < count; ++i, ++row_idx) { lpeer.NextRank(partition_begin[i], peer_begin[i], row_idx); - rdata[i] = lpeer.dense_rank; + rdata[i] = NumericCast(lpeer.dense_rank); } } @@ -1237,7 +1237,7 @@ void WindowPercentRankExecutor::EvaluateInternal(WindowExecutorState &lstate, Ve for (idx_t i = 0; i < count; ++i, ++row_idx) { lpeer.NextRank(partition_begin[i], peer_begin[i], row_idx); - int64_t denom = partition_end[i] - partition_begin[i] - 1; + auto denom = NumericCast(partition_end[i] - partition_begin[i] - 1); double percent_rank = denom > 0 ? ((double)lpeer.rank - 1) / denom : 0; rdata[i] = percent_rank; } @@ -1260,7 +1260,7 @@ void WindowCumeDistExecutor::EvaluateInternal(WindowExecutorState &lstate, Vecto auto peer_end = FlatVector::GetData(lbstate.bounds.data[PEER_END]); auto rdata = FlatVector::GetData(result); for (idx_t i = 0; i < count; ++i, ++row_idx) { - int64_t denom = partition_end[i] - partition_begin[i]; + auto denom = NumericCast(partition_end[i] - partition_begin[i]); double cume_dist = denom > 0 ? ((double)(peer_end[i] - partition_begin[i])) / denom : 0; rdata[i] = cume_dist; } @@ -1365,7 +1365,7 @@ void WindowNtileExecutor::EvaluateInternal(WindowExecutorState &lstate, Vector & throw InvalidInputException("Argument for ntile must be greater than zero"); } // With thanks from SQLite's ntileValueFunc() - int64_t n_total = partition_end[i] - partition_begin[i]; + auto n_total = NumericCast(partition_end[i] - partition_begin[i]); if (n_param > n_total) { // more groups allowed than we have values // map every entry to a unique group @@ -1374,7 +1374,7 @@ void WindowNtileExecutor::EvaluateInternal(WindowExecutorState &lstate, Vector & int64_t n_size = (n_total / n_param); // find the row idx within the group D_ASSERT(row_idx >= partition_begin[i]); - int64_t adjusted_row_idx = row_idx - partition_begin[i]; + auto adjusted_row_idx = NumericCast(row_idx - partition_begin[i]); // now compute the ntile int64_t n_large = n_total - n_param * n_size; int64_t i_small = n_large * (n_size + 1); @@ -1452,16 +1452,16 @@ void WindowLeadLagExecutor::EvaluateInternal(WindowExecutorState &lstate, Vector idx_t delta = 0; if (val_idx < (int64_t)row_idx) { // Count backwards - delta = idx_t(row_idx - val_idx); - val_idx = FindPrevStart(ignore_nulls, partition_begin[i], row_idx, delta); + delta = idx_t(row_idx - idx_t(val_idx)); + val_idx = int64_t(FindPrevStart(ignore_nulls, partition_begin[i], row_idx, delta)); } else if (val_idx > (int64_t)row_idx) { - delta = idx_t(val_idx - row_idx); - val_idx = FindNextStart(ignore_nulls, row_idx + 1, partition_end[i], delta); + delta = idx_t(idx_t(val_idx) - row_idx); + val_idx = int64_t(FindNextStart(ignore_nulls, row_idx + 1, partition_end[i], delta)); } // else offset is zero, so don't move. if (!delta) { - CopyCell(payload_collection, 0, val_idx, result, i); + CopyCell(payload_collection, 0, NumericCast(val_idx), result, i); } else if (wexpr.default_expr) { llstate.leadlag_default.CopyCell(result, i); } else { diff --git a/src/duckdb/src/execution/window_segment_tree.cpp b/src/duckdb/src/execution/window_segment_tree.cpp index 5ea8429a..906a62e9 100644 --- a/src/duckdb/src/execution/window_segment_tree.cpp +++ b/src/duckdb/src/execution/window_segment_tree.cpp @@ -1157,13 +1157,16 @@ void WindowDistinctAggregator::Sink(DataChunk &arg_chunk, SelectionVector *filte // 3: for i ← 0 to in.size do // 4: sorted[i] ← (in[i], i) const auto count = arg_chunk.size(); - auto payload_data = FlatVector::GetData(payload_chunk.data[0]); - std::iota(payload_data, payload_data + count, payload_pos); + payload_chunk.Reset(); + auto &sorted_vec = payload_chunk.data[0]; + auto sorted = FlatVector::GetData(sorted_vec); + std::iota(sorted, sorted + count, payload_pos); payload_pos += count; for (column_t c = 0; c < arg_chunk.ColumnCount(); ++c) { sort_chunk.data[c].Reference(arg_chunk.data[c]); } + sort_chunk.data.back().Reference(sorted_vec); sort_chunk.SetCardinality(arg_chunk); payload_chunk.SetCardinality(sort_chunk); diff --git a/src/duckdb/src/function/aggregate/distributive/first.cpp b/src/duckdb/src/function/aggregate/distributive/first.cpp index 2d2aa053..143cf431 100644 --- a/src/duckdb/src/function/aggregate/distributive/first.cpp +++ b/src/duckdb/src/function/aggregate/distributive/first.cpp @@ -88,7 +88,7 @@ struct FirstFunctionString : public FirstFunctionBase { auto ptr = LAST ? new char[len] : char_ptr_cast(input_data.allocator.Allocate(len)); memcpy(ptr, value.GetData(), len); - state.value = string_t(ptr, UnsafeNumericCast(len)); + state.value = string_t(ptr, UnsafeNumericCast(len)); } } } diff --git a/src/duckdb/src/function/cast/string_cast.cpp b/src/duckdb/src/function/cast/string_cast.cpp index d18c6ce1..4645dd34 100644 --- a/src/duckdb/src/function/cast/string_cast.cpp +++ b/src/duckdb/src/function/cast/string_cast.cpp @@ -161,7 +161,7 @@ bool VectorStringToList::StringToNestedTypeCastLoop(const string_t *source_data, if (!VectorStringToList::SplitStringList(source_data[idx], child_data, total, varchar_vector)) { string text = "Type VARCHAR with value '" + source_data[idx].GetString() + "' can't be cast to the destination type LIST"; - HandleVectorCastError::Operation(text, result_mask, idx, vector_cast_data); + HandleVectorCastError::Operation(text, result_mask, i, vector_cast_data); } list_data[i].length = total - list_data[i].offset; // length is the amount of parts coming from this string } @@ -412,7 +412,7 @@ bool VectorStringToArray::StringToNestedTypeCastLoop(const string_t *source_data // Null the entire array for (idx_t j = 0; j < array_size; j++) { - FlatVector::SetNull(varchar_vector, idx * array_size + j, true); + FlatVector::SetNull(varchar_vector, i * array_size + j, true); } total += array_size; @@ -422,7 +422,7 @@ bool VectorStringToArray::StringToNestedTypeCastLoop(const string_t *source_data if (!VectorStringToList::SplitStringList(source_data[idx], child_data, total, varchar_vector)) { auto text = StringUtil::Format("Type VARCHAR with value '%s' can't be cast to the destination type ARRAY", source_data[idx].GetString()); - HandleVectorCastError::Operation(text, result_mask, idx, vector_cast_data); + HandleVectorCastError::Operation(text, result_mask, i, vector_cast_data); } } D_ASSERT(total == child_count); diff --git a/src/duckdb/src/function/cast_rules.cpp b/src/duckdb/src/function/cast_rules.cpp index 98ca78b8..acbe2eb0 100644 --- a/src/duckdb/src/function/cast_rules.cpp +++ b/src/duckdb/src/function/cast_rules.cpp @@ -211,6 +211,7 @@ static int64_t ImplicitCastUhugeint(const LogicalType &to) { static int64_t ImplicitCastDate(const LogicalType &to) { switch (to.id()) { case LogicalTypeId::TIMESTAMP: + case LogicalTypeId::TIMESTAMP_TZ: return TargetTypeCost(to); default: return -1; diff --git a/src/duckdb/src/function/function.cpp b/src/duckdb/src/function/function.cpp index 3d76a725..9427f445 100644 --- a/src/duckdb/src/function/function.cpp +++ b/src/duckdb/src/function/function.cpp @@ -158,8 +158,8 @@ void Function::EraseArgument(SimpleFunction &bound_function, vector FunctionBinder::BindScalarFunction(const string &schema, const string &name, vector> children, ErrorData &error, - bool is_operator, Binder *binder) { + bool is_operator, optional_ptr binder) { // bind the function auto &function = Catalog::GetSystemCatalog(context).GetEntry(context, CatalogType::SCALAR_FUNCTION_ENTRY, schema, name); @@ -290,7 +290,7 @@ unique_ptr FunctionBinder::BindScalarFunction(const string &schema, unique_ptr FunctionBinder::BindScalarFunction(ScalarFunctionCatalogEntry &func, vector> children, ErrorData &error, - bool is_operator, Binder *binder) { + bool is_operator, optional_ptr binder) { // bind the function auto best_function = BindFunction(func.name, func.functions, children, error); if (!best_function.IsValid()) { @@ -335,16 +335,21 @@ unique_ptr FunctionBinder::BindScalarFunction(ScalarFunctionCatalogE } } } - return BindScalarFunction(bound_function, std::move(children), is_operator); + return BindScalarFunction(bound_function, std::move(children), is_operator, binder); } unique_ptr FunctionBinder::BindScalarFunction(ScalarFunction bound_function, vector> children, - bool is_operator) { + bool is_operator, optional_ptr binder) { unique_ptr bind_info; if (bound_function.bind) { bind_info = bound_function.bind(context, bound_function, children); } + if (bound_function.get_modified_databases && binder) { + auto &properties = binder->GetStatementProperties(); + FunctionModifiedDatabasesInput input(bind_info, properties.modified_databases); + bound_function.get_modified_databases(input); + } // check if we need to add casts to the children CastToFunctionArguments(bound_function, children); diff --git a/src/duckdb/src/function/pragma/pragma_functions.cpp b/src/duckdb/src/function/pragma/pragma_functions.cpp index d44ec629..3e82bfb7 100644 --- a/src/duckdb/src/function/pragma/pragma_functions.cpp +++ b/src/duckdb/src/function/pragma/pragma_functions.cpp @@ -2,6 +2,8 @@ #include "duckdb/common/enums/output_type.hpp" #include "duckdb/common/operator/cast_operators.hpp" +#include "duckdb/function/function_set.hpp" +#include "duckdb/logging/http_logger.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/main/database.hpp" #include "duckdb/main/query_profiler.hpp" @@ -10,7 +12,6 @@ #include "duckdb/planner/expression_binder.hpp" #include "duckdb/storage/buffer_manager.hpp" #include "duckdb/storage/storage_manager.hpp" -#include "duckdb/function/function_set.hpp" #include diff --git a/src/duckdb/src/function/pragma/pragma_queries.cpp b/src/duckdb/src/function/pragma/pragma_queries.cpp index a69d735b..fdb47ae3 100644 --- a/src/duckdb/src/function/pragma/pragma_queries.cpp +++ b/src/duckdb/src/function/pragma/pragma_queries.cpp @@ -3,9 +3,10 @@ #include "duckdb/common/file_system.hpp" #include "duckdb/common/string_util.hpp" #include "duckdb/function/pragma/pragma_functions.hpp" +#include "duckdb/main/client_data.hpp" #include "duckdb/main/config.hpp" #include "duckdb/main/database_manager.hpp" -#include "duckdb/main/client_data.hpp" +#include "duckdb/main/extension_helper.hpp" #include "duckdb/parser/parser.hpp" #include "duckdb/parser/qualified_name.hpp" #include "duckdb/parser/statement/copy_statement.hpp" @@ -141,9 +142,9 @@ string PragmaImportDatabase(ClientContext &context, const FunctionParameters &pa auto file_path = fs.JoinPath(parameters.values[0].ToString(), file); auto handle = fs.OpenFile(file_path, FileFlags::FILE_FLAGS_READ); auto fsize = fs.GetFileSize(*handle); - auto buffer = make_unsafe_uniq_array(fsize); + auto buffer = make_unsafe_uniq_array(UnsafeNumericCast(fsize)); fs.Read(*handle, buffer.get(), fsize); - auto query = string(buffer.get(), fsize); + auto query = string(buffer.get(), UnsafeNumericCast(fsize)); // Replace the placeholder with the path provided to IMPORT if (file == "load.sql") { Parser parser; diff --git a/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp b/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp index 1125322f..a8e046b6 100644 --- a/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +++ b/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp @@ -39,7 +39,7 @@ static inline RESULT_TYPE StringCompressInternal(const string_t &input) { ReverseMemCpy(result_ptr + remainder, data_ptr_cast(input.GetPointer()), input.GetSize()); memset(result_ptr, '\0', remainder); } - result_ptr[0] = UnsafeNumericCast(input.GetSize()); + result_ptr[0] = UnsafeNumericCast(input.GetSize()); return result; } diff --git a/src/duckdb/src/function/scalar/list/list_extract.cpp b/src/duckdb/src/function/scalar/list/list_extract.cpp index 822b9079..aa8278ce 100644 --- a/src/duckdb/src/function/scalar/list/list_extract.cpp +++ b/src/duckdb/src/function/scalar/list/list_extract.cpp @@ -62,13 +62,14 @@ void ListExtractTemplate(idx_t count, UnifiedVectorFormat &list_data, UnifiedVec result_mask.SetInvalid(i); continue; } - child_offset = list_entry.offset + list_entry.length + offsets_entry; + child_offset = UnsafeNumericCast(UnsafeNumericCast(list_entry.offset + list_entry.length) + + offsets_entry); } else { if ((idx_t)offsets_entry >= list_entry.length) { result_mask.SetInvalid(i); continue; } - child_offset = list_entry.offset + offsets_entry; + child_offset = UnsafeNumericCast(UnsafeNumericCast(list_entry.offset) + offsets_entry); } auto child_index = child_format.sel->get_index(child_offset); if (child_format.validity.RowIsValid(child_index)) { diff --git a/src/duckdb/src/function/scalar/list/list_resize.cpp b/src/duckdb/src/function/scalar/list/list_resize.cpp index edd6ca29..792e0f6b 100644 --- a/src/duckdb/src/function/scalar/list/list_resize.cpp +++ b/src/duckdb/src/function/scalar/list/list_resize.cpp @@ -28,7 +28,7 @@ void ListResizeFunction(DataChunk &args, ExpressionState &state, Vector &result) UnifiedVectorFormat new_size_data; new_sizes.ToUnifiedFormat(count, new_size_data); - auto new_size_entries = UnifiedVectorFormat::GetData(new_size_data); + auto new_size_entries = UnifiedVectorFormat::GetData(new_size_data); UnifiedVectorFormat child_data; child.ToUnifiedFormat(count, child_data); diff --git a/src/duckdb/src/function/scalar/list/list_select.cpp b/src/duckdb/src/function/scalar/list/list_select.cpp index 0301e090..07413977 100644 --- a/src/duckdb/src/function/scalar/list/list_select.cpp +++ b/src/duckdb/src/function/scalar/list/list_select.cpp @@ -12,10 +12,11 @@ struct SetSelectionVectorSelect { ValidityMask &input_validity, Vector &selection_entry, idx_t child_idx, idx_t &target_offset, idx_t selection_offset, idx_t input_offset, idx_t target_length) { - idx_t sel_idx = selection_entry.GetValue(selection_offset + child_idx).GetValue() - 1; - if (sel_idx < target_length) { - selection_vector.set_index(target_offset, input_offset + sel_idx); - if (!input_validity.RowIsValid(input_offset + sel_idx)) { + auto sel_idx = selection_entry.GetValue(selection_offset + child_idx).GetValue() - 1; + if (sel_idx >= 0 && sel_idx < UnsafeNumericCast(target_length)) { + auto sel_idx_unsigned = UnsafeNumericCast(sel_idx); + selection_vector.set_index(target_offset, input_offset + sel_idx_unsigned); + if (!input_validity.RowIsValid(input_offset + sel_idx_unsigned)) { validity_mask.SetInvalid(target_offset); } } else { @@ -44,6 +45,12 @@ struct SetSelectionVectorWhere { if (!input_validity.RowIsValid(input_offset + child_idx)) { validity_mask.SetInvalid(target_offset); } + + if (child_idx >= target_length) { + selection_vector.set_index(target_offset, 0); + validity_mask.SetInvalid(target_offset); + } + target_offset++; } diff --git a/src/duckdb/src/function/scalar/list/list_zip.cpp b/src/duckdb/src/function/scalar/list/list_zip.cpp index 6069fab5..7e050382 100644 --- a/src/duckdb/src/function/scalar/list/list_zip.cpp +++ b/src/duckdb/src/function/scalar/list/list_zip.cpp @@ -143,8 +143,10 @@ static unique_ptr ListZipBind(ClientContext &context, ScalarFuncti case LogicalTypeId::SQLNULL: struct_children.push_back(make_pair(string(), LogicalTypeId::SQLNULL)); break; - default: + case LogicalTypeId::UNKNOWN: throw ParameterNotResolvedException(); + default: + throw BinderException("Parameter type needs to be List"); } } bound_function.return_type = LogicalType::LIST(LogicalType::STRUCT(struct_children)); diff --git a/src/duckdb/src/function/scalar/operators/add.cpp b/src/duckdb/src/function/scalar/operators/add.cpp index f0670120..f3b86d52 100644 --- a/src/duckdb/src/function/scalar/operators/add.cpp +++ b/src/duckdb/src/function/scalar/operators/add.cpp @@ -36,15 +36,8 @@ interval_t AddOperator::Operation(interval_t left, interval_t right) { template <> date_t AddOperator::Operation(date_t left, int32_t right) { - if (!Value::IsFinite(left)) { - return left; - } - int32_t days; - if (!TryAddOperator::Operation(left.days, right, days)) { - throw OutOfRangeException("Date out of range"); - } - date_t result(days); - if (!Value::IsFinite(result)) { + date_t result; + if (!TryAddOperator::Operation(left, right, result)) { throw OutOfRangeException("Date out of range"); } return result; @@ -154,6 +147,23 @@ bool TryAddOperator::Operation(uint64_t left, uint64_t right, uint64_t &result) return OverflowCheckedAddition::Operation(left, right, result); } +template <> +bool TryAddOperator::Operation(date_t left, int32_t right, date_t &result) { + if (left == date_t::infinity() || left == date_t::ninfinity()) { + result = date_t(left); + return true; + } + int32_t days; + if (!TryAddOperator::Operation(left.days, right, days)) { + return false; + } + result.days = days; + if (!Value::IsFinite(result)) { + return false; + } + return true; +} + template <> bool TryAddOperator::Operation(int8_t left, int8_t right, int8_t &result) { return OverflowCheckedAddition::Operation(left, right, result); diff --git a/src/duckdb/src/function/scalar/sequence/nextval.cpp b/src/duckdb/src/function/scalar/sequence/nextval.cpp index 2167e8e4..4e80ed43 100644 --- a/src/duckdb/src/function/scalar/sequence/nextval.cpp +++ b/src/duckdb/src/function/scalar/sequence/nextval.cpp @@ -11,12 +11,13 @@ #include "duckdb/common/serializer/deserializer.hpp" #include "duckdb/common/serializer/serializer.hpp" #include "duckdb/common/vector_operations/unary_executor.hpp" +#include "duckdb/transaction/meta_transaction.hpp" #include "duckdb/planner/binder.hpp" namespace duckdb { struct CurrentSequenceValueOperator { - static int64_t Operation(DuckTransaction &transaction, SequenceCatalogEntry &seq) { + static int64_t Operation(DuckTransaction &, SequenceCatalogEntry &seq) { return seq.CurrentValue(); } }; @@ -27,62 +28,80 @@ struct NextSequenceValueOperator { } }; +SequenceCatalogEntry &BindSequence(ClientContext &context, string &catalog, string &schema, const string &name) { + // fetch the sequence from the catalog + Binder::BindSchemaOrCatalog(context, catalog, schema); + return Catalog::GetEntry(context, catalog, schema, name); +} + SequenceCatalogEntry &BindSequence(ClientContext &context, const string &name) { auto qname = QualifiedName::Parse(name); - // fetch the sequence from the catalog - Binder::BindSchemaOrCatalog(context, qname.catalog, qname.schema); - return Catalog::GetEntry(context, qname.catalog, qname.schema, qname.name); + return BindSequence(context, qname.catalog, qname.schema, qname.name); +} + +struct NextValLocalState : public FunctionLocalState { + explicit NextValLocalState(DuckTransaction &transaction, SequenceCatalogEntry &sequence) + : transaction(transaction), sequence(sequence) { + } + + DuckTransaction &transaction; + SequenceCatalogEntry &sequence; +}; + +unique_ptr NextValLocalFunction(ExpressionState &state, const BoundFunctionExpression &expr, + FunctionData *bind_data) { + if (!bind_data) { + return nullptr; + } + auto &context = state.GetContext(); + auto &info = bind_data->Cast(); + auto &sequence = info.sequence; + auto &transaction = DuckTransaction::Get(context, sequence.catalog); + return make_uniq(transaction, sequence); } template static void NextValFunction(DataChunk &args, ExpressionState &state, Vector &result) { auto &func_expr = state.expr.Cast(); - auto &info = func_expr.bind_info->Cast(); - auto &input = args.data[0]; - - auto &context = state.GetContext(); - if (info.sequence) { - auto &sequence = *info.sequence; - auto &transaction = DuckTransaction::Get(context, sequence.catalog); - // sequence to use is hard coded - // increment the sequence - result.SetVectorType(VectorType::FLAT_VECTOR); - auto result_data = FlatVector::GetData(result); - for (idx_t i = 0; i < args.size(); i++) { - // get the next value from the sequence - result_data[i] = OP::Operation(transaction, sequence); - } - } else { - // sequence to use comes from the input - UnaryExecutor::Execute(input, result, args.size(), [&](string_t value) { - // fetch the sequence from the catalog - auto &sequence = BindSequence(context, value.GetString()); - // finally get the next value from the sequence - auto &transaction = DuckTransaction::Get(context, sequence.catalog); - return OP::Operation(transaction, sequence); - }); + if (!func_expr.bind_info) { + // no bind info - return null + result.SetVectorType(VectorType::CONSTANT_VECTOR); + ConstantVector::SetNull(result, true); + return; + } + auto &lstate = ExecuteFunctionState::GetFunctionState(state)->Cast(); + // sequence to use is hard coded + // increment the sequence + result.SetVectorType(VectorType::FLAT_VECTOR); + auto result_data = FlatVector::GetData(result); + for (idx_t i = 0; i < args.size(); i++) { + // get the next value from the sequence + result_data[i] = OP::Operation(lstate.transaction, lstate.sequence); } } -static unique_ptr NextValBind(ClientContext &context, ScalarFunction &bound_function, +static unique_ptr NextValBind(ClientContext &context, ScalarFunction &, vector> &arguments) { - optional_ptr sequence; - if (arguments[0]->IsFoldable()) { - // parameter to nextval function is a foldable constant - // evaluate the constant and perform the catalog lookup already - auto seqname = ExpressionExecutor::EvaluateScalar(context, *arguments[0]); - if (!seqname.IsNull()) { - sequence = &BindSequence(context, seqname.ToString()); - } + if (!arguments[0]->IsFoldable()) { + throw NotImplementedException( + "currval/nextval requires a constant sequence - non-constant sequences are no longer supported"); } - return make_uniq(sequence); + // parameter to nextval function is a foldable constant + // evaluate the constant and perform the catalog lookup already + auto seqname = ExpressionExecutor::EvaluateScalar(context, *arguments[0]); + if (seqname.IsNull()) { + return nullptr; + } + auto &seq = BindSequence(context, seqname.ToString()); + return make_uniq(seq); } static void NextValDependency(BoundFunctionExpression &expr, LogicalDependencyList &dependencies) { - auto &info = expr.bind_info->Cast(); - if (info.sequence) { - dependencies.AddDependency(*info.sequence); + if (!expr.bind_info) { + return; } + auto &info = expr.bind_info->Cast(); + dependencies.AddDependency(info.sequence); } void Serialize(Serializer &serializer, const optional_ptr bind_data, const ScalarFunction &) { @@ -93,14 +112,21 @@ void Serialize(Serializer &serializer, const optional_ptr bind_dat unique_ptr Deserialize(Deserializer &deserializer, ScalarFunction &) { auto create_info = deserializer.ReadPropertyWithDefault>(100, "sequence_create_info", unique_ptr()); - optional_ptr catalog_entry_ptr; - if (create_info) { - auto &seq_info = create_info->Cast(); - auto &context = deserializer.Get(); - catalog_entry_ptr = - &Catalog::GetEntry(context, seq_info.catalog, seq_info.schema, seq_info.name); + if (!create_info) { + return nullptr; + } + auto &seq_info = create_info->Cast(); + auto &context = deserializer.Get(); + auto &sequence = BindSequence(context, seq_info.catalog, seq_info.schema, seq_info.name); + return make_uniq(sequence); +} + +void NextValModifiedDatabases(FunctionModifiedDatabasesInput &input) { + if (!input.bind_data) { + return; } - return make_uniq(catalog_entry_ptr); + auto &seq = input.bind_data->Cast(); + input.modified_databases.insert(seq.sequence.ParentCatalog().GetName()); } void NextvalFun::RegisterFunction(BuiltinFunctions &set) { @@ -109,6 +135,8 @@ void NextvalFun::RegisterFunction(BuiltinFunctions &set) { next_val.stability = FunctionStability::VOLATILE; next_val.serialize = Serialize; next_val.deserialize = Deserialize; + next_val.get_modified_databases = NextValModifiedDatabases; + next_val.init_local_state = NextValLocalFunction; set.AddFunction(next_val); } @@ -118,6 +146,7 @@ void CurrvalFun::RegisterFunction(BuiltinFunctions &set) { curr_val.stability = FunctionStability::VOLATILE; curr_val.serialize = Serialize; curr_val.deserialize = Deserialize; + curr_val.init_local_state = NextValLocalFunction; set.AddFunction(curr_val); } diff --git a/src/duckdb/src/function/scalar/strftime_format.cpp b/src/duckdb/src/function/scalar/strftime_format.cpp index f0ec2492..d4cf4067 100644 --- a/src/duckdb/src/function/scalar/strftime_format.cpp +++ b/src/duckdb/src/function/scalar/strftime_format.cpp @@ -80,7 +80,7 @@ idx_t StrfTimeFormat::GetSpecifierLength(StrTimeSpecifier specifier, date_t date if (0 <= year && year <= 9999) { return 4; } else { - return NumericHelper::SignedLength(year); + return UnsafeNumericCast(NumericHelper::SignedLength(year)); } } case StrTimeSpecifier::MONTH_DECIMAL: { @@ -129,11 +129,14 @@ idx_t StrfTimeFormat::GetSpecifierLength(StrTimeSpecifier specifier, date_t date return len; } case StrTimeSpecifier::DAY_OF_MONTH: - return NumericHelper::UnsignedLength(Date::ExtractDay(date)); + return UnsafeNumericCast( + NumericHelper::UnsignedLength(UnsafeNumericCast(Date::ExtractDay(date)))); case StrTimeSpecifier::DAY_OF_YEAR_DECIMAL: - return NumericHelper::UnsignedLength(Date::ExtractDayOfTheYear(date)); + return UnsafeNumericCast( + NumericHelper::UnsignedLength(UnsafeNumericCast(Date::ExtractDayOfTheYear(date)))); case StrTimeSpecifier::YEAR_WITHOUT_CENTURY: - return NumericHelper::UnsignedLength(AbsValue(Date::ExtractYear(date)) % 100); + return UnsafeNumericCast(NumericHelper::UnsignedLength( + UnsafeNumericCast(AbsValue(Date::ExtractYear(date)) % 100))); default: throw InternalException("Unimplemented specifier for GetSpecifierLength"); } @@ -195,13 +198,13 @@ char *StrfTimeFormat::WritePadded(char *target, uint32_t value, size_t padding) D_ASSERT(padding > 1); if (padding % 2) { int decimals = value % 1000; - WritePadded3(target + padding - 3, decimals); + WritePadded3(target + padding - 3, UnsafeNumericCast(decimals)); value /= 1000; padding -= 3; } for (size_t i = 0; i < padding / 2; i++) { int decimals = value % 100; - WritePadded2(target + padding - 2 * (i + 1), decimals); + WritePadded2(target + padding - 2 * (i + 1), UnsafeNumericCast(decimals)); value /= 100; } return target + padding; @@ -245,26 +248,26 @@ char *StrfTimeFormat::WriteDateSpecifier(StrTimeSpecifier specifier, date_t date } case StrTimeSpecifier::DAY_OF_YEAR_PADDED: { int32_t doy = Date::ExtractDayOfTheYear(date); - target = WritePadded3(target, doy); + target = WritePadded3(target, UnsafeNumericCast(doy)); break; } case StrTimeSpecifier::WEEK_NUMBER_PADDED_MON_FIRST: - target = WritePadded2(target, Date::ExtractWeekNumberRegular(date, true)); + target = WritePadded2(target, UnsafeNumericCast(Date::ExtractWeekNumberRegular(date, true))); break; case StrTimeSpecifier::WEEK_NUMBER_PADDED_SUN_FIRST: - target = WritePadded2(target, Date::ExtractWeekNumberRegular(date, false)); + target = WritePadded2(target, UnsafeNumericCast(Date::ExtractWeekNumberRegular(date, false))); break; case StrTimeSpecifier::WEEK_NUMBER_ISO: - target = WritePadded2(target, Date::ExtractISOWeekNumber(date)); + target = WritePadded2(target, UnsafeNumericCast(Date::ExtractISOWeekNumber(date))); break; case StrTimeSpecifier::DAY_OF_YEAR_DECIMAL: { - uint32_t doy = Date::ExtractDayOfTheYear(date); + auto doy = UnsafeNumericCast(Date::ExtractDayOfTheYear(date)); target += NumericHelper::UnsignedLength(doy); NumericHelper::FormatUnsigned(doy, target); break; } case StrTimeSpecifier::YEAR_ISO: - target = WritePadded(target, Date::ExtractISOYearNumber(date), 4); + target = WritePadded(target, UnsafeNumericCast(Date::ExtractISOYearNumber(date)), 4); break; case StrTimeSpecifier::WEEKDAY_ISO: *target = char('0' + uint8_t(Date::ExtractISODayOfTheWeek(date))); @@ -281,7 +284,7 @@ char *StrfTimeFormat::WriteStandardSpecifier(StrTimeSpecifier specifier, int32_t // data contains [0] year, [1] month, [2] day, [3] hour, [4] minute, [5] second, [6] msec, [7] utc switch (specifier) { case StrTimeSpecifier::DAY_OF_MONTH_PADDED: - target = WritePadded2(target, data[2]); + target = WritePadded2(target, UnsafeNumericCast(data[2])); break; case StrTimeSpecifier::ABBREVIATED_MONTH_NAME: { auto &month_name = Date::MONTH_NAMES_ABBREVIATED[data[1] - 1]; @@ -292,14 +295,14 @@ char *StrfTimeFormat::WriteStandardSpecifier(StrTimeSpecifier specifier, int32_t return WriteString(target, month_name); } case StrTimeSpecifier::MONTH_DECIMAL_PADDED: - target = WritePadded2(target, data[1]); + target = WritePadded2(target, UnsafeNumericCast(data[1])); break; case StrTimeSpecifier::YEAR_WITHOUT_CENTURY_PADDED: - target = WritePadded2(target, AbsValue(data[0]) % 100); + target = WritePadded2(target, UnsafeNumericCast(AbsValue(data[0]) % 100)); break; case StrTimeSpecifier::YEAR_DECIMAL: if (data[0] >= 0 && data[0] <= 9999) { - target = WritePadded(target, data[0], 4); + target = WritePadded(target, UnsafeNumericCast(data[0]), 4); } else { int32_t year = data[0]; if (data[0] < 0) { @@ -307,13 +310,13 @@ char *StrfTimeFormat::WriteStandardSpecifier(StrTimeSpecifier specifier, int32_t year = -year; target++; } - auto len = NumericHelper::UnsignedLength(year); + auto len = NumericHelper::UnsignedLength(UnsafeNumericCast(year)); NumericHelper::FormatUnsigned(year, target + len); target += len; } break; case StrTimeSpecifier::HOUR_24_PADDED: { - target = WritePadded2(target, data[3]); + target = WritePadded2(target, UnsafeNumericCast(data[3])); break; } case StrTimeSpecifier::HOUR_12_PADDED: { @@ -321,7 +324,7 @@ char *StrfTimeFormat::WriteStandardSpecifier(StrTimeSpecifier specifier, int32_t if (hour == 0) { hour = 12; } - target = WritePadded2(target, hour); + target = WritePadded2(target, UnsafeNumericCast(hour)); break; } case StrTimeSpecifier::AM_PM: @@ -329,20 +332,20 @@ char *StrfTimeFormat::WriteStandardSpecifier(StrTimeSpecifier specifier, int32_t *target++ = 'M'; break; case StrTimeSpecifier::MINUTE_PADDED: { - target = WritePadded2(target, data[4]); + target = WritePadded2(target, UnsafeNumericCast(data[4])); break; } case StrTimeSpecifier::SECOND_PADDED: - target = WritePadded2(target, data[5]); + target = WritePadded2(target, UnsafeNumericCast(data[5])); break; case StrTimeSpecifier::NANOSECOND_PADDED: - target = WritePadded(target, data[6] * Interval::NANOS_PER_MICRO, 9); + target = WritePadded(target, UnsafeNumericCast(data[6] * Interval::NANOS_PER_MICRO), 9); break; case StrTimeSpecifier::MICROSECOND_PADDED: - target = WritePadded(target, data[6], 6); + target = WritePadded(target, UnsafeNumericCast(data[6]), 6); break; case StrTimeSpecifier::MILLISECOND_PADDED: - target = WritePadded3(target, data[6] / Interval::MICROS_PER_MSEC); + target = WritePadded3(target, UnsafeNumericCast(data[6] / Interval::MICROS_PER_MSEC)); break; case StrTimeSpecifier::UTC_OFFSET: { *target++ = (data[7] < 0) ? '-' : '+'; @@ -350,10 +353,10 @@ char *StrfTimeFormat::WriteStandardSpecifier(StrTimeSpecifier specifier, int32_t auto offset = abs(data[7]); auto offset_hours = offset / Interval::MINS_PER_HOUR; auto offset_minutes = offset % Interval::MINS_PER_HOUR; - target = WritePadded2(target, offset_hours); + target = WritePadded2(target, UnsafeNumericCast(offset_hours)); if (offset_minutes) { *target++ = ':'; - target = WritePadded2(target, offset_minutes); + target = WritePadded2(target, UnsafeNumericCast(offset_minutes)); } break; } @@ -364,7 +367,7 @@ char *StrfTimeFormat::WriteStandardSpecifier(StrTimeSpecifier specifier, int32_t } break; case StrTimeSpecifier::DAY_OF_MONTH: { - target = Write2(target, data[2] % 100); + target = Write2(target, UnsafeNumericCast(data[2] % 100)); break; } case StrTimeSpecifier::MONTH_DECIMAL: { @@ -372,7 +375,7 @@ char *StrfTimeFormat::WriteStandardSpecifier(StrTimeSpecifier specifier, int32_t break; } case StrTimeSpecifier::YEAR_WITHOUT_CENTURY: { - target = Write2(target, AbsValue(data[0]) % 100); + target = Write2(target, UnsafeNumericCast(AbsValue(data[0]) % 100)); break; } case StrTimeSpecifier::HOUR_24_DECIMAL: { @@ -740,8 +743,7 @@ int32_t StrpTimeFormat::TryParseCollection(const char *data, idx_t &pos, idx_t s return -1; } -//! Parses a timestamp using the given specifier -bool StrpTimeFormat::Parse(string_t str, ParseResult &result) const { +bool StrpTimeFormat::Parse(const char *data, size_t size, ParseResult &result) const { auto &result_data = result.data; auto &error_message = result.error_message; auto &error_position = result.error_position; @@ -755,15 +757,11 @@ bool StrpTimeFormat::Parse(string_t str, ParseResult &result) const { result_data[5] = 0; result_data[6] = 0; result_data[7] = 0; - - auto data = str.GetData(); - idx_t size = str.GetSize(); // skip leading spaces while (StringUtil::CharacterIsSpace(*data)) { data++; size--; } - // Check for specials // Precheck for alphas for performance. idx_t pos = 0; @@ -845,9 +843,9 @@ bool StrpTimeFormat::Parse(string_t str, ParseResult &result) const { // numeric specifier: parse a number uint64_t number = 0; size_t start_pos = pos; - size_t end_pos = start_pos + numeric_width[i]; + size_t end_pos = start_pos + UnsafeNumericCast(numeric_width[i]); while (pos < size && pos < end_pos && StringUtil::CharacterIsDigit(data[pos])) { - number = number * 10 + data[pos] - '0'; + number = number * 10 + UnsafeNumericCast(data[pos]) - '0'; pos++; } if (pos == start_pos) { @@ -1067,7 +1065,6 @@ bool StrpTimeFormat::Parse(string_t str, ParseResult &result) const { case StrTimeSpecifier::YEAR_DECIMAL: // Just validate, don't use break; - break; case StrTimeSpecifier::WEEKDAY_DECIMAL: // First offset specifier offset_specifier = specifiers[i]; @@ -1229,7 +1226,7 @@ bool StrpTimeFormat::Parse(string_t str, ParseResult &result) const { // But tz must not be empty. if (tz_end == tz_begin) { error_message = "Empty Time Zone name"; - error_position = tz_begin - data; + error_position = UnsafeNumericCast(tz_begin - data); return false; } result.tz.assign(tz_begin, tz_end); @@ -1288,7 +1285,9 @@ bool StrpTimeFormat::Parse(string_t str, ParseResult &result) const { case StrTimeSpecifier::WEEK_NUMBER_PADDED_MON_FIRST: { // Adjust weekday to be 0-based for the week type if (has_weekday) { - weekday = (weekday + 7 - int(offset_specifier == StrTimeSpecifier::WEEK_NUMBER_PADDED_MON_FIRST)) % 7; + weekday = (weekday + 7 - + static_cast(offset_specifier == StrTimeSpecifier::WEEK_NUMBER_PADDED_MON_FIRST)) % + 7; } // Get the start of week 1, move back 7 days and then weekno * 7 + weekday gives the date const auto jan1 = Date::FromDate(result_data[0], 1, 1); @@ -1324,6 +1323,13 @@ bool StrpTimeFormat::Parse(string_t str, ParseResult &result) const { return true; } +//! Parses a timestamp using the given specifier +bool StrpTimeFormat::Parse(string_t str, ParseResult &result) const { + auto data = str.GetData(); + idx_t size = str.GetSize(); + return Parse(data, size, result); +} + StrpTimeFormat::ParseResult StrpTimeFormat::Parse(const string &format_string, const string &text) { StrpTimeFormat format; format.format_specifier = format_string; @@ -1413,6 +1419,14 @@ bool StrpTimeFormat::TryParseDate(string_t input, date_t &result, string &error_ return parse_result.TryToDate(result); } +bool StrpTimeFormat::TryParseDate(const char *data, size_t size, date_t &result) const { + ParseResult parse_result; + if (!Parse(data, size, parse_result)) { + return false; + } + return parse_result.TryToDate(result); +} + bool StrpTimeFormat::TryParseTime(string_t input, dtime_t &result, string &error_message) const { ParseResult parse_result; if (!Parse(input, parse_result)) { @@ -1431,4 +1445,12 @@ bool StrpTimeFormat::TryParseTimestamp(string_t input, timestamp_t &result, stri return parse_result.TryToTimestamp(result); } +bool StrpTimeFormat::TryParseTimestamp(const char *data, size_t size, timestamp_t &result) const { + ParseResult parse_result; + if (!Parse(data, size, parse_result)) { + return false; + } + return parse_result.TryToTimestamp(result); +} + } // namespace duckdb diff --git a/src/duckdb/src/function/scalar/string/caseconvert.cpp b/src/duckdb/src/function/scalar/string/caseconvert.cpp index 100ed976..fa5b612f 100644 --- a/src/duckdb/src/function/scalar/string/caseconvert.cpp +++ b/src/duckdb/src/function/scalar/string/caseconvert.cpp @@ -44,8 +44,8 @@ static string_t ASCIICaseConvert(Vector &result, const char *input_data, idx_t i auto result_str = StringVector::EmptyString(result, output_length); auto result_data = result_str.GetDataWriteable(); for (idx_t i = 0; i < input_length; i++) { - result_data[i] = IS_UPPER ? UpperFun::ASCII_TO_UPPER_MAP[uint8_t(input_data[i])] - : LowerFun::ASCII_TO_LOWER_MAP[uint8_t(input_data[i])]; + result_data[i] = UnsafeNumericCast(IS_UPPER ? UpperFun::ASCII_TO_UPPER_MAP[uint8_t(input_data[i])] + : LowerFun::ASCII_TO_LOWER_MAP[uint8_t(input_data[i])]); } result_str.Finalize(); return result_str; @@ -58,12 +58,12 @@ static idx_t GetResultLength(const char *input_data, idx_t input_length) { if (input_data[i] & 0x80) { // unicode int sz = 0; - int codepoint = utf8proc_codepoint(input_data + i, sz); - int converted_codepoint = IS_UPPER ? utf8proc_toupper(codepoint) : utf8proc_tolower(codepoint); - int new_sz = utf8proc_codepoint_length(converted_codepoint); + auto codepoint = utf8proc_codepoint(input_data + i, sz); + auto converted_codepoint = IS_UPPER ? utf8proc_toupper(codepoint) : utf8proc_tolower(codepoint); + auto new_sz = utf8proc_codepoint_length(converted_codepoint); D_ASSERT(new_sz >= 0); - output_length += new_sz; - i += sz; + output_length += UnsafeNumericCast(new_sz); + i += UnsafeNumericCast(sz); } else { // ascii output_length++; @@ -79,17 +79,17 @@ static void CaseConvert(const char *input_data, idx_t input_length, char *result if (input_data[i] & 0x80) { // non-ascii character int sz = 0, new_sz = 0; - int codepoint = utf8proc_codepoint(input_data + i, sz); - int converted_codepoint = IS_UPPER ? utf8proc_toupper(codepoint) : utf8proc_tolower(codepoint); + auto codepoint = utf8proc_codepoint(input_data + i, sz); + auto converted_codepoint = IS_UPPER ? utf8proc_toupper(codepoint) : utf8proc_tolower(codepoint); auto success = utf8proc_codepoint_to_utf8(converted_codepoint, new_sz, result_data); D_ASSERT(success); (void)success; result_data += new_sz; - i += sz; + i += UnsafeNumericCast(sz); } else { // ascii - *result_data = IS_UPPER ? UpperFun::ASCII_TO_UPPER_MAP[uint8_t(input_data[i])] - : LowerFun::ASCII_TO_LOWER_MAP[uint8_t(input_data[i])]; + *result_data = UnsafeNumericCast(IS_UPPER ? UpperFun::ASCII_TO_UPPER_MAP[uint8_t(input_data[i])] + : LowerFun::ASCII_TO_LOWER_MAP[uint8_t(input_data[i])]); result_data++; i++; } diff --git a/src/duckdb/src/function/scalar/string/contains.cpp b/src/duckdb/src/function/scalar/string/contains.cpp index fb68e00e..3e24ed6a 100644 --- a/src/duckdb/src/function/scalar/string/contains.cpp +++ b/src/duckdb/src/function/scalar/string/contains.cpp @@ -22,7 +22,7 @@ static idx_t ContainsUnaligned(const unsigned char *haystack, idx_t haystack_siz UNSIGNED haystack_entry = 0; const UNSIGNED start = (sizeof(UNSIGNED) * 8) - 8; const UNSIGNED shift = (sizeof(UNSIGNED) - NEEDLE_SIZE) * 8; - for (int i = 0; i < NEEDLE_SIZE; i++) { + for (idx_t i = 0; i < NEEDLE_SIZE; i++) { needle_entry |= UNSIGNED(needle[i]) << UNSIGNED(start - i * 8); haystack_entry |= UNSIGNED(haystack[i]) << UNSIGNED(start - i * 8); } @@ -106,7 +106,7 @@ idx_t ContainsFun::Find(const unsigned char *haystack, idx_t haystack_size, cons if (location == nullptr) { return DConstants::INVALID_INDEX; } - idx_t base_offset = const_uchar_ptr_cast(location) - haystack; + idx_t base_offset = UnsafeNumericCast(const_uchar_ptr_cast(location) - haystack); haystack_size -= base_offset; haystack = const_uchar_ptr_cast(location); // switch algorithm depending on needle size diff --git a/src/duckdb/src/function/scalar/string/length.cpp b/src/duckdb/src/function/scalar/string/length.cpp index dd88fd8d..5ad1438c 100644 --- a/src/duckdb/src/function/scalar/string/length.cpp +++ b/src/duckdb/src/function/scalar/string/length.cpp @@ -29,14 +29,14 @@ struct GraphemeCountOperator { struct StrLenOperator { template static inline TR Operation(TA input) { - return input.GetSize(); + return UnsafeNumericCast(input.GetSize()); } }; struct OctetLenOperator { template static inline TR Operation(TA input) { - return Bit::OctetLength(input); + return UnsafeNumericCast(Bit::OctetLength(input)); } }; @@ -44,7 +44,7 @@ struct OctetLenOperator { struct BitLenOperator { template static inline TR Operation(TA input) { - return 8 * input.GetSize(); + return UnsafeNumericCast(8 * input.GetSize()); } }; @@ -52,7 +52,7 @@ struct BitLenOperator { struct BitStringLenOperator { template static inline TR Operation(TA input) { - return Bit::BitLength(input); + return UnsafeNumericCast(Bit::BitLength(input)); } }; @@ -73,8 +73,8 @@ static unique_ptr LengthPropagateStats(ClientContext &context, F static void ListLengthFunction(DataChunk &args, ExpressionState &state, Vector &result) { auto &input = args.data[0]; D_ASSERT(input.GetType().id() == LogicalTypeId::LIST); - UnaryExecutor::Execute(input, result, args.size(), - [](list_entry_t input) { return input.length; }); + UnaryExecutor::Execute( + input, result, args.size(), [](list_entry_t input) { return UnsafeNumericCast(input.length); }); if (args.AllConstant()) { result.SetVectorType(VectorType::CONSTANT_VECTOR); } @@ -138,7 +138,7 @@ static void ListLengthBinaryFunction(DataChunk &args, ExpressionState &, Vector if (dimension != 1) { throw NotImplementedException("array_length for lists with dimensions other than 1 not implemented"); } - return input.length; + return UnsafeNumericCast(input.length); }); if (args.AllConstant()) { result.SetVectorType(VectorType::CONSTANT_VECTOR); @@ -174,7 +174,7 @@ static void ArrayLengthBinaryFunction(DataChunk &args, ExpressionState &state, V throw OutOfRangeException(StringUtil::Format( "array_length dimension '%lld' out of range (min: '1', max: '%lld')", dimension, max_dimension)); } - return dimensions[dimension - 1]; + return dimensions[UnsafeNumericCast(dimension - 1)]; }); if (args.AllConstant()) { @@ -196,7 +196,7 @@ static unique_ptr ArrayOrListLengthBinaryBind(ClientContext &conte vector dimensions; while (true) { if (type.id() == LogicalTypeId::ARRAY) { - dimensions.push_back(ArrayType::GetSize(type)); + dimensions.push_back(UnsafeNumericCast(ArrayType::GetSize(type))); type = ArrayType::GetChildType(type); } else { break; diff --git a/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp b/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp index f8a5736b..0e6cfa7d 100644 --- a/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +++ b/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp @@ -96,7 +96,7 @@ void ExtractSingleTuple(const string_t &string, duckdb_re2::RE2 &pattern, int32_ // Every group is a substring of the original, we can find out the offset using the pointer // the 'match_group' address is guaranteed to be bigger than that of the source D_ASSERT(const_char_ptr_cast(match_group.begin()) >= string.GetData()); - idx_t offset = match_group.begin() - string.GetData(); + auto offset = UnsafeNumericCast(match_group.begin() - string.GetData()); list_content[child_idx] = string_t(string.GetData() + offset, UnsafeNumericCast(match_group.size())); } @@ -199,7 +199,7 @@ void RegexpExtractAll::Execute(DataChunk &args, ExpressionState &state, Vector & if (group_count_p == -1) { throw InvalidInputException("Pattern failed to parse, error: '%s'", stored_re->error()); } - non_const_args->SetSize(group_count_p); + non_const_args->SetSize(UnsafeNumericCast(group_count_p)); } } diff --git a/src/duckdb/src/function/scalar/string/strip_accents.cpp b/src/duckdb/src/function/scalar/string/strip_accents.cpp index 758c7264..1883c60f 100644 --- a/src/duckdb/src/function/scalar/string/strip_accents.cpp +++ b/src/duckdb/src/function/scalar/string/strip_accents.cpp @@ -22,7 +22,8 @@ struct StripAccentsOperator { } // non-ascii, perform collation - auto stripped = utf8proc_remove_accents((const utf8proc_uint8_t *)input.GetData(), input.GetSize()); + auto stripped = utf8proc_remove_accents((const utf8proc_uint8_t *)input.GetData(), + UnsafeNumericCast(input.GetSize())); auto result_str = StringVector::AddString(result, const_char_ptr_cast(stripped)); free(stripped); return result_str; diff --git a/src/duckdb/src/function/scalar/string/substring.cpp b/src/duckdb/src/function/scalar/string/substring.cpp index b0b2d816..76f4859f 100644 --- a/src/duckdb/src/function/scalar/string/substring.cpp +++ b/src/duckdb/src/function/scalar/string/substring.cpp @@ -40,9 +40,9 @@ string_t SubstringEmptyString(Vector &result) { } string_t SubstringSlice(Vector &result, const char *input_data, int64_t offset, int64_t length) { - auto result_string = StringVector::EmptyString(result, length); + auto result_string = StringVector::EmptyString(result, UnsafeNumericCast(length)); auto result_data = result_string.GetDataWriteable(); - memcpy(result_data, input_data + offset, length); + memcpy(result_data, input_data + offset, UnsafeNumericCast(length)); result_string.Finalize(); return result_string; } @@ -88,10 +88,10 @@ string_t SubstringASCII(Vector &result, string_t input, int64_t offset, int64_t AssertInSupportedRange(input_size, offset, length); int64_t start, end; - if (!SubstringStartEnd(input_size, offset, length, start, end)) { + if (!SubstringStartEnd(UnsafeNumericCast(input_size), offset, length, start, end)) { return SubstringEmptyString(result); } - return SubstringSlice(result, input_data, start, end - start); + return SubstringSlice(result, input_data, start, UnsafeNumericCast(end - start)); } string_t SubstringFun::SubstringUnicode(Vector &result, string_t input, int64_t offset, int64_t length) { @@ -186,7 +186,8 @@ string_t SubstringFun::SubstringUnicode(Vector &result, string_t input, int64_t } D_ASSERT(end_pos >= start_pos); // after we have found these, we can slice the substring - return SubstringSlice(result, input_data, start_pos, end_pos - start_pos); + return SubstringSlice(result, input_data, UnsafeNumericCast(start_pos), + UnsafeNumericCast(end_pos - start_pos)); } string_t SubstringFun::SubstringGrapheme(Vector &result, string_t input, int64_t offset, int64_t length) { @@ -198,14 +199,14 @@ string_t SubstringFun::SubstringGrapheme(Vector &result, string_t input, int64_t // we don't know yet if the substring is ascii, but we assume it is (for now) // first get the start and end as if this was an ascii string int64_t start, end; - if (!SubstringStartEnd(input_size, offset, length, start, end)) { + if (!SubstringStartEnd(UnsafeNumericCast(input_size), offset, length, start, end)) { return SubstringEmptyString(result); } // now check if all the characters between 0 and end are ascii characters // note that we scan one further to check for a potential combining diacritics (e.g. i + diacritic is ï) bool is_ascii = true; - idx_t ascii_end = MinValue(end + 1, input_size); + idx_t ascii_end = MinValue(UnsafeNumericCast(end + 1), input_size); for (idx_t i = 0; i < ascii_end; i++) { if (input_data[i] & 0x80) { // found a non-ascii character: eek @@ -229,7 +230,7 @@ string_t SubstringFun::SubstringGrapheme(Vector &result, string_t input, int64_t return true; }); // now call substring start and end again, but with the number of unicode characters this time - SubstringStartEnd(num_characters, offset, length, start, end); + SubstringStartEnd(UnsafeNumericCast(num_characters), offset, length, start, end); } // now scan the graphemes of the string to find the positions of the start and end characters @@ -249,7 +250,8 @@ string_t SubstringFun::SubstringGrapheme(Vector &result, string_t input, int64_t return SubstringEmptyString(result); } // after we have found these, we can slice the substring - return SubstringSlice(result, input_data, start_pos, end_pos - start_pos); + return SubstringSlice(result, input_data, UnsafeNumericCast(start_pos), + UnsafeNumericCast(end_pos - start_pos)); } struct SubstringUnicodeOp { diff --git a/src/duckdb/src/function/scalar/struct/struct_extract.cpp b/src/duckdb/src/function/scalar/struct/struct_extract.cpp index 50e033b7..2572cb51 100644 --- a/src/duckdb/src/function/scalar/struct/struct_extract.cpp +++ b/src/duckdb/src/function/scalar/struct/struct_extract.cpp @@ -133,8 +133,8 @@ static unique_ptr StructExtractBindIndex(ClientContext &context, S throw BinderException("Key index %lld for struct_extract out of range - expected an index between 1 and %llu", index, struct_children.size()); } - bound_function.return_type = struct_children[index - 1].second; - return make_uniq(index - 1); + bound_function.return_type = struct_children[NumericCast(index - 1)].second; + return make_uniq(NumericCast(index - 1)); } static unique_ptr PropagateStructExtractStats(ClientContext &context, FunctionStatisticsInput &input) { diff --git a/src/duckdb/src/function/scalar_function.cpp b/src/duckdb/src/function/scalar_function.cpp index ceebf3d5..6b02a00a 100644 --- a/src/duckdb/src/function/scalar_function.cpp +++ b/src/duckdb/src/function/scalar_function.cpp @@ -13,7 +13,8 @@ ScalarFunction::ScalarFunction(string name, vector arguments, Logic : BaseScalarFunction(std::move(name), std::move(arguments), std::move(return_type), side_effects, std::move(varargs), null_handling), function(std::move(function)), bind(bind), init_local_state(init_local_state), dependency(dependency), - statistics(statistics), bind_lambda(bind_lambda), serialize(nullptr), deserialize(nullptr) { + statistics(statistics), bind_lambda(bind_lambda), get_modified_databases(nullptr), serialize(nullptr), + deserialize(nullptr) { } ScalarFunction::ScalarFunction(vector arguments, LogicalType return_type, scalar_function_t function, diff --git a/src/duckdb/src/function/table/arrow.cpp b/src/duckdb/src/function/table/arrow.cpp index dd742b78..b7054fd0 100644 --- a/src/duckdb/src/function/table/arrow.cpp +++ b/src/duckdb/src/function/table/arrow.cpp @@ -10,6 +10,7 @@ #include "duckdb/function/table_function.hpp" #include "duckdb/parser/parsed_data/create_table_function_info.hpp" #include "duckdb/function/table/arrow/arrow_duck_schema.hpp" +#include "duckdb/parser/tableref/table_function_ref.hpp" #include "utf8proc_wrapper.hpp" namespace duckdb { @@ -117,7 +118,7 @@ static unique_ptr GetArrowLogicalTypeNoDictionary(ArrowSchema &schema return list_type; } else if (format[0] == '+' && format[1] == 'w') { std::string parameters = format.substr(format.find(':') + 1); - idx_t fixed_size = std::stoi(parameters); + auto fixed_size = NumericCast(std::stoi(parameters)); auto child_type = ArrowTableFunction::GetArrowLogicalType(*schema.children[0]); auto list_type = make_uniq(LogicalType::ARRAY(child_type->GetDuckType(), fixed_size), fixed_size); list_type->AddChild(std::move(child_type)); @@ -204,7 +205,7 @@ static unique_ptr GetArrowLogicalTypeNoDictionary(ArrowSchema &schema return make_uniq(LogicalType::BLOB, ArrowVariableSizeType::SUPER_SIZE); } else if (format[0] == 'w') { std::string parameters = format.substr(format.find(':') + 1); - idx_t fixed_size = std::stoi(parameters); + auto fixed_size = NumericCast(std::stoi(parameters)); return make_uniq(LogicalType::BLOB, fixed_size); } else if (format[0] == 't' && format[1] == 's') { // Timestamp with Timezone @@ -257,18 +258,30 @@ unique_ptr ArrowTableFunction::ArrowScanBind(ClientContext &contex if (input.inputs[0].IsNull() || input.inputs[1].IsNull() || input.inputs[2].IsNull()) { throw BinderException("arrow_scan: pointers cannot be null"); } + auto &ref = input.ref; + + shared_ptr dependency; + if (ref.external_dependency) { + // This was created during the replacement scan for Python (see python_replacement_scan.cpp) + // this object is the owning reference to 'stream_factory_ptr' and has to be kept alive. + dependency = ref.external_dependency->GetDependency("replacement_cache"); + D_ASSERT(dependency); + } auto stream_factory_ptr = input.inputs[0].GetPointer(); auto stream_factory_produce = (stream_factory_produce_t)input.inputs[1].GetPointer(); // NOLINT auto stream_factory_get_schema = (stream_factory_get_schema_t)input.inputs[2].GetPointer(); // NOLINT - auto res = make_uniq(stream_factory_produce, stream_factory_ptr); + auto res = make_uniq(stream_factory_produce, stream_factory_ptr, std::move(dependency)); auto &data = *res; stream_factory_get_schema(reinterpret_cast(stream_factory_ptr), data.schema_root.arrow_schema); PopulateArrowTableType(res->arrow_table, data.schema_root, names, return_types); QueryResult::DeduplicateColumns(names); res->all_types = return_types; + if (return_types.empty()) { + throw InvalidInputException("Provided table/dataframe must have at least one column"); + } return std::move(res); } @@ -373,7 +386,8 @@ void ArrowTableFunction::ArrowScanFunction(ClientContext &context, TableFunction return; } } - int64_t output_size = MinValue(STANDARD_VECTOR_SIZE, state.chunk->arrow_array.length - state.chunk_offset); + auto output_size = + MinValue(STANDARD_VECTOR_SIZE, NumericCast(state.chunk->arrow_array.length) - state.chunk_offset); data.lines_read += output_size; if (global_state.CanRemoveFilterColumns()) { state.all_columns.Reset(); diff --git a/src/duckdb/src/function/table/arrow_conversion.cpp b/src/duckdb/src/function/table/arrow_conversion.cpp index 55058683..c1759ef8 100644 --- a/src/duckdb/src/function/table/arrow_conversion.cpp +++ b/src/duckdb/src/function/table/arrow_conversion.cpp @@ -40,12 +40,12 @@ idx_t GetEffectiveOffset(ArrowArray &array, int64_t parent_offset, const ArrowSc if (nested_offset != -1) { // The parent of this array is a list // We just ignore the parent offset, it's already applied to the list - return array.offset + nested_offset; + return UnsafeNumericCast(array.offset + nested_offset); } // Parent offset is set in the case of a struct, it applies to all child arrays // 'chunk_offset' is how much of the chunk we've already scanned, in case the chunk size exceeds // STANDARD_VECTOR_SIZE - return array.offset + parent_offset + state.chunk_offset; + return UnsafeNumericCast(array.offset + parent_offset) + state.chunk_offset; } template @@ -158,7 +158,8 @@ static void ArrowToDuckDBList(Vector &vector, ArrowArray &array, ArrowArrayScanS ListVector::Reserve(vector, list_size); ListVector::SetListSize(vector, list_size); auto &child_vector = ListVector::GetEntry(vector); - SetValidityMask(child_vector, *array.children[0], scan_state, list_size, array.offset, start_offset); + SetValidityMask(child_vector, *array.children[0], scan_state, list_size, array.offset, + NumericCast(start_offset)); auto &list_mask = FlatVector::Validity(vector); if (parent_mask) { //! Since this List is owned by a struct we must guarantee their validity map matches on Null @@ -183,13 +184,16 @@ static void ArrowToDuckDBList(Vector &vector, ArrowArray &array, ArrowArrayScanS switch (array_physical_type) { case ArrowArrayPhysicalType::DICTIONARY_ENCODED: // TODO: add support for offsets - ColumnArrowToDuckDBDictionary(child_vector, child_array, child_state, list_size, child_type, start_offset); + ColumnArrowToDuckDBDictionary(child_vector, child_array, child_state, list_size, child_type, + NumericCast(start_offset)); break; case ArrowArrayPhysicalType::RUN_END_ENCODED: - ColumnArrowToDuckDBRunEndEncoded(child_vector, child_array, child_state, list_size, child_type, start_offset); + ColumnArrowToDuckDBRunEndEncoded(child_vector, child_array, child_state, list_size, child_type, + NumericCast(start_offset)); break; case ArrowArrayPhysicalType::DEFAULT: - ColumnArrowToDuckDB(child_vector, child_array, child_state, list_size, child_type, start_offset); + ColumnArrowToDuckDB(child_vector, child_array, child_state, list_size, child_type, + NumericCast(start_offset)); break; default: throw NotImplementedException("ArrowArrayPhysicalType not recognized"); @@ -209,7 +213,8 @@ static void ArrowToDuckDBArray(Vector &vector, ArrowArray &array, ArrowArrayScan SetValidityMask(vector, array, scan_state, size, parent_offset, nested_offset); auto &child_vector = ArrayVector::GetEntry(vector); - SetValidityMask(child_vector, *array.children[0], scan_state, child_count, array.offset, child_offset); + SetValidityMask(child_vector, *array.children[0], scan_state, child_count, array.offset, + NumericCast(child_offset)); auto &array_mask = FlatVector::Validity(vector); if (parent_mask) { @@ -244,9 +249,10 @@ static void ArrowToDuckDBArray(Vector &vector, ArrowArray &array, ArrowArrayScan } else { if (child_array.dictionary) { ColumnArrowToDuckDBDictionary(child_vector, child_array, child_state, child_count, child_type, - child_offset); + NumericCast(child_offset)); } else { - ColumnArrowToDuckDB(child_vector, child_array, child_state, child_count, child_type, child_offset); + ColumnArrowToDuckDB(child_vector, child_array, child_state, child_count, child_type, + NumericCast(child_offset)); } } } @@ -311,9 +317,6 @@ static void ArrowToDuckDBMapVerify(Vector &vector, idx_t count) { case MapInvalidReason::NULL_KEY: { throw InvalidInputException("Arrow map contains NULL as map key, which isn't supported by DuckDB map type"); } - case MapInvalidReason::NULL_KEY_LIST: { - throw InvalidInputException("Arrow map contains NULL as key list, which isn't supported by DuckDB map type"); - } default: { throw InternalException("MapInvalidReason not implemented"); } @@ -339,8 +342,9 @@ static void SetVectorString(Vector &vector, idx_t size, char *cdata, T *offsets) static void DirectConversion(Vector &vector, ArrowArray &array, const ArrowScanLocalState &scan_state, int64_t nested_offset, uint64_t parent_offset) { auto internal_type = GetTypeIdSize(vector.GetType().InternalType()); - auto data_ptr = ArrowBufferData(array, 1) + - internal_type * GetEffectiveOffset(array, parent_offset, scan_state, nested_offset); + auto data_ptr = + ArrowBufferData(array, 1) + + internal_type * GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset); FlatVector::SetData(vector, data_ptr); } @@ -595,7 +599,7 @@ static void ColumnArrowToDuckDBRunEndEncoded(Vector &vector, ArrowArray &array, auto &scan_state = array_state.state; D_ASSERT(run_ends_array.length == values_array.length); - auto compressed_size = run_ends_array.length; + auto compressed_size = NumericCast(run_ends_array.length); // Create a vector for the run ends and the values auto &run_end_encoding = array_state.RunEndEncoding(); if (!run_end_encoding.run_ends) { @@ -606,11 +610,12 @@ static void ColumnArrowToDuckDBRunEndEncoded(Vector &vector, ArrowArray &array, ColumnArrowToDuckDB(*run_end_encoding.run_ends, run_ends_array, array_state, compressed_size, run_ends_type); auto &values = *run_end_encoding.values; - SetValidityMask(values, values_array, scan_state, compressed_size, parent_offset, nested_offset); + SetValidityMask(values, values_array, scan_state, compressed_size, NumericCast(parent_offset), + nested_offset); ColumnArrowToDuckDB(values, values_array, array_state, compressed_size, values_type); } - idx_t scan_offset = GetEffectiveOffset(array, parent_offset, scan_state, nested_offset); + idx_t scan_offset = GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset); auto physical_type = run_ends_type.GetDuckType().InternalType(); switch (physical_type) { case PhysicalType::INT16: @@ -641,12 +646,12 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca //! Arrow bit-packs boolean values //! Lets first figure out where we are in the source array auto src_ptr = ArrowBufferData(array, 1) + - GetEffectiveOffset(array, parent_offset, scan_state, nested_offset) / 8; + GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset) / 8; auto tgt_ptr = (uint8_t *)FlatVector::GetData(vector); int src_pos = 0; idx_t cur_bit = scan_state.chunk_offset % 8; if (nested_offset != -1) { - cur_bit = nested_offset % 8; + cur_bit = NumericCast(nested_offset % 8); } for (idx_t row = 0; row < size; row++) { if ((src_ptr[src_pos] & (1 << cur_bit)) == 0) { @@ -686,11 +691,11 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca auto cdata = ArrowBufferData(array, 2); if (size_type == ArrowVariableSizeType::SUPER_SIZE) { auto offsets = ArrowBufferData(array, 1) + - GetEffectiveOffset(array, parent_offset, scan_state, nested_offset); + GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset); SetVectorString(vector, size, cdata, offsets); } else { auto offsets = ArrowBufferData(array, 1) + - GetEffectiveOffset(array, parent_offset, scan_state, nested_offset); + GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset); SetVectorString(vector, size, cdata, offsets); } break; @@ -706,7 +711,7 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca case ArrowDateTimeType::MILLISECONDS: { //! convert date from nanoseconds to days auto src_ptr = ArrowBufferData(array, 1) + - GetEffectiveOffset(array, parent_offset, scan_state, nested_offset); + GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset); auto tgt_ptr = FlatVector::GetData(vector); for (idx_t row = 0; row < size; row++) { tgt_ptr[row] = date_t( @@ -723,21 +728,24 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca auto precision = arrow_type.GetDateTimeType(); switch (precision) { case ArrowDateTimeType::SECONDS: { - TimeConversion(vector, array, scan_state, nested_offset, parent_offset, size, 1000000); + TimeConversion(vector, array, scan_state, nested_offset, NumericCast(parent_offset), size, + 1000000); break; } case ArrowDateTimeType::MILLISECONDS: { - TimeConversion(vector, array, scan_state, nested_offset, parent_offset, size, 1000); + TimeConversion(vector, array, scan_state, nested_offset, NumericCast(parent_offset), size, + 1000); break; } case ArrowDateTimeType::MICROSECONDS: { - TimeConversion(vector, array, scan_state, nested_offset, parent_offset, size, 1); + TimeConversion(vector, array, scan_state, nested_offset, NumericCast(parent_offset), size, + 1); break; } case ArrowDateTimeType::NANOSECONDS: { auto tgt_ptr = FlatVector::GetData(vector); auto src_ptr = ArrowBufferData(array, 1) + - GetEffectiveOffset(array, parent_offset, scan_state, nested_offset); + GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset); for (idx_t row = 0; row < size; row++) { tgt_ptr[row].micros = src_ptr[row] / 1000; } @@ -752,11 +760,13 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca auto precision = arrow_type.GetDateTimeType(); switch (precision) { case ArrowDateTimeType::SECONDS: { - TimestampTZConversion(vector, array, scan_state, nested_offset, parent_offset, size, 1000000); + TimestampTZConversion(vector, array, scan_state, nested_offset, NumericCast(parent_offset), size, + 1000000); break; } case ArrowDateTimeType::MILLISECONDS: { - TimestampTZConversion(vector, array, scan_state, nested_offset, parent_offset, size, 1000); + TimestampTZConversion(vector, array, scan_state, nested_offset, NumericCast(parent_offset), size, + 1000); break; } case ArrowDateTimeType::MICROSECONDS: { @@ -766,7 +776,7 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca case ArrowDateTimeType::NANOSECONDS: { auto tgt_ptr = FlatVector::GetData(vector); auto src_ptr = ArrowBufferData(array, 1) + - GetEffectiveOffset(array, parent_offset, scan_state, nested_offset); + GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset); for (idx_t row = 0; row < size; row++) { tgt_ptr[row].value = src_ptr[row] / 1000; } @@ -781,22 +791,25 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca auto precision = arrow_type.GetDateTimeType(); switch (precision) { case ArrowDateTimeType::SECONDS: { - IntervalConversionUs(vector, array, scan_state, nested_offset, parent_offset, size, 1000000); + IntervalConversionUs(vector, array, scan_state, nested_offset, NumericCast(parent_offset), size, + 1000000); break; } case ArrowDateTimeType::DAYS: case ArrowDateTimeType::MILLISECONDS: { - IntervalConversionUs(vector, array, scan_state, nested_offset, parent_offset, size, 1000); + IntervalConversionUs(vector, array, scan_state, nested_offset, NumericCast(parent_offset), size, + 1000); break; } case ArrowDateTimeType::MICROSECONDS: { - IntervalConversionUs(vector, array, scan_state, nested_offset, parent_offset, size, 1); + IntervalConversionUs(vector, array, scan_state, nested_offset, NumericCast(parent_offset), size, + 1); break; } case ArrowDateTimeType::NANOSECONDS: { auto tgt_ptr = FlatVector::GetData(vector); auto src_ptr = ArrowBufferData(array, 1) + - GetEffectiveOffset(array, parent_offset, scan_state, nested_offset); + GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset); for (idx_t row = 0; row < size; row++) { tgt_ptr[row].micros = src_ptr[row] / 1000; tgt_ptr[row].days = 0; @@ -805,11 +818,13 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca break; } case ArrowDateTimeType::MONTHS: { - IntervalConversionMonths(vector, array, scan_state, nested_offset, parent_offset, size); + IntervalConversionMonths(vector, array, scan_state, nested_offset, NumericCast(parent_offset), + size); break; } case ArrowDateTimeType::MONTH_DAY_NANO: { - IntervalConversionMonthDayNanos(vector, array, scan_state, nested_offset, parent_offset, size); + IntervalConversionMonthDayNanos(vector, array, scan_state, nested_offset, + NumericCast(parent_offset), size); break; } default: @@ -820,8 +835,8 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca case LogicalTypeId::DECIMAL: { auto val_mask = FlatVector::Validity(vector); //! We have to convert from INT128 - auto src_ptr = - ArrowBufferData(array, 1) + GetEffectiveOffset(array, parent_offset, scan_state, nested_offset); + auto src_ptr = ArrowBufferData(array, 1) + + GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset); switch (vector.GetType().InternalType()) { case PhysicalType::INT16: { auto tgt_ptr = FlatVector::GetData(vector); @@ -859,7 +874,8 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca case PhysicalType::INT128: { FlatVector::SetData(vector, ArrowBufferData(array, 1) + GetTypeIdSize(vector.GetType().InternalType()) * - GetEffectiveOffset(array, parent_offset, scan_state, nested_offset)); + GetEffectiveOffset(array, NumericCast(parent_offset), + scan_state, nested_offset)); break; } default: @@ -869,19 +885,23 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca break; } case LogicalTypeId::BLOB: { - ArrowToDuckDBBlob(vector, array, scan_state, size, arrow_type, nested_offset, parent_offset); + ArrowToDuckDBBlob(vector, array, scan_state, size, arrow_type, nested_offset, + NumericCast(parent_offset)); break; } case LogicalTypeId::LIST: { - ArrowToDuckDBList(vector, array, array_state, size, arrow_type, nested_offset, parent_mask, parent_offset); + ArrowToDuckDBList(vector, array, array_state, size, arrow_type, nested_offset, parent_mask, + NumericCast(parent_offset)); break; } case LogicalTypeId::ARRAY: { - ArrowToDuckDBArray(vector, array, array_state, size, arrow_type, nested_offset, parent_mask, parent_offset); + ArrowToDuckDBArray(vector, array, array_state, size, arrow_type, nested_offset, parent_mask, + NumericCast(parent_offset)); break; } case LogicalTypeId::MAP: { - ArrowToDuckDBList(vector, array, array_state, size, arrow_type, nested_offset, parent_mask, parent_offset); + ArrowToDuckDBList(vector, array, array_state, size, arrow_type, nested_offset, parent_mask, + NumericCast(parent_offset)); ArrowToDuckDBMapVerify(vector, size); break; } @@ -889,7 +909,7 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca //! Fill the children auto &child_entries = StructVector::GetEntries(vector); auto &struct_validity_mask = FlatVector::Validity(vector); - for (int64_t child_idx = 0; child_idx < array.n_children; child_idx++) { + for (idx_t child_idx = 0; child_idx < NumericCast(array.n_children); child_idx++) { auto &child_entry = *child_entries[child_idx]; auto &child_array = *array.children[child_idx]; auto &child_type = arrow_type[child_idx]; @@ -909,15 +929,15 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca switch (array_physical_type) { case ArrowArrayPhysicalType::DICTIONARY_ENCODED: ColumnArrowToDuckDBDictionary(child_entry, child_array, child_state, size, child_type, nested_offset, - &struct_validity_mask, array.offset); + &struct_validity_mask, NumericCast(array.offset)); break; case ArrowArrayPhysicalType::RUN_END_ENCODED: ColumnArrowToDuckDBRunEndEncoded(child_entry, child_array, child_state, size, child_type, nested_offset, - &struct_validity_mask, array.offset); + &struct_validity_mask, NumericCast(array.offset)); break; case ArrowArrayPhysicalType::DEFAULT: ColumnArrowToDuckDB(child_entry, child_array, child_state, size, child_type, nested_offset, - &struct_validity_mask, array.offset); + &struct_validity_mask, NumericCast(array.offset)); break; default: throw NotImplementedException("ArrowArrayPhysicalType not recognized"); @@ -933,13 +953,13 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca auto &validity_mask = FlatVector::Validity(vector); duckdb::vector children; - for (int64_t child_idx = 0; child_idx < array.n_children; child_idx++) { + for (idx_t child_idx = 0; child_idx < NumericCast(array.n_children); child_idx++) { Vector child(members[child_idx].second, size); auto &child_array = *array.children[child_idx]; auto &child_state = array_state.GetChild(child_idx); auto &child_type = arrow_type[child_idx]; - SetValidityMask(child, child_array, scan_state, size, parent_offset, nested_offset); + SetValidityMask(child, child_array, scan_state, size, NumericCast(parent_offset), nested_offset); auto array_physical_type = GetArrowArrayPhysicalType(child_type); switch (array_physical_type) { @@ -960,9 +980,9 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca } for (idx_t row_idx = 0; row_idx < size; row_idx++) { - auto tag = type_ids[row_idx]; + auto tag = NumericCast(type_ids[row_idx]); - auto out_of_range = tag < 0 || tag >= array.n_children; + auto out_of_range = tag >= array.n_children; if (out_of_range) { throw InvalidInputException("Arrow union tag out of range: %d", tag); } @@ -982,7 +1002,7 @@ template static void SetSelectionVectorLoop(SelectionVector &sel, data_ptr_t indices_p, idx_t size) { auto indices = reinterpret_cast(indices_p); for (idx_t row = 0; row < size; row++) { - sel.set_index(row, indices[row]); + sel.set_index(row, UnsafeNumericCast(indices[row])); } } @@ -994,7 +1014,7 @@ static void SetSelectionVectorLoopWithChecks(SelectionVector &sel, data_ptr_t in if (indices[row] > NumericLimits::Maximum()) { throw ConversionException("DuckDB only supports indices that fit on an uint32"); } - sel.set_index(row, indices[row]); + sel.set_index(row, NumericCast(indices[row])); } } @@ -1004,7 +1024,7 @@ static void SetMaskedSelectionVectorLoop(SelectionVector &sel, data_ptr_t indice auto indices = reinterpret_cast(indices_p); for (idx_t row = 0; row < size; row++) { if (mask.RowIsValid(row)) { - sel.set_index(row, indices[row]); + sel.set_index(row, UnsafeNumericCast(indices[row])); } else { //! Need to point out to last element sel.set_index(row, last_element_pos); @@ -1119,22 +1139,23 @@ static void ColumnArrowToDuckDBDictionary(Vector &vector, ArrowArray &array, Arr const bool has_nulls = CanContainNull(array, parent_mask); if (array_state.CacheOutdated(array.dictionary)) { //! We need to set the dictionary data for this column - auto base_vector = make_uniq(vector.GetType(), array.dictionary->length); - SetValidityMask(*base_vector, *array.dictionary, scan_state, array.dictionary->length, 0, 0, has_nulls); + auto base_vector = make_uniq(vector.GetType(), NumericCast(array.dictionary->length)); + SetValidityMask(*base_vector, *array.dictionary, scan_state, NumericCast(array.dictionary->length), 0, 0, + has_nulls); auto &dictionary_type = arrow_type.GetDictionary(); auto arrow_physical_type = GetArrowArrayPhysicalType(dictionary_type); switch (arrow_physical_type) { case ArrowArrayPhysicalType::DICTIONARY_ENCODED: - ColumnArrowToDuckDBDictionary(*base_vector, *array.dictionary, array_state, array.dictionary->length, - dictionary_type); + ColumnArrowToDuckDBDictionary(*base_vector, *array.dictionary, array_state, + NumericCast(array.dictionary->length), dictionary_type); break; case ArrowArrayPhysicalType::RUN_END_ENCODED: - ColumnArrowToDuckDBRunEndEncoded(*base_vector, *array.dictionary, array_state, array.dictionary->length, - dictionary_type); + ColumnArrowToDuckDBRunEndEncoded(*base_vector, *array.dictionary, array_state, + NumericCast(array.dictionary->length), dictionary_type); break; case ArrowArrayPhysicalType::DEFAULT: - ColumnArrowToDuckDB(*base_vector, *array.dictionary, array_state, array.dictionary->length, - dictionary_type); + ColumnArrowToDuckDB(*base_vector, *array.dictionary, array_state, + NumericCast(array.dictionary->length), dictionary_type); break; default: throw NotImplementedException("ArrowArrayPhysicalType not recognized"); @@ -1143,14 +1164,14 @@ static void ColumnArrowToDuckDBDictionary(Vector &vector, ArrowArray &array, Arr } auto offset_type = arrow_type.GetDuckType(); //! Get Pointer to Indices of Dictionary - auto indices = - ArrowBufferData(array, 1) + - GetTypeIdSize(offset_type.InternalType()) * GetEffectiveOffset(array, parent_offset, scan_state, nested_offset); + auto indices = ArrowBufferData(array, 1) + + GetTypeIdSize(offset_type.InternalType()) * + GetEffectiveOffset(array, NumericCast(parent_offset), scan_state, nested_offset); SelectionVector sel; if (has_nulls) { ValidityMask indices_validity; - GetValidityMask(indices_validity, array, scan_state, size, parent_offset); + GetValidityMask(indices_validity, array, scan_state, size, NumericCast(parent_offset)); if (parent_mask && !parent_mask->AllValid()) { auto &struct_validity_mask = *parent_mask; for (idx_t i = 0; i < size; i++) { @@ -1159,7 +1180,8 @@ static void ColumnArrowToDuckDBDictionary(Vector &vector, ArrowArray &array, Arr } } } - SetSelectionVector(sel, indices, offset_type, size, &indices_validity, array.dictionary->length); + SetSelectionVector(sel, indices, offset_type, size, &indices_validity, + NumericCast(array.dictionary->length)); } else { SetSelectionVector(sel, indices, offset_type, size); } diff --git a/src/duckdb/src/function/table/copy_csv.cpp b/src/duckdb/src/function/table/copy_csv.cpp index 8d1d50b3..05a1187a 100644 --- a/src/duckdb/src/function/table/copy_csv.cpp +++ b/src/duckdb/src/function/table/copy_csv.cpp @@ -12,6 +12,14 @@ #include "duckdb/function/scalar/string_functions.hpp" #include "duckdb/function/table/read_csv.hpp" #include "duckdb/parser/parsed_data/copy_info.hpp" +#include "duckdb/parser/expression/cast_expression.hpp" +#include "duckdb/parser/expression/function_expression.hpp" +#include "duckdb/parser/expression/columnref_expression.hpp" +#include "duckdb/parser/expression/constant_expression.hpp" +#include "duckdb/parser/expression/bound_expression.hpp" +#include "duckdb/planner/expression/bound_reference_expression.hpp" +#include "duckdb/execution/column_binding_resolver.hpp" +#include "duckdb/planner/operator/logical_dummy_scan.hpp" #include namespace duckdb { @@ -93,6 +101,62 @@ string TransformNewLine(string new_line) { ; } +static vector> CreateCastExpressions(WriteCSVData &bind_data, ClientContext &context, + const vector &names, + const vector &sql_types) { + auto &options = bind_data.options; + auto &formats = options.write_date_format; + + bool has_dateformat = !formats[LogicalTypeId::DATE].IsNull(); + bool has_timestampformat = !formats[LogicalTypeId::TIMESTAMP].IsNull(); + + // Create a binder + auto binder = Binder::CreateBinder(context); + + auto &bind_context = binder->bind_context; + auto table_index = binder->GenerateTableIndex(); + bind_context.AddGenericBinding(table_index, "copy_csv", names, sql_types); + + // Create the ParsedExpressions (cast, strftime, etc..) + vector> unbound_expressions; + for (idx_t i = 0; i < sql_types.size(); i++) { + auto &type = sql_types[i]; + auto &name = names[i]; + + bool is_timestamp = type.id() == LogicalTypeId::TIMESTAMP || type.id() == LogicalTypeId::TIMESTAMP_TZ; + if (has_dateformat && type.id() == LogicalTypeId::DATE) { + // strftime(, 'format') + vector> children; + children.push_back(make_uniq(make_uniq(name, type, i))); + children.push_back(make_uniq(formats[LogicalTypeId::DATE])); + auto func = make_uniq_base("strftime", std::move(children)); + unbound_expressions.push_back(std::move(func)); + } else if (has_timestampformat && is_timestamp) { + // strftime(, 'format') + vector> children; + children.push_back(make_uniq(make_uniq(name, type, i))); + children.push_back(make_uniq(formats[LogicalTypeId::TIMESTAMP])); + auto func = make_uniq_base("strftime", std::move(children)); + unbound_expressions.push_back(std::move(func)); + } else { + // CAST AS VARCHAR + auto column = make_uniq(make_uniq(name, type, i)); + auto expr = make_uniq_base(LogicalType::VARCHAR, std::move(column)); + unbound_expressions.push_back(std::move(expr)); + } + } + + // Create an ExpressionBinder, bind the Expressions + vector> expressions; + ExpressionBinder expression_binder(*binder, context); + expression_binder.target_type = LogicalType::VARCHAR; + for (auto &expr : unbound_expressions) { + expressions.push_back(expression_binder.Bind(expr)); + } + + return expressions; +} + static unique_ptr WriteCSVBind(ClientContext &context, CopyFunctionBindInput &input, const vector &names, const vector &sql_types) { auto bind_data = make_uniq(input.info.file_path, sql_types, names); @@ -110,12 +174,17 @@ static unique_ptr WriteCSVBind(ClientContext &context, CopyFunctio } bind_data->Finalize(); + auto expressions = CreateCastExpressions(*bind_data, context, names, sql_types); + bind_data->cast_expressions = std::move(expressions); + bind_data->requires_quotes = make_unsafe_uniq_array(256); memset(bind_data->requires_quotes.get(), 0, sizeof(bool) * 256); bind_data->requires_quotes['\n'] = true; bind_data->requires_quotes['\r'] = true; - bind_data->requires_quotes[bind_data->options.dialect_options.state_machine_options.delimiter.GetValue()] = true; - bind_data->requires_quotes[bind_data->options.dialect_options.state_machine_options.quote.GetValue()] = true; + bind_data->requires_quotes[NumericCast( + bind_data->options.dialect_options.state_machine_options.delimiter.GetValue())] = true; + bind_data->requires_quotes[NumericCast( + bind_data->options.dialect_options.state_machine_options.quote.GetValue())] = true; if (!bind_data->options.write_newline.empty()) { bind_data->newline = TransformNewLine(bind_data->options.write_newline); @@ -130,7 +199,9 @@ static unique_ptr ReadCSVBind(ClientContext &context, CopyInfo &in bind_data->csv_names = expected_names; bind_data->return_types = expected_types; bind_data->return_names = expected_names; - bind_data->files = MultiFileReader::GetFileList(context, Value(info.file_path), "CSV"); + + auto multi_file_reader = MultiFileReader::CreateDefault("CSVCopy"); + bind_data->files = multi_file_reader->CreateFileList(context, Value(info.file_path))->GetAllFiles(); auto &options = bind_data->options; @@ -159,7 +230,7 @@ static unique_ptr ReadCSVBind(ClientContext &context, CopyInfo &in } if (options.auto_detect) { - auto buffer_manager = make_shared(context, options, bind_data->files[0], 0); + auto buffer_manager = make_shared_ptr(context, options, bind_data->files[0], 0); CSVSniffer sniffer(options, buffer_manager, CSVStateMachineCache::Get(context), {&expected_types, &expected_names}); sniffer.SniffCSV(); @@ -262,6 +333,14 @@ static void WriteQuotedString(WriteStream &writer, WriteCSVData &csv_data, const // Sink //===--------------------------------------------------------------------===// struct LocalWriteCSVData : public LocalFunctionData { +public: + LocalWriteCSVData(ClientContext &context, vector> &expressions) + : executor(context, expressions) { + } + +public: + //! Used to execute the expressions that transform input -> string + ExpressionExecutor executor; //! The thread-local buffer to write data into MemoryStream stream; //! A chunk with VARCHAR columns to cast intermediates into @@ -314,7 +393,7 @@ struct GlobalWriteCSVData : public GlobalFunctionData { static unique_ptr WriteCSVInitializeLocal(ExecutionContext &context, FunctionData &bind_data) { auto &csv_data = bind_data.Cast(); - auto local_data = make_uniq(); + auto local_data = make_uniq(context.client, csv_data.cast_expressions); // create the chunk with VARCHAR types vector types; @@ -359,33 +438,16 @@ idx_t WriteCSVFileSize(GlobalFunctionData &gstate) { } static void WriteCSVChunkInternal(ClientContext &context, FunctionData &bind_data, DataChunk &cast_chunk, - MemoryStream &writer, DataChunk &input, bool &written_anything) { + MemoryStream &writer, DataChunk &input, bool &written_anything, + ExpressionExecutor &executor) { auto &csv_data = bind_data.Cast(); auto &options = csv_data.options; // first cast the columns of the chunk to varchar cast_chunk.Reset(); cast_chunk.SetCardinality(input); - for (idx_t col_idx = 0; col_idx < input.ColumnCount(); col_idx++) { - if (csv_data.sql_types[col_idx].id() == LogicalTypeId::VARCHAR) { - // VARCHAR, just reinterpret (cannot reference, because LogicalTypeId::VARCHAR is used by the JSON type too) - cast_chunk.data[col_idx].Reinterpret(input.data[col_idx]); - } else if (!csv_data.options.write_date_format[LogicalTypeId::DATE].Empty() && - csv_data.sql_types[col_idx].id() == LogicalTypeId::DATE) { - // use the date format to cast the chunk - csv_data.options.write_date_format[LogicalTypeId::DATE].ConvertDateVector( - input.data[col_idx], cast_chunk.data[col_idx], input.size()); - } else if (!csv_data.options.write_date_format[LogicalTypeId::TIMESTAMP].Empty() && - (csv_data.sql_types[col_idx].id() == LogicalTypeId::TIMESTAMP || - csv_data.sql_types[col_idx].id() == LogicalTypeId::TIMESTAMP_TZ)) { - // use the timestamp format to cast the chunk - csv_data.options.write_date_format[LogicalTypeId::TIMESTAMP].ConvertTimestampVector( - input.data[col_idx], cast_chunk.data[col_idx], input.size()); - } else { - // non varchar column, perform the cast - VectorOperations::Cast(context, input.data[col_idx], cast_chunk.data[col_idx], input.size()); - } - } + + executor.Execute(input, cast_chunk); cast_chunk.Flatten(); // now loop over the vectors and output the values @@ -426,7 +488,7 @@ static void WriteCSVSink(ExecutionContext &context, FunctionData &bind_data, Glo // write data into the local buffer WriteCSVChunkInternal(context.client, bind_data, local_data.cast_chunk, local_data.stream, input, - local_data.written_anything); + local_data.written_anything, local_data.executor); // check if we should flush what we have currently written auto &writer = local_data.stream; @@ -504,11 +566,15 @@ unique_ptr WriteCSVPrepareBatch(ClientContext &context, Funct DataChunk cast_chunk; cast_chunk.Initialize(Allocator::Get(context), types); + auto &original_types = collection->Types(); + auto expressions = CreateCastExpressions(csv_data, context, csv_data.options.name_list, original_types); + ExpressionExecutor executor(context, expressions); + // write CSV chunks to the batch data bool written_anything = false; auto batch = make_uniq(); for (auto &chunk : collection->Chunks()) { - WriteCSVChunkInternal(context, bind_data, cast_chunk, batch->stream, chunk, written_anything); + WriteCSVChunkInternal(context, bind_data, cast_chunk, batch->stream, chunk, written_anything, executor); } return std::move(batch); } diff --git a/src/duckdb/src/function/table/glob.cpp b/src/duckdb/src/function/table/glob.cpp index 84dbc688..d3146245 100644 --- a/src/duckdb/src/function/table/glob.cpp +++ b/src/duckdb/src/function/table/glob.cpp @@ -8,27 +8,33 @@ namespace duckdb { struct GlobFunctionBindData : public TableFunctionData { - vector files; + unique_ptr file_list; }; static unique_ptr GlobFunctionBind(ClientContext &context, TableFunctionBindInput &input, vector &return_types, vector &names) { auto result = make_uniq(); - result->files = MultiFileReader::GetFileList(context, input.inputs[0], "Globbing", FileGlobOptions::ALLOW_EMPTY); + auto multi_file_reader = MultiFileReader::Create(input.table_function); + result->file_list = multi_file_reader->CreateFileList(context, input.inputs[0], FileGlobOptions::ALLOW_EMPTY); return_types.emplace_back(LogicalType::VARCHAR); names.emplace_back("file"); return std::move(result); } struct GlobFunctionState : public GlobalTableFunctionState { - GlobFunctionState() : current_idx(0) { + GlobFunctionState() { } - idx_t current_idx; + MultiFileListScanData file_list_scan; }; static unique_ptr GlobFunctionInit(ClientContext &context, TableFunctionInitInput &input) { - return make_uniq(); + auto &bind_data = input.bind_data->Cast(); + auto res = make_uniq(); + + bind_data.file_list->InitializeScan(res->file_list_scan); + + return std::move(res); } static void GlobFunction(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) { @@ -36,10 +42,12 @@ static void GlobFunction(ClientContext &context, TableFunctionInput &data_p, Dat auto &state = data_p.global_state->Cast(); idx_t count = 0; - idx_t next_idx = MinValue(state.current_idx + STANDARD_VECTOR_SIZE, bind_data.files.size()); - for (; state.current_idx < next_idx; state.current_idx++) { - output.data[0].SetValue(count, bind_data.files[state.current_idx]); - count++; + while (count < STANDARD_VECTOR_SIZE) { + string file; + if (!bind_data.file_list->Scan(state.file_list_scan, file)) { + break; + } + output.data[0].SetValue(count++, file); } output.SetCardinality(count); } diff --git a/src/duckdb/src/function/table/read_csv.cpp b/src/duckdb/src/function/table/read_csv.cpp index 4434d7cd..58cbfdd7 100644 --- a/src/duckdb/src/function/table/read_csv.cpp +++ b/src/duckdb/src/function/table/read_csv.cpp @@ -48,7 +48,8 @@ static unique_ptr ReadCSVBind(ClientContext &context, TableFunctio auto result = make_uniq(); auto &options = result->options; - result->files = MultiFileReader::GetFileList(context, input.inputs[0], "CSV"); + auto multi_file_reader = MultiFileReader::Create(input.table_function); + auto multi_file_list = multi_file_reader->CreateFileList(context, input.inputs[0]); options.FromNamedParameters(input.named_parameters, context, return_types, names); if (options.rejects_table_name.IsSetByUser() && !options.store_rejects.GetValue() && @@ -79,7 +80,7 @@ static unique_ptr ReadCSVBind(ClientContext &context, TableFunctio throw BinderException("REJECTS_LIMIT option is only supported when REJECTS_TABLE is set to a table name"); } - options.file_options.AutoDetectHivePartitioning(result->files, context); + options.file_options.AutoDetectHivePartitioning(*multi_file_list, context); if (!options.auto_detect && return_types.empty()) { throw BinderException("read_csv requires columns to be specified through the 'columns' option. Use " @@ -87,8 +88,8 @@ static unique_ptr ReadCSVBind(ClientContext &context, TableFunctio "AUTO_DETECT=TRUE) to automatically guess columns."); } if (options.auto_detect && !options.file_options.union_by_name) { - options.file_path = result->files[0]; - result->buffer_manager = make_shared(context, options, result->files[0], 0); + options.file_path = multi_file_list->GetFirstFile(); + result->buffer_manager = make_shared_ptr(context, options, options.file_path, 0); CSVSniffer sniffer(options, result->buffer_manager, CSVStateMachineCache::Get(context), {&return_types, &names}); auto sniffer_result = sniffer.SniffCSV(); @@ -103,8 +104,8 @@ static unique_ptr ReadCSVBind(ClientContext &context, TableFunctio D_ASSERT(return_types.size() == names.size()); result->options.dialect_options.num_cols = names.size(); if (options.file_options.union_by_name) { - result->reader_bind = - MultiFileReader::BindUnionReader(context, return_types, names, *result, options); + result->reader_bind = multi_file_reader->BindUnionReader(context, return_types, names, + *multi_file_list, *result, options); if (result->union_readers.size() > 1) { result->column_info.emplace_back(result->initial_reader->names, result->initial_reader->types); for (idx_t i = 1; i < result->union_readers.size(); i++) { @@ -128,7 +129,8 @@ static unique_ptr ReadCSVBind(ClientContext &context, TableFunctio } else { result->csv_types = return_types; result->csv_names = names; - result->reader_bind = MultiFileReader::BindOptions(options.file_options, result->files, return_types, names); + multi_file_reader->BindOptions(options.file_options, *multi_file_list, return_types, names, + result->reader_bind); } result->return_types = return_types; result->return_names = names; @@ -153,6 +155,10 @@ static unique_ptr ReadCSVBind(ClientContext &context, TableFunctio } } } + + // TODO: make the CSV reader use MultiFileList throughout, instead of converting to vector + result->files = multi_file_list->GetAllFiles(); + result->Finalize(); return std::move(result); } @@ -217,8 +223,8 @@ static void ReadCSVFunction(ClientContext &context, TableFunctionInput &data_p, } do { if (output.size() != 0) { - MultiFileReader::FinalizeChunk(bind_data.reader_bind, - csv_local_state.csv_reader->csv_file_scan->reader_data, output); + MultiFileReader().FinalizeChunk(context, bind_data.reader_bind, + csv_local_state.csv_reader->csv_file_scan->reader_data, output, nullptr); break; } if (csv_local_state.csv_reader->FinishedIterator()) { @@ -276,6 +282,7 @@ void ReadCSVTableFunction::ReadCSVAddNamedParameters(TableFunction &table_functi table_function.named_parameters["names"] = LogicalType::LIST(LogicalType::VARCHAR); table_function.named_parameters["column_names"] = LogicalType::LIST(LogicalType::VARCHAR); table_function.named_parameters["parallel"] = LogicalType::BOOLEAN; + MultiFileReader::AddParameters(table_function); } @@ -292,10 +299,14 @@ double CSVReaderProgress(ClientContext &context, const FunctionData *bind_data_p void CSVComplexFilterPushdown(ClientContext &context, LogicalGet &get, FunctionData *bind_data_p, vector> &filters) { auto &data = bind_data_p->Cast(); - auto reset_reader = - MultiFileReader::ComplexFilterPushdown(context, data.files, data.options.file_options, get, filters); - if (reset_reader) { - MultiFileReader::PruneReaders(data); + SimpleMultiFileList file_list(data.files); + auto filtered_list = + MultiFileReader().ComplexFilterPushdown(context, file_list, data.options.file_options, get, filters); + if (filtered_list) { + data.files = filtered_list->GetAllFiles(); + MultiFileReader::PruneReaders(data, file_list); + } else { + data.files = file_list.GetAllFiles(); } } @@ -326,6 +337,15 @@ static unique_ptr CSVReaderDeserialize(Deserializer &deserializer, return std::move(result); } +void PushdownTypeToCSVScanner(ClientContext &context, optional_ptr bind_data, + const unordered_map &new_column_types) { + auto &csv_bind = bind_data->Cast(); + for (auto &type : new_column_types) { + csv_bind.csv_types[type.first] = type.second; + csv_bind.return_types[type.first] = type.second; + } +} + TableFunction ReadCSVTableFunction::GetFunction() { TableFunction read_csv("read_csv", {LogicalType::VARCHAR}, ReadCSVFunction, ReadCSVBind, ReadCSVInitGlobal, ReadCSVInitLocal); @@ -336,6 +356,7 @@ TableFunction ReadCSVTableFunction::GetFunction() { read_csv.get_batch_index = CSVReaderGetBatchIndex; read_csv.cardinality = CSVReaderCardinality; read_csv.projection_pushdown = true; + read_csv.type_pushdown = PushdownTypeToCSVScanner; ReadCSVAddNamedParameters(read_csv); return read_csv; } @@ -352,7 +373,9 @@ void ReadCSVTableFunction::RegisterFunction(BuiltinFunctions &set) { set.AddFunction(MultiFileReader::CreateFunctionSet(ReadCSVTableFunction::GetAutoFunction())); } -unique_ptr ReadCSVReplacement(ClientContext &context, const string &table_name, ReplacementScanData *data) { +unique_ptr ReadCSVReplacement(ClientContext &context, ReplacementScanInput &input, + optional_ptr data) { + auto &table_name = input.table_name; auto lower_name = StringUtil::Lower(table_name); // remove any compression if (StringUtil::EndsWith(lower_name, ".gz")) { diff --git a/src/duckdb/src/function/table/read_file.cpp b/src/duckdb/src/function/table/read_file.cpp index 7655d34c..e9039b0b 100644 --- a/src/duckdb/src/function/table/read_file.cpp +++ b/src/duckdb/src/function/table/read_file.cpp @@ -53,7 +53,10 @@ template static unique_ptr ReadFileBind(ClientContext &context, TableFunctionBindInput &input, vector &return_types, vector &names) { auto result = make_uniq(); - result->files = MultiFileReader::GetFileList(context, input.inputs[0], OP::FILE_TYPE, FileGlobOptions::ALLOW_EMPTY); + + auto multi_file_reader = MultiFileReader::Create(input.table_function); + result->files = + multi_file_reader->CreateFileList(context, input.inputs[0], FileGlobOptions::ALLOW_EMPTY)->GetAllFiles(); return_types.push_back(LogicalType::VARCHAR); names.push_back("filename"); @@ -160,7 +163,8 @@ static void ReadFileExecute(ClientContext &context, TableFunctionInput &input, D } break; case ReadFileBindData::FILE_SIZE_COLUMN: { auto &file_size_vector = output.data[col_idx]; - FlatVector::GetData(file_size_vector)[out_idx] = file_handle->GetFileSize(); + FlatVector::GetData(file_size_vector)[out_idx] = + NumericCast(file_handle->GetFileSize()); } break; case ReadFileBindData::FILE_LAST_MODIFIED_COLUMN: { auto &last_modified_vector = output.data[col_idx]; diff --git a/src/duckdb/src/function/table/repeat.cpp b/src/duckdb/src/function/table/repeat.cpp index b62cbe15..08fdc008 100644 --- a/src/duckdb/src/function/table/repeat.cpp +++ b/src/duckdb/src/function/table/repeat.cpp @@ -26,7 +26,11 @@ static unique_ptr RepeatBind(ClientContext &context, TableFunction if (inputs[1].IsNull()) { throw BinderException("Repeat second parameter cannot be NULL"); } - return make_uniq(inputs[0], inputs[1].GetValue()); + auto repeat_count = inputs[1].GetValue(); + if (repeat_count < 0) { + throw BinderException("Repeat second parameter cannot be be less than 0"); + } + return make_uniq(inputs[0], NumericCast(repeat_count)); } static unique_ptr RepeatInit(ClientContext &context, TableFunctionInitInput &input) { diff --git a/src/duckdb/src/function/table/repeat_row.cpp b/src/duckdb/src/function/table/repeat_row.cpp index a81d8720..f68bf7ca 100644 --- a/src/duckdb/src/function/table/repeat_row.cpp +++ b/src/duckdb/src/function/table/repeat_row.cpp @@ -32,7 +32,7 @@ static unique_ptr RepeatRowBind(ClientContext &context, TableFunct if (inputs.empty()) { throw BinderException("repeat_rows requires at least one column to be specified"); } - return make_uniq(inputs, entry->second.GetValue()); + return make_uniq(inputs, NumericCast(entry->second.GetValue())); } static unique_ptr RepeatRowInit(ClientContext &context, TableFunctionInitInput &input) { diff --git a/src/duckdb/src/function/table/sniff_csv.cpp b/src/duckdb/src/function/table/sniff_csv.cpp index 536c5849..d395e9dd 100644 --- a/src/duckdb/src/function/table/sniff_csv.cpp +++ b/src/duckdb/src/function/table/sniff_csv.cpp @@ -66,7 +66,9 @@ static unique_ptr CSVSniffBind(ClientContext &context, TableFuncti return_types.emplace_back(LogicalType::BOOLEAN); names.emplace_back("HasHeader"); // 7. List> - return_types.emplace_back(LogicalType::VARCHAR); + child_list_t struct_children {{"name", LogicalType::VARCHAR}, {"type", LogicalType::VARCHAR}}; + auto list_child = LogicalType::STRUCT(struct_children); + return_types.emplace_back(LogicalType::LIST(list_child)); names.emplace_back("Columns"); // 8. Date Format return_types.emplace_back(LogicalType::VARCHAR); @@ -109,7 +111,7 @@ static void CSVSniffFunction(ClientContext &context, TableFunctionInput &data_p, auto sniffer_options = data.options; sniffer_options.file_path = data.path; - auto buffer_manager = make_shared(context, sniffer_options, sniffer_options.file_path, 0); + auto buffer_manager = make_shared_ptr(context, sniffer_options, sniffer_options.file_path, 0); if (sniffer_options.name_list.empty()) { sniffer_options.name_list = data.names_csv; } @@ -141,16 +143,20 @@ static void CSVSniffFunction(ClientContext &context, TableFunctionInput &data_p, auto has_header = Value::BOOLEAN(sniffer_options.dialect_options.header.GetValue()).ToString(); output.SetValue(5, 0, has_header); // 7. List> {'col1': 'INTEGER', 'col2': 'VARCHAR'} + vector values; std::ostringstream columns; columns << "{"; for (idx_t i = 0; i < sniffer_result.return_types.size(); i++) { + child_list_t struct_children {{"name", sniffer_result.names[i]}, + {"type", {sniffer_result.return_types[i].ToString()}}}; + values.emplace_back(Value::STRUCT(struct_children)); columns << "'" << sniffer_result.names[i] << "': '" << sniffer_result.return_types[i].ToString() << "'"; if (i != sniffer_result.return_types.size() - 1) { columns << separator; } } columns << "}"; - output.SetValue(6, 0, columns.str()); + output.SetValue(6, 0, Value::LIST(values)); // 8. Date Format auto date_format = sniffer_options.dialect_options.date_format[LogicalType::DATE].GetValue(); if (!date_format.Empty()) { diff --git a/src/duckdb/src/function/table/system/duckdb_columns.cpp b/src/duckdb/src/function/table/system/duckdb_columns.cpp index 2d7790e1..1632a9e5 100644 --- a/src/duckdb/src/function/table/system/duckdb_columns.cpp +++ b/src/duckdb/src/function/table/system/duckdb_columns.cpp @@ -209,15 +209,15 @@ void ColumnHelper::WriteColumns(idx_t start_index, idx_t start_col, idx_t end_co // database_name, VARCHAR output.SetValue(col++, index, entry.catalog.GetName()); // database_oid, BIGINT - output.SetValue(col++, index, Value::BIGINT(entry.catalog.GetOid())); + output.SetValue(col++, index, Value::BIGINT(NumericCast(entry.catalog.GetOid()))); // schema_name, VARCHAR output.SetValue(col++, index, entry.schema.name); // schema_oid, BIGINT - output.SetValue(col++, index, Value::BIGINT(entry.schema.oid)); + output.SetValue(col++, index, Value::BIGINT(NumericCast(entry.schema.oid))); // table_name, VARCHAR output.SetValue(col++, index, entry.name); // table_oid, BIGINT - output.SetValue(col++, index, Value::BIGINT(entry.oid)); + output.SetValue(col++, index, Value::BIGINT(NumericCast(entry.oid))); // column_name, VARCHAR output.SetValue(col++, index, Value(ColumnName(i))); // column_index, INTEGER diff --git a/src/duckdb/src/function/table/system/duckdb_constraints.cpp b/src/duckdb/src/function/table/system/duckdb_constraints.cpp index 64aff394..71fabb16 100644 --- a/src/duckdb/src/function/table/system/duckdb_constraints.cpp +++ b/src/duckdb/src/function/table/system/duckdb_constraints.cpp @@ -15,6 +15,7 @@ #include "duckdb/planner/constraints/bound_not_null_constraint.hpp" #include "duckdb/planner/constraints/bound_foreign_key_constraint.hpp" #include "duckdb/storage/data_table.hpp" +#include "duckdb/planner/binder.hpp" namespace duckdb { @@ -49,11 +50,24 @@ struct hash { namespace duckdb { +struct ConstraintEntry { + ConstraintEntry(ClientContext &context, TableCatalogEntry &table) : table(table) { + if (!table.IsDuckTable()) { + return; + } + auto binder = Binder::CreateBinder(context); + bound_constraints = binder->BindConstraints(table.GetConstraints(), table.name, table.GetColumns()); + } + + TableCatalogEntry &table; + vector> bound_constraints; +}; + struct DuckDBConstraintsData : public GlobalTableFunctionState { DuckDBConstraintsData() : offset(0), constraint_offset(0), unique_constraint_offset(0) { } - vector> entries; + vector entries; idx_t offset; idx_t constraint_offset; idx_t unique_constraint_offset; @@ -118,8 +132,9 @@ unique_ptr DuckDBConstraintsInit(ClientContext &contex }); sort(entries.begin(), entries.end(), [&](CatalogEntry &x, CatalogEntry &y) { return (x.name < y.name); }); - - result->entries.insert(result->entries.end(), entries.begin(), entries.end()); + for (auto &entry : entries) { + result->entries.emplace_back(context, entry.get().Cast()); + } }; return std::move(result); @@ -135,10 +150,9 @@ void DuckDBConstraintsFunction(ClientContext &context, TableFunctionInput &data_ // either fill up the chunk or return all the remaining columns idx_t count = 0; while (data.offset < data.entries.size() && count < STANDARD_VECTOR_SIZE) { - auto &entry = data.entries[data.offset].get(); - D_ASSERT(entry.type == CatalogType::TABLE_ENTRY); + auto &entry = data.entries[data.offset]; - auto &table = entry.Cast(); + auto &table = entry.table; auto &constraints = table.GetConstraints(); bool is_duck_table = table.IsDuckTable(); for (; data.constraint_offset < constraints.size() && count < STANDARD_VECTOR_SIZE; data.constraint_offset++) { @@ -163,7 +177,7 @@ void DuckDBConstraintsFunction(ClientContext &context, TableFunctionInput &data_ if (!is_duck_table) { continue; } - auto &bound_constraints = table.GetBoundConstraints(); + auto &bound_constraints = entry.bound_constraints; auto &bound_foreign_key = bound_constraints[data.constraint_offset]->Cast(); if (bound_foreign_key.info.type == ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE) { // Those are already covered by PRIMARY KEY and UNIQUE entries @@ -180,21 +194,21 @@ void DuckDBConstraintsFunction(ClientContext &context, TableFunctionInput &data_ // database_name, LogicalType::VARCHAR output.SetValue(col++, count, Value(table.schema.catalog.GetName())); // database_oid, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(table.schema.catalog.GetOid())); + output.SetValue(col++, count, Value::BIGINT(NumericCast(table.schema.catalog.GetOid()))); // schema_name, LogicalType::VARCHAR output.SetValue(col++, count, Value(table.schema.name)); // schema_oid, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(table.schema.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(table.schema.oid))); // table_name, LogicalType::VARCHAR output.SetValue(col++, count, Value(table.name)); // table_oid, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(table.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(table.oid))); // constraint_index, BIGINT UniqueKeyInfo uk_info; if (is_duck_table) { - auto &bound_constraint = *table.GetBoundConstraints()[data.constraint_offset]; + auto &bound_constraint = *entry.bound_constraints[data.constraint_offset]; switch (bound_constraint.type) { case ConstraintType::UNIQUE: { auto &bound_unique = bound_constraint.Cast(); @@ -224,15 +238,16 @@ void DuckDBConstraintsFunction(ClientContext &context, TableFunctionInput &data_ } if (uk_info.columns.empty()) { - output.SetValue(col++, count, Value::BIGINT(data.unique_constraint_offset++)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(data.unique_constraint_offset++))); } else { auto known_unique_constraint_offset = data.known_fk_unique_constraint_offsets.find(uk_info); if (known_unique_constraint_offset == data.known_fk_unique_constraint_offsets.end()) { data.known_fk_unique_constraint_offsets.insert(make_pair(uk_info, data.unique_constraint_offset)); - output.SetValue(col++, count, Value::BIGINT(data.unique_constraint_offset)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(data.unique_constraint_offset))); data.unique_constraint_offset++; } else { - output.SetValue(col++, count, Value::BIGINT(known_unique_constraint_offset->second)); + output.SetValue(col++, count, + Value::BIGINT(NumericCast(known_unique_constraint_offset->second))); } } output.SetValue(col++, count, Value(constraint_type)); @@ -250,7 +265,7 @@ void DuckDBConstraintsFunction(ClientContext &context, TableFunctionInput &data_ vector column_index_list; if (is_duck_table) { - auto &bound_constraint = *table.GetBoundConstraints()[data.constraint_offset]; + auto &bound_constraint = *entry.bound_constraints[data.constraint_offset]; switch (bound_constraint.type) { case ConstraintType::CHECK: { auto &bound_check = bound_constraint.Cast(); @@ -286,7 +301,7 @@ void DuckDBConstraintsFunction(ClientContext &context, TableFunctionInput &data_ vector index_list; vector column_name_list; for (auto column_index : column_index_list) { - index_list.push_back(Value::BIGINT(column_index.index)); + index_list.push_back(Value::BIGINT(NumericCast(column_index.index))); column_name_list.emplace_back(table.GetColumn(column_index).Name()); } diff --git a/src/duckdb/src/function/table/system/duckdb_databases.cpp b/src/duckdb/src/function/table/system/duckdb_databases.cpp index f0a1fc99..2c7c9c91 100644 --- a/src/duckdb/src/function/table/system/duckdb_databases.cpp +++ b/src/duckdb/src/function/table/system/duckdb_databases.cpp @@ -26,6 +26,9 @@ static unique_ptr DuckDBDatabasesBind(ClientContext &context, Tabl names.emplace_back("comment"); return_types.emplace_back(LogicalType::VARCHAR); + names.emplace_back("tags"); + return_types.emplace_back(LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)); + names.emplace_back("internal"); return_types.emplace_back(LogicalType::BOOLEAN); @@ -66,7 +69,7 @@ void DuckDBDatabasesFunction(ClientContext &context, TableFunctionInput &data_p, // database_name, VARCHAR output.SetValue(col++, count, attached.GetName()); // database_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(attached.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(attached.oid))); bool is_internal = attached.IsSystem() || attached.IsTemporary(); bool is_readonly = attached.IsReadOnly(); // path, VARCHAR @@ -80,6 +83,8 @@ void DuckDBDatabasesFunction(ClientContext &context, TableFunctionInput &data_p, output.SetValue(col++, count, db_path); // comment, VARCHAR output.SetValue(col++, count, Value(attached.comment)); + // tags, MAP + output.SetValue(col++, count, Value::MAP(attached.tags)); // internal, BOOLEAN output.SetValue(col++, count, Value::BOOLEAN(is_internal)); // type, VARCHAR diff --git a/src/duckdb/src/function/table/system/duckdb_dependencies.cpp b/src/duckdb/src/function/table/system/duckdb_dependencies.cpp index c262d7d4..6f737019 100644 --- a/src/duckdb/src/function/table/system/duckdb_dependencies.cpp +++ b/src/duckdb/src/function/table/system/duckdb_dependencies.cpp @@ -85,13 +85,13 @@ void DuckDBDependenciesFunction(ClientContext &context, TableFunctionInput &data // classid, LogicalType::BIGINT output.SetValue(0, count, Value::BIGINT(0)); // objid, LogicalType::BIGINT - output.SetValue(1, count, Value::BIGINT(entry.object.oid)); + output.SetValue(1, count, Value::BIGINT(NumericCast(entry.object.oid))); // objsubid, LogicalType::INTEGER output.SetValue(2, count, Value::INTEGER(0)); // refclassid, LogicalType::BIGINT output.SetValue(3, count, Value::BIGINT(0)); // refobjid, LogicalType::BIGINT - output.SetValue(4, count, Value::BIGINT(entry.dependent.oid)); + output.SetValue(4, count, Value::BIGINT(NumericCast(entry.dependent.oid))); // refobjsubid, LogicalType::INTEGER output.SetValue(5, count, Value::INTEGER(0)); // deptype, LogicalType::VARCHAR diff --git a/src/duckdb/src/function/table/system/duckdb_extensions.cpp b/src/duckdb/src/function/table/system/duckdb_extensions.cpp index 7a2f4510..8fe90803 100644 --- a/src/duckdb/src/function/table/system/duckdb_extensions.cpp +++ b/src/duckdb/src/function/table/system/duckdb_extensions.cpp @@ -8,6 +8,10 @@ #include "duckdb/main/database.hpp" #include "duckdb/main/extension_helper.hpp" +#include "duckdb/common/serializer/buffered_file_reader.hpp" +#include "duckdb/common/serializer/binary_deserializer.hpp" +#include "duckdb/main/extension_install_info.hpp" + namespace duckdb { struct ExtensionInformation { @@ -15,6 +19,8 @@ struct ExtensionInformation { bool loaded = false; bool installed = false; string file_path; + ExtensionInstallMode install_mode; + string installed_from; string description; vector aliases; string extension_version; @@ -51,6 +57,12 @@ static unique_ptr DuckDBExtensionsBind(ClientContext &context, Tab names.emplace_back("extension_version"); return_types.emplace_back(LogicalType::VARCHAR); + names.emplace_back("install_mode"); + return_types.emplace_back(LogicalType::VARCHAR); + + names.emplace_back("installed_from"); + return_types.emplace_back(LogicalType::VARCHAR); + return nullptr; } @@ -60,6 +72,7 @@ unique_ptr DuckDBExtensionsInit(ClientContext &context auto &fs = FileSystem::GetFileSystem(context); auto &db = DatabaseInstance::GetDatabase(context); + // Firstly, we go over all Default Extensions: duckdb_extensions always prints those, installed/loaded or not map installed_extensions; auto extension_count = ExtensionHelper::DefaultExtensionCount(); auto alias_count = ExtensionHelper::ExtensionAliasCount(); @@ -70,6 +83,8 @@ unique_ptr DuckDBExtensionsInit(ClientContext &context info.installed = extension.statically_loaded; info.loaded = false; info.file_path = extension.statically_loaded ? "(BUILT-IN)" : string(); + info.install_mode = + extension.statically_loaded ? ExtensionInstallMode::STATICALLY_LINKED : ExtensionInstallMode::UNKNOWN; info.description = extension.description; for (idx_t k = 0; k < alias_count; k++) { auto alias = ExtensionHelper::GetExtensionAlias(k); @@ -79,8 +94,9 @@ unique_ptr DuckDBExtensionsInit(ClientContext &context } installed_extensions[info.name] = std::move(info); } + + // Secondly we scan all installed extensions and their install info #ifndef WASM_LOADABLE_EXTENSIONS - // scan the install directory for installed extensions auto ext_directory = ExtensionHelper::ExtensionDirectory(context); fs.ListFiles(ext_directory, [&](const string &path, bool is_directory) { if (!StringUtil::EndsWith(path, ".duckdb_extension")) { @@ -88,34 +104,56 @@ unique_ptr DuckDBExtensionsInit(ClientContext &context } ExtensionInformation info; info.name = fs.ExtractBaseName(path); + info.installed = true; info.loaded = false; info.file_path = fs.JoinPath(ext_directory, path); + + // Check the info file for its installation source + auto info_file_path = fs.JoinPath(ext_directory, path + ".info"); + + // Read the info file + auto extension_install_info = ExtensionInstallInfo::TryReadInfoFile(fs, info_file_path, info.name); + info.install_mode = extension_install_info->mode; + info.extension_version = extension_install_info->version; + if (extension_install_info->mode == ExtensionInstallMode::REPOSITORY) { + info.installed_from = ExtensionRepository::GetRepository(extension_install_info->repository_url); + } else { + info.installed_from = extension_install_info->full_path; + } + auto entry = installed_extensions.find(info.name); if (entry == installed_extensions.end()) { installed_extensions[info.name] = std::move(info); } else { if (!entry->second.loaded) { entry->second.file_path = info.file_path; + entry->second.install_mode = info.install_mode; + entry->second.installed_from = info.installed_from; + entry->second.install_mode = info.install_mode; + entry->second.extension_version = info.extension_version; } entry->second.installed = true; } }); #endif - // now check the list of currently loaded extensions + + // Finally, we check the list of currently loaded extensions auto &loaded_extensions = db.LoadedExtensionsData(); for (auto &e : loaded_extensions) { auto &ext_name = e.first; auto &ext_info = e.second; auto entry = installed_extensions.find(ext_name); - if (entry == installed_extensions.end()) { + if (entry == installed_extensions.end() || !entry->second.installed) { ExtensionInformation info; info.name = ext_name; info.loaded = true; - info.extension_version = ext_info.extension_version; + info.extension_version = ext_info.version; + info.installed = ext_info.mode == ExtensionInstallMode::STATICALLY_LINKED; + info.install_mode = ext_info.mode; installed_extensions[ext_name] = std::move(info); } else { entry->second.loaded = true; - entry->second.extension_version = ext_info.extension_version; + entry->second.extension_version = ext_info.version; } } @@ -144,7 +182,7 @@ void DuckDBExtensionsFunction(ClientContext &context, TableFunctionInput &data_p // loaded LogicalType::BOOLEAN output.SetValue(1, count, Value::BOOLEAN(entry.loaded)); // installed LogicalType::BOOLEAN - output.SetValue(2, count, !entry.installed && entry.loaded ? Value() : Value::BOOLEAN(entry.installed)); + output.SetValue(2, count, Value::BOOLEAN(entry.installed)); // install_path LogicalType::VARCHAR output.SetValue(3, count, Value(entry.file_path)); // description LogicalType::VARCHAR @@ -153,6 +191,10 @@ void DuckDBExtensionsFunction(ClientContext &context, TableFunctionInput &data_p output.SetValue(5, count, Value::LIST(LogicalType::VARCHAR, entry.aliases)); // extension version LogicalType::LIST(LogicalType::VARCHAR) output.SetValue(6, count, Value(entry.extension_version)); + // installed_mode LogicalType::VARCHAR + output.SetValue(7, count, entry.installed ? Value(EnumUtil::ToString(entry.install_mode)) : Value()); + // installed_source LogicalType::VARCHAR + output.SetValue(8, count, Value(entry.installed_from)); data.offset++; count++; diff --git a/src/duckdb/src/function/table/system/duckdb_functions.cpp b/src/duckdb/src/function/table/system/duckdb_functions.cpp index 107da17e..1ee4b851 100644 --- a/src/duckdb/src/function/table/system/duckdb_functions.cpp +++ b/src/duckdb/src/function/table/system/duckdb_functions.cpp @@ -49,6 +49,9 @@ static unique_ptr DuckDBFunctionsBind(ClientContext &context, Tabl names.emplace_back("comment"); return_types.emplace_back(LogicalType::VARCHAR); + names.emplace_back("tags"); + return_types.emplace_back(LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)); + names.emplace_back("return_type"); return_types.emplace_back(LogicalType::VARCHAR); @@ -453,7 +456,7 @@ bool ExtractFunctionData(FunctionEntry &entry, idx_t function_idx, DataChunk &ou output.SetValue(col++, output_offset, Value(function.schema.catalog.GetName())); // database_oid, BIGINT - output.SetValue(col++, output_offset, Value::BIGINT(function.schema.catalog.GetOid())); + output.SetValue(col++, output_offset, Value::BIGINT(NumericCast(function.schema.catalog.GetOid()))); // schema_name, LogicalType::VARCHAR output.SetValue(col++, output_offset, Value(function.schema.name)); @@ -470,6 +473,9 @@ bool ExtractFunctionData(FunctionEntry &entry, idx_t function_idx, DataChunk &ou // comment, LogicalType::VARCHAR output.SetValue(col++, output_offset, entry.comment); + // tags, LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR) + output.SetValue(col++, output_offset, Value::MAP(entry.tags)); + // return_type, LogicalType::VARCHAR output.SetValue(col++, output_offset, OP::GetReturnType(function, function_idx)); @@ -497,7 +503,7 @@ bool ExtractFunctionData(FunctionEntry &entry, idx_t function_idx, DataChunk &ou output.SetValue(col++, output_offset, Value::BOOLEAN(function.internal)); // function_oid, LogicalType::BIGINT - output.SetValue(col++, output_offset, Value::BIGINT(function.oid)); + output.SetValue(col++, output_offset, Value::BIGINT(NumericCast(function.oid))); // example, LogicalType::VARCHAR output.SetValue(col++, output_offset, entry.example.empty() ? Value() : entry.example); diff --git a/src/duckdb/src/function/table/system/duckdb_indexes.cpp b/src/duckdb/src/function/table/system/duckdb_indexes.cpp index 7cbb6e90..80938f60 100644 --- a/src/duckdb/src/function/table/system/duckdb_indexes.cpp +++ b/src/duckdb/src/function/table/system/duckdb_indexes.cpp @@ -45,6 +45,9 @@ static unique_ptr DuckDBIndexesBind(ClientContext &context, TableF names.emplace_back("comment"); return_types.emplace_back(LogicalType::VARCHAR); + names.emplace_back("tags"); + return_types.emplace_back(LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)); + names.emplace_back("is_unique"); return_types.emplace_back(LogicalType::BOOLEAN); @@ -91,24 +94,26 @@ void DuckDBIndexesFunction(ClientContext &context, TableFunctionInput &data_p, D // database_name, VARCHAR output.SetValue(col++, count, index.catalog.GetName()); // database_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(index.catalog.GetOid())); + output.SetValue(col++, count, Value::BIGINT(NumericCast(index.catalog.GetOid()))); // schema_name, VARCHAR output.SetValue(col++, count, Value(index.schema.name)); // schema_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(index.schema.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(index.schema.oid))); // index_name, VARCHAR output.SetValue(col++, count, Value(index.name)); // index_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(index.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(index.oid))); // find the table in the catalog auto &table_entry = index.schema.catalog.GetEntry(context, index.GetSchemaName(), index.GetTableName()); // table_name, VARCHAR output.SetValue(col++, count, Value(table_entry.name)); // table_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(table_entry.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(table_entry.oid))); // comment, VARCHAR output.SetValue(col++, count, Value(index.comment)); + // tags, MAP + output.SetValue(col++, count, Value::MAP(index.tags)); // is_unique, BOOLEAN output.SetValue(col++, count, Value::BOOLEAN(index.IsUnique())); // is_primary, BOOLEAN diff --git a/src/duckdb/src/function/table/system/duckdb_memory.cpp b/src/duckdb/src/function/table/system/duckdb_memory.cpp index 9117c91a..e67fa510 100644 --- a/src/duckdb/src/function/table/system/duckdb_memory.cpp +++ b/src/duckdb/src/function/table/system/duckdb_memory.cpp @@ -48,9 +48,9 @@ void DuckDBMemoryFunction(ClientContext &context, TableFunctionInput &data_p, Da // tag, VARCHAR output.SetValue(col++, count, EnumUtil::ToString(entry.tag)); // memory_usage_bytes, BIGINT - output.SetValue(col++, count, Value::BIGINT(entry.size)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(entry.size))); // temporary_storage_bytes, BIGINT - output.SetValue(col++, count, Value::BIGINT(entry.evicted_data)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(entry.evicted_data))); count++; } output.SetCardinality(count); diff --git a/src/duckdb/src/function/table/system/duckdb_schemas.cpp b/src/duckdb/src/function/table/system/duckdb_schemas.cpp index 65d4a48c..295d440b 100644 --- a/src/duckdb/src/function/table/system/duckdb_schemas.cpp +++ b/src/duckdb/src/function/table/system/duckdb_schemas.cpp @@ -33,6 +33,9 @@ static unique_ptr DuckDBSchemasBind(ClientContext &context, TableF names.emplace_back("comment"); return_types.emplace_back(LogicalType::VARCHAR); + names.emplace_back("tags"); + return_types.emplace_back(LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)); + names.emplace_back("internal"); return_types.emplace_back(LogicalType::BOOLEAN); @@ -66,15 +69,17 @@ void DuckDBSchemasFunction(ClientContext &context, TableFunctionInput &data_p, D // return values: idx_t col = 0; // "oid", PhysicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(entry.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(entry.oid))); // database_name, VARCHAR output.SetValue(col++, count, entry.catalog.GetName()); // database_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(entry.catalog.GetOid())); + output.SetValue(col++, count, Value::BIGINT(NumericCast(entry.catalog.GetOid()))); // "schema_name", PhysicalType::VARCHAR output.SetValue(col++, count, Value(entry.name)); // "comment", PhysicalType::VARCHAR output.SetValue(col++, count, Value(entry.comment)); + // "tags", MAP(VARCHAR, VARCHAR) + output.SetValue(col++, count, Value::MAP(entry.tags)); // "internal", PhysicalType::BOOLEAN output.SetValue(col++, count, Value::BOOLEAN(entry.internal)); // "sql", PhysicalType::VARCHAR diff --git a/src/duckdb/src/function/table/system/duckdb_sequences.cpp b/src/duckdb/src/function/table/system/duckdb_sequences.cpp index 484129be..b95d23c2 100644 --- a/src/duckdb/src/function/table/system/duckdb_sequences.cpp +++ b/src/duckdb/src/function/table/system/duckdb_sequences.cpp @@ -41,6 +41,9 @@ static unique_ptr DuckDBSequencesBind(ClientContext &context, Tabl names.emplace_back("comment"); return_types.emplace_back(LogicalType::VARCHAR); + names.emplace_back("tags"); + return_types.emplace_back(LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)); + names.emplace_back("temporary"); return_types.emplace_back(LogicalType::BOOLEAN); @@ -98,17 +101,19 @@ void DuckDBSequencesFunction(ClientContext &context, TableFunctionInput &data_p, // database_name, VARCHAR output.SetValue(col++, count, seq.catalog.GetName()); // database_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(seq.catalog.GetOid())); + output.SetValue(col++, count, Value::BIGINT(NumericCast(seq.catalog.GetOid()))); // schema_name, VARCHAR output.SetValue(col++, count, Value(seq.schema.name)); // schema_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(seq.schema.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(seq.schema.oid))); // sequence_name, VARCHAR output.SetValue(col++, count, Value(seq.name)); // sequence_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(seq.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(seq.oid))); // comment, VARCHAR output.SetValue(col++, count, Value(seq.comment)); + // tags, MAP(VARCHAR, VARCHAR) + output.SetValue(col++, count, Value::MAP(seq.tags)); // temporary, BOOLEAN output.SetValue(col++, count, Value::BOOLEAN(seq.temporary)); // start_value, BIGINT diff --git a/src/duckdb/src/function/table/system/duckdb_tables.cpp b/src/duckdb/src/function/table/system/duckdb_tables.cpp index e96c8c50..7f1386ab 100644 --- a/src/duckdb/src/function/table/system/duckdb_tables.cpp +++ b/src/duckdb/src/function/table/system/duckdb_tables.cpp @@ -44,6 +44,9 @@ static unique_ptr DuckDBTablesBind(ClientContext &context, TableFu names.emplace_back("comment"); return_types.emplace_back(LogicalType::VARCHAR); + names.emplace_back("tags"); + return_types.emplace_back(LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)); + names.emplace_back("internal"); return_types.emplace_back(LogicalType::BOOLEAN); @@ -127,17 +130,19 @@ void DuckDBTablesFunction(ClientContext &context, TableFunctionInput &data_p, Da // database_name, VARCHAR output.SetValue(col++, count, table.catalog.GetName()); // database_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(table.catalog.GetOid())); + output.SetValue(col++, count, Value::BIGINT(NumericCast(table.catalog.GetOid()))); // schema_name, LogicalType::VARCHAR output.SetValue(col++, count, Value(table.schema.name)); // schema_oid, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(table.schema.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(table.schema.oid))); // table_name, LogicalType::VARCHAR output.SetValue(col++, count, Value(table.name)); // table_oid, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(table.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(table.oid))); // comment, LogicalType::VARCHAR output.SetValue(col++, count, Value(table.comment)); + // tags, LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR) + output.SetValue(col++, count, Value::MAP(table.tags)); // internal, LogicalType::BOOLEAN output.SetValue(col++, count, Value::BOOLEAN(table.internal)); // temporary, LogicalType::BOOLEAN @@ -145,18 +150,21 @@ void DuckDBTablesFunction(ClientContext &context, TableFunctionInput &data_p, Da // has_primary_key, LogicalType::BOOLEAN output.SetValue(col++, count, Value::BOOLEAN(TableHasPrimaryKey(table))); // estimated_size, LogicalType::BIGINT - Value card_val = - !storage_info.cardinality.IsValid() ? Value() : Value::BIGINT(storage_info.cardinality.GetIndex()); + + Value card_val = !storage_info.cardinality.IsValid() + ? Value() + : Value::BIGINT(NumericCast(storage_info.cardinality.GetIndex())); output.SetValue(col++, count, card_val); // column_count, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(table.GetColumns().LogicalColumnCount())); + output.SetValue(col++, count, Value::BIGINT(NumericCast(table.GetColumns().LogicalColumnCount()))); // index_count, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(storage_info.index_info.size())); + output.SetValue(col++, count, Value::BIGINT(NumericCast(storage_info.index_info.size()))); // check_constraint_count, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(CheckConstraintCount(table))); + output.SetValue(col++, count, Value::BIGINT(NumericCast(CheckConstraintCount(table)))); // sql, LogicalType::VARCHAR - output.SetValue(col++, count, Value(table.ToSQL())); - + auto table_info = table.GetInfo(); + table_info->catalog.clear(); + output.SetValue(col++, count, Value(table_info->ToString())); count++; } output.SetCardinality(count); diff --git a/src/duckdb/src/function/table/system/duckdb_temporary_files.cpp b/src/duckdb/src/function/table/system/duckdb_temporary_files.cpp index d4f043af..f1886639 100644 --- a/src/duckdb/src/function/table/system/duckdb_temporary_files.cpp +++ b/src/duckdb/src/function/table/system/duckdb_temporary_files.cpp @@ -45,7 +45,7 @@ void DuckDBTemporaryFilesFunction(ClientContext &context, TableFunctionInput &da // database_name, VARCHAR output.SetValue(col++, count, entry.path); // database_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(entry.size)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(entry.size))); count++; } output.SetCardinality(count); diff --git a/src/duckdb/src/function/table/system/duckdb_types.cpp b/src/duckdb/src/function/table/system/duckdb_types.cpp index 2a7fc1fd..3872852d 100644 --- a/src/duckdb/src/function/table/system/duckdb_types.cpp +++ b/src/duckdb/src/function/table/system/duckdb_types.cpp @@ -52,6 +52,9 @@ static unique_ptr DuckDBTypesBind(ClientContext &context, TableFun names.emplace_back("comment"); return_types.emplace_back(LogicalType::VARCHAR); + names.emplace_back("tags"); + return_types.emplace_back(LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)); + names.emplace_back("internal"); return_types.emplace_back(LogicalType::BOOLEAN); @@ -89,17 +92,17 @@ void DuckDBTypesFunction(ClientContext &context, TableFunctionInput &data_p, Dat // database_name, VARCHAR output.SetValue(col++, count, type_entry.catalog.GetName()); // database_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(type_entry.catalog.GetOid())); + output.SetValue(col++, count, Value::BIGINT(NumericCast(type_entry.catalog.GetOid()))); // schema_name, LogicalType::VARCHAR output.SetValue(col++, count, Value(type_entry.schema.name)); // schema_oid, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(type_entry.schema.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(type_entry.schema.oid))); // type_oid, BIGINT int64_t oid; if (type_entry.internal) { - oid = int64_t(type.id()); + oid = NumericCast(type.id()); } else { - oid = type_entry.oid; + oid = NumericCast(type_entry.oid); } Value oid_val; if (data.oids.find(oid) == data.oids.end()) { @@ -114,7 +117,9 @@ void DuckDBTypesFunction(ClientContext &context, TableFunctionInput &data_p, Dat // type_size, BIGINT auto internal_type = type.InternalType(); output.SetValue(col++, count, - internal_type == PhysicalType::INVALID ? Value() : Value::BIGINT(GetTypeIdSize(internal_type))); + internal_type == PhysicalType::INVALID + ? Value() + : Value::BIGINT(NumericCast(GetTypeIdSize(internal_type)))); // logical_type, VARCHAR output.SetValue(col++, count, Value(EnumUtil::ToString(type.id()))); // type_category, VARCHAR @@ -165,6 +170,8 @@ void DuckDBTypesFunction(ClientContext &context, TableFunctionInput &data_p, Dat output.SetValue(col++, count, category.empty() ? Value() : Value(category)); // comment, VARCHAR output.SetValue(col++, count, Value(type_entry.comment)); + // tags, MAP + output.SetValue(col++, count, Value::MAP(type_entry.tags)); // internal, BOOLEAN output.SetValue(col++, count, Value::BOOLEAN(type_entry.internal)); // labels, VARCHAR[] diff --git a/src/duckdb/src/function/table/system/duckdb_views.cpp b/src/duckdb/src/function/table/system/duckdb_views.cpp index bd17a7ef..1ae6fcce 100644 --- a/src/duckdb/src/function/table/system/duckdb_views.cpp +++ b/src/duckdb/src/function/table/system/duckdb_views.cpp @@ -40,6 +40,9 @@ static unique_ptr DuckDBViewsBind(ClientContext &context, TableFun names.emplace_back("comment"); return_types.emplace_back(LogicalType::VARCHAR); + names.emplace_back("tags"); + return_types.emplace_back(LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)); + names.emplace_back("internal"); return_types.emplace_back(LogicalType::BOOLEAN); @@ -89,23 +92,25 @@ void DuckDBViewsFunction(ClientContext &context, TableFunctionInput &data_p, Dat // database_name, VARCHAR output.SetValue(col++, count, view.catalog.GetName()); // database_oid, BIGINT - output.SetValue(col++, count, Value::BIGINT(view.catalog.GetOid())); + output.SetValue(col++, count, Value::BIGINT(NumericCast(view.catalog.GetOid()))); // schema_name, LogicalType::VARCHAR output.SetValue(col++, count, Value(view.schema.name)); // schema_oid, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(view.schema.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(view.schema.oid))); // view_name, LogicalType::VARCHAR output.SetValue(col++, count, Value(view.name)); // view_oid, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(view.oid)); + output.SetValue(col++, count, Value::BIGINT(NumericCast(view.oid))); // comment, LogicalType::VARCHARs output.SetValue(col++, count, Value(view.comment)); + // tags, LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR) + output.SetValue(col++, count, Value::MAP(view.tags)); // internal, LogicalType::BOOLEAN output.SetValue(col++, count, Value::BOOLEAN(view.internal)); // temporary, LogicalType::BOOLEAN output.SetValue(col++, count, Value::BOOLEAN(view.temporary)); // column_count, LogicalType::BIGINT - output.SetValue(col++, count, Value::BIGINT(view.types.size())); + output.SetValue(col++, count, Value::BIGINT(NumericCast(view.types.size()))); // sql, LogicalType::VARCHAR output.SetValue(col++, count, Value(view.ToSQL())); diff --git a/src/duckdb/src/function/table/system/duckdb_which_secret.cpp b/src/duckdb/src/function/table/system/duckdb_which_secret.cpp new file mode 100644 index 00000000..3314fee9 --- /dev/null +++ b/src/duckdb/src/function/table/system/duckdb_which_secret.cpp @@ -0,0 +1,75 @@ +#include "duckdb/function/table/system_functions.hpp" + +#include "duckdb/common/file_system.hpp" +#include "duckdb/common/map.hpp" +#include "duckdb/common/string_util.hpp" +#include "duckdb/common/multi_file_reader.hpp" +#include "duckdb/function/function_set.hpp" +#include "duckdb/main/client_context.hpp" +#include "duckdb/main/database.hpp" +#include "duckdb/main/extension_helper.hpp" +#include "duckdb/main/secret/secret_manager.hpp" + +namespace duckdb { + +struct DuckDBWhichSecretData : public GlobalTableFunctionState { + DuckDBWhichSecretData() : finished(false) { + } + bool finished; +}; + +struct DuckDBWhichSecretBindData : public TableFunctionData { + explicit DuckDBWhichSecretBindData(TableFunctionBindInput &tf_input) : inputs(tf_input.inputs) {}; + + duckdb::vector inputs; +}; + +static unique_ptr DuckDBWhichSecretBind(ClientContext &context, TableFunctionBindInput &input, + vector &return_types, vector &names) { + names.emplace_back("name"); + return_types.emplace_back(LogicalType::VARCHAR); + + names.emplace_back("persistent"); + return_types.emplace_back(LogicalType::VARCHAR); + + names.emplace_back("storage"); + return_types.emplace_back(LogicalType::VARCHAR); + + return make_uniq(input); +} + +unique_ptr DuckDBWhichSecretInit(ClientContext &context, TableFunctionInitInput &input) { + return make_uniq(); +} + +void DuckDBWhichSecretFunction(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) { + auto &data = data_p.global_state->Cast(); + if (data.finished) { + // finished returning values + return; + } + auto &bind_data = data_p.bind_data->Cast(); + + auto &secret_manager = SecretManager::Get(context); + auto transaction = CatalogTransaction::GetSystemCatalogTransaction(context); + + auto &inputs = bind_data.inputs; + auto path = inputs[0].ToString(); + auto type = inputs[1].ToString(); + auto secret_match = secret_manager.LookupSecret(transaction, path, type); + if (secret_match.HasMatch()) { + auto &secret_entry = *secret_match.secret_entry; + output.SetCardinality(1); + output.SetValue(0, 0, secret_entry.secret->GetName()); + output.SetValue(1, 0, EnumUtil::ToString(secret_entry.persist_type)); + output.SetValue(2, 0, secret_entry.storage_mode); + } + data.finished = true; +} + +void DuckDBWhichSecretFun::RegisterFunction(BuiltinFunctions &set) { + set.AddFunction(TableFunction("which_secret", {duckdb::LogicalType::VARCHAR, duckdb::LogicalType::VARCHAR}, + DuckDBWhichSecretFunction, DuckDBWhichSecretBind, DuckDBWhichSecretInit)); +} + +} // namespace duckdb diff --git a/src/duckdb/src/function/table/system/pragma_database_size.cpp b/src/duckdb/src/function/table/system/pragma_database_size.cpp index c10eae0c..ba8f2020 100644 --- a/src/duckdb/src/function/table/system/pragma_database_size.cpp +++ b/src/duckdb/src/function/table/system/pragma_database_size.cpp @@ -76,10 +76,10 @@ void PragmaDatabaseSizeFunction(ClientContext &context, TableFunctionInput &data idx_t col = 0; output.data[col++].SetValue(row, Value(db.GetName())); output.data[col++].SetValue(row, Value(StringUtil::BytesToHumanReadableString(ds.bytes))); - output.data[col++].SetValue(row, Value::BIGINT(ds.block_size)); - output.data[col++].SetValue(row, Value::BIGINT(ds.total_blocks)); - output.data[col++].SetValue(row, Value::BIGINT(ds.used_blocks)); - output.data[col++].SetValue(row, Value::BIGINT(ds.free_blocks)); + output.data[col++].SetValue(row, Value::BIGINT(NumericCast(ds.block_size))); + output.data[col++].SetValue(row, Value::BIGINT(NumericCast(ds.total_blocks))); + output.data[col++].SetValue(row, Value::BIGINT(NumericCast(ds.used_blocks))); + output.data[col++].SetValue(row, Value::BIGINT(NumericCast(ds.free_blocks))); output.data[col++].SetValue( row, ds.wal_size == idx_t(-1) ? Value() : Value(StringUtil::BytesToHumanReadableString(ds.wal_size))); output.data[col++].SetValue(row, data.memory_usage); diff --git a/src/duckdb/src/function/table/system/pragma_metadata_info.cpp b/src/duckdb/src/function/table/system/pragma_metadata_info.cpp index d6717a9d..1a10c671 100644 --- a/src/duckdb/src/function/table/system/pragma_metadata_info.cpp +++ b/src/duckdb/src/function/table/system/pragma_metadata_info.cpp @@ -64,13 +64,13 @@ static void PragmaMetadataInfoFunction(ClientContext &context, TableFunctionInpu // block_id output.SetValue(col_idx++, count, Value::BIGINT(entry.block_id)); // total_blocks - output.SetValue(col_idx++, count, Value::BIGINT(entry.total_blocks)); + output.SetValue(col_idx++, count, Value::BIGINT(NumericCast(entry.total_blocks))); // free_blocks - output.SetValue(col_idx++, count, Value::BIGINT(entry.free_list.size())); + output.SetValue(col_idx++, count, Value::BIGINT(NumericCast(entry.free_list.size()))); // free_list vector list_values; for (auto &free_id : entry.free_list) { - list_values.push_back(Value::BIGINT(free_id)); + list_values.push_back(Value::BIGINT(NumericCast(free_id))); } output.SetValue(col_idx++, count, Value::LIST(LogicalType::BIGINT, std::move(list_values))); count++; diff --git a/src/duckdb/src/function/table/system/pragma_storage_info.cpp b/src/duckdb/src/function/table/system/pragma_storage_info.cpp index 90c60d15..0c33ebf0 100644 --- a/src/duckdb/src/function/table/system/pragma_storage_info.cpp +++ b/src/duckdb/src/function/table/system/pragma_storage_info.cpp @@ -103,22 +103,22 @@ static void PragmaStorageInfoFunction(ClientContext &context, TableFunctionInput idx_t col_idx = 0; // row_group_id - output.SetValue(col_idx++, count, Value::BIGINT(entry.row_group_index)); + output.SetValue(col_idx++, count, Value::BIGINT(NumericCast(entry.row_group_index))); // column_name auto &col = columns.GetColumn(PhysicalIndex(entry.column_id)); output.SetValue(col_idx++, count, Value(col.Name())); // column_id - output.SetValue(col_idx++, count, Value::BIGINT(entry.column_id)); + output.SetValue(col_idx++, count, Value::BIGINT(NumericCast(entry.column_id))); // column_path output.SetValue(col_idx++, count, Value(entry.column_path)); // segment_id - output.SetValue(col_idx++, count, Value::BIGINT(entry.segment_idx)); + output.SetValue(col_idx++, count, Value::BIGINT(NumericCast(entry.segment_idx))); // segment_type output.SetValue(col_idx++, count, Value(entry.segment_type)); // start - output.SetValue(col_idx++, count, Value::BIGINT(entry.segment_start)); + output.SetValue(col_idx++, count, Value::BIGINT(NumericCast(entry.segment_start))); // count - output.SetValue(col_idx++, count, Value::BIGINT(entry.segment_count)); + output.SetValue(col_idx++, count, Value::BIGINT(NumericCast(entry.segment_count))); // compression output.SetValue(col_idx++, count, Value(entry.compression_type)); // stats @@ -131,7 +131,7 @@ static void PragmaStorageInfoFunction(ClientContext &context, TableFunctionInput // block_offset if (entry.persistent) { output.SetValue(col_idx++, count, Value::BIGINT(entry.block_id)); - output.SetValue(col_idx++, count, Value::BIGINT(entry.block_offset)); + output.SetValue(col_idx++, count, Value::BIGINT(NumericCast(entry.block_offset))); } else { output.SetValue(col_idx++, count, Value()); output.SetValue(col_idx++, count, Value()); diff --git a/src/duckdb/src/function/table/system_functions.cpp b/src/duckdb/src/function/table/system_functions.cpp index a9c19154..a1a821db 100644 --- a/src/duckdb/src/function/table/system_functions.cpp +++ b/src/duckdb/src/function/table/system_functions.cpp @@ -30,6 +30,7 @@ void BuiltinFunctions::RegisterSQLiteFunctions() { DuckDBMemoryFun::RegisterFunction(*this); DuckDBOptimizersFun::RegisterFunction(*this); DuckDBSecretsFun::RegisterFunction(*this); + DuckDBWhichSecretFun::RegisterFunction(*this); DuckDBSequencesFun::RegisterFunction(*this); DuckDBSettingsFun::RegisterFunction(*this); DuckDBTablesFun::RegisterFunction(*this); diff --git a/src/duckdb/src/function/table/table_scan.cpp b/src/duckdb/src/function/table/table_scan.cpp index 26a98437..d6c7bdde 100644 --- a/src/duckdb/src/function/table/table_scan.cpp +++ b/src/duckdb/src/function/table/table_scan.cpp @@ -202,8 +202,9 @@ unique_ptr TableScanCardinality(ClientContext &context, const Fu auto &bind_data = bind_data_p->Cast(); auto &local_storage = LocalStorage::Get(context, bind_data.table.catalog); auto &storage = bind_data.table.GetStorage(); - idx_t estimated_cardinality = storage.info->cardinality + local_storage.AddedRows(bind_data.table.GetStorage()); - return make_uniq(storage.info->cardinality, estimated_cardinality); + idx_t table_rows = storage.GetTotalRows(); + idx_t estimated_cardinality = table_rows + local_storage.AddedRows(bind_data.table.GetStorage()); + return make_uniq(table_rows, estimated_cardinality); } //===--------------------------------------------------------------------===// @@ -263,7 +264,8 @@ static void RewriteIndexExpression(Index &index, LogicalGet &get, Expression &ex auto &bound_colref = expr.Cast(); // bound column ref: rewrite to fit in the current set of bound column ids bound_colref.binding.table_index = get.table_index; - column_t referenced_column = index.column_ids[bound_colref.binding.column_index]; + auto &column_ids = index.GetColumnIds(); + column_t referenced_column = column_ids[bound_colref.binding.column_index]; // search for the referenced column in the set of column_ids for (idx_t i = 0; i < get.column_ids.size(); i++) { if (get.column_ids[i] == referenced_column) { @@ -306,22 +308,13 @@ void TableScanPushdownComplexFilter(ClientContext &context, LogicalGet &get, Fun return; } - // behold - storage.info->indexes.Scan([&](Index &index) { - // first rewrite the index expression so the ColumnBindings align with the column bindings of the current table - - if (index.IsUnknown()) { - // unknown index: skip - return false; - } - - if (index.index_type != ART::TYPE_NAME) { - // only ART indexes are supported for now - return false; - } - - auto &art_index = index.Cast(); + auto checkpoint_lock = storage.GetSharedCheckpointLock(); + auto &info = storage.GetDataTableInfo(); + auto &transaction = Transaction::Get(context, bind_data.table.catalog); + // bind and scan any ART indexes + info->GetIndexes().BindAndScan(context, *info, [&](ART &art_index) { + // first rewrite the index expression so the ColumnBindings align with the column bindings of the current table if (art_index.unbound_expressions.size() > 1) { // NOTE: index scans are not (yet) supported for compound index keys return false; @@ -336,8 +329,6 @@ void TableScanPushdownComplexFilter(ClientContext &context, LogicalGet &get, Fun } // try to find a matching index for any of the filter expressions - auto &transaction = Transaction::Get(context, bind_data.table.catalog); - for (auto &filter : filters) { auto index_state = art_index.TryInitializeScan(transaction, *index_expression, *filter); if (index_state != nullptr) { diff --git a/src/duckdb/src/function/table/unnest.cpp b/src/duckdb/src/function/table/unnest.cpp index 15f39508..b6485bc3 100644 --- a/src/duckdb/src/function/table/unnest.cpp +++ b/src/duckdb/src/function/table/unnest.cpp @@ -63,7 +63,7 @@ static unique_ptr UnnestLocalInit(ExecutionContext &con static unique_ptr UnnestInit(ClientContext &context, TableFunctionInitInput &input) { auto &bind_data = input.bind_data->Cast(); auto result = make_uniq(); - auto ref = make_uniq(bind_data.input_type, 0); + auto ref = make_uniq(bind_data.input_type, 0U); auto bound_unnest = make_uniq(ListType::GetChildType(bind_data.input_type)); bound_unnest->child = std::move(ref); result->select_list.push_back(std::move(bound_unnest)); diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index 3f50f4b3..0f59f375 100644 --- a/src/duckdb/src/function/table/version/pragma_version.cpp +++ b/src/duckdb/src/function/table/version/pragma_version.cpp @@ -1,5 +1,5 @@ #ifndef DUCKDB_PATCH_VERSION -#define DUCKDB_PATCH_VERSION "2" +#define DUCKDB_PATCH_VERSION "3" #endif #ifndef DUCKDB_MINOR_VERSION #define DUCKDB_MINOR_VERSION 10 @@ -8,10 +8,10 @@ #define DUCKDB_MAJOR_VERSION 0 #endif #ifndef DUCKDB_VERSION -#define DUCKDB_VERSION "v0.10.2" +#define DUCKDB_VERSION "v0.10.3" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "1601d94f94" +#define DUCKDB_SOURCE_ID "62d61a417f" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp" diff --git a/src/duckdb/src/function/table_function.cpp b/src/duckdb/src/function/table_function.cpp index 9d0ec2b2..802f89fb 100644 --- a/src/duckdb/src/function/table_function.cpp +++ b/src/duckdb/src/function/table_function.cpp @@ -18,8 +18,8 @@ TableFunction::TableFunction(string name, vector arguments, table_f init_global(init_global), init_local(init_local), function(function), in_out_function(nullptr), in_out_function_final(nullptr), statistics(nullptr), dependency(nullptr), cardinality(nullptr), pushdown_complex_filter(nullptr), to_string(nullptr), table_scan_progress(nullptr), get_batch_index(nullptr), - get_bind_info(nullptr), serialize(nullptr), deserialize(nullptr), projection_pushdown(false), - filter_pushdown(false), filter_prune(false) { + get_bind_info(nullptr), type_pushdown(nullptr), get_multi_file_reader(nullptr), serialize(nullptr), + deserialize(nullptr), projection_pushdown(false), filter_pushdown(false), filter_prune(false) { } TableFunction::TableFunction(const vector &arguments, table_function_t function, @@ -31,8 +31,9 @@ TableFunction::TableFunction() : SimpleNamedParameterFunction("", {}), bind(nullptr), bind_replace(nullptr), init_global(nullptr), init_local(nullptr), function(nullptr), in_out_function(nullptr), statistics(nullptr), dependency(nullptr), cardinality(nullptr), pushdown_complex_filter(nullptr), to_string(nullptr), table_scan_progress(nullptr), - get_batch_index(nullptr), get_bind_info(nullptr), serialize(nullptr), deserialize(nullptr), - projection_pushdown(false), filter_pushdown(false), filter_prune(false) { + get_batch_index(nullptr), get_bind_info(nullptr), type_pushdown(nullptr), get_multi_file_reader(nullptr), + serialize(nullptr), deserialize(nullptr), projection_pushdown(false), filter_pushdown(false), + filter_prune(false) { } bool TableFunction::Equal(const TableFunction &rhs) const { diff --git a/src/duckdb/src/include/duckdb.h b/src/duckdb/src/include/duckdb.h index 45606c8a..2a7d2420 100644 --- a/src/duckdb/src/include/duckdb.h +++ b/src/duckdb/src/include/duckdb.h @@ -934,7 +934,8 @@ converted. The result must be freed with `duckdb_free`. DUCKDB_API char *duckdb_value_varchar(duckdb_result *result, idx_t col, idx_t row); /*! - * returns: The string value at the specified location. + * returns: The string value at the specified location. Attempts to cast the result value to string. + * No support for nested types, and for other complex types. * The resulting field "string.data" must be freed with `duckdb_free.` */ DUCKDB_API duckdb_string duckdb_value_string(duckdb_result *result, idx_t col, idx_t row); @@ -2578,11 +2579,10 @@ The error message should not be freed. It will be de-allocated when `duckdb_appe DUCKDB_API const char *duckdb_appender_error(duckdb_appender appender); /*! -Flush the appender to the table, forcing the cache of the appender to be cleared and the data to be appended to the -base table. - -This should generally not be used unless you know what you are doing. Instead, call `duckdb_appender_destroy` when you -are done with the appender. +Flush the appender to the table, forcing the cache of the appender to be cleared. If flushing the data triggers a +constraint violation or any other error, then all data is invalidated, and this function returns DuckDBError. +It is not possible to append more values. Call duckdb_appender_error to obtain the error message followed by +duckdb_appender_destroy to destroy the invalidated appender. * appender: The appender to flush. * returns: `DuckDBSuccess` on success or `DuckDBError` on failure. @@ -2590,9 +2590,10 @@ are done with the appender. DUCKDB_API duckdb_state duckdb_appender_flush(duckdb_appender appender); /*! -Close the appender, flushing all intermediate state in the appender to the table and closing it for further appends. - -This is generally not necessary. Call `duckdb_appender_destroy` instead. +Closes the appender by flushing all intermediate states and closing it for further appends. If flushing the data +triggers a constraint violation or any other error, then all data is invalidated, and this function returns DuckDBError. +Call duckdb_appender_error to obtain the error message followed by duckdb_appender_destroy to destroy the invalidated +appender. * appender: The appender to flush and close. * returns: `DuckDBSuccess` on success or `DuckDBError` on failure. @@ -2600,8 +2601,11 @@ This is generally not necessary. Call `duckdb_appender_destroy` instead. DUCKDB_API duckdb_state duckdb_appender_close(duckdb_appender appender); /*! -Close the appender and destroy it. Flushing all intermediate state in the appender to the table, and de-allocating -all memory associated with the appender. +Closes the appender by flushing all intermediate states to the table and destroying it. By destroying it, this function +de-allocates all memory associated with the appender. If flushing the data triggers a constraint violation, +then all data is invalidated, and this function returns DuckDBError. Due to the destruction of the appender, it is no +longer possible to obtain the specific error message with duckdb_appender_error. Therefore, call duckdb_appender_close +before destroying the appender, if you need insights into the specific error. * appender: The appender to flush, close and destroy. * returns: `DuckDBSuccess` on success or `DuckDBError` on failure. diff --git a/src/duckdb/src/include/duckdb/catalog/catalog.hpp b/src/duckdb/src/include/duckdb/catalog/catalog.hpp index 31098ba1..19d48ef5 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog.hpp @@ -229,16 +229,6 @@ class Catalog { const string &schema, const string &name, QueryErrorContext error_context = QueryErrorContext()); - //! Gets the "schema.name" entry without a specified type, if entry does not exist an exception is thrown - DUCKDB_API CatalogEntry &GetEntry(ClientContext &context, const string &schema, const string &name); - - //! Fetches a logical type from the catalog - DUCKDB_API LogicalType GetType(ClientContext &context, const string &schema, const string &names, - OnEntryNotFound if_not_found); - - DUCKDB_API static LogicalType GetType(ClientContext &context, const string &catalog_name, const string &schema, - const string &name); - template optional_ptr GetEntry(ClientContext &context, const string &schema_name, const string &name, OnEntryNotFound if_not_found, QueryErrorContext error_context = QueryErrorContext()) { @@ -262,6 +252,7 @@ class Catalog { DUCKDB_API optional_ptr AddFunction(ClientContext &context, CreateFunctionInfo &info); //! Alter an existing entry in the catalog. + DUCKDB_API void Alter(CatalogTransaction transaction, AlterInfo &info); DUCKDB_API void Alter(ClientContext &context, AlterInfo &info); virtual unique_ptr PlanCreateTableAs(ClientContext &context, LogicalCreateTable &op, diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp index 29c46fa1..33802d1d 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp @@ -27,6 +27,7 @@ class Serializer; class Deserializer; class Value; +struct CatalogTransaction; struct CreateInfo; //! Abstract base class of an entry in the catalog @@ -54,6 +55,8 @@ class CatalogEntry { atomic timestamp; //! (optional) comment on this entry Value comment; + //! (optional) extra data associated with this entry + unordered_map tags; private: //! Child entry @@ -63,6 +66,7 @@ class CatalogEntry { public: virtual unique_ptr AlterEntry(ClientContext &context, AlterInfo &info); + virtual unique_ptr AlterEntry(CatalogTransaction transaction, AlterInfo &info); virtual void UndoAlter(ClientContext &context, AlterInfo &info); virtual unique_ptr Copy(ClientContext &context) const; diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp index 3245d0a7..f0175bbd 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp @@ -14,7 +14,7 @@ namespace duckdb { //! Wrapper class to allow copying a DuckIndexEntry (for altering the DuckIndexEntry metadata such as comments) struct IndexDataTableInfo { - IndexDataTableInfo(shared_ptr &info_p, const string &index_name_p); + IndexDataTableInfo(shared_ptr info_p, const string &index_name_p); ~IndexDataTableInfo(); //! Pointer to the DataTableInfo diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp index 33bbd010..c34923e3 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp @@ -45,7 +45,7 @@ class DuckSchemaEntry : public SchemaCatalogEntry { optional_ptr CreateTable(CatalogTransaction transaction, BoundCreateTableInfo &info) override; optional_ptr CreateFunction(CatalogTransaction transaction, CreateFunctionInfo &info) override; - optional_ptr CreateIndex(ClientContext &context, CreateIndexInfo &info, + optional_ptr CreateIndex(CatalogTransaction transaction, CreateIndexInfo &info, TableCatalogEntry &table) override; optional_ptr CreateView(CatalogTransaction transaction, CreateViewInfo &info) override; optional_ptr CreateSequence(CatalogTransaction transaction, CreateSequenceInfo &info) override; @@ -57,7 +57,7 @@ class DuckSchemaEntry : public SchemaCatalogEntry { CreatePragmaFunctionInfo &info) override; optional_ptr CreateCollation(CatalogTransaction transaction, CreateCollationInfo &info) override; optional_ptr CreateType(CatalogTransaction transaction, CreateTypeInfo &info) override; - void Alter(ClientContext &context, AlterInfo &info) override; + void Alter(CatalogTransaction transaction, AlterInfo &info) override; void Scan(ClientContext &context, CatalogType type, const std::function &callback) override; void Scan(CatalogType type, const std::function &callback) override; void DropEntry(ClientContext &context, DropInfo &info) override; diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp index 0890ce82..c728b295 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp @@ -17,15 +17,14 @@ class DuckTableEntry : public TableCatalogEntry { public: //! Create a TableCatalogEntry and initialize storage for it DuckTableEntry(Catalog &catalog, SchemaCatalogEntry &schema, BoundCreateTableInfo &info, - std::shared_ptr inherited_storage = nullptr); + shared_ptr inherited_storage = nullptr); public: unique_ptr AlterEntry(ClientContext &context, AlterInfo &info) override; + unique_ptr AlterEntry(CatalogTransaction, AlterInfo &info) override; void UndoAlter(ClientContext &context, AlterInfo &info) override; //! Returns the underlying storage of the table DataTable &GetStorage() override; - //! Returns a list of the bound constraints of the table - const vector> &GetBoundConstraints() override; //! Get statistics of a column (physical or virtual) within the table unique_ptr GetStatistics(ClientContext &context, column_t column_id) override; @@ -55,18 +54,17 @@ class DuckTableEntry : public TableCatalogEntry { unique_ptr ChangeColumnType(ClientContext &context, ChangeColumnTypeInfo &info); unique_ptr SetNotNull(ClientContext &context, SetNotNullInfo &info); unique_ptr DropNotNull(ClientContext &context, DropNotNullInfo &info); - unique_ptr AddForeignKeyConstraint(ClientContext &context, AlterForeignKeyInfo &info); + unique_ptr AddForeignKeyConstraint(optional_ptr context, AlterForeignKeyInfo &info); unique_ptr DropForeignKeyConstraint(ClientContext &context, AlterForeignKeyInfo &info); unique_ptr SetColumnComment(ClientContext &context, SetColumnCommentInfo &info); void UpdateConstraintsOnColumnDrop(const LogicalIndex &removed_index, const vector &adjusted_indices, - const RemoveColumnInfo &info, CreateTableInfo &create_info, bool is_generated); + const RemoveColumnInfo &info, CreateTableInfo &create_info, + const vector> &bound_constraints, bool is_generated); private: //! A reference to the underlying storage unit used for this table - std::shared_ptr storage; - //! A list of constraints that are part of this table - vector> bound_constraints; + shared_ptr storage; //! Manages dependencies of the individual columns of the table ColumnDependencyManager column_dependency_manager; }; diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp index 69f4918c..788c6561 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp @@ -21,6 +21,7 @@ class FunctionEntry : public StandardEntry { description = std::move(info.description); parameter_names = std::move(info.parameter_names); example = std::move(info.example); + this->dependencies = info.dependencies; } //! The description (if any) diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp index 0356ea30..a6f7d728 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp @@ -58,8 +58,9 @@ class SchemaCatalogEntry : public InCatalogEntry { string ToSQL() const override; //! Creates an index with the given name in the schema - virtual optional_ptr CreateIndex(ClientContext &context, CreateIndexInfo &info, + virtual optional_ptr CreateIndex(CatalogTransaction transaction, CreateIndexInfo &info, TableCatalogEntry &table) = 0; + optional_ptr CreateIndex(ClientContext &context, CreateIndexInfo &info, TableCatalogEntry &table); //! Create a scalar or aggregate function within the given schema virtual optional_ptr CreateFunction(CatalogTransaction transaction, CreateFunctionInfo &info) = 0; //! Creates a table with the given name in the schema @@ -91,7 +92,7 @@ class SchemaCatalogEntry : public InCatalogEntry { virtual void DropEntry(ClientContext &context, DropInfo &info) = 0; //! Alters a catalog entry - virtual void Alter(ClientContext &context, AlterInfo &info) = 0; + virtual void Alter(CatalogTransaction transaction, AlterInfo &info) = 0; CatalogTransaction GetCatalogTransaction(ClientContext &context); }; diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp index ca2b4c47..ed12b77a 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp @@ -15,13 +15,10 @@ namespace duckdb { class DuckTransaction; +class SequenceCatalogEntry; struct SequenceValue { - SequenceValue() : usage_count(0), counter(-1) { - } - SequenceValue(uint64_t usage_count, int64_t counter) : usage_count(usage_count), counter(counter) { - } - + SequenceCatalogEntry *entry; uint64_t usage_count; int64_t counter; }; diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp index 243765a4..6e8c0f24 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp @@ -37,6 +37,7 @@ struct SetColumnCommentInfo; class TableFunction; struct FunctionData; +class Binder; class TableColumnInfo; struct ColumnSegmentInfo; class TableStorageInfo; @@ -74,11 +75,9 @@ class TableCatalogEntry : public StandardEntry { DUCKDB_API const ColumnList &GetColumns() const; //! Returns the underlying storage of the table virtual DataTable &GetStorage(); - //! Returns a list of the bound constraints of the table - virtual const vector> &GetBoundConstraints(); //! Returns a list of the constraints of the table - DUCKDB_API const vector> &GetConstraints(); + DUCKDB_API const vector> &GetConstraints() const; DUCKDB_API string ToSQL() const override; //! Get statistics of a column (physical or virtual) within the table @@ -105,7 +104,7 @@ class TableCatalogEntry : public StandardEntry { //! Returns the storage info of this table virtual TableStorageInfo GetStorageInfo(ClientContext &context) = 0; - virtual void BindUpdateConstraints(LogicalGet &get, LogicalProjection &proj, LogicalUpdate &update, + virtual void BindUpdateConstraints(Binder &binder, LogicalGet &get, LogicalProjection &proj, LogicalUpdate &update, ClientContext &context); protected: diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp index 97fdce21..064ba4c0 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp @@ -26,6 +26,8 @@ class TypeCatalogEntry : public StandardEntry { LogicalType user_type; + bind_type_modifiers_function_t bind_modifiers; + public: unique_ptr GetInfo() const override; unique_ptr Copy(ClientContext &context) const override; diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_entry_retriever.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_entry_retriever.hpp new file mode 100644 index 00000000..28b3874c --- /dev/null +++ b/src/duckdb/src/include/duckdb/catalog/catalog_entry_retriever.hpp @@ -0,0 +1,72 @@ +#pragma once + +#include +#include "duckdb/common/enums/catalog_type.hpp" +#include "duckdb/common/enums/on_entry_not_found.hpp" +#include "duckdb/common/string.hpp" +#include "duckdb/parser/query_error_context.hpp" +#include "duckdb/catalog/catalog_entry/schema_catalog_entry.hpp" + +namespace duckdb { + +class ClientContext; +class Catalog; +class CatalogEntry; + +using catalog_entry_callback_t = std::function; + +// Wraps the Catalog::GetEntry method +class CatalogEntryRetriever { +public: + explicit CatalogEntryRetriever(ClientContext &context) : context(context) { + } + CatalogEntryRetriever(const CatalogEntryRetriever &other) : callback(other.callback), context(other.context) { + } + +public: + optional_ptr GetEntry(CatalogType type, const string &catalog, const string &schema, + const string &name, + OnEntryNotFound on_entry_not_found = OnEntryNotFound::THROW_EXCEPTION, + QueryErrorContext error_context = QueryErrorContext()); + + optional_ptr GetEntry(CatalogType type, Catalog &catalog, const string &schema, const string &name, + OnEntryNotFound on_entry_not_found = OnEntryNotFound::THROW_EXCEPTION, + QueryErrorContext error_context = QueryErrorContext()); + + LogicalType GetType(const string &catalog, const string &schema, const string &name, + OnEntryNotFound on_entry_not_found = OnEntryNotFound::RETURN_NULL); + LogicalType GetType(Catalog &catalog, const string &schema, const string &name, + OnEntryNotFound on_entry_not_found = OnEntryNotFound::RETURN_NULL); + + optional_ptr GetSchema(const string &catalog, const string &name, + OnEntryNotFound on_entry_not_found = OnEntryNotFound::THROW_EXCEPTION, + QueryErrorContext error_context = QueryErrorContext()); + + void SetCallback(catalog_entry_callback_t callback) { + this->callback = std::move(callback); + } + catalog_entry_callback_t GetCallback() { + return callback; + } + +private: + using catalog_entry_retrieve_func_t = std::function()>; + optional_ptr GetEntryInternal(const catalog_entry_retrieve_func_t &retriever) { + auto result = retriever(); + if (!result) { + return result; + } + if (callback) { + // Call the callback if it's set + callback(*result); + } + return result; + } + +private: + //! (optional) callback, called on every succesful entry retrieval + catalog_entry_callback_t callback = nullptr; + ClientContext &context; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp b/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp index f9a327e7..ce8024a8 100644 --- a/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +++ b/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp @@ -27,6 +27,9 @@ struct CatalogTransaction { transaction_t transaction_id; transaction_t start_time; + bool HasContext() const { + return context; + } ClientContext &GetContext(); static CatalogTransaction GetSystemCatalogTransaction(ClientContext &context); diff --git a/src/duckdb/src/include/duckdb/catalog/dependency.hpp b/src/duckdb/src/include/duckdb/catalog/dependency.hpp index 120b5fd7..4ac3656e 100644 --- a/src/duckdb/src/include/duckdb/catalog/dependency.hpp +++ b/src/duckdb/src/include/duckdb/catalog/dependency.hpp @@ -153,6 +153,10 @@ struct CatalogEntryInfo { } return true; } + +public: + void Serialize(Serializer &serializer) const; + static CatalogEntryInfo Deserialize(Deserializer &deserializer); }; struct Dependency { diff --git a/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp b/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp index ed08f01a..8bbadd21 100644 --- a/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp +++ b/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp @@ -32,6 +32,10 @@ struct LogicalDependency { explicit LogicalDependency(CatalogEntry &entry); LogicalDependency(); bool operator==(const LogicalDependency &other) const; + +public: + void Serialize(Serializer &serializer) const; + static LogicalDependency Deserialize(Deserializer &deserializer); }; struct LogicalDependencyHashFunction { @@ -42,7 +46,7 @@ struct LogicalDependencyEquality { bool operator()(const LogicalDependency &a, const LogicalDependency &b) const; }; -//! The DependencyList containing LogicalDependency objects, not looked up in the catalog yet +//! The LogicalDependencyList containing LogicalDependency objects, not looked up in the catalog yet class LogicalDependencyList { using create_info_set_t = unordered_set; @@ -54,6 +58,8 @@ class LogicalDependencyList { public: DUCKDB_API void VerifyDependencies(Catalog &catalog, const string &name); + void Serialize(Serializer &serializer) const; + static LogicalDependencyList Deserialize(Deserializer &deserializer); bool operator==(const LogicalDependencyList &other) const; const create_info_set_t &Set() const; diff --git a/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp b/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp index e580bfcc..9b191036 100644 --- a/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp +++ b/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp @@ -100,7 +100,7 @@ class DependencyManager { bool IsSystemEntry(CatalogEntry &entry) const; optional_ptr LookupEntry(CatalogTransaction transaction, const LogicalDependency &dependency); optional_ptr LookupEntry(CatalogTransaction transaction, CatalogEntry &dependency); - + string CollectDependents(CatalogTransaction transaction, catalog_entry_set_t &entries, CatalogEntryInfo &info); void CleanupDependencies(CatalogTransaction transaction, CatalogEntry &entry); public: @@ -112,7 +112,7 @@ class DependencyManager { private: void AddObject(CatalogTransaction transaction, CatalogEntry &object, const LogicalDependencyList &dependencies); void DropObject(CatalogTransaction transaction, CatalogEntry &object, bool cascade); - void AlterObject(CatalogTransaction transaction, CatalogEntry &old_obj, CatalogEntry &new_obj); + void AlterObject(CatalogTransaction transaction, CatalogEntry &old_obj, CatalogEntry &new_obj, AlterInfo &info); private: void RemoveDependency(CatalogTransaction transaction, const DependencyInfo &info); diff --git a/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp b/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp index cab74168..a3fa83d8 100644 --- a/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp +++ b/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp @@ -25,6 +25,8 @@ class StandardEntry : public InCatalogEntry { //! The schema the entry belongs to SchemaCatalogEntry &schema; + //! The dependencies of the entry, can be empty + LogicalDependencyList dependencies; public: SchemaCatalogEntry &ParentSchema() override { diff --git a/src/duckdb/src/include/duckdb/common/arrow/appender/append_data.hpp b/src/duckdb/src/include/duckdb/common/arrow/appender/append_data.hpp index 8cbbf02c..52845cbd 100644 --- a/src/duckdb/src/include/duckdb/common/arrow/appender/append_data.hpp +++ b/src/duckdb/src/include/duckdb/common/arrow/appender/append_data.hpp @@ -59,6 +59,7 @@ struct ArrowAppendData { //===--------------------------------------------------------------------===// // Append Helper Functions //===--------------------------------------------------------------------===// + static void GetBitPosition(idx_t row_idx, idx_t ¤t_byte, uint8_t ¤t_bit) { current_byte = row_idx / 8; current_bit = row_idx % 8; diff --git a/src/duckdb/src/include/duckdb/common/arrow/appender/enum_data.hpp b/src/duckdb/src/include/duckdb/common/arrow/appender/enum_data.hpp index e6ed5c10..f7f73e05 100644 --- a/src/duckdb/src/include/duckdb/common/arrow/appender/enum_data.hpp +++ b/src/duckdb/src/include/duckdb/common/arrow/appender/enum_data.hpp @@ -44,14 +44,14 @@ struct ArrowEnumData : public ArrowScalarBaseData { auto string_length = GetLength(data[i]); // append the offset data - auto current_offset = last_offset + string_length; - offset_data[offset_idx] = UnsafeNumericCast(current_offset); + auto current_offset = UnsafeNumericCast(last_offset) + string_length; + offset_data[offset_idx] = UnsafeNumericCast(current_offset); // resize the string buffer if required, and write the string data append_data.aux_buffer.resize(current_offset); WriteData(append_data.aux_buffer.data() + last_offset, data[i]); - last_offset = UnsafeNumericCast(current_offset); + last_offset = UnsafeNumericCast(current_offset); } append_data.row_count += size; } diff --git a/src/duckdb/src/include/duckdb/common/arrow/appender/map_data.hpp b/src/duckdb/src/include/duckdb/common/arrow/appender/map_data.hpp index e881c532..630ff166 100644 --- a/src/duckdb/src/include/duckdb/common/arrow/appender/map_data.hpp +++ b/src/duckdb/src/include/duckdb/common/arrow/appender/map_data.hpp @@ -75,7 +75,7 @@ struct ArrowMapData { struct_result->children = struct_data.child_pointers.data(); struct_result->n_buffers = 1; struct_result->n_children = struct_child_count; - struct_result->length = struct_data.child_data[0]->row_count; + struct_result->length = NumericCast(struct_data.child_data[0]->row_count); append_data.child_arrays[0] = *struct_result; diff --git a/src/duckdb/src/include/duckdb/common/arrow/appender/scalar_data.hpp b/src/duckdb/src/include/duckdb/common/arrow/appender/scalar_data.hpp index 2c2769e1..e7eab00f 100644 --- a/src/duckdb/src/include/duckdb/common/arrow/appender/scalar_data.hpp +++ b/src/duckdb/src/include/duckdb/common/arrow/appender/scalar_data.hpp @@ -42,6 +42,21 @@ struct ArrowIntervalConverter { } }; +struct ArrowTimeTzConverter { + template + static TGT Operation(SRC input) { + return input.time().micros; + } + + static bool SkipNulls() { + return true; + } + + template + static void SetNull(TGT &value) { + } +}; + template struct ArrowScalarBaseData { static void Append(ArrowAppendData &append_data, Vector &input, idx_t from, idx_t to, idx_t input_size) { diff --git a/src/duckdb/src/include/duckdb/common/arrow/appender/varchar_data.hpp b/src/duckdb/src/include/duckdb/common/arrow/appender/varchar_data.hpp index d6ffcd9d..753756b9 100644 --- a/src/duckdb/src/include/duckdb/common/arrow/appender/varchar_data.hpp +++ b/src/duckdb/src/include/duckdb/common/arrow/appender/varchar_data.hpp @@ -77,8 +77,9 @@ struct ArrowVarcharData { auto string_length = OP::GetLength(data[source_idx]); // append the offset data - auto current_offset = last_offset + string_length; - if (!LARGE_STRING && (int64_t)last_offset + string_length > NumericLimits::Maximum()) { + auto current_offset = UnsafeNumericCast(last_offset) + string_length; + if (!LARGE_STRING && + UnsafeNumericCast(last_offset) + string_length > NumericLimits::Maximum()) { D_ASSERT(append_data.options.arrow_offset_size == ArrowOffsetSize::REGULAR); throw InvalidInputException( "Arrow Appender: The maximum total string size for regular string buffers is " diff --git a/src/duckdb/src/include/duckdb/common/bit_utils.hpp b/src/duckdb/src/include/duckdb/common/bit_utils.hpp index 3c4f4a6b..766e951e 100644 --- a/src/duckdb/src/include/duckdb/common/bit_utils.hpp +++ b/src/duckdb/src/include/duckdb/common/bit_utils.hpp @@ -10,68 +10,7 @@ #include "duckdb/common/hugeint.hpp" #include "duckdb/common/uhugeint.hpp" - -#if defined(_MSC_VER) && !defined(__clang__) -#define __restrict__ -#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ -#define __ORDER_LITTLE_ENDIAN__ 2 -#include -static inline int __builtin_ctzll(unsigned long long x) { -#ifdef _WIN64 - unsigned long ret; - _BitScanForward64(&ret, x); - return (int)ret; -#else - unsigned long low, high; - bool low_set = _BitScanForward(&low, (unsigned __int32)(x)) != 0; - _BitScanForward(&high, (unsigned __int32)(x >> 32)); - high += 32; - return low_set ? low : high; -#endif -} -static inline int __builtin_clzll(unsigned long long mask) { - unsigned long where; -// BitScanReverse scans from MSB to LSB for first set bit. -// Returns 0 if no set bit is found. -#if defined(_WIN64) - if (_BitScanReverse64(&where, mask)) - return static_cast(63 - where); -#elif defined(_WIN32) - // Scan the high 32 bits. - if (_BitScanReverse(&where, static_cast(mask >> 32))) - return static_cast(63 - (where + 32)); // Create a bit offset from the MSB. - // Scan the low 32 bits. - if (_BitScanReverse(&where, static_cast(mask))) - return static_cast(63 - where); -#else -#error "Implementation of __builtin_clzll required" -#endif - return 64; // Undefined Behavior. -} - -static inline int __builtin_ctz(unsigned int value) { - unsigned long trailing_zero = 0; - - if (_BitScanForward(&trailing_zero, value)) { - return trailing_zero; - } else { - // This is undefined, I better choose 32 than 0 - return 32; - } -} - -static inline int __builtin_clz(unsigned int value) { - unsigned long leading_zero = 0; - - if (_BitScanReverse(&leading_zero, value)) { - return 31 - leading_zero; - } else { - // Same remarks as above - return 32; - } -} - -#endif +#include "duckdb/common/numeric_utils.hpp" namespace duckdb { @@ -79,60 +18,86 @@ template struct CountZeros {}; template <> -struct CountZeros { - inline static int Leading(uint32_t value) { - if (!value) { - return 32; +struct CountZeros { + // see here: https://en.wikipedia.org/wiki/De_Bruijn_sequence + inline static idx_t Leading(const uint64_t value_in) { + if (!value_in) { + return 64; } - return __builtin_clz(value); + + uint64_t value = value_in; + + constexpr uint64_t index64msb[] = {0, 47, 1, 56, 48, 27, 2, 60, 57, 49, 41, 37, 28, 16, 3, 61, + 54, 58, 35, 52, 50, 42, 21, 44, 38, 32, 29, 23, 17, 11, 4, 62, + 46, 55, 26, 59, 40, 36, 15, 53, 34, 51, 20, 43, 31, 22, 10, 45, + 25, 39, 14, 33, 19, 30, 9, 24, 13, 18, 8, 12, 7, 6, 5, 63}; + + constexpr uint64_t debruijn64msb = 0X03F79D71B4CB0A89; + + value |= value >> 1; + value |= value >> 2; + value |= value >> 4; + value |= value >> 8; + value |= value >> 16; + value |= value >> 32; + auto result = 63 - index64msb[(value * debruijn64msb) >> 58]; +#ifdef __clang__ + D_ASSERT(result == static_cast(__builtin_clzl(value_in))); +#endif + return result; } - inline static int Trailing(uint32_t value) { - if (!value) { - return 32; + inline static idx_t Trailing(uint64_t value_in) { + if (!value_in) { + return 64; } - return __builtin_ctz(value); + uint64_t value = value_in; + + constexpr uint64_t index64lsb[] = {63, 0, 58, 1, 59, 47, 53, 2, 60, 39, 48, 27, 54, 33, 42, 3, + 61, 51, 37, 40, 49, 18, 28, 20, 55, 30, 34, 11, 43, 14, 22, 4, + 62, 57, 46, 52, 38, 26, 32, 41, 50, 36, 17, 19, 29, 10, 13, 21, + 56, 45, 25, 31, 35, 16, 9, 12, 44, 24, 15, 8, 23, 7, 6, 5}; + constexpr uint64_t debruijn64lsb = 0x07EDD5E59A4E28C2ULL; + auto result = index64lsb[((value & -value) * debruijn64lsb) >> 58]; +#ifdef __clang__ + D_ASSERT(result == static_cast(__builtin_ctzl(value_in))); +#endif + return result; } }; template <> -struct CountZeros { - inline static int Leading(uint64_t value) { - if (!value) { - return 64; - } - return __builtin_clzll(value); +struct CountZeros { + inline static idx_t Leading(uint32_t value) { + return CountZeros::Leading(static_cast(value)) - 32; } - inline static int Trailing(uint64_t value) { - if (!value) { - return 64; - } - return __builtin_ctzll(value); + inline static idx_t Trailing(uint32_t value) { + return CountZeros::Trailing(static_cast(value)); } }; template <> struct CountZeros { - inline static int Leading(hugeint_t value) { - const uint64_t upper = (uint64_t)value.upper; + inline static idx_t Leading(hugeint_t value) { + const uint64_t upper = static_cast(value.upper); const uint64_t lower = value.lower; if (upper) { - return __builtin_clzll(upper); + return CountZeros::Leading(upper); } else if (lower) { - return 64 + __builtin_clzll(lower); + return 64 + CountZeros::Leading(lower); } else { return 128; } } - inline static int Trailing(hugeint_t value) { - const uint64_t upper = (uint64_t)value.upper; + inline static idx_t Trailing(hugeint_t value) { + const uint64_t upper = static_cast(value.upper); const uint64_t lower = value.lower; if (lower) { - return __builtin_ctzll(lower); + return CountZeros::Trailing(lower); } else if (upper) { - return 64 + __builtin_ctzll(upper); + return 64 + CountZeros::Trailing(upper); } else { return 128; } @@ -141,27 +106,27 @@ struct CountZeros { template <> struct CountZeros { - inline static int Leading(uhugeint_t value) { - const uint64_t upper = (uint64_t)value.upper; + inline static idx_t Leading(uhugeint_t value) { + const uint64_t upper = static_cast(value.upper); const uint64_t lower = value.lower; if (upper) { - return __builtin_clzll(upper); + return CountZeros::Leading(upper); } else if (lower) { - return 64 + __builtin_clzll(lower); + return 64 + CountZeros::Leading(lower); } else { return 128; } } - inline static int Trailing(uhugeint_t value) { - const uint64_t upper = (uint64_t)value.upper; + inline static idx_t Trailing(uhugeint_t value) { + const uint64_t upper = static_cast(value.upper); const uint64_t lower = value.lower; if (lower) { - return __builtin_ctzll(lower); + return CountZeros::Trailing(lower); } else if (upper) { - return 64 + __builtin_ctzll(upper); + return 64 + CountZeros::Trailing(upper); } else { return 128; } diff --git a/src/duckdb/src/include/duckdb/common/bitpacking.hpp b/src/duckdb/src/include/duckdb/common/bitpacking.hpp index 7bddedfc..8aa0305b 100644 --- a/src/duckdb/src/include/duckdb/common/bitpacking.hpp +++ b/src/duckdb/src/include/duckdb/common/bitpacking.hpp @@ -112,7 +112,7 @@ class BitpackingPrimitives { return num_to_round; } - return num_to_round + BITPACKING_ALGORITHM_GROUP_SIZE - remainder; + return num_to_round + BITPACKING_ALGORITHM_GROUP_SIZE - NumericCast(remainder); } private: @@ -133,7 +133,7 @@ class BitpackingPrimitives { } } - return FindMinimumBitWidth(min_value, max_value); + return FindMinimumBitWidth(min_value, max_value); } template @@ -174,7 +174,7 @@ class BitpackingPrimitives { if (bitwidth < sizeof(T) * 8 && bitwidth != 0) { if (is_signed) { D_ASSERT(max_value <= (T(1) << (bitwidth - 1)) - 1); - D_ASSERT(min_value >= (T(-1) * ((T(1) << (bitwidth - 1)) - 1) - 1)); + // D_ASSERT(min_value >= (T(-1) * ((T(1) << (bitwidth - 1)) - 1) - 1)); } else { D_ASSERT(max_value <= (T(1) << (bitwidth)) - 1); } @@ -192,7 +192,7 @@ class BitpackingPrimitives { T const mask = UnsafeNumericCast(T_U(1) << (width - 1)); for (idx_t i = 0; i < BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE; ++i) { T value = Load(dst + i * sizeof(T)); - value = UnsafeNumericCast(value & ((T_U(1) << width) - T_U(1))); + value = UnsafeNumericCast(T_U(value) & ((T_U(1) << width) - T_U(1))); T result = (value ^ mask) - mask; Store(result, dst + i * sizeof(T)); } diff --git a/src/duckdb/src/include/duckdb/common/constants.hpp b/src/duckdb/src/include/duckdb/common/constants.hpp index 57d9f166..d4a0d7cd 100644 --- a/src/duckdb/src/include/duckdb/common/constants.hpp +++ b/src/duckdb/src/include/duckdb/common/constants.hpp @@ -57,6 +57,8 @@ extern const double PI; struct DConstants { //! The value used to signify an invalid index entry static constexpr const idx_t INVALID_INDEX = idx_t(-1); + //! The total maximum vector size (128GB) + static constexpr const idx_t MAX_VECTOR_SIZE = 1ULL << 37ULL; }; struct LogicalIndex { diff --git a/src/duckdb/src/include/duckdb/common/enable_shared_from_this.ipp b/src/duckdb/src/include/duckdb/common/enable_shared_from_this.ipp new file mode 100644 index 00000000..85cdd220 --- /dev/null +++ b/src/duckdb/src/include/duckdb/common/enable_shared_from_this.ipp @@ -0,0 +1,42 @@ +namespace duckdb { + +template +class enable_shared_from_this { // NOLINT: invalid case style +public: + template + friend class shared_ptr; + +private: + mutable weak_ptr __weak_this_; // NOLINT: __weak_this_ is reserved + +protected: + constexpr enable_shared_from_this() noexcept { + } + enable_shared_from_this(enable_shared_from_this const &) noexcept { // NOLINT: not marked as explicit + } + enable_shared_from_this &operator=(enable_shared_from_this const &) noexcept { + return *this; + } + ~enable_shared_from_this() { + } + +public: + shared_ptr shared_from_this() { // NOLINT: invalid case style + return shared_ptr(__weak_this_); + } + shared_ptr shared_from_this() const { // NOLINT: invalid case style + return shared_ptr(__weak_this_); + } + +#if _LIBCPP_STD_VER >= 17 + weak_ptr weak_from_this() noexcept { // NOLINT: invalid case style + return __weak_this_; + } + + weak_ptr weak_from_this() const noexcept { // NOLINT: invalid case style + return __weak_this_; + } +#endif // _LIBCPP_STD_VER >= 17 +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/enum_util.hpp b/src/duckdb/src/include/duckdb/common/enum_util.hpp index 81b670cd..fea98310 100644 --- a/src/duckdb/src/include/duckdb/common/enum_util.hpp +++ b/src/duckdb/src/include/duckdb/common/enum_util.hpp @@ -62,6 +62,8 @@ enum class ArrowOffsetSize : uint8_t; enum class ArrowVariableSizeType : uint8_t; +enum class BinderType : uint8_t; + enum class BindingMode : uint8_t; enum class BitpackingMode : uint8_t; @@ -120,13 +122,17 @@ enum class ExplainOutputType : uint8_t; enum class ExplainType : uint8_t; +enum class ExponentType : uint8_t; + enum class ExpressionClass : uint8_t; enum class ExpressionType : uint8_t; +enum class ExtensionInstallMode : uint8_t; + enum class ExtensionLoadResult : uint8_t; -enum class ExternalDependenciesType : uint8_t; +enum class ExtensionUpdateResultTag : uint8_t; enum class ExtraDropInfoType : uint8_t; @@ -136,6 +142,8 @@ enum class FileBufferType : uint8_t; enum class FileCompressionType : uint8_t; +enum class FileExpandResult : uint8_t; + enum class FileGlobOptions : uint8_t; enum class FileLockType : uint8_t; @@ -242,6 +250,8 @@ enum class ResultModifierType : uint8_t; enum class SampleMethod : uint8_t; +enum class SampleType : uint8_t; + enum class ScanType : uint8_t; enum class SecretDisplayType : uint8_t; @@ -370,6 +380,9 @@ const char* EnumUtil::ToChars(ArrowOffsetSize value); template<> const char* EnumUtil::ToChars(ArrowVariableSizeType value); +template<> +const char* EnumUtil::ToChars(BinderType value); + template<> const char* EnumUtil::ToChars(BindingMode value); @@ -457,17 +470,23 @@ const char* EnumUtil::ToChars(ExplainOutputType value); template<> const char* EnumUtil::ToChars(ExplainType value); +template<> +const char* EnumUtil::ToChars(ExponentType value); + template<> const char* EnumUtil::ToChars(ExpressionClass value); template<> const char* EnumUtil::ToChars(ExpressionType value); +template<> +const char* EnumUtil::ToChars(ExtensionInstallMode value); + template<> const char* EnumUtil::ToChars(ExtensionLoadResult value); template<> -const char* EnumUtil::ToChars(ExternalDependenciesType value); +const char* EnumUtil::ToChars(ExtensionUpdateResultTag value); template<> const char* EnumUtil::ToChars(ExtraDropInfoType value); @@ -481,6 +500,9 @@ const char* EnumUtil::ToChars(FileBufferType value); template<> const char* EnumUtil::ToChars(FileCompressionType value); +template<> +const char* EnumUtil::ToChars(FileExpandResult value); + template<> const char* EnumUtil::ToChars(FileGlobOptions value); @@ -640,6 +662,9 @@ const char* EnumUtil::ToChars(ResultModifierType value); template<> const char* EnumUtil::ToChars(SampleMethod value); +template<> +const char* EnumUtil::ToChars(SampleType value); + template<> const char* EnumUtil::ToChars(ScanType value); @@ -809,6 +834,9 @@ ArrowOffsetSize EnumUtil::FromString(const char *value); template<> ArrowVariableSizeType EnumUtil::FromString(const char *value); +template<> +BinderType EnumUtil::FromString(const char *value); + template<> BindingMode EnumUtil::FromString(const char *value); @@ -896,17 +924,23 @@ ExplainOutputType EnumUtil::FromString(const char *value); template<> ExplainType EnumUtil::FromString(const char *value); +template<> +ExponentType EnumUtil::FromString(const char *value); + template<> ExpressionClass EnumUtil::FromString(const char *value); template<> ExpressionType EnumUtil::FromString(const char *value); +template<> +ExtensionInstallMode EnumUtil::FromString(const char *value); + template<> ExtensionLoadResult EnumUtil::FromString(const char *value); template<> -ExternalDependenciesType EnumUtil::FromString(const char *value); +ExtensionUpdateResultTag EnumUtil::FromString(const char *value); template<> ExtraDropInfoType EnumUtil::FromString(const char *value); @@ -920,6 +954,9 @@ FileBufferType EnumUtil::FromString(const char *value); template<> FileCompressionType EnumUtil::FromString(const char *value); +template<> +FileExpandResult EnumUtil::FromString(const char *value); + template<> FileGlobOptions EnumUtil::FromString(const char *value); @@ -1079,6 +1116,9 @@ ResultModifierType EnumUtil::FromString(const char *value); template<> SampleMethod EnumUtil::FromString(const char *value); +template<> +SampleType EnumUtil::FromString(const char *value); + template<> ScanType EnumUtil::FromString(const char *value); diff --git a/src/duckdb/src/include/duckdb/common/enums/checkpoint_type.hpp b/src/duckdb/src/include/duckdb/common/enums/checkpoint_type.hpp new file mode 100644 index 00000000..580d810a --- /dev/null +++ b/src/duckdb/src/include/duckdb/common/enums/checkpoint_type.hpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/common/enums/checkpoint_type.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/common/constants.hpp" + +namespace duckdb { + +enum class CheckpointWALAction { + //! Delete the WAL file after the checkpoint completes - generally done on shutdown + DELETE_WAL, + //! Leave the WAL file alone + DONT_DELETE_WAL +}; + +enum class CheckpointAction { + //! Checkpoint only if a checkpoint is required (i.e. the WAL has data in it that can be flushed) + CHECKPOINT_IF_REQUIRED, + //! Force a checkpoint regardless of whether or not there is data in the WAL to flush + FORCE_CHECKPOINT +}; + +enum class CheckpointType { + //! Full checkpoints involve vacuuming deleted rows and updates + //! They can only be run if no transaction need to read old data (that would be cleaned up/vacuumed) + FULL_CHECKPOINT, + //! Concurrent checkpoints write committed data to disk but do less clean-up + //! They can be run even when active transactions need to read old data + CONCURRENT_CHECKPOINT +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp b/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp index e9e435ae..1375886b 100644 --- a/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +++ b/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp @@ -100,6 +100,7 @@ enum class LogicalOperatorType : uint8_t { LOGICAL_SET = 179, LOGICAL_LOAD = 180, LOGICAL_RESET = 181, + LOGICAL_UPDATE_EXTENSIONS = 182, // ----------------------------- // Secrets diff --git a/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp b/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp index 608efb4d..7aadb07b 100644 --- a/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +++ b/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp @@ -113,6 +113,7 @@ enum class PhysicalOperatorType : uint8_t { RESET, EXTENSION, VERIFY_VECTOR, + UPDATE_EXTENSIONS, // ----------------------------- // Secret diff --git a/src/duckdb/src/include/duckdb/common/enums/relation_type.hpp b/src/duckdb/src/include/duckdb/common/enums/relation_type.hpp index f1c5fd33..30af8873 100644 --- a/src/duckdb/src/include/duckdb/common/enums/relation_type.hpp +++ b/src/duckdb/src/include/duckdb/common/enums/relation_type.hpp @@ -32,6 +32,7 @@ enum class RelationType : uint8_t { CREATE_TABLE_RELATION, INSERT_RELATION, VALUE_LIST_RELATION, + MATERIALIZED_RELATION, DELETE_RELATION, UPDATE_RELATION, WRITE_CSV_RELATION, diff --git a/src/duckdb/src/include/duckdb/common/enums/scan_options.hpp b/src/duckdb/src/include/duckdb/common/enums/scan_options.hpp index 3281aff4..31223e43 100644 --- a/src/duckdb/src/include/duckdb/common/enums/scan_options.hpp +++ b/src/duckdb/src/include/duckdb/common/enums/scan_options.hpp @@ -21,7 +21,9 @@ enum class TableScanType : uint8_t { TABLE_SCAN_COMMITTED_ROWS_DISALLOW_UPDATES = 2, //! Scan all rows, excluding any permanently deleted rows. //! Permanently deleted rows are rows which no transaction will ever need again. - TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED = 3 + TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED = 3, + //! Scan the latest committed rows + TABLE_SCAN_LATEST_COMMITTED_ROWS = 4 }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/enums/scan_vector_type.hpp b/src/duckdb/src/include/duckdb/common/enums/scan_vector_type.hpp new file mode 100644 index 00000000..dcdf6e90 --- /dev/null +++ b/src/duckdb/src/include/duckdb/common/enums/scan_vector_type.hpp @@ -0,0 +1,17 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/common/enums/scan_vector_type.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/common/constants.hpp" + +namespace duckdb { + +enum class ScanVectorType { SCAN_ENTIRE_VECTOR, SCAN_FLAT_VECTOR }; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp b/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp index 26ecce70..e927ee0c 100644 --- a/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp +++ b/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp @@ -46,6 +46,7 @@ enum class StatementType : uint8_t { DETACH_STATEMENT, MULTI_STATEMENT, COPY_DATABASE_STATEMENT, + UPDATE_EXTENSIONS_STATEMENT, }; DUCKDB_API string StatementTypeToString(StatementType type); diff --git a/src/duckdb/src/include/duckdb/common/enums/tableref_type.hpp b/src/duckdb/src/include/duckdb/common/enums/tableref_type.hpp index c4cf9844..09dff91e 100644 --- a/src/duckdb/src/include/duckdb/common/enums/tableref_type.hpp +++ b/src/duckdb/src/include/duckdb/common/enums/tableref_type.hpp @@ -25,7 +25,8 @@ enum class TableReferenceType : uint8_t { CTE = 7, // Recursive CTE EMPTY_FROM = 8, // placeholder for empty FROM PIVOT = 9, // pivot statement - SHOW_REF = 10 // SHOW statement + SHOW_REF = 10, // SHOW statement + COLUMN_DATA = 11 // column data collection }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/enums/undo_flags.hpp b/src/duckdb/src/include/duckdb/common/enums/undo_flags.hpp index 92816114..a91548bd 100644 --- a/src/duckdb/src/include/duckdb/common/enums/undo_flags.hpp +++ b/src/duckdb/src/include/duckdb/common/enums/undo_flags.hpp @@ -17,7 +17,8 @@ enum class UndoFlags : uint32_t { // far too big but aligned (TM) CATALOG_ENTRY = 1, INSERT_TUPLE = 2, DELETE_TUPLE = 3, - UPDATE_TUPLE = 4 + UPDATE_TUPLE = 4, + SEQUENCE_VALUE = 5 }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/exception.hpp b/src/duckdb/src/include/duckdb/common/exception.hpp index 3765c6ba..4f8dc1e1 100644 --- a/src/duckdb/src/include/duckdb/common/exception.hpp +++ b/src/duckdb/src/include/duckdb/common/exception.hpp @@ -10,7 +10,6 @@ #include "duckdb/common/assert.hpp" #include "duckdb/common/exception_format_value.hpp" -#include "duckdb/common/shared_ptr.hpp" #include "duckdb/common/unordered_map.hpp" #include "duckdb/common/typedefs.hpp" diff --git a/src/duckdb/src/include/duckdb/common/extra_type_info.hpp b/src/duckdb/src/include/duckdb/common/extra_type_info.hpp index 8c8f8c0a..7ed7197b 100644 --- a/src/duckdb/src/include/duckdb/common/extra_type_info.hpp +++ b/src/duckdb/src/include/duckdb/common/extra_type_info.hpp @@ -36,12 +36,14 @@ struct ExtraTypeInfo { ExtraTypeInfoType type; string alias; + vector modifiers; public: bool Equals(ExtraTypeInfo *other_p) const; virtual void Serialize(Serializer &serializer) const; static shared_ptr Deserialize(Deserializer &source); + virtual shared_ptr Copy() const; template TARGET &Cast() { @@ -67,6 +69,7 @@ struct DecimalTypeInfo : public ExtraTypeInfo { public: void Serialize(Serializer &serializer) const override; static shared_ptr Deserialize(Deserializer &source); + shared_ptr Copy() const override; protected: bool EqualsInternal(ExtraTypeInfo *other_p) const override; @@ -83,6 +86,7 @@ struct StringTypeInfo : public ExtraTypeInfo { public: void Serialize(Serializer &serializer) const override; static shared_ptr Deserialize(Deserializer &source); + shared_ptr Copy() const override; protected: bool EqualsInternal(ExtraTypeInfo *other_p) const override; @@ -99,6 +103,7 @@ struct ListTypeInfo : public ExtraTypeInfo { public: void Serialize(Serializer &serializer) const override; static shared_ptr Deserialize(Deserializer &source); + shared_ptr Copy() const override; protected: bool EqualsInternal(ExtraTypeInfo *other_p) const override; @@ -115,6 +120,7 @@ struct StructTypeInfo : public ExtraTypeInfo { public: void Serialize(Serializer &serializer) const override; static shared_ptr Deserialize(Deserializer &deserializer); + shared_ptr Copy() const override; protected: bool EqualsInternal(ExtraTypeInfo *other_p) const override; @@ -131,6 +137,7 @@ struct AggregateStateTypeInfo : public ExtraTypeInfo { public: void Serialize(Serializer &serializer) const override; static shared_ptr Deserialize(Deserializer &source); + shared_ptr Copy() const override; protected: bool EqualsInternal(ExtraTypeInfo *other_p) const override; @@ -141,15 +148,18 @@ struct AggregateStateTypeInfo : public ExtraTypeInfo { struct UserTypeInfo : public ExtraTypeInfo { explicit UserTypeInfo(string name_p); - UserTypeInfo(string catalog_p, string schema_p, string name_p); + UserTypeInfo(string name_p, vector modifiers_p); + UserTypeInfo(string catalog_p, string schema_p, string name_p, vector modifiers_p); string catalog; string schema; string user_type_name; + vector user_type_modifiers; public: void Serialize(Serializer &serializer) const override; static shared_ptr Deserialize(Deserializer &source); + shared_ptr Copy() const override; protected: bool EqualsInternal(ExtraTypeInfo *other_p) const override; @@ -176,6 +186,7 @@ struct EnumTypeInfo : public ExtraTypeInfo { void Serialize(Serializer &serializer) const override; static shared_ptr Deserialize(Deserializer &source); + shared_ptr Copy() const override; protected: // Equalities are only used in enums with different catalog entries @@ -196,6 +207,7 @@ struct ArrayTypeInfo : public ExtraTypeInfo { public: void Serialize(Serializer &serializer) const override; static shared_ptr Deserialize(Deserializer &reader); + shared_ptr Copy() const override; protected: bool EqualsInternal(ExtraTypeInfo *other_p) const override; @@ -210,6 +222,7 @@ struct AnyTypeInfo : public ExtraTypeInfo { public: void Serialize(Serializer &serializer) const override; static shared_ptr Deserialize(Deserializer &source); + shared_ptr Copy() const override; protected: bool EqualsInternal(ExtraTypeInfo *other_p) const override; @@ -226,6 +239,7 @@ struct IntegerLiteralTypeInfo : public ExtraTypeInfo { public: void Serialize(Serializer &serializer) const override; static shared_ptr Deserialize(Deserializer &source); + shared_ptr Copy() const override; protected: bool EqualsInternal(ExtraTypeInfo *other_p) const override; diff --git a/src/duckdb/src/include/duckdb/common/file_opener.hpp b/src/duckdb/src/include/duckdb/common/file_opener.hpp index 2c4dbc39..6f3e5a8e 100644 --- a/src/duckdb/src/include/duckdb/common/file_opener.hpp +++ b/src/duckdb/src/include/duckdb/common/file_opener.hpp @@ -14,6 +14,8 @@ namespace duckdb { +struct CatalogTransaction; +class SecretManager; class ClientContext; class Value; @@ -33,8 +35,10 @@ class FileOpener { virtual optional_ptr TryGetClientContext() = 0; virtual optional_ptr TryGetDatabase() = 0; + DUCKDB_API static unique_ptr TryGetCatalogTransaction(optional_ptr opener); DUCKDB_API static optional_ptr TryGetClientContext(optional_ptr opener); DUCKDB_API static optional_ptr TryGetDatabase(optional_ptr opener); + DUCKDB_API static optional_ptr TryGetSecretManager(optional_ptr opener); DUCKDB_API static SettingLookupResult TryGetCurrentSetting(optional_ptr opener, const string &key, Value &result); DUCKDB_API static SettingLookupResult TryGetCurrentSetting(optional_ptr opener, const string &key, diff --git a/src/duckdb/src/include/duckdb/common/file_system.hpp b/src/duckdb/src/include/duckdb/common/file_system.hpp index 0c994909..e0df2f70 100644 --- a/src/duckdb/src/include/duckdb/common/file_system.hpp +++ b/src/duckdb/src/include/duckdb/common/file_system.hpp @@ -16,6 +16,7 @@ #include "duckdb/common/vector.hpp" #include "duckdb/common/enums/file_glob_options.hpp" #include "duckdb/common/optional_ptr.hpp" +#include "duckdb/common/optional_idx.hpp" #include "duckdb/common/error_data.hpp" #include "duckdb/common/file_open_flags.hpp" #include @@ -172,6 +173,8 @@ class FileSystem { DUCKDB_API virtual string ExpandPath(const string &path); //! Returns the system-available memory in bytes. Returns DConstants::INVALID_INDEX if the system function fails. DUCKDB_API static optional_idx GetAvailableMemory(); + //! Returns the space available on the disk. Returns DConstants::INVALID_INDEX if the information was not available. + DUCKDB_API static optional_idx GetAvailableDiskSpace(const string &path); //! Path separator for path DUCKDB_API virtual string PathSeparator(const string &path); //! Checks if path is starts with separator (i.e., '/' on UNIX '\\' on Windows) diff --git a/src/duckdb/src/include/duckdb/common/gzip_file_system.hpp b/src/duckdb/src/include/duckdb/common/gzip_file_system.hpp index 9d6f6a21..5a9f5f12 100644 --- a/src/duckdb/src/include/duckdb/common/gzip_file_system.hpp +++ b/src/duckdb/src/include/duckdb/common/gzip_file_system.hpp @@ -25,8 +25,11 @@ class GZipFileSystem : public CompressedFileSystem { //! Verifies that a buffer contains a valid GZIP header static void VerifyGZIPHeader(uint8_t gzip_hdr[], idx_t read_count); + static bool CheckIsZip(const char *length, idx_t size); + //! Consumes a byte stream as a gzip string, returning the decompressed string static string UncompressGZIPString(const string &in); + static string UncompressGZIPString(const char *length, idx_t size); unique_ptr CreateStream() override; idx_t InBufferSize() override; diff --git a/src/duckdb/src/include/duckdb/common/helper.hpp b/src/duckdb/src/include/duckdb/common/helper.hpp index c989983b..d4039585 100644 --- a/src/duckdb/src/include/duckdb/common/helper.hpp +++ b/src/duckdb/src/include/duckdb/common/helper.hpp @@ -65,6 +65,14 @@ make_uniq(ARGS&&... args) // NOLINT: mimic std style return unique_ptr, true>(new DATA_TYPE(std::forward(args)...)); } +template +inline +shared_ptr +make_shared_ptr(ARGS&&... args) // NOLINT: mimic std style +{ + return shared_ptr(std::make_shared(std::forward(args)...)); +} + template inline typename TemplatedUniqueIf::templated_unique_single_t @@ -109,10 +117,15 @@ unique_ptr unique_ptr_cast(unique_ptr src) { // NOLINT: mimic std style return unique_ptr(static_cast(src.release())); } +template +shared_ptr shared_ptr_cast(shared_ptr src) { // NOLINT: mimic std style + return shared_ptr(std::static_pointer_cast(src.internal)); +} + struct SharedConstructor { template static shared_ptr Create(ARGS &&...args) { - return make_shared(std::forward(args)...); + return make_shared_ptr(std::forward(args)...); } }; @@ -139,6 +152,14 @@ static duckdb::unique_ptr make_unique(ARGS&&... __args) { // NOLINT: mimic st return unique_ptr(new T(std::forward(__args)...)); } +template +static duckdb::shared_ptr make_shared(ARGS&&... __args) { // NOLINT: mimic std style +#ifndef DUCKDB_ENABLE_DEPRECATED_API + static_assert(sizeof(T) == 0, "Use make_shared_ptr instead of make_shared!"); +#endif // DUCKDB_ENABLE_DEPRECATED_API + return shared_ptr(new T(std::forward(__args)...)); +} + template constexpr T MaxValue(T a, T b) { return a > b ? a : b; diff --git a/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp b/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp index 7dd55e30..9ba4c82a 100644 --- a/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp +++ b/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp @@ -74,36 +74,22 @@ class GlobalHivePartitionState { public: mutex lock; hive_partition_map_t partition_map; - //! Used for incremental updating local copies of the partition map; - vector partitions; }; class HivePartitionedColumnData : public PartitionedColumnData { public: HivePartitionedColumnData(ClientContext &context, vector types, vector partition_by_cols, - shared_ptr global_state = nullptr) - : PartitionedColumnData(PartitionedColumnDataType::HIVE, context, std::move(types)), - global_state(std::move(global_state)), group_by_columns(std::move(partition_by_cols)), - hashes_v(LogicalType::HASH) { - InitializeKeys(); - } - HivePartitionedColumnData(const HivePartitionedColumnData &other); + shared_ptr global_state = nullptr); void ComputePartitionIndices(PartitionedColumnDataAppendState &state, DataChunk &input) override; //! Reverse lookup map to reconstruct keys from a partition id std::map GetReverseMap(); protected: - //! Create allocators for all currently registered partitions - void GrowAllocators(); - //! Create append states for all currently registered partitions - void GrowAppendState(PartitionedColumnDataAppendState &state); - //! Create and initialize partitions for all currently registered partitions - void GrowPartitions(PartitionedColumnDataAppendState &state); //! Register a newly discovered partition idx_t RegisterNewPartition(HivePartitionKey key, PartitionedColumnDataAppendState &state); - //! Copy the newly added entries in the global_state.map to the local_partition_map (requires lock!) - void SynchronizeLocalMap(); + //! Add a new partition with the given partition id + void AddNewPartition(HivePartitionKey key, idx_t partition_id, PartitionedColumnDataAppendState &state); private: void InitializeKeys(); diff --git a/src/duckdb/src/include/duckdb/common/http_state.hpp b/src/duckdb/src/include/duckdb/common/http_state.hpp index 1341b921..6fc1fa92 100644 --- a/src/duckdb/src/include/duckdb/common/http_state.hpp +++ b/src/duckdb/src/include/duckdb/common/http_state.hpp @@ -20,7 +20,7 @@ namespace duckdb { class CachedFileHandle; //! Represents a file that is intended to be fully downloaded, then used in parallel by multiple threads -class CachedFile : public std::enable_shared_from_this { +class CachedFile : public enable_shared_from_this { friend class CachedFileHandle; public: diff --git a/src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp b/src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp new file mode 100644 index 00000000..518fffc4 --- /dev/null +++ b/src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp @@ -0,0 +1,129 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/common/insertion_order_preserving_map.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/common/unordered_map.hpp" +#include "duckdb/common/unordered_set.hpp" +#include "duckdb/common/string.hpp" +#include "duckdb/common/string_util.hpp" +#include "duckdb/common/helper.hpp" +#include "duckdb/common/case_insensitive_map.hpp" +#include "duckdb/common/pair.hpp" + +namespace duckdb { + +template +class InsertionOrderPreservingMap { +public: + typedef vector> VECTOR_TYPE; // NOLINT: matching name of std + typedef string key_type; // NOLINT: matching name of std + +public: + InsertionOrderPreservingMap() { + } + +private: + VECTOR_TYPE map; + case_insensitive_map_t map_idx; + +public: + vector Keys() const { + vector keys; + keys.resize(this->size()); + for (auto &kv : map_idx) { + keys[kv.second] = kv.first; + } + + return keys; + } + + typename VECTOR_TYPE::iterator begin() { // NOLINT: match stl API + return map.begin(); + } + + typename VECTOR_TYPE::iterator end() { // NOLINT: match stl API + return map.end(); + } + + typename VECTOR_TYPE::const_iterator begin() const { // NOLINT: match stl API + return map.begin(); + } + + typename VECTOR_TYPE::const_iterator end() const { // NOLINT: match stl API + return map.end(); + } + + typename VECTOR_TYPE::iterator find(const string &key) { // NOLINT: match stl API + auto entry = map_idx.find(key); + if (entry == map_idx.end()) { + return map.end(); + } + return map.begin() + static_cast(entry->second); + } + + typename VECTOR_TYPE::const_iterator find(const string &key) const { // NOLINT: match stl API + auto entry = map_idx.find(key); + if (entry == map_idx.end()) { + return map.end(); + } + return map.begin() + static_cast(entry->second); + } + + idx_t size() const { // NOLINT: match stl API + return map_idx.size(); + } + + bool empty() const { // NOLINT: match stl API + return map_idx.empty(); + } + + void resize(idx_t nz) { // NOLINT: match stl API + map.resize(nz); + } + + void insert(const string &key, V &value) { // NOLINT: match stl API + map.push_back(make_pair(key, std::move(value))); + map_idx[key] = map.size() - 1; + } + + void insert(pair &&value) { // NOLINT: match stl API + map.push_back(std::move(value)); + map_idx[value.first] = map.size() - 1; + } + + void erase(typename VECTOR_TYPE::iterator it) { // NOLINT: match stl API + auto key = it->first; + auto idx = map_idx[it->first]; + map.erase(it); + map_idx.erase(key); + for (auto &kv : map_idx) { + if (kv.second > idx) { + kv.second--; + } + } + } + + bool contains(const string &key) const { // NOLINT: match stl API + return map_idx.find(key) != map_idx.end(); + } + + const V &at(const string &key) const { // NOLINT: match stl API + return map[map_idx.at(key)].second; + } + + V &operator[](const string &key) { + if (!contains(key)) { + auto v = V(); + insert(key, v); + } + return map[map_idx[key]].second; + } +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/multi_file_list.hpp b/src/duckdb/src/include/duckdb/common/multi_file_list.hpp new file mode 100644 index 00000000..2c551d6a --- /dev/null +++ b/src/duckdb/src/include/duckdb/common/multi_file_list.hpp @@ -0,0 +1,151 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/common/multi_file_list.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/common/common.hpp" +#include "duckdb/common/multi_file_reader_options.hpp" + +namespace duckdb { +class MultiFileList; + +enum class FileExpandResult : uint8_t { NO_FILES, SINGLE_FILE, MULTIPLE_FILES }; + +struct MultiFileListScanData { + idx_t current_file_idx = DConstants::INVALID_INDEX; +}; + +class MultiFileListIterationHelper { +public: + DUCKDB_API explicit MultiFileListIterationHelper(MultiFileList &collection); + +private: + MultiFileList &file_list; + +private: + class MultiFileListIterator; + + class MultiFileListIterator { + public: + DUCKDB_API explicit MultiFileListIterator(MultiFileList *file_list); + + optional_ptr file_list; + MultiFileListScanData file_scan_data; + string current_file; + + public: + DUCKDB_API void Next(); + + DUCKDB_API MultiFileListIterator &operator++(); + DUCKDB_API bool operator!=(const MultiFileListIterator &other) const; + DUCKDB_API const string &operator*() const; + }; + +public: + MultiFileListIterator begin(); // NOLINT: match stl API + MultiFileListIterator end(); // NOLINT: match stl API +}; + +//! Abstract class for lazily generated list of file paths/globs +//! NOTE: subclasses are responsible for ensuring thread-safety +class MultiFileList { +public: + explicit MultiFileList(vector paths, FileGlobOptions options); + virtual ~MultiFileList(); + + //! Returns the raw, unexpanded paths, pre-filter + const vector GetPaths() const; + + //! Get Iterator over the files for pretty for loops + MultiFileListIterationHelper Files(); + + //! Initialize a sequential scan over a file list + void InitializeScan(MultiFileListScanData &iterator); + //! Scan the next file into result_file, returns false when out of files + bool Scan(MultiFileListScanData &iterator, string &result_file); + + //! Returns the first file or an empty string if GetTotalFileCount() == 0 + string GetFirstFile(); + //! Syntactic sugar for GetExpandResult() == FileExpandResult::NO_FILES + bool IsEmpty(); + + //! Virtual functions for subclasses +public: + virtual unique_ptr ComplexFilterPushdown(ClientContext &context, + const MultiFileReaderOptions &options, LogicalGet &get, + vector> &filters); + virtual vector GetAllFiles() = 0; + virtual FileExpandResult GetExpandResult() = 0; + virtual idx_t GetTotalFileCount() = 0; + +protected: + //! Get the i-th expanded file + virtual string GetFile(idx_t i) = 0; + +protected: + //! The unexpanded input paths + const vector paths; + //! Whether paths can expand to 0 files + const FileGlobOptions glob_options; +}; + +//! MultiFileList that takes a list of files and produces the same list of paths. Useful for quickly wrapping +//! existing vectors of paths in a MultiFileList without changing any code +class SimpleMultiFileList : public MultiFileList { +public: + //! Construct a SimpleMultiFileList from a list of already expanded files + explicit SimpleMultiFileList(vector paths); + //! Copy `paths` to `filtered_files` and apply the filters + unique_ptr ComplexFilterPushdown(ClientContext &context, const MultiFileReaderOptions &options, + LogicalGet &get, vector> &filters) override; + + //! Main MultiFileList API + vector GetAllFiles() override; + FileExpandResult GetExpandResult() override; + idx_t GetTotalFileCount() override; + +protected: + //! Main MultiFileList API + string GetFile(idx_t i) override; +}; + +//! MultiFileList that takes a list of paths and produces a list of files with all globs expanded +class GlobMultiFileList : public MultiFileList { +public: + GlobMultiFileList(ClientContext &context, vector paths, FileGlobOptions options); + //! Calls ExpandAll, then prunes the expanded_files using the hive/filename filters + unique_ptr ComplexFilterPushdown(ClientContext &context, const MultiFileReaderOptions &options, + LogicalGet &get, vector> &filters) override; + + //! Main MultiFileList API + vector GetAllFiles() override; + FileExpandResult GetExpandResult() override; + idx_t GetTotalFileCount() override; + +protected: + //! Main MultiFileList API + string GetFile(idx_t i) override; + + //! Get the i-th expanded file + string GetFileInternal(idx_t i); + //! Grabs the next path and expands it into Expanded paths: returns false if no more files to expand + bool ExpandPathInternal(); + //! Whether all files have been expanded + bool IsFullyExpanded(); + + //! The ClientContext for globbing + ClientContext &context; + //! The current path to expand + idx_t current_path; + //! The expanded files + vector expanded_files; + + mutex lock; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp b/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp index ca52810e..98217540 100644 --- a/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +++ b/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp @@ -11,6 +11,7 @@ #include "duckdb/common/common.hpp" #include "duckdb/common/enums/file_glob_options.hpp" #include "duckdb/common/multi_file_reader_options.hpp" +#include "duckdb/common/multi_file_list.hpp" #include "duckdb/common/optional_ptr.hpp" #include "duckdb/common/types/value.hpp" #include "duckdb/common/union_by_name.hpp" @@ -47,6 +48,33 @@ struct MultiFileReaderBindData { DUCKDB_API static MultiFileReaderBindData Deserialize(Deserializer &deserializer); }; +//! Global state for MultiFileReads +struct MultiFileReaderGlobalState { + MultiFileReaderGlobalState(vector extra_columns_p, optional_ptr file_list_p) + : extra_columns(std::move(extra_columns_p)), file_list(file_list_p) {}; + + //! extra columns that will be produced during scanning + const vector extra_columns; + // the file list driving the current scan + const optional_ptr file_list; + + //! Indicates that the MultiFileReader has added columns to be scanned that are not in the projection + bool RequiresExtraColumns() { + return !extra_columns.empty(); + } + + template + TARGET &Cast() { + DynamicCastCheck(this); + return reinterpret_cast(*this); + } + template + const TARGET &Cast() const { + DynamicCastCheck(this); + return reinterpret_cast(*this); + } +}; + struct MultiFileFilterEntry { idx_t index = DConstants::INVALID_INDEX; bool is_constant = false; @@ -55,7 +83,6 @@ struct MultiFileFilterEntry { struct MultiFileConstantEntry { MultiFileConstantEntry(idx_t column_id, Value value_p) : column_id(column_id), value(std::move(value_p)) { } - //! The column id to apply the constant value to idx_t column_id; //! The constant value @@ -80,63 +107,105 @@ struct MultiFileReaderData { //! Map of column_id -> cast, used when reading multiple files when files have diverging types //! for the same column unordered_map cast_map; + //! (Optionally) The MultiFileReader-generated metadata corresponding to the currently read file + optional_idx file_list_idx; }; +//! The MultiFileReader class provides a set of helper methods to handle scanning from multiple files struct MultiFileReader { + virtual ~MultiFileReader(); + + //! Create a MultiFileReader for a specific TableFunction, using its function name for errors + DUCKDB_API static unique_ptr Create(const TableFunction &table_function); + //! Create a default MultiFileReader, function_name is used for errors + DUCKDB_API static unique_ptr CreateDefault(const string &function_name = ""); + //! Add the parameters for multi-file readers (e.g. union_by_name, filename) to a table function DUCKDB_API static void AddParameters(TableFunction &table_function); - //! Performs any globbing for the multi-file reader and returns a list of files to be read - DUCKDB_API static vector GetFileList(ClientContext &context, const Value &input, const string &name, - FileGlobOptions options = FileGlobOptions::DISALLOW_EMPTY); + //! Creates a table function set from a single reader function (including e.g. list parameters, etc) + DUCKDB_API static TableFunctionSet CreateFunctionSet(TableFunction table_function); + + //! Parse a Value containing 1 or more paths into a vector of paths. Note: no expansion is performed here + DUCKDB_API virtual vector ParsePaths(const Value &input); + //! Create a MultiFileList from a vector of paths. Any globs will be expanded using the default filesystem + DUCKDB_API virtual unique_ptr + CreateFileList(ClientContext &context, const vector &paths, + FileGlobOptions options = FileGlobOptions::DISALLOW_EMPTY); + //! Shorthand for ParsePaths + CreateFileList + DUCKDB_API unique_ptr CreateFileList(ClientContext &context, const Value &input, + FileGlobOptions options = FileGlobOptions::DISALLOW_EMPTY); + //! Parse the named parameters of a multi-file reader - DUCKDB_API static bool ParseOption(const string &key, const Value &val, MultiFileReaderOptions &options, - ClientContext &context); - //! Perform complex filter pushdown into the multi-file reader, potentially filtering out files that should be read - //! If "true" the first file has been eliminated - DUCKDB_API static bool ComplexFilterPushdown(ClientContext &context, vector &files, - const MultiFileReaderOptions &options, LogicalGet &get, - vector> &filters); + DUCKDB_API virtual bool ParseOption(const string &key, const Value &val, MultiFileReaderOptions &options, + ClientContext &context); + //! Perform filter pushdown into the MultiFileList. Returns a new MultiFileList if filters were pushed down + DUCKDB_API virtual unique_ptr ComplexFilterPushdown(ClientContext &context, MultiFileList &files, + const MultiFileReaderOptions &options, + LogicalGet &get, + vector> &filters); + //! Try to use the MultiFileReader for binding. Returns true if a bind could be made, returns false if the + //! MultiFileReader can not perform the bind and binding should be performed on 1 or more files in the MultiFileList + //! directly. + DUCKDB_API virtual bool Bind(MultiFileReaderOptions &options, MultiFileList &files, + vector &return_types, vector &names, + MultiFileReaderBindData &bind_data); //! Bind the options of the multi-file reader, potentially emitting any extra columns that are required - DUCKDB_API static MultiFileReaderBindData BindOptions(MultiFileReaderOptions &options, const vector &files, - vector &return_types, vector &names); + DUCKDB_API virtual void BindOptions(MultiFileReaderOptions &options, MultiFileList &files, + vector &return_types, vector &names, + MultiFileReaderBindData &bind_data); + + //! Initialize global state used by the MultiFileReader + DUCKDB_API virtual unique_ptr + InitializeGlobalState(ClientContext &context, const MultiFileReaderOptions &file_options, + const MultiFileReaderBindData &bind_data, const MultiFileList &file_list, + const vector &global_types, const vector &global_names, + const vector &global_column_ids); + //! Finalize the bind phase of the multi-file reader after we know (1) the required (output) columns, and (2) the //! pushed down table filters - DUCKDB_API static void FinalizeBind(const MultiFileReaderOptions &file_options, - const MultiFileReaderBindData &options, const string &filename, - const vector &local_names, const vector &global_types, - const vector &global_names, const vector &global_column_ids, - MultiFileReaderData &reader_data, ClientContext &context); - //! Create all required mappings from the global types/names to the file-local types/names - DUCKDB_API static void CreateMapping(const string &file_name, const vector &local_types, + DUCKDB_API virtual void FinalizeBind(const MultiFileReaderOptions &file_options, + const MultiFileReaderBindData &options, const string &filename, const vector &local_names, const vector &global_types, const vector &global_names, const vector &global_column_ids, - optional_ptr filters, MultiFileReaderData &reader_data, - const string &initial_file); + MultiFileReaderData &reader_data, ClientContext &context, + optional_ptr global_state); + + //! Create all required mappings from the global types/names to the file-local types/names + DUCKDB_API virtual void CreateMapping(const string &file_name, const vector &local_types, + const vector &local_names, const vector &global_types, + const vector &global_names, const vector &global_column_ids, + optional_ptr filters, MultiFileReaderData &reader_data, + const string &initial_file, const MultiFileReaderBindData &options, + optional_ptr global_state); //! Populated the filter_map - DUCKDB_API static void CreateFilterMap(const vector &global_types, - optional_ptr filters, MultiFileReaderData &reader_data); + DUCKDB_API virtual void CreateFilterMap(const vector &global_types, + optional_ptr filters, MultiFileReaderData &reader_data, + optional_ptr global_state); + //! Finalize the reading of a chunk - applying any constants that are required - DUCKDB_API static void FinalizeChunk(const MultiFileReaderBindData &bind_data, - const MultiFileReaderData &reader_data, DataChunk &chunk); - //! Creates a table function set from a single reader function (including e.g. list parameters, etc) - DUCKDB_API static TableFunctionSet CreateFunctionSet(TableFunction table_function); + DUCKDB_API virtual void FinalizeChunk(ClientContext &context, const MultiFileReaderBindData &bind_data, + const MultiFileReaderData &reader_data, DataChunk &chunk, + optional_ptr global_state); template - static MultiFileReaderBindData BindUnionReader(ClientContext &context, vector &return_types, - vector &names, RESULT_CLASS &result, - OPTIONS_CLASS &options) { + MultiFileReaderBindData BindUnionReader(ClientContext &context, vector &return_types, + vector &names, MultiFileList &files, RESULT_CLASS &result, + OPTIONS_CLASS &options) { D_ASSERT(options.file_options.union_by_name); vector union_col_names; vector union_col_types; + // obtain the set of union column names + types by unifying the types of all of the files // note that this requires opening readers for each file and reading the metadata of each file - auto union_readers = - UnionByName::UnionCols(context, result.files, union_col_types, union_col_names, options); + // note also that it requires fully expanding the MultiFileList + auto materialized_file_list = files.GetAllFiles(); + auto union_readers = UnionByName::UnionCols(context, materialized_file_list, union_col_types, + union_col_names, options); std::move(union_readers.begin(), union_readers.end(), std::back_inserter(result.union_readers)); // perform the binding on the obtained set of names + types - auto bind_data = - MultiFileReader::BindOptions(options.file_options, result.files, union_col_types, union_col_names); + MultiFileReaderBindData bind_data; + BindOptions(options.file_options, files, union_col_types, union_col_names, bind_data); names = union_col_names; return_types = union_col_types; result.Initialize(result.union_readers[0]); @@ -145,37 +214,40 @@ struct MultiFileReader { } template - static MultiFileReaderBindData BindReader(ClientContext &context, vector &return_types, - vector &names, RESULT_CLASS &result, OPTIONS_CLASS &options) { + MultiFileReaderBindData BindReader(ClientContext &context, vector &return_types, vector &names, + MultiFileList &files, RESULT_CLASS &result, OPTIONS_CLASS &options) { if (options.file_options.union_by_name) { - return BindUnionReader(context, return_types, names, result, options); + return BindUnionReader(context, return_types, names, files, result, options); } else { shared_ptr reader; - reader = make_shared(context, result.files[0], options); + reader = make_shared_ptr(context, files.GetFirstFile(), options); return_types = reader->return_types; names = reader->names; result.Initialize(std::move(reader)); - return MultiFileReader::BindOptions(options.file_options, result.files, return_types, names); + MultiFileReaderBindData bind_data; + BindOptions(options.file_options, files, return_types, names, bind_data); + return bind_data; } } template - static void InitializeReader(READER_CLASS &reader, const MultiFileReaderOptions &options, - const MultiFileReaderBindData &bind_data, const vector &global_types, - const vector &global_names, const vector &global_column_ids, - optional_ptr table_filters, const string &initial_file, - ClientContext &context) { + void InitializeReader(READER_CLASS &reader, const MultiFileReaderOptions &options, + const MultiFileReaderBindData &bind_data, const vector &global_types, + const vector &global_names, const vector &global_column_ids, + optional_ptr table_filters, const string &initial_file, + ClientContext &context, optional_ptr global_state) { FinalizeBind(options, bind_data, reader.GetFileName(), reader.GetNames(), global_types, global_names, - global_column_ids, reader.reader_data, context); + global_column_ids, reader.reader_data, context, global_state); CreateMapping(reader.GetFileName(), reader.GetTypes(), reader.GetNames(), global_types, global_names, - global_column_ids, table_filters, reader.reader_data, initial_file); + global_column_ids, table_filters, reader.reader_data, initial_file, bind_data, global_state); reader.reader_data.filters = table_filters; } template - static void PruneReaders(BIND_DATA &data) { + static void PruneReaders(BIND_DATA &data, MultiFileList &file_list) { unordered_set file_set; - for (auto &file : data.files) { + + for (const auto &file : file_list.Files()) { file_set.insert(file); } @@ -188,25 +260,29 @@ struct MultiFileReader { } for (idx_t r = 0; r < data.union_readers.size(); r++) { if (!data.union_readers[r]) { - data.union_readers.erase(data.union_readers.begin() + r); + data.union_readers.erase_at(r); r--; continue; } // check if the union reader should still be read or not auto entry = file_set.find(data.union_readers[r]->GetFileName()); if (entry == file_set.end()) { - data.union_readers.erase(data.union_readers.begin() + r); + data.union_readers.erase_at(r); r--; continue; } } } -private: - static void CreateNameMapping(const string &file_name, const vector &local_types, - const vector &local_names, const vector &global_types, - const vector &global_names, const vector &global_column_ids, - MultiFileReaderData &reader_data, const string &initial_file); +protected: + virtual void CreateNameMapping(const string &file_name, const vector &local_types, + const vector &local_names, const vector &global_types, + const vector &global_names, const vector &global_column_ids, + MultiFileReaderData &reader_data, const string &initial_file, + optional_ptr global_state); + + //! Used in errors to report which function is using this MultiFileReader + string function_name; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp b/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp index 5b8bd906..0f931e29 100644 --- a/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +++ b/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp @@ -15,6 +15,7 @@ namespace duckdb { struct BindInfo; +class MultiFileList; struct MultiFileReaderOptions { bool filename = false; @@ -24,12 +25,15 @@ struct MultiFileReaderOptions { bool hive_types_autocast = true; case_insensitive_map_t hive_types_schema; + // These are used to pass options through custom multifilereaders + case_insensitive_map_t custom_options; + DUCKDB_API void Serialize(Serializer &serializer) const; DUCKDB_API static MultiFileReaderOptions Deserialize(Deserializer &source); DUCKDB_API void AddBatchInfo(BindInfo &bind_info) const; - DUCKDB_API void AutoDetectHivePartitioning(const vector &files, ClientContext &context); - DUCKDB_API static bool AutoDetectHivePartitioningInternal(const vector &files, ClientContext &context); - DUCKDB_API void AutoDetectHiveTypesInternal(const vector &file, ClientContext &context); + DUCKDB_API void AutoDetectHivePartitioning(MultiFileList &files, ClientContext &context); + DUCKDB_API static bool AutoDetectHivePartitioningInternal(MultiFileList &files, ClientContext &context); + DUCKDB_API void AutoDetectHiveTypesInternal(MultiFileList &files, ClientContext &context); DUCKDB_API void VerifyHiveTypesArePartitions(const std::map &partitions) const; DUCKDB_API LogicalType GetHiveLogicalType(const string &hive_partition_column) const; DUCKDB_API Value GetHivePartitionValue(const string &base, const string &entry, ClientContext &context) const; diff --git a/src/duckdb/src/include/duckdb/common/numeric_utils.hpp b/src/duckdb/src/include/duckdb/common/numeric_utils.hpp index 5b111c89..17ca6be0 100644 --- a/src/duckdb/src/include/duckdb/common/numeric_utils.hpp +++ b/src/duckdb/src/include/duckdb/common/numeric_utils.hpp @@ -68,6 +68,9 @@ static void ThrowNumericCastError(FROM in, TO minval, TO maxval) { template TO NumericCast(FROM val) { + if (std::is_same::value) { + return static_cast(val); + } // some dance around signed-unsigned integer comparison below auto minval = NumericLimits::Minimum(); auto maxval = NumericLimits::Maximum(); diff --git a/src/duckdb/src/include/duckdb/common/operator/add.hpp b/src/duckdb/src/include/duckdb/common/operator/add.hpp index ff9c3a06..75d79a77 100644 --- a/src/duckdb/src/include/duckdb/common/operator/add.hpp +++ b/src/duckdb/src/include/duckdb/common/operator/add.hpp @@ -64,6 +64,8 @@ template <> bool TryAddOperator::Operation(uint32_t left, uint32_t right, uint32_t &result); template <> bool TryAddOperator::Operation(uint64_t left, uint64_t right, uint64_t &result); +template <> +bool TryAddOperator::Operation(date_t left, int32_t right, date_t &result); template <> bool TryAddOperator::Operation(int8_t left, int8_t right, int8_t &result); diff --git a/src/duckdb/src/include/duckdb/common/operator/decimal_cast_operators.hpp b/src/duckdb/src/include/duckdb/common/operator/decimal_cast_operators.hpp index f3f70cbb..9207ec82 100644 --- a/src/duckdb/src/include/duckdb/common/operator/decimal_cast_operators.hpp +++ b/src/duckdb/src/include/duckdb/common/operator/decimal_cast_operators.hpp @@ -9,6 +9,8 @@ #pragma once #include "duckdb/common/operator/cast_operators.hpp" +#include "duckdb/common/types/decimal.hpp" +#include "duckdb/common/operator/integer_cast_operator.hpp" namespace duckdb { @@ -457,4 +459,235 @@ string_t StringCastFromDecimal::Operation(int64_t input, uint8_t width, uint8_t template <> string_t StringCastFromDecimal::Operation(hugeint_t input, uint8_t width, uint8_t scale, Vector &result); +//===--------------------------------------------------------------------===// +// Cast VARCHAR <-> Decimal +//===--------------------------------------------------------------------===// +enum class ExponentType : uint8_t { NONE, POSITIVE, NEGATIVE }; + +template +struct DecimalCastData { + using StoreType = T; + StoreType result; + uint8_t width; + uint8_t scale; + uint8_t digit_count; + uint8_t decimal_count; + //! Whether we have determined if the result should be rounded + bool round_set; + //! If the result should be rounded + bool should_round; + //! Only set when ALLOW_EXPONENT is enabled + uint8_t excessive_decimals; + ExponentType exponent_type; +}; + +struct DecimalCastOperation { + template + static bool HandleDigit(T &state, uint8_t digit) { + if (state.result == 0 && digit == 0) { + // leading zero's don't count towards the digit count + return true; + } + if (state.digit_count == state.width - state.scale) { + // width of decimal type is exceeded! + return false; + } + state.digit_count++; + if (NEGATIVE) { + if (state.result < (NumericLimits::Minimum() / 10)) { + return false; + } + state.result = state.result * 10 - digit; + } else { + if (state.result > (NumericLimits::Maximum() / 10)) { + return false; + } + state.result = state.result * 10 + digit; + } + return true; + } + + template + static bool HandleHexDigit(T &state, uint8_t digit) { + return false; + } + + template + static bool HandleBinaryDigit(T &state, uint8_t digit) { + return false; + } + + template + static void RoundUpResult(T &state) { + if (NEGATIVE) { + state.result -= 1; + } else { + state.result += 1; + } + } + + template + static bool HandleExponent(T &state, int32_t exponent) { + auto decimal_excess = (state.decimal_count > state.scale) ? state.decimal_count - state.scale : 0; + if (exponent > 0) { + state.exponent_type = ExponentType::POSITIVE; + // Positive exponents need up to 'exponent' amount of digits + // Everything beyond that amount needs to be truncated + if (decimal_excess > exponent) { + // We've allowed too many decimals + state.excessive_decimals = UnsafeNumericCast(decimal_excess - exponent); + exponent = 0; + } else { + exponent -= decimal_excess; + } + D_ASSERT(exponent >= 0); + } else if (exponent < 0) { + state.exponent_type = ExponentType::NEGATIVE; + } + if (!Finalize(state)) { + return false; + } + if (exponent < 0) { + bool round_up = false; + for (idx_t i = 0; i < idx_t(-int64_t(exponent)); i++) { + auto mod = state.result % 10; + round_up = NEGATIVE ? mod <= -5 : mod >= 5; + state.result /= 10; + if (state.result == 0) { + break; + } + } + if (round_up) { + RoundUpResult(state); + } + return true; + } else { + // positive exponent: append 0's + for (idx_t i = 0; i < idx_t(exponent); i++) { + if (!HandleDigit(state, 0)) { + return false; + } + } + return true; + } + } + + template + static bool HandleDecimal(T &state, uint8_t digit) { + if (state.decimal_count == state.scale && !state.round_set) { + // Determine whether the last registered decimal should be rounded or not + state.round_set = true; + state.should_round = digit >= 5; + } + if (!ALLOW_EXPONENT && state.decimal_count == state.scale) { + // we exceeded the amount of supported decimals + // however, we don't throw an error here + // we just truncate the decimal + return true; + } + //! If we expect an exponent, we need to preserve the decimals + //! But we don't want to overflow, so we prevent overflowing the result with this check + if (state.digit_count + state.decimal_count >= DecimalWidth::max) { + return true; + } + state.decimal_count++; + if (NEGATIVE) { + state.result = state.result * 10 - digit; + } else { + state.result = state.result * 10 + digit; + } + return true; + } + + template + static bool TruncateExcessiveDecimals(T &state) { + D_ASSERT(state.excessive_decimals); + bool round_up = false; + for (idx_t i = 0; i < state.excessive_decimals; i++) { + auto mod = state.result % 10; + round_up = NEGATIVE ? mod <= -5 : mod >= 5; + state.result /= static_cast(10.0); + } + //! Only round up when exponents are involved + if (state.exponent_type == ExponentType::POSITIVE && round_up) { + RoundUpResult(state); + } + D_ASSERT(state.decimal_count > state.scale); + state.decimal_count = state.scale; + return true; + } + + template + static bool Finalize(T &state) { + if (state.exponent_type != ExponentType::POSITIVE && state.decimal_count > state.scale) { + //! Did not encounter an exponent, but ALLOW_EXPONENT was on + state.excessive_decimals = state.decimal_count - state.scale; + } + if (state.excessive_decimals && !TruncateExcessiveDecimals(state)) { + return false; + } + if (state.exponent_type == ExponentType::NONE && state.round_set && state.should_round) { + RoundUpResult(state); + } + // if we have not gotten exactly "scale" decimals, we need to multiply the result + // e.g. if we have a string "1.0" that is cast to a DECIMAL(9,3), the value needs to be 1000 + // but we have only gotten the value "10" so far, so we multiply by 1000 + for (uint8_t i = state.decimal_count; i < state.scale; i++) { + state.result *= 10; + } + return true; + } +}; + +template +bool TryDecimalStringCast(string_t input, T &result, CastParameters ¶meters, uint8_t width, uint8_t scale) { + return TryDecimalStringCast(input.GetData(), input.GetSize(), result, parameters, width, + scale); +} + +template +bool TryDecimalStringCast(const char *string_ptr, idx_t string_size, T &result, CastParameters ¶meters, + uint8_t width, uint8_t scale) { + DecimalCastData state; + state.result = 0; + state.width = width; + state.scale = scale; + state.digit_count = 0; + state.decimal_count = 0; + state.excessive_decimals = 0; + state.exponent_type = ExponentType::NONE; + state.round_set = false; + state.should_round = false; + if (!TryIntegerCast, true, true, DecimalCastOperation, false, decimal_separator>( + string_ptr, string_size, state, false)) { + string_t value(string_ptr, (uint32_t)string_size); + string error = StringUtil::Format("Could not convert string \"%s\" to DECIMAL(%d,%d)", value.GetString(), + (int)width, (int)scale); + HandleCastError::AssignError(error, parameters); + return false; + } + result = state.result; + return true; +} + +template +bool TryDecimalStringCast(const char *string_ptr, idx_t string_size, T &result, uint8_t width, uint8_t scale) { + DecimalCastData state; + state.result = 0; + state.width = width; + state.scale = scale; + state.digit_count = 0; + state.decimal_count = 0; + state.excessive_decimals = 0; + state.exponent_type = ExponentType::NONE; + state.round_set = false; + state.should_round = false; + if (!TryIntegerCast, true, true, DecimalCastOperation, false, decimal_separator>( + string_ptr, string_size, state, false)) { + return false; + } + result = state.result; + return true; +} + } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/operator/integer_cast_operator.hpp b/src/duckdb/src/include/duckdb/common/operator/integer_cast_operator.hpp index 0fdca6b1..decec991 100644 --- a/src/duckdb/src/include/duckdb/common/operator/integer_cast_operator.hpp +++ b/src/duckdb/src/include/duckdb/common/operator/integer_cast_operator.hpp @@ -234,7 +234,8 @@ static bool IntegerCastLoop(const char *buf, idx_t len, T &result, bool strict) if (!StringUtil::CharacterIsDigit(buf[pos])) { break; } - if (!OP::template HandleDecimal(result, buf[pos] - '0')) { + if (!OP::template HandleDecimal( + result, UnsafeNumericCast(buf[pos] - '0'))) { return false; } pos++; @@ -296,7 +297,7 @@ static bool IntegerCastLoop(const char *buf, idx_t len, T &result, bool strict) } return false; } - uint8_t digit = buf[pos++] - '0'; + auto digit = UnsafeNumericCast(buf[pos++] - '0'); if (!OP::template HandleDigit(result, digit)) { return false; } @@ -330,9 +331,9 @@ static bool IntegerHexCastLoop(const char *buf, idx_t len, T &result, bool stric } uint8_t digit; if (current_char >= 'a') { - digit = current_char - 'a' + 10; + digit = UnsafeNumericCast(current_char - 'a' + 10); } else { - digit = current_char - '0'; + digit = UnsafeNumericCast(current_char - '0'); } pos++; diff --git a/src/duckdb/src/include/duckdb/common/operator/numeric_cast.hpp b/src/duckdb/src/include/duckdb/common/operator/numeric_cast.hpp index 26603a98..f48839c4 100644 --- a/src/duckdb/src/include/duckdb/common/operator/numeric_cast.hpp +++ b/src/duckdb/src/include/duckdb/common/operator/numeric_cast.hpp @@ -75,7 +75,7 @@ bool TryCastWithOverflowCheckFloat(SRC value, T &result, SRC min, SRC max) { return false; } // PG FLOAT => INT casts use statistical rounding. - result = std::nearbyint(value); + result = static_cast(std::nearbyint(value)); return true; } @@ -182,7 +182,7 @@ bool TryCastWithOverflowCheck(double input, float &result) { return true; } auto res = float(input); - if (!Value::FloatIsFinite(input)) { + if (!Value::FloatIsFinite(res)) { return false; } result = res; diff --git a/src/duckdb/src/include/duckdb/common/optional_ptr.hpp b/src/duckdb/src/include/duckdb/common/optional_ptr.hpp index 8e357e77..4763f5b4 100644 --- a/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +++ b/src/duckdb/src/include/duckdb/common/optional_ptr.hpp @@ -10,6 +10,7 @@ #include "duckdb/common/exception.hpp" #include "duckdb/common/unique_ptr.hpp" +#include "duckdb/common/shared_ptr.hpp" namespace duckdb { @@ -20,8 +21,12 @@ class optional_ptr { // NOLINT: mimic std casing } optional_ptr(T *ptr_p) : ptr(ptr_p) { // NOLINT: allow implicit creation from pointer } + optional_ptr(T &ref) : ptr(&ref) { // NOLINT: allow implicit creation from reference + } optional_ptr(const unique_ptr &ptr_p) : ptr(ptr_p.get()) { // NOLINT: allow implicit creation from unique pointer } + optional_ptr(const shared_ptr &ptr_p) : ptr(ptr_p.get()) { // NOLINT: allow implicit creation from shared pointer + } void CheckValid() const { if (!ptr) { diff --git a/src/duckdb/src/include/duckdb/common/optionally_owned_ptr.hpp b/src/duckdb/src/include/duckdb/common/optionally_owned_ptr.hpp new file mode 100644 index 00000000..b7d9e727 --- /dev/null +++ b/src/duckdb/src/include/duckdb/common/optionally_owned_ptr.hpp @@ -0,0 +1,91 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/common/optionally_owned_ptr.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/common/exception.hpp" +#include "duckdb/common/unique_ptr.hpp" + +namespace duckdb { + +template +class optionally_owned_ptr { // NOLINT: mimic std casing +public: + optionally_owned_ptr() { + } + optionally_owned_ptr(T *ptr_p) : ptr(ptr_p) { // NOLINT: allow implicit creation from pointer + } + optionally_owned_ptr(T &ref) : ptr(&ref) { // NOLINT: allow implicit creation from reference + } + optionally_owned_ptr(unique_ptr &&owned_p) // NOLINT: allow implicit creation from moved unique_ptr + : owned(std::move(owned_p)), ptr(owned) { + } + // Move constructor + optionally_owned_ptr(optionally_owned_ptr &&other) noexcept : owned(std::move(other.owned)), ptr(other.ptr) { + other.ptr = nullptr; + } + // Copy constructor + optionally_owned_ptr(const optionally_owned_ptr &other) = delete; + + operator bool() const { // NOLINT: allow implicit conversion to bool + return ptr; + } + T &operator*() { + return *ptr; + } + const T &operator*() const { + return *ptr; + } + T *operator->() { + return ptr.get(); + } + const T *operator->() const { + return ptr.get(); + } + T *get() { // NOLINT: mimic std casing + return ptr.get(); + } + const T *get() const { // NOLINT: mimic std casing + return ptr.get(); + } + bool is_owned() const { // NOLINT: mimic std casing + return owned != nullptr; + } + // this looks dirty - but this is the default behavior of raw pointers + T *get_mutable() const { // NOLINT: mimic std casing + return ptr.get(); + } + + optionally_owned_ptr &operator=(T &ref) { + owned = nullptr; + ptr = optional_ptr(ref); + return *this; + } + optionally_owned_ptr &operator=(T *ref) { + owned = nullptr; + ptr = optional_ptr(ref); + return *this; + } + + bool operator==(const optionally_owned_ptr &rhs) const { + if (owned != rhs.owned) { + return false; + } + return ptr == rhs.ptr; + } + + bool operator!=(const optionally_owned_ptr &rhs) const { + return !(*this == rhs); + } + +private: + unique_ptr owned; + optional_ptr ptr; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/platform.h b/src/duckdb/src/include/duckdb/common/platform.h index 32babf9c..3166ff96 100644 --- a/src/duckdb/src/include/duckdb/common/platform.h +++ b/src/duckdb/src/include/duckdb/common/platform.h @@ -1,5 +1,10 @@ #include -#include "duckdb/common/string_util.hpp" + +// duplicated from string_util.h to avoid linking issues +#ifndef DUCKDB_QUOTE_DEFINE +#define DUCKDB_QUOTE_DEFINE_IMPL(x) #x +#define DUCKDB_QUOTE_DEFINE(x) DUCKDB_QUOTE_DEFINE_IMPL(x) +#endif namespace duckdb { diff --git a/src/duckdb/src/include/duckdb/common/radix.hpp b/src/duckdb/src/include/duckdb/common/radix.hpp index a4d774b9..4b7c89a3 100644 --- a/src/duckdb/src/include/duckdb/common/radix.hpp +++ b/src/duckdb/src/include/duckdb/common/radix.hpp @@ -117,25 +117,33 @@ inline void Radix::EncodeData(data_ptr_t dataptr, bool value) { template <> inline void Radix::EncodeData(data_ptr_t dataptr, int8_t value) { - Store(value, dataptr); + uint8_t bytes; // dance around signedness conversion check + Store(value, data_ptr_cast(&bytes)); + Store(bytes, dataptr); dataptr[0] = FlipSign(dataptr[0]); } template <> inline void Radix::EncodeData(data_ptr_t dataptr, int16_t value) { - Store(BSwap(value), dataptr); + uint16_t bytes; + Store(value, data_ptr_cast(&bytes)); + Store(BSwap(bytes), dataptr); dataptr[0] = FlipSign(dataptr[0]); } template <> inline void Radix::EncodeData(data_ptr_t dataptr, int32_t value) { - Store(BSwap(value), dataptr); + uint32_t bytes; + Store(value, data_ptr_cast(&bytes)); + Store(BSwap(bytes), dataptr); dataptr[0] = FlipSign(dataptr[0]); } template <> inline void Radix::EncodeData(data_ptr_t dataptr, int64_t value) { - Store(BSwap(value), dataptr); + uint64_t bytes; + Store(value, data_ptr_cast(&bytes)); + Store(BSwap(bytes), dataptr); dataptr[0] = FlipSign(dataptr[0]); } diff --git a/src/duckdb/src/include/duckdb/common/re2_regex.hpp b/src/duckdb/src/include/duckdb/common/re2_regex.hpp index de4b3313..77b5b261 100644 --- a/src/duckdb/src/include/duckdb/common/re2_regex.hpp +++ b/src/duckdb/src/include/duckdb/common/re2_regex.hpp @@ -4,7 +4,8 @@ #include "duckdb/common/winapi.hpp" #include "duckdb/common/vector.hpp" -#include +#include "duckdb/common/shared_ptr.hpp" +#include "duckdb/common/string.hpp" #include namespace duckdb_re2 { @@ -22,7 +23,7 @@ class Regex { } private: - std::shared_ptr regex; + duckdb::shared_ptr regex; }; struct GroupMatch { diff --git a/src/duckdb/src/include/duckdb/common/row_operations/row_operations.hpp b/src/duckdb/src/include/duckdb/common/row_operations/row_operations.hpp index 9347a9f6..2973c6b6 100644 --- a/src/duckdb/src/include/duckdb/common/row_operations/row_operations.hpp +++ b/src/duckdb/src/include/duckdb/common/row_operations/row_operations.hpp @@ -31,12 +31,14 @@ class NestedValidity { data_ptr_t *struct_validity_locations; idx_t entry_idx; idx_t idx_in_entry; + idx_t list_validity_offset; public: explicit NestedValidity(data_ptr_t validitymask_location); NestedValidity(data_ptr_t *validitymask_locations, idx_t child_vector_index); void SetInvalid(idx_t idx); bool IsValid(idx_t idx); + void OffsetListBy(idx_t offset); }; struct RowOperationsState { diff --git a/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp b/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp index 18f8a157..b291628a 100644 --- a/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +++ b/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp @@ -89,6 +89,7 @@ class BinaryDeserializer : public Deserializer { } void ReadData(data_ptr_t buffer, idx_t read_size) { + D_ASSERT(!has_buffered_field); stream.ReadData(buffer, read_size); } @@ -102,7 +103,7 @@ class BinaryDeserializer : public Deserializer { template T VarIntDecode() { // FIXME: maybe we should pass a source to EncodingUtil instead - uint8_t buffer[16]; + uint8_t buffer[16] = {}; idx_t varint_size; for (varint_size = 0; varint_size < 16; varint_size++) { ReadData(buffer + varint_size, 1); diff --git a/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp b/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp index 0cf532b3..d24000ad 100644 --- a/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +++ b/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp @@ -17,9 +17,11 @@ namespace duckdb { class BinarySerializer : public Serializer { public: - explicit BinarySerializer(WriteStream &stream, bool serialize_default_values_p = false) : stream(stream) { - serialize_default_values = serialize_default_values_p; - serialize_enum_as_string = false; + explicit BinarySerializer(WriteStream &stream, SerializationOptions options_p = SerializationOptions()) + : stream(stream) { + options = std::move(options_p); + // Override the value set by the passed in SerializationOptions + options.serialize_enum_as_string = false; } private: @@ -44,7 +46,7 @@ class BinarySerializer : public Serializer { template void VarIntEncode(T value) { - uint8_t buffer[16]; + uint8_t buffer[16] = {}; auto write_size = EncodingUtil::EncodeLEB128(buffer, value); D_ASSERT(write_size <= sizeof(buffer)); WriteData(buffer, write_size); @@ -52,8 +54,8 @@ class BinarySerializer : public Serializer { public: template - static void Serialize(const T &value, WriteStream &stream, bool serialize_default_values = false) { - BinarySerializer serializer(stream, serialize_default_values); + static void Serialize(const T &value, WriteStream &stream, SerializationOptions options = SerializationOptions()) { + BinarySerializer serializer(stream, std::move(options)); serializer.OnObjectBegin(); value.Serialize(serializer); serializer.OnObjectEnd(); diff --git a/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp b/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp index e4096878..d8f95c5a 100644 --- a/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp +++ b/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp @@ -196,6 +196,12 @@ class Deserializer { return val; } + // Deserialize a optionally_owned_ptr + template ::ELEMENT_TYPE> + inline typename std::enable_if::value, T>::type Read() { + return optionally_owned_ptr(Read>()); + } + // Deserialize unique_ptr if the element type has a Deserialize method template ::ELEMENT_TYPE> inline typename std::enable_if::value && has_deserialize::value, T>::type Read() { @@ -302,6 +308,23 @@ class Deserializer { return map; } + template + inline typename std::enable_if::value, T>::type Read() { + using VALUE_TYPE = typename is_insertion_preserving_map::VALUE_TYPE; + + T map; + auto size = OnListBegin(); + for (idx_t i = 0; i < size; i++) { + OnObjectBegin(); + auto key = ReadProperty(0, "key"); + auto value = ReadProperty(1, "value"); + OnObjectEnd(); + map[key] = std::move(value); + } + OnListEnd(); + return map; + } + // Deserialize an unordered set template inline typename std::enable_if::value, T>::type Read() { @@ -340,6 +363,19 @@ class Deserializer { return std::make_pair(first, second); } + // Deserialize a priority_queue + template + inline typename std::enable_if::value, T>::type Read() { + using ELEMENT_TYPE = typename is_queue::ELEMENT_TYPE; + T queue; + auto size = OnListBegin(); + for (idx_t i = 0; i < size; i++) { + queue.emplace(Read()); + } + OnListEnd(); + return queue; + } + // Primitive types // Deserialize a bool template diff --git a/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp b/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp index 616d90f2..a1c91b8e 100644 --- a/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +++ b/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp @@ -10,8 +10,11 @@ #include "duckdb/common/set.hpp" #include "duckdb/common/shared_ptr.hpp" #include "duckdb/common/unique_ptr.hpp" +#include "duckdb/common/queue.hpp" #include "duckdb/common/optional_ptr.hpp" +#include "duckdb/common/optionally_owned_ptr.hpp" #include "duckdb/common/optional_idx.hpp" +#include "duckdb/common/insertion_order_preserving_map.hpp" namespace duckdb { @@ -50,6 +53,13 @@ struct has_deserialize< T, typename std::enable_if(Deserializer &)>::value, T>::type> : std::true_type {}; +// Accept `static shared_ptr Deserialize(Deserializer& deserializer)` +template +struct has_deserialize< + T, + typename std::enable_if(Deserializer &)>::value, T>::type> + : std::true_type {}; + // Accept `static T Deserialize(Deserializer& deserializer)` template struct has_deserialize< @@ -92,6 +102,20 @@ struct is_map> : std::true_type { typedef typename std::tuple_element<3, std::tuple>::type EQUAL_TYPE; }; +template +struct is_insertion_preserving_map : std::false_type {}; +template +struct is_insertion_preserving_map> : std::true_type { + typedef typename std::tuple_element<0, std::tuple>::type VALUE_TYPE; +}; + +template +struct is_queue : std::false_type {}; +template +struct is_queue> : std::true_type { + typedef T ELEMENT_TYPE; +}; + template struct is_unique_ptr : std::false_type {}; template @@ -105,6 +129,10 @@ template struct is_shared_ptr> : std::true_type { typedef T ELEMENT_TYPE; }; +template +struct is_shared_ptr> : std::true_type { + typedef T ELEMENT_TYPE; +}; template struct is_optional_ptr : std::false_type {}; @@ -113,6 +141,13 @@ struct is_optional_ptr> : std::true_type { typedef T ELEMENT_TYPE; }; +template +struct is_optionally_owned_ptr : std::false_type {}; +template +struct is_optionally_owned_ptr> : std::true_type { + typedef T ELEMENT_TYPE; +}; + template struct is_pair : std::false_type {}; template @@ -193,6 +228,16 @@ struct SerializationDefaultValue { return !value; } + template + static inline typename std::enable_if::value, T>::type GetDefault() { + return T(); + } + + template + static inline bool IsDefault(const typename std::enable_if::value, T>::type &value) { + return !value; + } + template static inline typename std::enable_if::value, T>::type GetDefault() { return T(); @@ -213,6 +258,16 @@ struct SerializationDefaultValue { return value.empty(); } + template + static inline typename std::enable_if::value, T>::type GetDefault() { + return T(); + } + + template + static inline bool IsDefault(const typename std::enable_if::value, T>::type &value) { + return value.empty(); + } + template static inline typename std::enable_if::value, T>::type GetDefault() { return T(); @@ -253,6 +308,16 @@ struct SerializationDefaultValue { return value.empty(); } + template + static inline typename std::enable_if::value, T>::type GetDefault() { + return T(); + } + + template + static inline bool IsDefault(const typename std::enable_if::value, T>::type &value) { + return value.empty(); + } + template static inline typename std::enable_if::value, T>::type GetDefault() { return T(); diff --git a/src/duckdb/src/include/duckdb/common/serializer/serializer.hpp b/src/duckdb/src/include/duckdb/common/serializer/serializer.hpp index f791b4a8..3ee8f138 100644 --- a/src/duckdb/src/include/duckdb/common/serializer/serializer.hpp +++ b/src/duckdb/src/include/duckdb/common/serializer/serializer.hpp @@ -16,20 +16,33 @@ #include "duckdb/common/unordered_map.hpp" #include "duckdb/common/unordered_set.hpp" #include "duckdb/common/optional_idx.hpp" +#include "duckdb/common/optionally_owned_ptr.hpp" #include "duckdb/common/value_operations/value_operations.hpp" #include "duckdb/execution/operator/csv_scanner/csv_option.hpp" +#include "duckdb/main/config.hpp" +#include "duckdb/common/insertion_order_preserving_map.hpp" namespace duckdb { -class Serializer { -protected: +class SerializationOptions { +public: bool serialize_enum_as_string = false; bool serialize_default_values = false; + SerializationCompatibility serialization_compatibility = SerializationCompatibility::Default(); +}; + +class Serializer { +protected: + SerializationOptions options; public: virtual ~Serializer() { } + bool ShouldSerialize(idx_t version_added) { + return options.serialization_compatibility.Compare(version_added); + } + class List { friend Serializer; @@ -64,7 +77,7 @@ class Serializer { template void WritePropertyWithDefault(const field_id_t field_id, const char *tag, const T &value) { // If current value is default, don't write it - if (!serialize_default_values && SerializationDefaultValue::IsDefault(value)) { + if (!options.serialize_default_values && SerializationDefaultValue::IsDefault(value)) { OnOptionalPropertyBegin(field_id, tag, false); OnOptionalPropertyEnd(false); return; @@ -77,7 +90,7 @@ class Serializer { template void WritePropertyWithDefault(const field_id_t field_id, const char *tag, const T &value, const T &&default_value) { // If current value is default, don't write it - if (!serialize_default_values && (value == default_value)) { + if (!options.serialize_default_values && (value == default_value)) { OnOptionalPropertyBegin(field_id, tag, false); OnOptionalPropertyEnd(false); return; @@ -92,7 +105,7 @@ class Serializer { void WritePropertyWithDefault(const field_id_t field_id, const char *tag, const CSVOption &value, const T &&default_value) { // If current value is default, don't write it - if (!serialize_default_values && (value == default_value)) { + if (!options.serialize_default_values && (value == default_value)) { OnOptionalPropertyBegin(field_id, tag, false); OnOptionalPropertyEnd(false); return; @@ -134,7 +147,7 @@ class Serializer { protected: template typename std::enable_if::value, void>::type WriteValue(const T value) { - if (serialize_enum_as_string) { + if (options.serialize_enum_as_string) { // Use the enum serializer to lookup tostring function auto str = EnumUtil::ToChars(value); WriteValue(str); @@ -144,6 +157,12 @@ class Serializer { } } + // Optionally Owned Pointer Ref + template + void WriteValue(const optionally_owned_ptr &ptr) { + WriteValue(ptr.get()); + } + // Unique Pointer Ref template void WriteValue(const unique_ptr &ptr) { @@ -259,6 +278,33 @@ class Serializer { OnListEnd(); } + // Insertion Order Preserving Map + // serialized as a list of pairs + template + void WriteValue(const duckdb::InsertionOrderPreservingMap &map) { + auto count = map.size(); + OnListBegin(count); + for (auto &entry : map) { + OnObjectBegin(); + WriteProperty(0, "key", entry.first); + WriteProperty(1, "value", entry.second); + OnObjectEnd(); + } + OnListEnd(); + } + + // priority queue + template + void WriteValue(const std::priority_queue &queue) { + vector placeholder; + auto queue_copy = std::priority_queue(queue); + while (queue_copy.size() > 0) { + placeholder.emplace_back(queue_copy.top()); + queue_copy.pop(); + } + WriteValue(placeholder); + } + // class or struct implementing `Serialize(Serializer& Serializer)`; template typename std::enable_if::value>::type WriteValue(const T &value) { diff --git a/src/duckdb/src/include/duckdb/common/shared_ptr.hpp b/src/duckdb/src/include/duckdb/common/shared_ptr.hpp index 4d97075e..6d0910ca 100644 --- a/src/duckdb/src/include/duckdb/common/shared_ptr.hpp +++ b/src/duckdb/src/include/duckdb/common/shared_ptr.hpp @@ -8,12 +8,45 @@ #pragma once +#include "duckdb/common/unique_ptr.hpp" +#include "duckdb/common/likely.hpp" +#include "duckdb/common/memory_safety.hpp" + #include +#include namespace duckdb { -using std::make_shared; -using std::shared_ptr; -using std::weak_ptr; +// This implementation is taken from the llvm-project, at this commit hash: +// https://github.com/llvm/llvm-project/blob/08bb121835be432ac52372f92845950628ce9a4a/libcxx/include/__memory/shared_ptr.h#353 +// originally named '__compatible_with' + +#if _LIBCPP_STD_VER >= 17 +template +struct __bounded_convertible_to_unbounded : std::false_type {}; + +template +struct __bounded_convertible_to_unbounded<_Up[_Np], T> : std::is_same, _Up[]> {}; + +template +struct compatible_with_t : std::_Or, __bounded_convertible_to_unbounded> {}; +#else +template +struct compatible_with_t : std::is_convertible {}; // NOLINT: invalid case style +#endif // _LIBCPP_STD_VER >= 17 + +} // namespace duckdb + +#include "duckdb/common/shared_ptr.ipp" +#include "duckdb/common/weak_ptr.ipp" +#include "duckdb/common/enable_shared_from_this.ipp" + +namespace duckdb { + +template +using unsafe_shared_ptr = shared_ptr; + +template +using unsafe_weak_ptr = weak_ptr; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/shared_ptr.ipp b/src/duckdb/src/include/duckdb/common/shared_ptr.ipp new file mode 100644 index 00000000..d046dc14 --- /dev/null +++ b/src/duckdb/src/include/duckdb/common/shared_ptr.ipp @@ -0,0 +1,268 @@ +namespace duckdb { + +template +class weak_ptr; + +template +class enable_shared_from_this; + +template +class shared_ptr { // NOLINT: invalid case style +public: + using original = std::shared_ptr; + using element_type = typename original::element_type; + using weak_type = weak_ptr; + +private: + static inline void AssertNotNull(const bool null) { +#if defined(DUCKDB_DEBUG_NO_SAFETY) || defined(DUCKDB_CLANG_TIDY) + return; +#else + if (DUCKDB_UNLIKELY(null)) { + throw duckdb::InternalException("Attempted to dereference shared_ptr that is NULL!"); + } +#endif + } + +private: + template + friend class weak_ptr; + + template + friend class shared_ptr; + + template + friend shared_ptr shared_ptr_cast(shared_ptr src); // NOLINT: invalid case style + +private: + original internal; + +public: + // Constructors + shared_ptr() : internal() { + } + shared_ptr(std::nullptr_t) : internal(nullptr) { // NOLINT: not marked as explicit + } + + // From raw pointer of type U convertible to T + template ::value, int>::type = 0> + explicit shared_ptr(U *ptr) : internal(ptr) { + __enable_weak_this(internal.get(), internal.get()); + } + // From raw pointer of type T with custom DELETER + template + shared_ptr(T *ptr, DELETER deleter) : internal(ptr, deleter) { + __enable_weak_this(internal.get(), internal.get()); + } + // Aliasing constructor: shares ownership information with ref but contains ptr instead + // When the created shared_ptr goes out of scope, it will call the DELETER of ref, will not delete ptr + template + shared_ptr(const shared_ptr &ref, T *ptr) noexcept : internal(ref.internal, ptr) { + } +#if _LIBCPP_STD_VER >= 20 + template + shared_ptr(shared_ptr &&ref, T *ptr) noexcept : internal(std::move(ref.internal), ptr) { + } +#endif + + // Copy constructor, share ownership with ref + template ::value, int>::type = 0> + shared_ptr(const shared_ptr &ref) noexcept : internal(ref.internal) { // NOLINT: not marked as explicit + } + shared_ptr(const shared_ptr &other) : internal(other.internal) { // NOLINT: not marked as explicit + } + // Move constructor, share ownership with ref + template ::value, int>::type = 0> +#ifdef DUCKDB_CLANG_TIDY + [[clang::reinitializes]] +#endif + shared_ptr(shared_ptr &&ref) noexcept // NOLINT: not marked as explicit + : internal(std::move(ref.internal)) { + } +#ifdef DUCKDB_CLANG_TIDY + [[clang::reinitializes]] +#endif + shared_ptr(shared_ptr &&other) // NOLINT: not marked as explicit + : internal(std::move(other.internal)) { + } + + // Construct from std::shared_ptr + explicit shared_ptr(std::shared_ptr other) : internal(other) { + // FIXME: should we __enable_weak_this here? + // *our* enable_shared_from_this hasn't initialized yet, so I think so? + __enable_weak_this(internal.get(), internal.get()); + } + + // Construct from weak_ptr + template + explicit shared_ptr(weak_ptr other) : internal(other.internal) { + } + + // Construct from unique_ptr, takes over ownership of the unique_ptr + template ::value && + std::is_convertible::pointer, T *>::value, + int>::type = 0> +#ifdef DUCKDB_CLANG_TIDY + [[clang::reinitializes]] +#endif + shared_ptr(unique_ptr &&other) // NOLINT: not marked as explicit + : internal(std::move(other)) { + __enable_weak_this(internal.get(), internal.get()); + } + + // Destructor + ~shared_ptr() = default; + + // Assign from shared_ptr copy + shared_ptr &operator=(const shared_ptr &other) noexcept { + if (this == &other) { + return *this; + } + // Create a new shared_ptr using the copy constructor, then swap out the ownership to *this + shared_ptr(other).swap(*this); + return *this; + } + template ::value, int>::type = 0> + shared_ptr &operator=(const shared_ptr &other) { + shared_ptr(other).swap(*this); + return *this; + } + + // Assign from moved shared_ptr + shared_ptr &operator=(shared_ptr &&other) noexcept { + // Create a new shared_ptr using the move constructor, then swap out the ownership to *this + shared_ptr(std::move(other)).swap(*this); + return *this; + } + template ::value, int>::type = 0> + shared_ptr &operator=(shared_ptr &&other) { + shared_ptr(std::move(other)).swap(*this); + return *this; + } + + // Assign from moved unique_ptr + template ::value && + std::is_convertible::pointer, T *>::value, + int>::type = 0> + shared_ptr &operator=(unique_ptr &&ref) { + shared_ptr(std::move(ref)).swap(*this); + return *this; + } + +#ifdef DUCKDB_CLANG_TIDY + [[clang::reinitializes]] +#endif + void + reset() { // NOLINT: invalid case style + internal.reset(); + } + template +#ifdef DUCKDB_CLANG_TIDY + [[clang::reinitializes]] +#endif + void + reset(U *ptr) { // NOLINT: invalid case style + internal.reset(ptr); + } + template +#ifdef DUCKDB_CLANG_TIDY + [[clang::reinitializes]] +#endif + void + reset(U *ptr, DELETER deleter) { // NOLINT: invalid case style + internal.reset(ptr, deleter); + } + + void swap(shared_ptr &r) noexcept { // NOLINT: invalid case style + internal.swap(r.internal); + } + + T *get() const { // NOLINT: invalid case style + return internal.get(); + } + + long use_count() const { // NOLINT: invalid case style + return internal.use_count(); + } + + explicit operator bool() const noexcept { + return internal.operator bool(); + } + + typename std::add_lvalue_reference::type operator*() const { + if (MemorySafety::ENABLED) { + const auto ptr = internal.get(); + AssertNotNull(!ptr); + return *ptr; + } else { + return *internal; + } + } + + T *operator->() const { + if (MemorySafety::ENABLED) { + const auto ptr = internal.get(); + AssertNotNull(!ptr); + return ptr; + } else { + return internal.operator->(); + } + } + + // Relational operators + template + bool operator==(const shared_ptr &other) const noexcept { + return internal == other.internal; + } + template + bool operator!=(const shared_ptr &other) const noexcept { + return internal != other.internal; + } + + bool operator==(std::nullptr_t) const noexcept { + return internal == nullptr; + } + bool operator!=(std::nullptr_t) const noexcept { + return internal != nullptr; + } + + template + bool operator<(const shared_ptr &other) const noexcept { + return internal < other.internal; + } + template + bool operator<=(const shared_ptr &other) const noexcept { + return internal <= other.internal; + } + template + bool operator>(const shared_ptr &other) const noexcept { + return internal > other.internal; + } + template + bool operator>=(const shared_ptr &other) const noexcept { + return internal >= other.internal; + } + +private: + // This overload is used when the class inherits from 'enable_shared_from_this' + template *>::value, + int>::type = 0> + void __enable_weak_this(const enable_shared_from_this *object, // NOLINT: invalid case style + V *ptr) noexcept { + typedef typename std::remove_cv::type non_const_u_t; + if (object && object->__weak_this_.expired()) { + // __weak_this__ is the mutable variable returned by 'shared_from_this' + // it is initialized here + auto non_const = const_cast(static_cast(ptr)); // NOLINT: const cast + object->__weak_this_ = shared_ptr(*this, non_const); + } + } + + void __enable_weak_this(...) noexcept { // NOLINT: invalid case style + } +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp b/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp index 7b239a15..a71788eb 100644 --- a/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp +++ b/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp @@ -154,9 +154,9 @@ struct PDQIterator { } inline friend idx_t operator-(const PDQIterator &lhs, const PDQIterator &rhs) { - D_ASSERT((*lhs - *rhs) % lhs.entry_size == 0); + D_ASSERT(duckdb::NumericCast(*lhs - *rhs) % lhs.entry_size == 0); D_ASSERT(*lhs - *rhs >= 0); - return (*lhs - *rhs) / lhs.entry_size; + return duckdb::NumericCast(*lhs - *rhs) / lhs.entry_size; } inline friend bool operator<(const PDQIterator &lhs, const PDQIterator &rhs) { @@ -320,7 +320,7 @@ inline T *align_cacheline(T *p) { #else std::size_t ip = reinterpret_cast(p); #endif - ip = (ip + cacheline_size - 1) & -cacheline_size; + ip = (ip + cacheline_size - 1) & -duckdb::UnsafeNumericCast(cacheline_size); return reinterpret_cast(ip); } diff --git a/src/duckdb/src/include/duckdb/common/string.hpp b/src/duckdb/src/include/duckdb/common/string.hpp index ad717374..553a548d 100644 --- a/src/duckdb/src/include/duckdb/common/string.hpp +++ b/src/duckdb/src/include/duckdb/common/string.hpp @@ -8,9 +8,10 @@ #pragma once -#include #include +#include namespace duckdb { using std::string; -} +using std::stringstream; +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/common/string_util.hpp b/src/duckdb/src/include/duckdb/common/string_util.hpp index ecbc480c..07a4319b 100644 --- a/src/duckdb/src/include/duckdb/common/string_util.hpp +++ b/src/duckdb/src/include/duckdb/common/string_util.hpp @@ -10,8 +10,9 @@ #include "duckdb/common/constants.hpp" #include "duckdb/common/exception.hpp" -#include "duckdb/common/vector.hpp" +#include "duckdb/common/numeric_utils.hpp" #include "duckdb/common/set.hpp" +#include "duckdb/common/vector.hpp" #include @@ -40,22 +41,22 @@ class StringUtil { static uint8_t GetHexValue(char c) { if (c >= '0' && c <= '9') { - return c - '0'; + return UnsafeNumericCast(c - '0'); } if (c >= 'a' && c <= 'f') { - return c - 'a' + 10; + return UnsafeNumericCast(c - 'a' + 10); } if (c >= 'A' && c <= 'F') { - return c - 'A' + 10; + return UnsafeNumericCast(c - 'A' + 10); } - throw InvalidInputException("Invalid input for hex digit: %s", string(c, 1)); + throw InvalidInputException("Invalid input for hex digit: %s", string(1, c)); } static uint8_t GetBinaryValue(char c) { if (c >= '0' && c <= '1') { - return c - '0'; + return UnsafeNumericCast(c - '0'); } - throw InvalidInputException("Invalid input for binary digit: %s", string(c, 1)); + throw InvalidInputException("Invalid input for binary digit: %s", string(1, c)); } static bool CharacterIsSpace(char c) { @@ -187,6 +188,9 @@ class StringUtil { //! Case insensitive compare DUCKDB_API static bool CILessThan(const string &l1, const string &l2); + //! Case insensitive find, returns DConstants::INVALID_INDEX if not found + DUCKDB_API static idx_t CIFind(vector &vec, const string &str); + //! Format a string using printf semantics template static string Format(const string fmt_str, ARGS... params) { diff --git a/src/duckdb/src/include/duckdb/common/types.hpp b/src/duckdb/src/include/duckdb/common/types.hpp index bd5778ec..c4b8015d 100644 --- a/src/duckdb/src/include/duckdb/common/types.hpp +++ b/src/duckdb/src/include/duckdb/common/types.hpp @@ -12,6 +12,7 @@ #include "duckdb/common/constants.hpp" #include "duckdb/common/optional_ptr.hpp" #include "duckdb/common/vector.hpp" +#include "duckdb/common/helper.hpp" #include @@ -34,7 +35,7 @@ using buffer_ptr = shared_ptr; template buffer_ptr make_buffer(ARGS &&...args) { // NOLINT: mimic std casing - return make_shared(std::forward(args)...); + return make_shared_ptr(std::forward(args)...); } struct list_entry_t { // NOLINT: mimic std casing @@ -272,6 +273,9 @@ struct LogicalType { return type_info_; } + //! DeepCopy() will make a unique copy of any ExtraTypeInfo as well + LogicalType DeepCopy() const; + inline void CopyAuxInfo(const LogicalType &other) { type_info_ = other.type_info_; } @@ -318,6 +322,11 @@ struct LogicalType { DUCKDB_API void SetAlias(string alias); DUCKDB_API bool HasAlias() const; DUCKDB_API string GetAlias() const; + DUCKDB_API void SetModifiers(vector modifiers); + DUCKDB_API bool HasModifiers() const; + DUCKDB_API vector GetModifiersCopy() const; + DUCKDB_API optional_ptr> GetModifiers(); + DUCKDB_API optional_ptr> GetModifiers() const; //! Returns the maximum logical type when combining the two types - or throws an exception if combining is not possible DUCKDB_API static LogicalType MaxLogicalType(ClientContext &context, const LogicalType &left, const LogicalType &right); @@ -404,7 +413,8 @@ struct LogicalType { // DEPRECATED - provided for backwards compatibility DUCKDB_API static LogicalType ENUM(const string &enum_name, Vector &ordered_data, idx_t size); // NOLINT DUCKDB_API static LogicalType USER(const string &user_type_name); // NOLINT - DUCKDB_API static LogicalType USER(string catalog, string schema, string name); // NOLINT + DUCKDB_API static LogicalType USER(const string &user_type_name, const vector &user_type_mods); // NOLINT + DUCKDB_API static LogicalType USER(string catalog, string schema, string name, vector user_type_mods); // NOLINT //! A list of all NUMERIC types (integral and floating point types) DUCKDB_API static const vector Numeric(); //! A list of all INTEGRAL types @@ -439,6 +449,8 @@ struct UserType { DUCKDB_API static const string &GetCatalog(const LogicalType &type); DUCKDB_API static const string &GetSchema(const LogicalType &type); DUCKDB_API static const string &GetTypeName(const LogicalType &type); + DUCKDB_API static const vector &GetTypeModifiers(const LogicalType &type); + DUCKDB_API static vector &GetTypeModifiers(LogicalType &type); }; struct EnumType { diff --git a/src/duckdb/src/include/duckdb/common/types/bit.hpp b/src/duckdb/src/include/duckdb/common/types/bit.hpp index 2dd594dd..12c64d8b 100644 --- a/src/duckdb/src/include/duckdb/common/types/bit.hpp +++ b/src/duckdb/src/include/duckdb/common/types/bit.hpp @@ -104,7 +104,7 @@ void Bit::NumericToBit(T numeric, string_t &output_str) { *output = 0; // set padding to 0 ++output; for (idx_t idx = 0; idx < sizeof(T); ++idx) { - output[idx] = data[sizeof(T) - idx - 1]; + output[idx] = static_cast(data[sizeof(T) - idx - 1]); } Bit::Finalize(output_str); } diff --git a/src/duckdb/src/include/duckdb/common/types/cast_helpers.hpp b/src/duckdb/src/include/duckdb/common/types/cast_helpers.hpp index 2171702c..f85b142b 100644 --- a/src/duckdb/src/include/duckdb/common/types/cast_helpers.hpp +++ b/src/duckdb/src/include/duckdb/common/types/cast_helpers.hpp @@ -30,6 +30,7 @@ class NumericHelper { public: template static int UnsignedLength(T value); + template static int SignedLength(SIGNED value) { int sign = -(value < 0); @@ -59,11 +60,12 @@ class NumericHelper { return ptr; } - template - static string_t FormatSigned(SIGNED value, Vector &vector) { - int sign = -(value < 0); - UNSIGNED unsigned_value = UnsafeNumericCast(UNSIGNED(value ^ sign) - sign); - int length = UnsignedLength(unsigned_value) - sign; + template + static string_t FormatSigned(T value, Vector &vector) { + typedef typename MakeUnsigned::type unsigned_t; + int8_t sign = -(value < 0); + unsigned_t unsigned_value = unsigned_t(value ^ T(sign)) + unsigned_t(AbsValue(sign)); + auto length = UnsafeNumericCast(UnsignedLength(unsigned_value) + AbsValue(sign)); string_t result = StringVector::EmptyString(vector, length); auto dataptr = result.GetDataWriteable(); auto endptr = dataptr + length; @@ -89,6 +91,11 @@ template <> int NumericHelper::UnsignedLength(uint32_t value); template <> int NumericHelper::UnsignedLength(uint64_t value); +template <> +int NumericHelper::UnsignedLength(hugeint_t value); + +template <> +char *NumericHelper::FormatUnsigned(hugeint_t value, char *ptr); template <> std::string NumericHelper::ToString(hugeint_t value); @@ -96,9 +103,13 @@ std::string NumericHelper::ToString(hugeint_t value); template <> std::string NumericHelper::ToString(uhugeint_t value); +template <> +string_t NumericHelper::FormatSigned(hugeint_t value, Vector &vector); + struct DecimalToString { - template + template static int DecimalLength(SIGNED value, uint8_t width, uint8_t scale) { + using UNSIGNED = typename MakeUnsigned::type; if (scale == 0) { // scale is 0: regular number return NumericHelper::SignedLength(value); @@ -115,24 +126,27 @@ struct DecimalToString { NumericHelper::SignedLength(value) + 1); } - template + template static void FormatDecimal(SIGNED value, uint8_t width, uint8_t scale, char *dst, idx_t len) { + using UNSIGNED = typename MakeUnsigned::type; char *end = dst + len; if (value < 0) { value = -value; *dst = '-'; } if (scale == 0) { - NumericHelper::FormatUnsigned(value, end); + NumericHelper::FormatUnsigned(UnsafeNumericCast(value), end); return; } // we write two numbers: // the numbers BEFORE the decimal (major) // and the numbers AFTER the decimal (minor) - UNSIGNED minor = value % (UNSIGNED)NumericHelper::POWERS_OF_TEN[scale]; - UNSIGNED major = value / (UNSIGNED)NumericHelper::POWERS_OF_TEN[scale]; + auto minor = + UnsafeNumericCast(value) % UnsafeNumericCast(NumericHelper::POWERS_OF_TEN[scale]); + auto major = + UnsafeNumericCast(value) / UnsafeNumericCast(NumericHelper::POWERS_OF_TEN[scale]); // write the number after the decimal - dst = NumericHelper::FormatUnsigned(minor, end); + dst = NumericHelper::FormatUnsigned(UnsafeNumericCast(minor), end); // (optionally) pad with zeros and add the decimal point while (dst > (end - scale)) { *--dst = '0'; @@ -142,213 +156,28 @@ struct DecimalToString { D_ASSERT(width > scale || major == 0); if (width > scale) { // there are numbers after the comma - dst = NumericHelper::FormatUnsigned(major, dst); + dst = NumericHelper::FormatUnsigned(UnsafeNumericCast(major), dst); } } - template + template static string_t Format(SIGNED value, uint8_t width, uint8_t scale, Vector &vector) { - int len = DecimalLength(value, width, scale); - string_t result = StringVector::EmptyString(vector, len); - FormatDecimal(value, width, scale, result.GetDataWriteable(), len); + int len = DecimalLength(value, width, scale); + string_t result = StringVector::EmptyString(vector, NumericCast(len)); + FormatDecimal(value, width, scale, result.GetDataWriteable(), UnsafeNumericCast(len)); result.Finalize(); return result; } }; -struct HugeintToStringCast { - static int UnsignedLength(hugeint_t value) { - D_ASSERT(value.upper >= 0); - if (value.upper == 0) { - return NumericHelper::UnsignedLength(value.lower); - } - // search the length using the POWERS_OF_TEN array - // the length has to be between [17] and [38], because the hugeint is bigger than 2^63 - // we use the same approach as above, but split a bit more because comparisons for hugeints are more expensive - if (value >= Hugeint::POWERS_OF_TEN[27]) { - // [27..38] - if (value >= Hugeint::POWERS_OF_TEN[32]) { - if (value >= Hugeint::POWERS_OF_TEN[36]) { - int length = 37; - length += value >= Hugeint::POWERS_OF_TEN[37]; - length += value >= Hugeint::POWERS_OF_TEN[38]; - return length; - } else { - int length = 33; - length += value >= Hugeint::POWERS_OF_TEN[33]; - length += value >= Hugeint::POWERS_OF_TEN[34]; - length += value >= Hugeint::POWERS_OF_TEN[35]; - return length; - } - } else { - if (value >= Hugeint::POWERS_OF_TEN[30]) { - int length = 31; - length += value >= Hugeint::POWERS_OF_TEN[31]; - length += value >= Hugeint::POWERS_OF_TEN[32]; - return length; - } else { - int length = 28; - length += value >= Hugeint::POWERS_OF_TEN[28]; - length += value >= Hugeint::POWERS_OF_TEN[29]; - return length; - } - } - } else { - // [17..27] - if (value >= Hugeint::POWERS_OF_TEN[22]) { - // [22..27] - if (value >= Hugeint::POWERS_OF_TEN[25]) { - int length = 26; - length += value >= Hugeint::POWERS_OF_TEN[26]; - return length; - } else { - int length = 23; - length += value >= Hugeint::POWERS_OF_TEN[23]; - length += value >= Hugeint::POWERS_OF_TEN[24]; - return length; - } - } else { - // [17..22] - if (value >= Hugeint::POWERS_OF_TEN[20]) { - int length = 21; - length += value >= Hugeint::POWERS_OF_TEN[21]; - return length; - } else { - int length = 18; - length += value >= Hugeint::POWERS_OF_TEN[18]; - length += value >= Hugeint::POWERS_OF_TEN[19]; - return length; - } - } - } - } - - // Formats value in reverse and returns a pointer to the beginning. - static char *FormatUnsigned(hugeint_t value, char *ptr) { - while (value.upper > 0) { - // while integer division is slow, hugeint division is MEGA slow - // we want to avoid doing as many divisions as possible - // for that reason we start off doing a division by a large power of ten that uint64_t can hold - // (100000000000000000) - this is the third largest - // the reason we don't use the largest is because that can result in an overflow inside the division - // function - uint64_t remainder; - value = Hugeint::DivModPositive(value, 100000000000000000ULL, remainder); - - auto startptr = ptr; - // now we format the remainder: note that we need to pad with zero's in case - // the remainder is small (i.e. less than 10000000000000000) - ptr = NumericHelper::FormatUnsigned(remainder, ptr); - - int format_length = UnsafeNumericCast(startptr - ptr); - // pad with zero - for (int i = format_length; i < 17; i++) { - *--ptr = '0'; - } - } - // once the value falls in the range of a uint64_t, fallback to formatting as uint64_t to avoid hugeint division - return NumericHelper::FormatUnsigned(value.lower, ptr); - } - - static string_t FormatSigned(hugeint_t value, Vector &vector) { - int negative = value.upper < 0; - if (negative) { - if (value == NumericLimits::Minimum()) { - string_t result = StringVector::AddString(vector, Hugeint::HUGEINT_MINIMUM_STRING); - return result; - } - Hugeint::NegateInPlace(value); - } - int length = UnsignedLength(value) + negative; - string_t result = StringVector::EmptyString(vector, length); - auto dataptr = result.GetDataWriteable(); - auto endptr = dataptr + length; - if (value.upper == 0) { - // small value: format as uint64_t - endptr = NumericHelper::FormatUnsigned(value.lower, endptr); - } else { - endptr = FormatUnsigned(value, endptr); - } - if (negative) { - *--endptr = '-'; - } - D_ASSERT(endptr == dataptr); - result.Finalize(); - return result; - } - - static int DecimalLength(hugeint_t value, uint8_t width, uint8_t scale) { - D_ASSERT(value > NumericLimits::Minimum()); - int negative; - - if (value.upper < 0) { - Hugeint::NegateInPlace(value); - negative = 1; - } else { - negative = 0; - } - if (scale == 0) { - // scale is 0: regular number - return UnsignedLength(value) + negative; - } - // length is max of either: - // scale + 2 OR - // integer length + 1 - // scale + 2 happens when the number is in the range of (-1, 1) - // in that case we print "0.XXX", which is the scale, plus "0." (2 chars) - // integer length + 1 happens when the number is outside of that range - // in that case we print the integer number, but with one extra character ('.') - auto extra_numbers = width > scale ? 2 : 1; - return MaxValue(scale + extra_numbers, UnsignedLength(value) + 1) + negative; - } - - static void FormatDecimal(hugeint_t value, uint8_t width, uint8_t scale, char *dst, int len) { - auto endptr = dst + len; - - int negative = value.upper < 0; - if (negative) { - Hugeint::NegateInPlace(value); - *dst = '-'; - dst++; - } - if (scale == 0) { - // with scale=0 we format the number as a regular number - FormatUnsigned(value, endptr); - return; - } - - // we write two numbers: - // the numbers BEFORE the decimal (major) - // and the numbers AFTER the decimal (minor) - hugeint_t minor; - hugeint_t major = Hugeint::DivMod(value, Hugeint::POWERS_OF_TEN[scale], minor); - - // write the number after the decimal - dst = FormatUnsigned(minor, endptr); - // (optionally) pad with zeros and add the decimal point - while (dst > (endptr - scale)) { - *--dst = '0'; - } - *--dst = '.'; - // now write the part before the decimal - D_ASSERT(width > scale || major == 0); - if (width > scale) { - dst = FormatUnsigned(major, dst); - } - } - - static string_t FormatDecimal(hugeint_t value, uint8_t width, uint8_t scale, Vector &vector) { - int length = DecimalLength(value, width, scale); - string_t result = StringVector::EmptyString(vector, length); - - auto dst = result.GetDataWriteable(); +template <> +int DecimalToString::DecimalLength(hugeint_t value, uint8_t width, uint8_t scale); - FormatDecimal(value, width, scale, dst, length); +template <> +string_t DecimalToString::Format(hugeint_t value, uint8_t width, uint8_t scale, Vector &vector); - result.Finalize(); - return result; - } -}; +template <> +void DecimalToString::FormatDecimal(hugeint_t value, uint8_t width, uint8_t scale, char *dst, idx_t len); struct UhugeintToStringCast { static string_t Format(uhugeint_t value, Vector &vector) { @@ -416,9 +245,9 @@ struct DateToStringCast { struct TimeToStringCast { //! Format microseconds to a buffer of length 6. Returns the number of trailing zeros - static int32_t FormatMicros(uint32_t microseconds, char micro_buffer[]) { + static int32_t FormatMicros(int32_t microseconds, char micro_buffer[]) { char *endptr = micro_buffer + 6; - endptr = NumericHelper::FormatUnsigned(microseconds, endptr); + endptr = NumericHelper::FormatUnsigned(microseconds, endptr); while (endptr > micro_buffer) { *--endptr = '0'; } @@ -447,7 +276,7 @@ struct TimeToStringCast { // we write backwards and pad with zeros to the left // now we figure out how many digits we need to include by looking backwards // and checking how many zeros we encounter - length -= FormatMicros(time[3], micro_buffer); + length -= NumericCast(FormatMicros(time[3], micro_buffer)); } return length; } @@ -484,8 +313,8 @@ struct TimeToStringCast { struct IntervalToStringCast { static void FormatSignedNumber(int64_t value, char buffer[], idx_t &length) { int sign = -(value < 0); - uint64_t unsigned_value = (value ^ sign) - sign; - length += NumericHelper::UnsignedLength(unsigned_value) - sign; + auto unsigned_value = NumericCast((value ^ sign) - sign); + length += NumericCast(NumericHelper::UnsignedLength(unsigned_value) - sign); auto endptr = buffer + length; endptr = NumericHelper::FormatUnsigned(unsigned_value, endptr); if (sign) { @@ -566,9 +395,8 @@ struct IntervalToStringCast { FormatTwoDigits(sec, buffer, length); if (micros != 0) { buffer[length++] = '.'; - auto trailing_zeros = - TimeToStringCast::FormatMicros(UnsafeNumericCast(micros), buffer + length); - length += 6 - trailing_zeros; + auto trailing_zeros = TimeToStringCast::FormatMicros(NumericCast(micros), buffer + length); + length += NumericCast(6 - trailing_zeros); } } else if (length == 0) { // empty interval: default to 00:00:00 diff --git a/src/duckdb/src/include/duckdb/common/types/datetime.hpp b/src/duckdb/src/include/duckdb/common/types/datetime.hpp index 4a06e1b7..ec231570 100644 --- a/src/duckdb/src/include/duckdb/common/types/datetime.hpp +++ b/src/duckdb/src/include/duckdb/common/types/datetime.hpp @@ -1,6 +1,7 @@ #pragma once #include "duckdb/common/common.hpp" +#include "duckdb/common/numeric_utils.hpp" #include @@ -57,10 +58,10 @@ struct dtime_t { // NOLINT return dtime_t(this->micros - micros); }; inline dtime_t operator*(const idx_t &copies) const { - return dtime_t(this->micros * copies); + return dtime_t(this->micros * UnsafeNumericCast(copies)); }; inline dtime_t operator/(const idx_t &copies) const { - return dtime_t(this->micros / copies); + return dtime_t(this->micros / UnsafeNumericCast(copies)); }; inline int64_t operator-(const dtime_t &other) const { return this->micros - other.micros; @@ -92,23 +93,47 @@ struct dtime_tz_t { // NOLINT static constexpr const uint64_t OFFSET_MASK = ~uint64_t(0) >> TIME_BITS; static constexpr const int32_t MAX_OFFSET = 16 * 60 * 60 - 1; // ±15:59:59 static constexpr const int32_t MIN_OFFSET = -MAX_OFFSET; + static constexpr const uint64_t OFFSET_MICROS = 1000000; uint64_t bits; + // Offsets are reverse ordered e.g., 13:00:00+01 < 12:00:00+00 < 11:00:00-01 + // Because we encode them as the low order bits, + // they are also biased into an unsigned integer: (-16, 16) => (32, 0) + static inline uint64_t encode_offset(int32_t offset) { // NOLINT + return uint64_t(MAX_OFFSET - offset); + } + static inline int32_t decode_offset(uint64_t bits) { // NOLINT + return MAX_OFFSET - int32_t(bits & OFFSET_MASK); + } + + static inline uint64_t encode_micros(int64_t micros) { // NOLINT + return uint64_t(micros) << OFFSET_BITS; + } + static inline int64_t decode_micros(uint64_t bits) { // NOLINT + return int64_t(bits >> OFFSET_BITS); + } + dtime_tz_t() = default; - inline dtime_tz_t(dtime_t t, int32_t offset) - : bits((uint64_t(t.micros) << OFFSET_BITS) | uint64_t(MAX_OFFSET - offset)) { + inline dtime_tz_t(dtime_t t, int32_t offset) : bits(encode_micros(t.micros) | encode_offset(offset)) { } explicit inline dtime_tz_t(uint64_t bits_p) : bits(bits_p) { } inline dtime_t time() const { // NOLINT - return dtime_t(bits >> OFFSET_BITS); + return dtime_t(decode_micros(bits)); } inline int32_t offset() const { // NOLINT - return MAX_OFFSET - int32_t(bits & OFFSET_MASK); + return decode_offset(bits); + } + + // Times are compared after adjusting to offset +00:00:00, e.g., 13:01:00+01 > 12:00:00+00 + // Because we encode them as the high order bits, + // they are biased by the maximum offset: (0, 24) => (0, 56) + inline uint64_t sort_key() const { // NOLINT + return bits + encode_micros((bits & OFFSET_MASK) * OFFSET_MICROS); } // comparison operators @@ -119,16 +144,16 @@ struct dtime_tz_t { // NOLINT return bits != rhs.bits; }; inline bool operator<=(const dtime_tz_t &rhs) const { - return bits <= rhs.bits; + return sort_key() <= rhs.sort_key(); }; inline bool operator<(const dtime_tz_t &rhs) const { - return bits < rhs.bits; + return sort_key() < rhs.sort_key(); }; inline bool operator>(const dtime_tz_t &rhs) const { - return bits > rhs.bits; + return sort_key() > rhs.sort_key(); }; inline bool operator>=(const dtime_tz_t &rhs) const { - return bits >= rhs.bits; + return sort_key() >= rhs.sort_key(); }; }; @@ -149,7 +174,7 @@ template <> struct hash { std::size_t operator()(const duckdb::dtime_tz_t &k) const { using std::hash; - return hash()(k.bits); + return hash()(k.bits); } }; } // namespace std diff --git a/src/duckdb/src/include/duckdb/common/types/hash.hpp b/src/duckdb/src/include/duckdb/common/types/hash.hpp index 11ec5f71..b213f249 100644 --- a/src/duckdb/src/include/duckdb/common/types/hash.hpp +++ b/src/duckdb/src/include/duckdb/common/types/hash.hpp @@ -35,7 +35,7 @@ inline hash_t MurmurHash32(uint32_t x) { template hash_t Hash(T value) { - return MurmurHash32(value); + return MurmurHash32(static_cast(value)); } //! Combine two hashes by XORing them diff --git a/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp b/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp index 85496e4d..cf6ee276 100644 --- a/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp +++ b/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp @@ -32,7 +32,9 @@ struct TupleDataChunkPart { TupleDataChunkPart(TupleDataChunkPart &&other) noexcept; TupleDataChunkPart &operator=(TupleDataChunkPart &&) noexcept; - static constexpr const uint32_t INVALID_INDEX = (uint32_t)-1; +public: + //! Mark heap as empty + void SetHeapEmpty(); public: //! Index/offset of the row block @@ -48,6 +50,10 @@ struct TupleDataChunkPart { uint32_t count; //! Lock for recomputing heap pointers (owned by TupleDataChunk) reference lock; + +private: + //! Marker for empty heaps + static constexpr const uint32_t INVALID_INDEX = (uint32_t)-1; }; struct TupleDataChunk { diff --git a/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp b/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp index db6d6e9b..969c7856 100644 --- a/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +++ b/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp @@ -71,7 +71,7 @@ struct SelectionVector { sel_vector = sel; } void Initialize(idx_t count = STANDARD_VECTOR_SIZE) { - selection_data = make_shared(count); + selection_data = make_shared_ptr(count); sel_vector = selection_data->owned_data.get(); } void Initialize(buffer_ptr data) { diff --git a/src/duckdb/src/include/duckdb/common/types/string_type.hpp b/src/duckdb/src/include/duckdb/common/types/string_type.hpp index 1ec8bdc8..c9155c59 100644 --- a/src/duckdb/src/include/duckdb/common/types/string_type.hpp +++ b/src/duckdb/src/include/duckdb/common/types/string_type.hpp @@ -12,6 +12,7 @@ #include "duckdb/common/constants.hpp" #include "duckdb/common/helper.hpp" #include "duckdb/common/numeric_utils.hpp" +#include "duckdb/common/limits.hpp" #include #include @@ -26,6 +27,7 @@ struct string_t { static constexpr idx_t PREFIX_BYTES = 4 * sizeof(char); static constexpr idx_t INLINE_BYTES = 12 * sizeof(char); static constexpr idx_t HEADER_SIZE = sizeof(uint32_t) + PREFIX_BYTES; + static constexpr idx_t MAX_STRING_SIZE = NumericLimits::Maximum(); #ifndef DUCKDB_DEBUG_NO_INLINE static constexpr idx_t PREFIX_LENGTH = PREFIX_BYTES; static constexpr idx_t INLINE_LENGTH = INLINE_BYTES; diff --git a/src/duckdb/src/include/duckdb/common/types/timestamp.hpp b/src/duckdb/src/include/duckdb/common/types/timestamp.hpp index 526b5a44..a77d2896 100644 --- a/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +++ b/src/duckdb/src/include/duckdb/common/types/timestamp.hpp @@ -158,6 +158,8 @@ class Timestamp { DUCKDB_API static int64_t GetEpochMicroSeconds(timestamp_t timestamp); //! Convert a timestamp to epoch (in nanoseconds) DUCKDB_API static int64_t GetEpochNanoSeconds(timestamp_t timestamp); + //! Convert a timestamp to a rounded epoch at a given resolution. + DUCKDB_API static int64_t GetEpochRounded(timestamp_t timestamp, const int64_t power_of_ten); //! Convert a timestamp to a Julian Day DUCKDB_API static double GetJulianDay(timestamp_t timestamp); diff --git a/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp b/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp index b7dd548c..fce5f0d1 100644 --- a/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +++ b/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp @@ -19,7 +19,7 @@ struct ValidityMask; template struct TemplatedValidityData { static constexpr const int BITS_PER_VALUE = sizeof(V) * 8; - static constexpr const V MAX_ENTRY = ~V(0); + static constexpr const V MAX_ENTRY = V(~V(0)); public: inline explicit TemplatedValidityData(idx_t count) { diff --git a/src/duckdb/src/include/duckdb/common/types/value.hpp b/src/duckdb/src/include/duckdb/common/types/value.hpp index 0328ee6f..a59481df 100644 --- a/src/duckdb/src/include/duckdb/common/types/value.hpp +++ b/src/duckdb/src/include/duckdb/common/types/value.hpp @@ -17,6 +17,7 @@ #include "duckdb/common/types/date.hpp" #include "duckdb/common/types/datetime.hpp" #include "duckdb/common/types/interval.hpp" +#include "duckdb/common/shared_ptr.hpp" namespace duckdb { @@ -176,6 +177,9 @@ class Value { //! Create a map value with the given entries DUCKDB_API static Value MAP(const LogicalType &key_type, const LogicalType &value_type, vector keys, vector values); + //! Create a map value from a set of key-value pairs + DUCKDB_API static Value MAP(const unordered_map &kv_pairs); + //! Create a union value from a selected value and a tag from a set of alternatives. DUCKDB_API static Value UNION(child_list_t members, uint8_t tag, Value value); diff --git a/src/duckdb/src/include/duckdb/common/types/vector.hpp b/src/duckdb/src/include/duckdb/common/types/vector.hpp index b0786597..599be03a 100644 --- a/src/duckdb/src/include/duckdb/common/types/vector.hpp +++ b/src/duckdb/src/include/duckdb/common/types/vector.hpp @@ -19,6 +19,11 @@ namespace duckdb { +class VectorCache; +class VectorStructBuffer; +class VectorListBuffer; +struct SelCache; + struct UnifiedVectorFormat { DUCKDB_API UnifiedVectorFormat(); // disable copy constructors @@ -49,11 +54,17 @@ struct RecursiveUnifiedVectorFormat { LogicalType logical_type; }; -class VectorCache; -class VectorStructBuffer; -class VectorListBuffer; +//! This is a helper data structure. It contains all fields necessary to resize a vector. +struct ResizeInfo { + ResizeInfo(Vector &vec, data_ptr_t data, optional_ptr buffer, const idx_t multiplier) + : vec(vec), data(data), buffer(buffer), multiplier(multiplier) { + } -struct SelCache; + Vector &vec; + data_ptr_t data; + optional_ptr buffer; + idx_t multiplier; +}; struct ConsecutiveChildListInfo { ConsecutiveChildListInfo() : is_constant(true), needs_slicing(false), child_list_info(list_entry_t(0, 0)) { @@ -63,7 +74,7 @@ struct ConsecutiveChildListInfo { list_entry_t child_list_info; }; -//! Vector of values of a specified PhysicalType. +//! Vector of values of a specified PhysicalType. class Vector { friend struct ConstantVector; friend struct DictionaryVector; @@ -185,8 +196,10 @@ class Vector { data = other.data; } - //! This functions resizes the vector + //! Resizes the vector. DUCKDB_API void Resize(idx_t cur_size, idx_t new_size); + //! Returns a vector of ResizeInfo containing each (nested) vector to resize. + DUCKDB_API void FindResizeInfos(vector &resize_infos, const idx_t multiplier); DUCKDB_API void Serialize(Serializer &serializer, idx_t count); DUCKDB_API void Deserialize(Deserializer &deserializer, idx_t count); @@ -464,15 +477,7 @@ struct FSSTVector { DUCKDB_API static idx_t GetCount(Vector &vector); }; -enum class MapInvalidReason : uint8_t { - VALID, - NULL_KEY_LIST, - NULL_KEY, - DUPLICATE_KEY, - NULL_VALUE_LIST, - NOT_ALIGNED, - INVALID_PARAMS -}; +enum class MapInvalidReason : uint8_t { VALID, NULL_KEY, DUPLICATE_KEY, NOT_ALIGNED, INVALID_PARAMS }; struct MapVector { DUCKDB_API static const Vector &GetKeys(const Vector &vector); diff --git a/src/duckdb/src/include/duckdb/common/unique_ptr.hpp b/src/duckdb/src/include/duckdb/common/unique_ptr.hpp index d9f0b835..0689aeb6 100644 --- a/src/duckdb/src/include/duckdb/common/unique_ptr.hpp +++ b/src/duckdb/src/include/duckdb/common/unique_ptr.hpp @@ -9,11 +9,12 @@ namespace duckdb { -template , bool SAFE = true> -class unique_ptr : public std::unique_ptr { // NOLINT: naming +template , bool SAFE = true> +class unique_ptr : public std::unique_ptr { // NOLINT: naming public: - using original = std::unique_ptr; + using original = std::unique_ptr; using original::original; // NOLINT + using pointer = typename original::pointer; private: static inline void AssertNotNull(const bool null) { @@ -53,9 +54,9 @@ class unique_ptr : public std::unique_ptr { // NOLINT } }; -template -class unique_ptr - : public std::unique_ptr> { +// FIXME: DELETER is defined, but we use std::default_delete??? +template +class unique_ptr : public std::unique_ptr> { public: using original = std::unique_ptr>; using original::original; diff --git a/src/duckdb/src/include/duckdb/common/vector.hpp b/src/duckdb/src/include/duckdb/common/vector.hpp index 4d64675e..676adac2 100644 --- a/src/duckdb/src/include/duckdb/common/vector.hpp +++ b/src/duckdb/src/include/duckdb/common/vector.hpp @@ -100,6 +100,17 @@ class vector : public std::vector> { // NOL } return get(original::size() - 1); } + + void unsafe_erase_at(idx_t idx) { // NOLINT: not using camelcase on purpose here + original::erase(original::begin() + static_cast(idx)); + } + + void erase_at(idx_t idx) { // NOLINT: not using camelcase on purpose here + if (MemorySafety::ENABLED && idx > original::size()) { + throw InternalException("Can't remove offset %d from vector of size %d", idx, original::size()); + } + unsafe_erase_at(idx); + } }; template diff --git a/src/duckdb/src/include/duckdb/common/vector_size.hpp b/src/duckdb/src/include/duckdb/common/vector_size.hpp index 0fa29086..3eb73b36 100644 --- a/src/duckdb/src/include/duckdb/common/vector_size.hpp +++ b/src/duckdb/src/include/duckdb/common/vector_size.hpp @@ -13,7 +13,7 @@ namespace duckdb { //! The default standard vector size -#define DEFAULT_STANDARD_VECTOR_SIZE 2048 +#define DEFAULT_STANDARD_VECTOR_SIZE 2048U //! The vector size used in the execution engine #ifndef STANDARD_VECTOR_SIZE diff --git a/src/duckdb/src/include/duckdb/common/weak_ptr.ipp b/src/duckdb/src/include/duckdb/common/weak_ptr.ipp new file mode 100644 index 00000000..076fde95 --- /dev/null +++ b/src/duckdb/src/include/duckdb/common/weak_ptr.ipp @@ -0,0 +1,117 @@ +namespace duckdb { + +template +class weak_ptr { // NOLINT: invalid case style +public: + using original = std::weak_ptr; + using element_type = typename original::element_type; + +private: + template + friend class shared_ptr; + +private: + original internal; + +public: + // Constructors + weak_ptr() : internal() { + } + + // NOLINTBEGIN + template ::value, int>::type = 0> + weak_ptr(shared_ptr const &ptr) noexcept : internal(ptr.internal) { + } + weak_ptr(weak_ptr const &other) noexcept : internal(other.internal) { + } + template ::value, int>::type = 0> + weak_ptr(weak_ptr const &ptr) noexcept : internal(ptr.internal) { + } +#ifdef DUCKDB_CLANG_TIDY + [[clang::reinitializes]] +#endif + weak_ptr(weak_ptr &&ptr) noexcept + : internal(std::move(ptr.internal)) { + } + template ::value, int>::type = 0> +#ifdef DUCKDB_CLANG_TIDY + [[clang::reinitializes]] +#endif + weak_ptr(weak_ptr &&ptr) noexcept + : internal(std::move(ptr.internal)) { + } + // NOLINTEND + // Destructor + ~weak_ptr() = default; + + // Assignment operators + weak_ptr &operator=(const weak_ptr &other) { + if (this == &other) { + return *this; + } + internal = other.internal; + return *this; + } + + template ::value, int>::type = 0> + weak_ptr &operator=(const shared_ptr &ptr) { + internal = ptr.internal; + return *this; + } + + // Modifiers +#ifdef DUCKDB_CLANG_TIDY + // This is necessary to tell clang-tidy that it reinitializes the variable after a move + [[clang::reinitializes]] +#endif + void + reset() { // NOLINT: invalid case style + internal.reset(); + } + + // Observers + long use_count() const { // NOLINT: invalid case style + return internal.use_count(); + } + + bool expired() const { // NOLINT: invalid case style + return internal.expired(); + } + + shared_ptr lock() const { // NOLINT: invalid case style + return shared_ptr(internal.lock()); + } + + // Relational operators + template + bool operator==(const weak_ptr &other) const noexcept { + return internal == other.internal; + } + + template + bool operator!=(const weak_ptr &other) const noexcept { + return internal != other.internal; + } + + template + bool operator<(const weak_ptr &other) const noexcept { + return internal < other.internal; + } + + template + bool operator<=(const weak_ptr &other) const noexcept { + return internal <= other.internal; + } + + template + bool operator>(const weak_ptr &other) const noexcept { + return internal > other.internal; + } + + template + bool operator>=(const weak_ptr &other) const noexcept { + return internal >= other.internal; + } +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp b/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp index 355701bd..562f61ad 100644 --- a/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp +++ b/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp @@ -61,7 +61,7 @@ struct RegularAdd { template static void AddConstant(STATE &state, T input, idx_t count) { - state.value += input * count; + state.value += input * int64_t(count); } }; @@ -73,7 +73,7 @@ struct HugeintAdd { template static void AddConstant(STATE &state, T input, idx_t count) { - AddNumber(state, Hugeint::Multiply(input, count)); + AddNumber(state, Hugeint::Multiply(input, UnsafeNumericCast(count))); } }; @@ -135,7 +135,7 @@ struct AddToHugeint { AddValue(state.value, uint64_t(input), input >= 0); } } else { - hugeint_t addition = hugeint_t(input) * count; + hugeint_t addition = hugeint_t(input) * Hugeint::Convert(count); state.value += addition; } } diff --git a/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp b/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp index 2074da5f..2c488fb3 100644 --- a/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +++ b/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp @@ -435,6 +435,15 @@ struct TimezoneMinuteFun { static ScalarFunctionSet GetFunctions(); }; +struct TimeTZSortKeyFun { + static constexpr const char *Name = "timetz_byte_comparable"; + static constexpr const char *Parameters = "time_tz"; + static constexpr const char *Description = "Converts a TIME WITH TIME ZONE to an integer sort key"; + static constexpr const char *Example = "timetz_byte_comparable('18:18:16.21-07:00'::TIME_TZ)"; + + static ScalarFunction GetFunction(); +}; + struct ToCenturiesFun { static constexpr const char *Name = "to_centuries"; static constexpr const char *Parameters = "integer"; @@ -516,6 +525,15 @@ struct ToMonthsFun { static ScalarFunction GetFunction(); }; +struct ToQuartersFun { + static constexpr const char *Name = "to_quarters"; + static constexpr const char *Parameters = "integer"; + static constexpr const char *Description = "Construct a quarter interval"; + static constexpr const char *Example = "to_quarters(5)"; + + static ScalarFunction GetFunction(); +}; + struct ToSecondsFun { static constexpr const char *Name = "to_seconds"; static constexpr const char *Parameters = "double"; diff --git a/src/duckdb/src/include/duckdb/execution/adaptive_filter.hpp b/src/duckdb/src/include/duckdb/execution/adaptive_filter.hpp index 61bd50c0..f93891b9 100644 --- a/src/duckdb/src/include/duckdb/execution/adaptive_filter.hpp +++ b/src/duckdb/src/include/duckdb/execution/adaptive_filter.hpp @@ -9,6 +9,7 @@ #pragma once #include "duckdb/planner/expression/list.hpp" +#include "duckdb/planner/table_filter.hpp" #include namespace duckdb { diff --git a/src/duckdb/src/include/duckdb/execution/expression_executor.hpp b/src/duckdb/src/include/duckdb/execution/expression_executor.hpp index 804c6f25..80c380d6 100644 --- a/src/duckdb/src/include/duckdb/execution/expression_executor.hpp +++ b/src/duckdb/src/include/duckdb/execution/expression_executor.hpp @@ -20,7 +20,7 @@ class ExecutionContext; //! ExpressionExecutor is responsible for executing a set of expressions and storing the result in a data chunk class ExpressionExecutor { - friend class Index; + friend class BoundIndex; friend class CreateIndexLocalSinkState; public: diff --git a/src/duckdb/src/include/duckdb/execution/index/art/art.hpp b/src/duckdb/src/include/duckdb/execution/index/art/art.hpp index 8a4daf65..07a03180 100644 --- a/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +++ b/src/duckdb/src/include/duckdb/execution/index/art/art.hpp @@ -8,7 +8,7 @@ #pragma once -#include "duckdb/storage/index.hpp" +#include "duckdb/execution/index/bound_index.hpp" #include "duckdb/execution/index/art/node.hpp" #include "duckdb/common/array.hpp" @@ -31,7 +31,7 @@ struct ARTFlags { vector merge_buffer_counts; }; -class ART : public Index { +class ART : public BoundIndex { public: // Index type name for the ART static constexpr const char *TYPE_NAME = "ART"; @@ -64,7 +64,7 @@ class ART : public Index { public: //! Create a index instance of this type - static unique_ptr Create(CreateIndexInput &input) { + static unique_ptr Create(CreateIndexInput &input) { auto art = make_uniq(input.name, input.constraint_type, input.column_ids, input.table_io_manager, input.unbound_expressions, input.db, nullptr, input.storage_info); return std::move(art); @@ -96,7 +96,7 @@ class ART : public Index { //! Merge another index into this index. The lock obtained from InitializeLock must be held, and the other //! index must also be locked during the merge - bool MergeIndexes(IndexLock &state, Index &other_index) override; + bool MergeIndexes(IndexLock &state, BoundIndex &other_index) override; //! Traverses an ART and vacuums the qualifying nodes. The lock obtained from InitializeLock must be held void Vacuum(IndexLock &state) override; diff --git a/src/duckdb/src/include/duckdb/execution/index/art/node.hpp b/src/duckdb/src/include/duckdb/execution/index/art/node.hpp index 2e170d41..34e2498d 100644 --- a/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +++ b/src/duckdb/src/include/duckdb/execution/index/art/node.hpp @@ -117,7 +117,7 @@ class Node : public IndexPointer { } //! Set the row ID (8th to 63rd bit) inline void SetRowId(const row_t row_id) { - Set((Get() & AND_METADATA) | row_id); + Set((Get() & AND_METADATA) | UnsafeNumericCast(row_id)); } //! Returns the type of the node, which is held in the metadata diff --git a/src/duckdb/src/include/duckdb/execution/index/bound_index.hpp b/src/duckdb/src/include/duckdb/execution/index/bound_index.hpp new file mode 100644 index 00000000..20e26891 --- /dev/null +++ b/src/duckdb/src/include/duckdb/execution/index/bound_index.hpp @@ -0,0 +1,145 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/storage/index.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/common/enums/index_constraint_type.hpp" +#include "duckdb/common/types/constraint_conflict_info.hpp" +#include "duckdb/common/types/data_chunk.hpp" +#include "duckdb/common/unordered_set.hpp" +#include "duckdb/execution/expression_executor.hpp" +#include "duckdb/parser/parsed_expression.hpp" +#include "duckdb/planner/expression.hpp" +#include "duckdb/storage/table_storage_info.hpp" +#include "duckdb/storage/index.hpp" + +namespace duckdb { + +class ClientContext; +class TableIOManager; +class Transaction; +class ConflictManager; + +struct IndexLock; +struct IndexScanState; + +//! The index is an abstract base class that serves as the basis for indexes +class BoundIndex : public Index { +public: + BoundIndex(const string &name, const string &index_type, IndexConstraintType index_constraint_type, + const vector &column_ids, TableIOManager &table_io_manager, + const vector> &unbound_expressions, AttachedDatabase &db); + + //! The physical types stored in the index + vector types; + //! The logical types of the expressions + vector logical_types; + + //! The name of the index + string name; + //! The index type (ART, B+-tree, Skip-List, ...) + string index_type; + //! The index constraint type + IndexConstraintType index_constraint_type; + +public: + bool IsBound() const override { + return true; + } + + const string &GetIndexType() const override { + return index_type; + } + + const string &GetIndexName() const override { + return name; + } + + IndexConstraintType GetConstraintType() const override { + return index_constraint_type; + } + +public: // Index interface + //! Obtain a lock on the index + void InitializeLock(IndexLock &state); + //! Called when data is appended to the index. The lock obtained from InitializeLock must be held + virtual ErrorData Append(IndexLock &state, DataChunk &entries, Vector &row_identifiers) = 0; + //! Obtains a lock and calls Append while holding that lock + ErrorData Append(DataChunk &entries, Vector &row_identifiers); + //! Verify that data can be appended to the index without a constraint violation + virtual void VerifyAppend(DataChunk &chunk) = 0; + //! Verify that data can be appended to the index without a constraint violation using the conflict manager + virtual void VerifyAppend(DataChunk &chunk, ConflictManager &conflict_manager) = 0; + //! Performs constraint checking for a chunk of input data + virtual void CheckConstraintsForChunk(DataChunk &input, ConflictManager &conflict_manager) = 0; + + //! Deletes all data from the index. The lock obtained from InitializeLock must be held + virtual void CommitDrop(IndexLock &index_lock) = 0; + //! Deletes all data from the index + void CommitDrop() override; + //! Delete a chunk of entries from the index. The lock obtained from InitializeLock must be held + virtual void Delete(IndexLock &state, DataChunk &entries, Vector &row_identifiers) = 0; + //! Obtains a lock and calls Delete while holding that lock + void Delete(DataChunk &entries, Vector &row_identifiers); + + //! Insert a chunk of entries into the index + virtual ErrorData Insert(IndexLock &lock, DataChunk &input, Vector &row_identifiers) = 0; + + //! Merge another index into this index. The lock obtained from InitializeLock must be held, and the other + //! index must also be locked during the merge + virtual bool MergeIndexes(IndexLock &state, BoundIndex &other_index) = 0; + //! Obtains a lock and calls MergeIndexes while holding that lock + bool MergeIndexes(BoundIndex &other_index); + + //! Traverses an ART and vacuums the qualifying nodes. The lock obtained from InitializeLock must be held + virtual void Vacuum(IndexLock &state) = 0; + //! Obtains a lock and calls Vacuum while holding that lock + void Vacuum(); + + //! Returns the in-memory usage of the index. The lock obtained from InitializeLock must be held + virtual idx_t GetInMemorySize(IndexLock &state) = 0; + //! Returns the in-memory usage of the index + idx_t GetInMemorySize(); + + //! Returns the string representation of an index, or only traverses and verifies the index + virtual string VerifyAndToString(IndexLock &state, const bool only_verify) = 0; + //! Obtains a lock and calls VerifyAndToString while holding that lock + string VerifyAndToString(const bool only_verify); + + //! Returns true if the index is affected by updates on the specified column IDs, and false otherwise + bool IndexIsUpdated(const vector &column_ids) const; + + //! Returns all index storage information for serialization + virtual IndexStorageInfo GetStorageInfo(const bool get_buffers); + + //! Execute the index expressions on an input chunk + void ExecuteExpressions(DataChunk &input, DataChunk &result); + static string AppendRowError(DataChunk &input, idx_t index); + + //! Throw a constraint violation exception + virtual string GetConstraintViolationMessage(VerifyExistenceType verify_type, idx_t failed_index, + DataChunk &input) = 0; + + vector> unbound_expressions; + +protected: + //! Lock used for any changes to the index + mutex lock; + + //! Bound expressions used during expression execution + vector> bound_expressions; + +private: + //! Expression executor to execute the index expressions + ExpressionExecutor executor; + + //! Bind the unbound expressions of the index + unique_ptr BindExpression(unique_ptr expr); +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/execution/index/index_type.hpp b/src/duckdb/src/include/duckdb/execution/index/index_type.hpp index a2eb16d2..3417b15e 100644 --- a/src/duckdb/src/include/duckdb/execution/index/index_type.hpp +++ b/src/duckdb/src/include/duckdb/execution/index/index_type.hpp @@ -17,7 +17,7 @@ namespace duckdb { -class Index; +class BoundIndex; enum class IndexConstraintType : uint8_t; class Expression; class TableIOManager; @@ -43,7 +43,7 @@ struct CreateIndexInput { options(options) {}; }; -typedef unique_ptr (*index_create_function_t)(CreateIndexInput &input); +typedef unique_ptr (*index_create_function_t)(CreateIndexInput &input); //! A index "type" class IndexType { public: diff --git a/src/duckdb/src/include/duckdb/execution/index/unbound_index.hpp b/src/duckdb/src/include/duckdb/execution/index/unbound_index.hpp new file mode 100644 index 00000000..1c7f859e --- /dev/null +++ b/src/duckdb/src/include/duckdb/execution/index/unbound_index.hpp @@ -0,0 +1,63 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/execution/index/unbound_index.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/storage/index.hpp" +#include "duckdb/parser/parsed_data/create_index_info.hpp" + +namespace duckdb { + +class UnboundIndex final : public Index { +private: + // The create info of the index + unique_ptr create_info; + + // The serialized storage info of the index + IndexStorageInfo storage_info; + +public: + UnboundIndex(unique_ptr create_info, IndexStorageInfo storage_info, TableIOManager &table_io_manager, + AttachedDatabase &db); + + bool IsBound() const override { + return false; + } + + const string &GetIndexType() const override { + return GetCreateInfo().index_type; + } + + const string &GetIndexName() const override { + return GetCreateInfo().index_name; + } + + IndexConstraintType GetConstraintType() const override { + return GetCreateInfo().constraint_type; + } + + const CreateIndexInfo &GetCreateInfo() const { + return create_info->Cast(); + } + + const IndexStorageInfo &GetStorageInfo() const { + return storage_info; + } + + const vector> &GetParsedExpressions() const { + return GetCreateInfo().parsed_expressions; + } + + const string &GetTableName() const { + return GetCreateInfo().table; + } + + void CommitDrop() override; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/execution/merge_sort_tree.hpp b/src/duckdb/src/include/duckdb/execution/merge_sort_tree.hpp index 6ce3048b..825c05f8 100644 --- a/src/duckdb/src/include/duckdb/execution/merge_sort_tree.hpp +++ b/src/duckdb/src/include/duckdb/execution/merge_sort_tree.hpp @@ -349,7 +349,7 @@ idx_t MergeSortTree::SelectNth(const SubFrames &frames, idx_t n // The first level contains a single run, // so the only thing we need is any cascading pointers auto level_no = tree.size() - 2; - auto level_width = 1; + idx_t level_width = 1; for (idx_t i = 0; i < level_no; ++i) { level_width *= FANOUT; } @@ -367,9 +367,11 @@ idx_t MergeSortTree::SelectNth(const SubFrames &frames, idx_t n for (idx_t f = 0; f < frames.size(); ++f) { const auto &frame = frames[f]; auto &cascade_idx = cascades[f]; - const auto lower_idx = std::lower_bound(level.begin(), level.end(), frame.start) - level.begin(); + const auto lower_idx = + UnsafeNumericCast(std::lower_bound(level.begin(), level.end(), frame.start) - level.begin()); cascade_idx.first = lower_idx / CASCADING * FANOUT; - const auto upper_idx = std::lower_bound(level.begin(), level.end(), frame.end) - level.begin(); + const auto upper_idx = + UnsafeNumericCast(std::lower_bound(level.begin(), level.end(), frame.end) - level.begin()); cascade_idx.second = upper_idx / CASCADING * FANOUT; } @@ -390,11 +392,13 @@ idx_t MergeSortTree::SelectNth(const SubFrames &frames, idx_t n const auto lower_begin = level_data + level_cascades[cascade_idx.first]; const auto lower_end = level_data + level_cascades[cascade_idx.first + FANOUT]; - match.first = std::lower_bound(lower_begin, lower_end, frame.start) - level_data; + match.first = + UnsafeNumericCast(std::lower_bound(lower_begin, lower_end, frame.start) - level_data); const auto upper_begin = level_data + level_cascades[cascade_idx.second]; const auto upper_end = level_data + level_cascades[cascade_idx.second + FANOUT]; - match.second = std::lower_bound(upper_begin, upper_end, frame.end) - level_data; + match.second = + UnsafeNumericCast(std::lower_bound(upper_begin, upper_end, frame.end) - level_data); matched += idx_t(match.second - match.first); } @@ -426,8 +430,8 @@ idx_t MergeSortTree::SelectNth(const SubFrames &frames, idx_t n // Continue with the uncascaded levels (except the first) for (; level_no > 0; --level_no) { const auto &level = tree[level_no].first; - auto range_begin = level.begin() + result * level_width; - auto range_end = range_begin + level_width; + auto range_begin = level.begin() + UnsafeNumericCast(result * level_width); + auto range_end = range_begin + UnsafeNumericCast(level_width); while (range_end < level.end()) { idx_t matched = 0; for (idx_t f = 0; f < frames.size(); ++f) { @@ -443,7 +447,7 @@ idx_t MergeSortTree::SelectNth(const SubFrames &frames, idx_t n } // Not enough in this child, so move right range_begin = range_end; - range_end += level_width; + range_end += UnsafeNumericCast(level_width); ++result; n -= matched; } @@ -511,8 +515,8 @@ void MergeSortTree::AggregateLowerBound(const idx_t lower, cons entry.first = run_idx.first * level_width; entry.second = std::min(entry.first + level_width, static_cast(tree[0].first.size())); auto *level_data = tree[level].first.data(); - idx_t entry_idx = - std::lower_bound(level_data + entry.first, level_data + entry.second, needle) - level_data; + auto entry_idx = NumericCast( + std::lower_bound(level_data + entry.first, level_data + entry.second, needle) - level_data); cascading_idx.first = cascading_idx.second = (entry_idx / CASCADING + 2 * (entry.first / level_width)) * FANOUT; @@ -541,7 +545,7 @@ void MergeSortTree::AggregateLowerBound(const idx_t lower, cons const auto run_pos = std::lower_bound(search_begin, search_end, needle) - level_data; // Compute runBegin and pass it to our callback const auto run_begin = curr.first - level_width; - aggregate(level, run_begin, run_pos); + aggregate(level, run_begin, NumericCast(run_pos)); // Update state for next round curr.first -= level_width; --cascading_idx.first; @@ -550,7 +554,7 @@ void MergeSortTree::AggregateLowerBound(const idx_t lower, cons if (curr.first != lower) { const auto *search_begin = level_data + cascading_idcs[cascading_idx.first]; const auto *search_end = level_data + cascading_idcs[cascading_idx.first + FANOUT]; - auto idx = std::lower_bound(search_begin, search_end, needle) - level_data; + auto idx = NumericCast(std::lower_bound(search_begin, search_end, needle) - level_data); cascading_idx.first = (idx / CASCADING + 2 * (lower / level_width)) * FANOUT; } @@ -563,7 +567,7 @@ void MergeSortTree::AggregateLowerBound(const idx_t lower, cons const auto run_pos = std::lower_bound(search_begin, search_end, needle) - level_data; // Compute runBegin and pass it to our callback const auto run_begin = curr.second; - aggregate(level, run_begin, run_pos); + aggregate(level, run_begin, NumericCast(run_pos)); // Update state for next round curr.second += level_width; ++cascading_idx.second; @@ -572,7 +576,7 @@ void MergeSortTree::AggregateLowerBound(const idx_t lower, cons if (curr.second != upper) { const auto *search_begin = level_data + cascading_idcs[cascading_idx.second]; const auto *search_end = level_data + cascading_idcs[cascading_idx.second + FANOUT]; - auto idx = std::lower_bound(search_begin, search_end, needle) - level_data; + auto idx = NumericCast(std::lower_bound(search_begin, search_end, needle) - level_data); cascading_idx.second = (idx / CASCADING + 2 * (upper / level_width)) * FANOUT; } } while (level >= LowestCascadingLevel()); @@ -587,8 +591,9 @@ void MergeSortTree::AggregateLowerBound(const idx_t lower, cons while (curr.first - lower >= level_width) { const auto *search_end = level_data + curr.first; const auto *search_begin = search_end - level_width; - const auto run_pos = std::lower_bound(search_begin, search_end, needle) - level_data; - const auto run_begin = search_begin - level_data; + const auto run_pos = + NumericCast(std::lower_bound(search_begin, search_end, needle) - level_data); + const auto run_begin = NumericCast(search_begin - level_data); aggregate(level, run_begin, run_pos); curr.first -= level_width; } @@ -596,8 +601,9 @@ void MergeSortTree::AggregateLowerBound(const idx_t lower, cons while (upper - curr.second >= level_width) { const auto *search_begin = level_data + curr.second; const auto *search_end = search_begin + level_width; - const auto run_pos = std::lower_bound(search_begin, search_end, needle) - level_data; - const auto run_begin = search_begin - level_data; + const auto run_pos = + NumericCast(std::lower_bound(search_begin, search_end, needle) - level_data); + const auto run_begin = NumericCast(search_begin - level_data); aggregate(level, run_begin, run_pos); curr.second += level_width; } diff --git a/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp b/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp index 512950c1..938ffaf7 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp @@ -18,6 +18,8 @@ class PhysicalStreamingWindow : public PhysicalOperator { public: static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::STREAMING_WINDOW; + static bool IsStreamingFunction(unique_ptr &expr); + public: PhysicalStreamingWindow(vector types, vector> select_list, idx_t estimated_cardinality, diff --git a/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp b/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp index aad04b56..a554a46b 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp @@ -50,6 +50,8 @@ class PhysicalWindow : public PhysicalOperator { bool SupportsBatchIndex() const override; OrderPreservationType SourceOrder() const override; + double GetProgress(ClientContext &context, GlobalSourceState &gstate_p) const override; + public: // Sink interface SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override; diff --git a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp index 29a62b8e..d5acf105 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp @@ -37,9 +37,10 @@ class ScannerResult { bool escaped = false; idx_t quoted_position = 0; + CSVStateMachine &state_machine; + protected: CSVStates &states; - CSVStateMachine &state_machine; }; //! This is the base of our CSV scanners. @@ -51,10 +52,10 @@ class BaseScanner { shared_ptr csv_file_scan = nullptr, CSVIterator iterator = {}); virtual ~BaseScanner() = default; + //! Returns true if the scanner is finished bool FinishedFile(); - //! Resets the scanner - void Reset(); + //! Parses data into a output_chunk virtual ScannerResult &ParseChunk(); @@ -63,6 +64,8 @@ class BaseScanner { CSVIterator &GetIterator(); + void SetIterator(const CSVIterator &it); + idx_t GetBoundaryIndex() { return iterator.GetBoundaryIdx(); } @@ -92,6 +95,10 @@ class BaseScanner { bool ever_quoted = false; + //! Skips Notes and/or parts of the data, starting from the top. + //! notes are dirty lines on top of the file, before the actual data + void SkipCSVRows(idx_t rows_to_skip); + protected: //! Boundaries of this scanner CSVIterator iterator; diff --git a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp index ce2da960..de25f08f 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp @@ -13,6 +13,7 @@ #include "duckdb/execution/operator/csv_scanner/scanner_boundary.hpp" #include "duckdb/execution/operator/csv_scanner/string_value_scanner.hpp" #include "duckdb/execution/operator/csv_scanner/base_scanner.hpp" +#include "duckdb/common/shared_ptr.hpp" namespace duckdb { diff --git a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp index 340c42cd..5f3ef031 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp @@ -52,7 +52,7 @@ class CSVError { public: CSVError() {}; CSVError(string error_message, CSVErrorType type, idx_t column_idx, string csv_row, LinesPerBoundary error_info, - idx_t row_byte_position, int64_t byte_position, const CSVReaderOptions &reader_options, + idx_t row_byte_position, optional_idx byte_position, const CSVReaderOptions &reader_options, const string &fixes); CSVError(string error_message, CSVErrorType type, LinesPerBoundary error_info); //! Produces error messages for column name -> type mismatch. @@ -60,7 +60,7 @@ class CSVError { //! Produces error messages for casting errors static CSVError CastError(const CSVReaderOptions &options, string &column_name, string &cast_error, idx_t column_idx, string &csv_row, LinesPerBoundary error_info, idx_t row_byte_position, - int64_t byte_position, LogicalTypeId type); + optional_idx byte_position, LogicalTypeId type); //! Produces error for when the line size exceeds the maximum line size option static CSVError LineSizeError(const CSVReaderOptions &options, idx_t actual_size, LinesPerBoundary error_info, string &csv_row, idx_t byte_position); @@ -69,15 +69,15 @@ class CSVError { //! Produces error messages for unterminated quoted values static CSVError UnterminatedQuotesError(const CSVReaderOptions &options, idx_t current_column, LinesPerBoundary error_info, string &csv_row, idx_t row_byte_position, - int64_t byte_position); + optional_idx byte_position); //! Produces error messages for null_padding option is set and we have quoted new values in parallel static CSVError NullPaddingFail(const CSVReaderOptions &options, LinesPerBoundary error_info); //! Produces error for incorrect (e.g., smaller and lower than the predefined) number of columns in a CSV Line static CSVError IncorrectColumnAmountError(const CSVReaderOptions &state_machine, idx_t actual_columns, LinesPerBoundary error_info, string &csv_row, idx_t row_byte_position, - int64_t byte_position); + optional_idx byte_position); static CSVError InvalidUTF8(const CSVReaderOptions &options, idx_t current_column, LinesPerBoundary error_info, - string &csv_row, idx_t row_byte_position, int64_t byte_position); + string &csv_row, idx_t row_byte_position, optional_idx byte_position); idx_t GetBoundaryIndex() { return error_info.boundary_idx; @@ -104,7 +104,7 @@ class CSVError { //! Byte position of where the row starts idx_t row_byte_position; //! Byte Position where error occurred. - int64_t byte_position; + optional_idx byte_position; }; class CSVErrorHandler { diff --git a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp index d929fb72..2e944369 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp @@ -69,9 +69,9 @@ struct CSVReaderOptions { //! User-defined name list vector name_list; //! Types considered as candidates for auto detection ordered by descending specificity (~ from high to low) - vector auto_type_candidates = {LogicalType::VARCHAR, LogicalType::TIMESTAMP, LogicalType::DATE, - LogicalType::TIME, LogicalType::DOUBLE, LogicalType::BIGINT, - LogicalType::BOOLEAN, LogicalType::SQLNULL}; + vector auto_type_candidates = {LogicalType::VARCHAR, LogicalType::DOUBLE, LogicalType::BIGINT, + LogicalType::TIMESTAMP, LogicalType::DATE, LogicalType::TIME, + LogicalType::BOOLEAN, LogicalType::SQLNULL}; //! In case the sniffer found a mismatch error from user defined types or dialect string sniffer_user_mismatch_error; //! In case the sniffer found a mismatch error from user defined types or dialect @@ -120,10 +120,8 @@ struct CSVReaderOptions { string suffix; string write_newline; - //! The date format to use (if any is specified) - map date_format = {{LogicalTypeId::DATE, {}}, {LogicalTypeId::TIMESTAMP, {}}}; //! The date format to use for writing (if any is specified) - map write_date_format = {{LogicalTypeId::DATE, {}}, {LogicalTypeId::TIMESTAMP, {}}}; + map write_date_format = {{LogicalTypeId::DATE, Value()}, {LogicalTypeId::TIMESTAMP, Value()}}; //! Whether or not a type format is specified map has_format = {{LogicalTypeId::DATE, false}, {LogicalTypeId::TIMESTAMP, false}}; @@ -146,6 +144,9 @@ struct CSVReaderOptions { void SetDelimiter(const string &delimiter); string GetDelimiter() const; + //! If we can safely ignore errors (i.e., they are being ignored and not being stored in a rejects table) + bool IgnoreErrors() const; + NewLineIdentifier GetNewline() const; void SetNewline(const string &input); //! Set an option that is supported by both reading and writing functions, called by diff --git a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_sniffer.hpp b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_sniffer.hpp index 3bb3c9bd..59a0c721 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_sniffer.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_sniffer.hpp @@ -16,6 +16,7 @@ namespace duckdb { struct DateTimestampSniffing { bool initialized = false; + bool had_match = false; vector format; }; //! Struct to store the result of the Sniffer @@ -74,6 +75,19 @@ struct SetColumns { } }; +struct HeaderValue { + HeaderValue() : is_null(true) { + } + explicit HeaderValue(string_t value_p) { + value = value_p; + } + bool IsNull() { + return is_null; + } + bool is_null = false; + string_t value {}; +}; + //! Sniffer that detects Header, Dialect and Types of CSV Files class CSVSniffer { public: @@ -125,6 +139,10 @@ class CSVSniffer { const vector "erule_candidates, const unordered_map> "e_candidates_map, const unordered_map> &escape_candidates_map); + //! 2.1 If the user set a number of lines to skip, make sure we skip them + //! We skip from the first scanner and then apply information on the remaining scanners. + void SkipLines(vector> &csv_state_machines); + //! 3. Analyzes if dialect candidate is a good candidate to be considered, if so, it adds it to the candidates void AnalyzeDialectCandidate(unique_ptr, idx_t &rows_read, idx_t &best_consistent_rows, idx_t &prev_padding_count); @@ -142,8 +160,6 @@ class CSVSniffer { void DetectTypes(); //! Change the date format for the type to the string //! Try to cast a string value to the specified sql type - bool TryCastValue(const DialectOptions &dialect_options, const string &decimal_separator, const Value &value, - const LogicalType &sql_type); void SetDateFormat(CSVStateMachine &candidate, const string &format_specifier, const LogicalTypeId &sql_type); //! Function that initialized the necessary variables used for date and timestamp detection @@ -151,7 +167,10 @@ class CSVSniffer { const LogicalType &sql_type); //! Functions that performs detection for date and timestamp formats void DetectDateAndTimeStampFormats(CSVStateMachine &candidate, const LogicalType &sql_type, const string &separator, - Value &dummy_val); + string_t &dummy_val); + //! If a string_t value can be cast to a type + bool CanYouCastIt(const string_t value, const LogicalType &type, const DialectOptions &dialect_options, + const bool is_null, const char decimal_separator); //! Variables for Type Detection //! Format Candidates for Date and Timestamp Types @@ -164,9 +183,10 @@ class CSVSniffer { unordered_map> best_sql_types_candidates_per_column_idx; map> best_format_candidates; unique_ptr best_candidate; - vector best_header_row; + vector best_header_row; //! Variable used for sniffing date and timestamp map format_candidates; + map original_format_candidates; //! ------------------------------------------------------// //! ------------------ Type Refinement ------------------ // diff --git a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp index 9ad42fd1..cf639132 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp @@ -67,14 +67,23 @@ class FullLinePosition { unordered_map> &buffer_handles); }; +class StringValueResult; + class CurrentError { public: - CurrentError(CSVErrorType type, idx_t col_idx_p, LinePosition error_position_p) - : type(type), col_idx(col_idx_p), error_position(error_position_p) {}; - + CurrentError(CSVErrorType type, idx_t col_idx_p, idx_t chunk_idx_p, LinePosition error_position_p, + idx_t current_line_size_p) + : type(type), col_idx(col_idx_p), chunk_idx(chunk_idx_p), current_line_size(current_line_size_p), + error_position(error_position_p) {}; + //! Error Type (e.g., Cast, Wrong # of columns, ...) CSVErrorType type; + //! Column index related to the CSV File columns idx_t col_idx; + //! Column index related to the produced chunk (i.e., with projection applied) + idx_t chunk_idx; + //! Current CSV Line size in Bytes idx_t current_line_size; + //! Error Message produced string error_message; //! Exact Position where the error happened LinePosition error_position; @@ -84,12 +93,74 @@ class CurrentError { } }; +class LineError { +public: + explicit LineError(bool ignore_errors_p) : is_error_in_line(false), ignore_errors(ignore_errors_p) {}; + //! We clear up our CurrentError Vector + void Reset() { + current_errors.clear(); + is_error_in_line = false; + } + void Insert(const CSVErrorType &type, const idx_t &col_idx, const idx_t &chunk_idx, + const LinePosition &error_position, const idx_t current_line_size = 0) { + is_error_in_line = true; + if (!ignore_errors) { + // We store it for later + current_errors.push_back({type, col_idx, chunk_idx, error_position, current_line_size}); + current_errors.back().current_line_size = current_line_size; + } + } + //! Set that we currently have an error, but don't really store them + void SetError() { + is_error_in_line = true; + } + //! Dirty hack for adding cast message + void ModifyErrorMessageOfLastError(string error_message) { + D_ASSERT(!current_errors.empty() && current_errors.back().type == CSVErrorType::CAST_ERROR); + current_errors.back().error_message = std::move(error_message); + } + + bool HasErrorType(CSVErrorType type) { + for (auto &error : current_errors) { + if (type == error.type) { + return true; + } + } + return false; + } + + bool HandleErrors(StringValueResult &result); + +private: + vector current_errors; + bool is_error_in_line; + bool ignore_errors; +}; + +struct ParseTypeInfo { + ParseTypeInfo() {}; + ParseTypeInfo(LogicalType &type, bool validate_utf_8_p) : validate_utf8(validate_utf_8_p) { + type_id = type.id(); + internal_type = type.InternalType(); + if (type.id() == LogicalTypeId::DECIMAL) { + // We only care about these if we have a decimal value + type.GetDecimalProperties(width, scale); + } + } + + bool validate_utf8; + LogicalTypeId type_id; + PhysicalType internal_type; + uint8_t scale; + uint8_t width; +}; class StringValueResult : public ScannerResult { public: StringValueResult(CSVStates &states, CSVStateMachine &state_machine, - const shared_ptr &buffer_handle, Allocator &buffer_allocator, idx_t result_size, - idx_t buffer_position, CSVErrorHandler &error_handler, CSVIterator &iterator, - bool store_line_size, shared_ptr csv_file_scan, idx_t &lines_read, bool sniffing); + const shared_ptr &buffer_handle, Allocator &buffer_allocator, + bool figure_out_new_line, idx_t buffer_position, CSVErrorHandler &error_handler, + CSVIterator &iterator, bool store_line_size, shared_ptr csv_file_scan, + idx_t &lines_read, bool sniffing); ~StringValueResult(); @@ -115,6 +186,7 @@ class StringValueResult : public ScannerResult { DataChunk parse_chunk; idx_t number_of_rows = 0; idx_t cur_col_id = 0; + bool figure_out_new_line; idx_t result_size; //! Information to properly handle errors CSVErrorHandler &error_handler; @@ -127,7 +199,7 @@ class StringValueResult : public ScannerResult { bool added_last_line = false; bool quoted_new_line = false; - unsafe_unique_array> parse_types; + unsafe_unique_array parse_types; vector names; shared_ptr csv_file_scan; @@ -144,9 +216,15 @@ class StringValueResult : public ScannerResult { idx_t requested_size; //! Errors happening in the current line (if any) - vector current_errors; - + LineError current_errors; + StrpTimeFormat date_format, timestamp_format; bool sniffing; + + char decimal_separator; + + //! We store borked rows so we can generate multiple errors during flushing + unordered_set borked_rows; + //! Specialized code for quoted values, makes sure to remove quotes and escapes static inline void AddQuotedValue(StringValueResult &result, const idx_t buffer_pos); //! Adds a Value to the result @@ -163,13 +241,9 @@ class StringValueResult : public ScannerResult { inline bool AddRowInternal(); //! Force the throw of a unicode error void HandleUnicodeError(idx_t col_idx, LinePosition &error_position); - //! Certain errors should only be handled when adding the line, to ensure proper error propagation. - bool HandleError(); - + bool HandleTooManyColumnsError(const char *value_ptr, const idx_t size); inline void AddValueToVector(const char *value_ptr, const idx_t size, bool allocate = false); - Value GetValue(idx_t row_idx, idx_t col_idx); - DataChunk &ToChunk(); //! Resets the state of the result void Reset(); @@ -181,7 +255,7 @@ class StringValueScanner : public BaseScanner { StringValueScanner(idx_t scanner_idx, const shared_ptr &buffer_manager, const shared_ptr &state_machine, const shared_ptr &error_handler, const shared_ptr &csv_file_scan, - bool sniffing = false, CSVIterator boundary = {}, idx_t result_size = STANDARD_VECTOR_SIZE); + bool sniffing = false, CSVIterator boundary = {}, bool figure_out_nl = false); StringValueScanner(const shared_ptr &buffer_manager, const shared_ptr &state_machine, @@ -201,8 +275,7 @@ class StringValueScanner : public BaseScanner { static string_t RemoveEscape(const char *str_ptr, idx_t end, char escape, Vector &vector); //! If we can directly cast the type when consuming the CSV file, or we have to do it later - static bool CanDirectlyCast(const LogicalType &type, - const map> &format_options); + static bool CanDirectlyCast(const LogicalType &type); const idx_t scanner_idx; @@ -224,9 +297,6 @@ class StringValueScanner : public BaseScanner { //! BOM skipping (https://en.wikipedia.org/wiki/Byte_order_mark) void SkipBOM(); - //! Skips Notes, notes are dirty lines on top of the file, before the actual data - void SkipCSVRows(); - void SkipUntilNewLine(); void SetStart(); diff --git a/src/duckdb/src/include/duckdb/execution/operator/helper/physical_update_extensions.hpp b/src/duckdb/src/include/duckdb/execution/operator/helper/physical_update_extensions.hpp new file mode 100644 index 00000000..bb5024b5 --- /dev/null +++ b/src/duckdb/src/include/duckdb/execution/operator/helper/physical_update_extensions.hpp @@ -0,0 +1,52 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// src/include/duckdb/execution/operator/helper/physical_update_extensions.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/execution/physical_operator.hpp" +#include "duckdb/parser/parsed_data/update_extensions_info.hpp" +#include "duckdb/main/extension_helper.hpp" + +namespace duckdb { + +struct UpdateExtensionsGlobalState : public GlobalSourceState { + UpdateExtensionsGlobalState() : offset(0) { + } + + vector update_result_entries; + idx_t offset; +}; + +//! PhysicalUpdateExtensions represents an extension UPDATE operation +class PhysicalUpdateExtensions : public PhysicalOperator { +public: + static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::UPDATE_EXTENSIONS; + +public: + explicit PhysicalUpdateExtensions(unique_ptr info, idx_t estimated_cardinality) + : PhysicalOperator(PhysicalOperatorType::UPDATE_EXTENSIONS, + {LogicalType::VARCHAR, LogicalType::VARCHAR, LogicalType::VARCHAR, LogicalType::VARCHAR, + LogicalType::VARCHAR}, + estimated_cardinality), + info(std::move(info)) { + } + + unique_ptr info; + + unique_ptr GetGlobalSourceState(ClientContext &context) const override; + +public: + // Source interface + SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override; + + bool IsSource() const override { + return true; + } +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp b/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp index 1a7155f3..bce3ac63 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp @@ -20,7 +20,7 @@ class PhysicalBatchInsert : public PhysicalOperator { //! INSERT INTO PhysicalBatchInsert(vector types, TableCatalogEntry &table, physical_index_vector_t column_index_map, vector> bound_defaults, - idx_t estimated_cardinality); + vector> bound_constraints, idx_t estimated_cardinality); //! CREATE TABLE AS PhysicalBatchInsert(LogicalOperator &op, SchemaCatalogEntry &schema, unique_ptr info, idx_t estimated_cardinality); @@ -33,6 +33,8 @@ class PhysicalBatchInsert : public PhysicalOperator { vector insert_types; //! The default expressions of the columns for which no value is provided vector> bound_defaults; + //! The bound constraints for the table + vector> bound_constraints; //! Table schema, in case of CREATE TABLE AS optional_ptr schema; //! Create table info, in case of CREATE TABLE AS diff --git a/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp b/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp index 387df24d..e9c9c24c 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp @@ -9,6 +9,7 @@ #pragma once #include "duckdb/execution/physical_operator.hpp" +#include "duckdb/planner/bound_constraint.hpp" namespace duckdb { class DataTable; @@ -19,14 +20,13 @@ class PhysicalDelete : public PhysicalOperator { static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::DELETE_OPERATOR; public: - PhysicalDelete(vector types, TableCatalogEntry &tableref, DataTable &table, idx_t row_id_index, - idx_t estimated_cardinality, bool return_chunk) - : PhysicalOperator(PhysicalOperatorType::DELETE_OPERATOR, std::move(types), estimated_cardinality), - tableref(tableref), table(table), row_id_index(row_id_index), return_chunk(return_chunk) { - } + PhysicalDelete(vector types, TableCatalogEntry &tableref, DataTable &table, + vector> bound_constraints, idx_t row_id_index, + idx_t estimated_cardinality, bool return_chunk); TableCatalogEntry &tableref; DataTable &table; + vector> bound_constraints; idx_t row_id_index; bool return_chunk; diff --git a/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp b/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp index a74b270f..4032aea6 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp @@ -57,6 +57,7 @@ class PhysicalExport : public PhysicalOperator { static void ExtractEntries(ClientContext &context, vector> &schemas, ExportEntries &result); + static catalog_entry_vector_t GetNaiveExportOrder(ClientContext &context, Catalog &catalog); public: // Sink interface diff --git a/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp b/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp index 8609a928..9680b583 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp @@ -26,11 +26,12 @@ class PhysicalInsert : public PhysicalOperator { public: //! INSERT INTO PhysicalInsert(vector types, TableCatalogEntry &table, physical_index_vector_t column_index_map, - vector> bound_defaults, vector> set_expressions, - vector set_columns, vector set_types, idx_t estimated_cardinality, - bool return_chunk, bool parallel, OnConflictAction action_type, - unique_ptr on_conflict_condition, unique_ptr do_update_condition, - unordered_set on_conflict_filter, vector columns_to_fetch); + vector> bound_defaults, vector> bound_constraints, + vector> set_expressions, vector set_columns, + vector set_types, idx_t estimated_cardinality, bool return_chunk, bool parallel, + OnConflictAction action_type, unique_ptr on_conflict_condition, + unique_ptr do_update_condition, unordered_set on_conflict_filter, + vector columns_to_fetch); //! CREATE TABLE AS PhysicalInsert(LogicalOperator &op, SchemaCatalogEntry &schema, unique_ptr info, idx_t estimated_cardinality, bool parallel); @@ -43,6 +44,8 @@ class PhysicalInsert : public PhysicalOperator { vector insert_types; //! The default expressions of the columns for which no value is provided vector> bound_defaults; + //! The bound constraints for the table + vector> bound_constraints; //! If the returning statement is present, return the whole chunk bool return_chunk; //! Table schema, in case of CREATE TABLE AS diff --git a/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp b/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp index 0cccd98d..9556b48c 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp @@ -10,6 +10,7 @@ #include "duckdb/execution/physical_operator.hpp" #include "duckdb/planner/expression.hpp" +#include "duckdb/planner/bound_constraint.hpp" namespace duckdb { class DataTable; @@ -22,13 +23,15 @@ class PhysicalUpdate : public PhysicalOperator { public: PhysicalUpdate(vector types, TableCatalogEntry &tableref, DataTable &table, vector columns, vector> expressions, - vector> bound_defaults, idx_t estimated_cardinality, bool return_chunk); + vector> bound_defaults, vector> bound_constraints, + idx_t estimated_cardinality, bool return_chunk); TableCatalogEntry &tableref; DataTable &table; vector columns; vector> expressions; vector> bound_defaults; + vector> bound_constraints; bool update_is_del_and_insert; //! If the returning statement is present, return the whole chunk bool return_chunk; diff --git a/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp b/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp index 57e452fb..9ee9e9e3 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp @@ -9,6 +9,7 @@ #pragma once #include "duckdb/common/types/column/column_data_collection.hpp" +#include "duckdb/common/optionally_owned_ptr.hpp" #include "duckdb/execution/physical_operator.hpp" namespace duckdb { @@ -20,15 +21,13 @@ class PhysicalColumnDataScan : public PhysicalOperator { public: PhysicalColumnDataScan(vector types, PhysicalOperatorType op_type, idx_t estimated_cardinality, - unique_ptr owned_collection = nullptr); + optionally_owned_ptr collection); PhysicalColumnDataScan(vector types, PhysicalOperatorType op_type, idx_t estimated_cardinality, idx_t cte_index); - // the column data collection to scan - optional_ptr collection; - //! Owned column data collection, if any - unique_ptr owned_collection; + //! (optionally owned) column data collection to scan + optionally_owned_ptr collection; idx_t cte_index; diff --git a/src/duckdb/src/include/duckdb/execution/operator/scan/physical_expression_scan.hpp b/src/duckdb/src/include/duckdb/execution/operator/scan/physical_expression_scan.hpp index a6f0d1ae..b934bd69 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/scan/physical_expression_scan.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/scan/physical_expression_scan.hpp @@ -39,8 +39,12 @@ class PhysicalExpressionScan : public PhysicalOperator { public: bool IsFoldable() const; - void EvaluateExpression(ClientContext &context, idx_t expression_idx, DataChunk *child_chunk, - DataChunk &result) const; + void EvaluateExpression(ClientContext &context, idx_t expression_idx, optional_ptr child_chunk, + DataChunk &result, optional_ptr temp_chunk_ptr = nullptr) const; + +private: + void EvaluateExpressionInternal(ClientContext &context, idx_t expression_idx, optional_ptr child_chunk, + DataChunk &result, DataChunk &temp_chunk) const; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/execution/operator/set/physical_cte.hpp b/src/duckdb/src/include/duckdb/execution/operator/set/physical_cte.hpp index 3ff5fb8c..fc006d46 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/set/physical_cte.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/set/physical_cte.hpp @@ -26,7 +26,7 @@ class PhysicalCTE : public PhysicalOperator { vector> cte_scans; - std::shared_ptr working_table; + shared_ptr working_table; idx_t table_index; string ctename; diff --git a/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp b/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp index 88071368..61d82fa0 100644 --- a/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +++ b/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp @@ -29,7 +29,7 @@ class PhysicalRecursiveCTE : public PhysicalOperator { idx_t table_index; bool union_all; - std::shared_ptr working_table; + shared_ptr working_table; shared_ptr recursive_meta_pipeline; public: diff --git a/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp b/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp index 64776321..50d04dfc 100644 --- a/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +++ b/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp @@ -31,7 +31,7 @@ class PhysicalPlanGenerator { LogicalDependencyList dependencies; //! Recursive CTEs require at least one ChunkScan, referencing the working_table. //! This data structure is used to establish it. - unordered_map> recursive_cte_tables; + unordered_map> recursive_cte_tables; //! Materialized CTE ids must be collected. unordered_map>> materialized_ctes; diff --git a/src/duckdb/src/include/duckdb/execution/reservoir_sample.hpp b/src/duckdb/src/include/duckdb/execution/reservoir_sample.hpp index 87ab341f..0edc7e07 100644 --- a/src/duckdb/src/include/duckdb/execution/reservoir_sample.hpp +++ b/src/duckdb/src/include/duckdb/execution/reservoir_sample.hpp @@ -17,6 +17,8 @@ namespace duckdb { +enum class SampleType : uint8_t { BLOCKING_SAMPLE = 0, RESERVOIR_SAMPLE = 1, RESERVOIR_PERCENTAGE_SAMPLE = 2 }; + class BaseReservoirSampling { public: explicit BaseReservoirSampling(int64_t seed); @@ -29,8 +31,6 @@ class BaseReservoirSampling { void ReplaceElement(double with_weight = -1); //! The random generator RandomEngine random; - //! Priority queue of [random element, index] for each of the elements in the sample - std::priority_queue> reservoir_weights; //! The next element to sample idx_t next_index_to_sample; //! The reservoir threshold of the current min entry @@ -43,11 +43,26 @@ class BaseReservoirSampling { //! when collecting a sample in parallel, we want to know how many values each thread has seen //! so we can collect the samples from the thread local states in a uniform manner idx_t num_entries_seen_total; + //! Priority queue of [random element, index] for each of the elements in the sample + std::priority_queue> reservoir_weights; + + void Serialize(Serializer &serializer) const; + static unique_ptr Deserialize(Deserializer &deserializer); }; class BlockingSample { public: - explicit BlockingSample(int64_t seed) : base_reservoir_sample(seed), random(base_reservoir_sample.random) { + static constexpr const SampleType TYPE = SampleType::BLOCKING_SAMPLE; + + unique_ptr base_reservoir_sample; + //! The sample type + SampleType type; + //! has the sample been destroyed due to updates to the referenced table + bool destroyed; + +public: + explicit BlockingSample(int64_t seed) : old_base_reservoir_sample(seed), random(old_base_reservoir_sample.random) { + base_reservoir_sample = nullptr; } virtual ~BlockingSample() { } @@ -59,20 +74,49 @@ class BlockingSample { //! Fetches a chunk from the sample. Note that this method is destructive and should only be used after the //! sample is completely built. virtual unique_ptr GetChunk() = 0; - BaseReservoirSampling base_reservoir_sample; + BaseReservoirSampling old_base_reservoir_sample; virtual void Serialize(Serializer &serializer) const; static unique_ptr Deserialize(Deserializer &deserializer); -protected: +public: + template + TARGET &Cast() { + if (type != TARGET::TYPE && TARGET::TYPE != SampleType::BLOCKING_SAMPLE) { + throw InternalException("Failed to cast sample to type - sample type mismatch"); + } + return reinterpret_cast(*this); + } + + template + const TARGET &Cast() const { + if (type != TARGET::TYPE && TARGET::TYPE != SampleType::BLOCKING_SAMPLE) { + throw InternalException("Failed to cast sample to type - sample type mismatch"); + } + return reinterpret_cast(*this); + } //! The reservoir sampling RandomEngine &random; }; +class ReservoirChunk { +public: + ReservoirChunk() { + } + + DataChunk chunk; + void Serialize(Serializer &serializer) const; + static unique_ptr Deserialize(Deserializer &deserializer); +}; + //! The reservoir sample class maintains a streaming sample of fixed size "sample_count" class ReservoirSample : public BlockingSample { public: - ReservoirSample(Allocator &allocator, idx_t sample_count, int64_t seed); + static constexpr const SampleType TYPE = SampleType::RESERVOIR_SAMPLE; + +public: + ReservoirSample(Allocator &allocator, idx_t sample_count, int64_t seed = 1); + explicit ReservoirSample(idx_t sample_count, int64_t seed = 1); //! Add a chunk of data to the sample void AddToReservoir(DataChunk &input) override; @@ -81,6 +125,8 @@ class ReservoirSample : public BlockingSample { //! sample is completely built. unique_ptr GetChunk() override; void Finalize() override; + void Serialize(Serializer &serializer) const override; + static unique_ptr Deserialize(Deserializer &deserializer); private: //! Replace a single element of the input @@ -96,8 +142,10 @@ class ReservoirSample : public BlockingSample { //! when explicit number used, sample_count = number idx_t sample_count; bool reservoir_initialized; + //! The current reservoir - unique_ptr reservoir_chunk; + unique_ptr reservoir_data_chunk; + unique_ptr reservoir_chunk; }; //! The reservoir sample sample_size class maintains a streaming sample of variable size @@ -105,7 +153,11 @@ class ReservoirSamplePercentage : public BlockingSample { constexpr static idx_t RESERVOIR_THRESHOLD = 100000; public: - ReservoirSamplePercentage(Allocator &allocator, double percentage, int64_t seed); + static constexpr const SampleType TYPE = SampleType::RESERVOIR_PERCENTAGE_SAMPLE; + +public: + ReservoirSamplePercentage(Allocator &allocator, double percentage, int64_t seed = -1); + explicit ReservoirSamplePercentage(double percentage, int64_t seed = -1); //! Add a chunk of data to the sample void AddToReservoir(DataChunk &input) override; @@ -115,6 +167,9 @@ class ReservoirSamplePercentage : public BlockingSample { unique_ptr GetChunk() override; void Finalize() override; + void Serialize(Serializer &serializer) const override; + static unique_ptr Deserialize(Deserializer &deserializer); + private: Allocator &allocator; //! The sample_size to sample diff --git a/src/duckdb/src/include/duckdb/function/function.hpp b/src/duckdb/src/include/duckdb/function/function.hpp index 7e89476e..8575f270 100644 --- a/src/duckdb/src/include/duckdb/function/function.hpp +++ b/src/duckdb/src/include/duckdb/function/function.hpp @@ -78,11 +78,6 @@ struct TableFunctionData : public FunctionData { DUCKDB_API bool Equals(const FunctionData &other) const override; }; -struct PyTableFunctionData : public TableFunctionData { - //! External dependencies of this table function - unique_ptr external_dependency; -}; - struct FunctionParameters { vector values; named_parameter_map_t named_parameters; diff --git a/src/duckdb/src/include/duckdb/function/function_binder.hpp b/src/duckdb/src/include/duckdb/function/function_binder.hpp index bddc1ffb..0fc61af9 100644 --- a/src/duckdb/src/include/duckdb/function/function_binder.hpp +++ b/src/duckdb/src/include/duckdb/function/function_binder.hpp @@ -50,14 +50,17 @@ class FunctionBinder { DUCKDB_API unique_ptr BindScalarFunction(const string &schema, const string &name, vector> children, ErrorData &error, - bool is_operator = false, Binder *binder = nullptr); + bool is_operator = false, + optional_ptr binder = nullptr); DUCKDB_API unique_ptr BindScalarFunction(ScalarFunctionCatalogEntry &function, vector> children, ErrorData &error, - bool is_operator = false, Binder *binder = nullptr); + bool is_operator = false, + optional_ptr binder = nullptr); DUCKDB_API unique_ptr BindScalarFunction(ScalarFunction bound_function, vector> children, - bool is_operator = false); + bool is_operator = false, + optional_ptr binder = nullptr); DUCKDB_API unique_ptr BindAggregateFunction(AggregateFunction bound_function, vector> children, diff --git a/src/duckdb/src/include/duckdb/function/replacement_scan.hpp b/src/duckdb/src/include/duckdb/function/replacement_scan.hpp index 455f8ae1..68a98a79 100644 --- a/src/duckdb/src/include/duckdb/function/replacement_scan.hpp +++ b/src/duckdb/src/include/duckdb/function/replacement_scan.hpp @@ -17,12 +17,35 @@ class ClientContext; class TableRef; struct ReplacementScanData { +public: virtual ~ReplacementScanData() { } + +public: + template + TARGET &Cast() { + DynamicCastCheck(this); + return reinterpret_cast(*this); + } + template + const TARGET &Cast() const { + DynamicCastCheck(this); + return reinterpret_cast(*this); + } +}; + +struct ReplacementScanInput { +public: + ReplacementScanInput(TableRef &ref, const string &table_name) : ref(ref), table_name(table_name) { + } + +public: + TableRef &ref; + const string &table_name; }; -typedef unique_ptr (*replacement_scan_t)(ClientContext &context, const string &table_name, - ReplacementScanData *data); +typedef unique_ptr (*replacement_scan_t)(ClientContext &context, ReplacementScanInput &input, + optional_ptr data); //! Replacement table scans are automatically attempted when a table name cannot be found in the schema //! This allows you to do e.g. SELECT * FROM 'filename.csv', and automatically convert this into a CSV scan diff --git a/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp b/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp index 28dd30ed..1b33d3c7 100644 --- a/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +++ b/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp @@ -140,7 +140,7 @@ struct RegexLocalState : public FunctionLocalState { if (extract_all) { auto group_count_p = constant_pattern.NumberOfCapturingGroups(); if (group_count_p != -1) { - group_buffer.Init(group_count_p); + group_buffer.Init(NumericCast(group_count_p)); } } D_ASSERT(info.constant_pattern); diff --git a/src/duckdb/src/include/duckdb/function/scalar/sequence_functions.hpp b/src/duckdb/src/include/duckdb/function/scalar/sequence_functions.hpp index 7323ea03..34103bfc 100644 --- a/src/duckdb/src/include/duckdb/function/scalar/sequence_functions.hpp +++ b/src/duckdb/src/include/duckdb/function/scalar/sequence_functions.hpp @@ -16,12 +16,11 @@ namespace duckdb { struct NextvalBindData : public FunctionData { - explicit NextvalBindData(optional_ptr sequence) - : sequence(sequence), create_info(sequence ? sequence->GetInfo() : nullptr) { + explicit NextvalBindData(SequenceCatalogEntry &sequence) : sequence(sequence), create_info(sequence.GetInfo()) { } //! The sequence to use for the nextval computation; only if the sequence is a constant - optional_ptr sequence; + SequenceCatalogEntry &sequence; //! The CreateInfo for the above sequence, if it exists unique_ptr create_info; @@ -32,7 +31,7 @@ struct NextvalBindData : public FunctionData { bool Equals(const FunctionData &other_p) const override { auto &other = other_p.Cast(); - return sequence == other.sequence; + return RefersToSameObject(sequence, other.sequence); } }; diff --git a/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp b/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp index a7b3addd..a538db42 100644 --- a/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +++ b/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp @@ -161,6 +161,11 @@ struct StrpTimeFormat : public StrTimeFormat { // NOLINT: work-around bug in cla DUCKDB_API bool Parse(string_t str, ParseResult &result) const; + DUCKDB_API bool Parse(const char *data, size_t size, ParseResult &result) const; + + DUCKDB_API bool TryParseDate(const char *data, size_t size, date_t &result) const; + DUCKDB_API bool TryParseTimestamp(const char *data, size_t size, timestamp_t &result) const; + DUCKDB_API bool TryParseDate(string_t str, date_t &result, string &error_message) const; DUCKDB_API bool TryParseTime(string_t str, dtime_t &result, string &error_message) const; DUCKDB_API bool TryParseTimestamp(string_t str, timestamp_t &result, string &error_message) const; diff --git a/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp b/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp index 3fc6cf62..c96c2b3c 100644 --- a/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +++ b/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp @@ -78,7 +78,7 @@ struct LengthFun { return length; } } - return input_length; + return UnsafeNumericCast(input_length); } }; diff --git a/src/duckdb/src/include/duckdb/function/scalar_function.hpp b/src/duckdb/src/include/duckdb/function/scalar_function.hpp index 917f09ee..3180128b 100644 --- a/src/duckdb/src/include/duckdb/function/scalar_function.hpp +++ b/src/duckdb/src/include/duckdb/function/scalar_function.hpp @@ -51,6 +51,15 @@ struct FunctionStatisticsInput { unique_ptr *expr_ptr; }; +struct FunctionModifiedDatabasesInput { + FunctionModifiedDatabasesInput(optional_ptr bind_data_p, unordered_set &modified_databases_p) + : bind_data(bind_data_p), modified_databases(modified_databases_p) { + } + + optional_ptr bind_data; + unordered_set &modified_databases; +}; + //! The scalar function type typedef std::function scalar_function_t; //! The type to bind the scalar function and to create the function data @@ -66,6 +75,8 @@ typedef void (*dependency_function_t)(BoundFunctionExpression &expr, LogicalDepe typedef unique_ptr (*function_statistics_t)(ClientContext &context, FunctionStatisticsInput &input); //! The type to bind lambda-specific parameter types typedef LogicalType (*bind_lambda_function_t)(const idx_t parameter_idx, const LogicalType &list_child_type); +//! The type to bind lambda-specific parameter types +typedef void (*get_modified_databases_t)(FunctionModifiedDatabasesInput &input); typedef void (*function_serialize_t)(Serializer &serializer, const optional_ptr bind_data, const ScalarFunction &function); @@ -102,6 +113,8 @@ class ScalarFunction : public BaseScalarFunction { // NOLINT: work-around bug in function_statistics_t statistics; //! The lambda bind function (if any) bind_lambda_function_t bind_lambda; + //! Gets the modified databases (if any) + get_modified_databases_t get_modified_databases; function_serialize_t serialize; function_deserialize_t deserialize; diff --git a/src/duckdb/src/include/duckdb/function/table/arrow.hpp b/src/duckdb/src/include/duckdb/function/table/arrow.hpp index 8a920121..d2ea0230 100644 --- a/src/duckdb/src/include/duckdb/function/table/arrow.hpp +++ b/src/duckdb/src/include/duckdb/function/table/arrow.hpp @@ -46,10 +46,12 @@ typedef unique_ptr (*stream_factory_produce_t)(uintptr_ ArrowStreamParameters ¶meters); typedef void (*stream_factory_get_schema_t)(ArrowArrayStream *stream_factory_ptr, ArrowSchema &schema); -struct ArrowScanFunctionData : public PyTableFunctionData { +struct ArrowScanFunctionData : public TableFunctionData { public: - ArrowScanFunctionData(stream_factory_produce_t scanner_producer_p, uintptr_t stream_factory_ptr_p) - : lines_read(0), stream_factory_ptr(stream_factory_ptr_p), scanner_producer(scanner_producer_p) { + ArrowScanFunctionData(stream_factory_produce_t scanner_producer_p, uintptr_t stream_factory_ptr_p, + shared_ptr dependency = nullptr) + : lines_read(0), stream_factory_ptr(stream_factory_ptr_p), scanner_producer(scanner_producer_p), + dependency(std::move(dependency)) { } vector all_types; atomic lines_read; @@ -59,6 +61,8 @@ struct ArrowScanFunctionData : public PyTableFunctionData { uintptr_t stream_factory_ptr; //! Pointer to the scanner factory produce stream_factory_produce_t scanner_producer; + //! The (optional) dependency of this function (used in Python for example) + shared_ptr dependency; //! Arrow table data ArrowTableType arrow_table; }; diff --git a/src/duckdb/src/include/duckdb/function/table/read_csv.hpp b/src/duckdb/src/include/duckdb/function/table/read_csv.hpp index aeb50502..0e8cd4b7 100644 --- a/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +++ b/src/duckdb/src/include/duckdb/function/table/read_csv.hpp @@ -56,6 +56,8 @@ struct WriteCSVData : public BaseCSVData { idx_t flush_size = 4096ULL * 8ULL; //! For each byte whether or not the CSV file requires quotes when containing the byte unsafe_unique_array requires_quotes; + //! Expressions used to convert the input into strings + vector> cast_expressions; }; struct ColumnInfo { @@ -93,6 +95,7 @@ struct ReadCSVData : public BaseCSVData { vector> union_readers; //! Reader bind data MultiFileReaderBindData reader_bind; + vector column_info; void Initialize(unique_ptr &reader) { diff --git a/src/duckdb/src/include/duckdb/function/table/system_functions.hpp b/src/duckdb/src/include/duckdb/function/table/system_functions.hpp index 1ab8f876..23f4d9cb 100644 --- a/src/duckdb/src/include/duckdb/function/table/system_functions.hpp +++ b/src/duckdb/src/include/duckdb/function/table/system_functions.hpp @@ -57,6 +57,10 @@ struct DuckDBSecretsFun { static void RegisterFunction(BuiltinFunctions &set); }; +struct DuckDBWhichSecretFun { + static void RegisterFunction(BuiltinFunctions &set); +}; + struct DuckDBDatabasesFun { static void RegisterFunction(BuiltinFunctions &set); }; diff --git a/src/duckdb/src/include/duckdb/function/table_function.hpp b/src/duckdb/src/include/duckdb/function/table_function.hpp index bd8e1769..503a3b2a 100644 --- a/src/duckdb/src/include/duckdb/function/table_function.hpp +++ b/src/duckdb/src/include/duckdb/function/table_function.hpp @@ -25,6 +25,7 @@ class LogicalDependencyList; class LogicalGet; class TableFilterSet; class TableCatalogEntry; +struct MultiFileReader; struct TableFunctionInfo { DUCKDB_API virtual ~TableFunctionInfo(); @@ -83,9 +84,10 @@ struct LocalTableFunctionState { struct TableFunctionBindInput { TableFunctionBindInput(vector &inputs, named_parameter_map_t &named_parameters, vector &input_table_types, vector &input_table_names, - optional_ptr info, optional_ptr binder) + optional_ptr info, optional_ptr binder, + const TableFunction &table_function, const TableFunctionRef &ref) : inputs(inputs), named_parameters(named_parameters), input_table_types(input_table_types), - input_table_names(input_table_names), info(info), binder(binder) { + input_table_names(input_table_names), info(info), binder(binder), table_function(table_function), ref(ref) { } vector &inputs; @@ -94,6 +96,8 @@ struct TableFunctionBindInput { vector &input_table_names; optional_ptr info; optional_ptr binder; + const TableFunction &table_function; + const TableFunctionRef &ref; }; struct TableFunctionInitInput { @@ -198,6 +202,8 @@ typedef idx_t (*table_function_get_batch_index_t)(ClientContext &context, const typedef BindInfo (*table_function_get_bind_info_t)(const optional_ptr bind_data); +typedef unique_ptr (*table_function_get_multi_file_reader_t)(); + typedef double (*table_function_progress_t)(ClientContext &context, const FunctionData *bind_data, const GlobalTableFunctionState *global_state); typedef void (*table_function_dependency_t)(LogicalDependencyList &dependencies, const FunctionData *bind_data); @@ -212,6 +218,9 @@ typedef void (*table_function_serialize_t)(Serializer &serializer, const optiona const TableFunction &function); typedef unique_ptr (*table_function_deserialize_t)(Deserializer &deserializer, TableFunction &function); +typedef void (*table_function_type_pushdown_t)(ClientContext &context, optional_ptr bind_data, + const unordered_map &new_column_types); + class TableFunction : public SimpleNamedParameterFunction { // NOLINT: work-around bug in clang-tidy public: DUCKDB_API @@ -267,6 +276,10 @@ class TableFunction : public SimpleNamedParameterFunction { // NOLINT: work-arou table_function_get_batch_index_t get_batch_index; //! (Optional) returns extra bind info table_function_get_bind_info_t get_bind_info; + //! (Optional) pushes down type information to scanner, returns true if pushdown was successful + table_function_type_pushdown_t type_pushdown; + //! (Optional) allows injecting a custom MultiFileReader implementation + table_function_get_multi_file_reader_t get_multi_file_reader; table_function_serialize_t serialize; table_function_deserialize_t deserialize; diff --git a/src/duckdb/src/include/duckdb/logging/http_logger.hpp b/src/duckdb/src/include/duckdb/logging/http_logger.hpp new file mode 100644 index 00000000..1ea9fa70 --- /dev/null +++ b/src/duckdb/src/include/duckdb/logging/http_logger.hpp @@ -0,0 +1,81 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/logging/http_logger.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/common/fstream.hpp" +#include "duckdb/common/mutex.hpp" +#include "duckdb/common/printer.hpp" +#include "duckdb/main/client_context.hpp" + +#include + +namespace duckdb { + +//! This has to be templated because we have two namespaces: +//! 1. duckdb_httplib +//! 2. duckdb_httplib_openssl +//! These have essentially the same code, but we cannot convert between them +//! We get around that by templating everything, which requires implementing everything in the header +class HTTPLogger { +public: + explicit HTTPLogger(ClientContext &context_p) : context(context_p) { + } + +public: + template + std::function GetLogger() { + return [&](const REQUEST &req, const RESPONSE &res) { + Log(req, res); + }; + } + +private: + template + static inline void TemplatedWriteRequests(STREAM &out, const REQUEST &req, const RESPONSE &res) { + out << "HTTP Request:\n"; + out << "\t" << req.method << " " << req.path << "\n"; + for (auto &entry : req.headers) { + out << "\t" << entry.first << ": " << entry.second << "\n"; + } + out << "\nHTTP Response:\n"; + out << "\t" << res.status << " " << res.reason << " " << req.version << "\n"; + for (auto &entry : res.headers) { + out << "\t" << entry.first << ": " << entry.second << "\n"; + } + out << "\n"; + } + + template + void Log(const REQUEST &req, const RESPONSE &res) { + const auto &config = ClientConfig::GetConfig(context); + D_ASSERT(config.enable_http_logging); + + lock_guard guard(lock); + if (config.http_logging_output.empty()) { + stringstream out; + TemplatedWriteRequests(out, req, res); + Printer::Print(out.str()); + } else { + ofstream out(config.http_logging_output, ios::app); + TemplatedWriteRequests(out, req, res); + out.close(); + // Throw an IO exception if it fails to write to the file + if (out.fail()) { + throw IOException("Failed to write HTTP log to file \"%s\": %s", config.http_logging_output, + strerror(errno)); + } + } + } + +private: + ClientContext &context; + mutex lock; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/main/appender.hpp b/src/duckdb/src/include/duckdb/main/appender.hpp index f433c194..9f58e183 100644 --- a/src/duckdb/src/include/duckdb/main/appender.hpp +++ b/src/duckdb/src/include/duckdb/main/appender.hpp @@ -59,9 +59,7 @@ class BaseAppender { // Append functions template - void Append(T value) { - throw InternalException("Undefined type for Appender::Append!"); - } + void Append(T value) = delete; DUCKDB_API void Append(const char *value, uint32_t length); diff --git a/src/duckdb/src/include/duckdb/main/attached_database.hpp b/src/duckdb/src/include/duckdb/main/attached_database.hpp index b0037d0d..a02a3f10 100644 --- a/src/duckdb/src/include/duckdb/main/attached_database.hpp +++ b/src/duckdb/src/include/duckdb/main/attached_database.hpp @@ -43,7 +43,7 @@ class AttachedDatabase : public CatalogEntry { const AttachInfo &info, AccessMode access_mode); ~AttachedDatabase() override; - void Initialize(optional_ptr context = nullptr); + void Initialize(); void Close(); Catalog &ParentCatalog() override; diff --git a/src/duckdb/src/include/duckdb/main/buffered_data/buffered_data.hpp b/src/duckdb/src/include/duckdb/main/buffered_data/buffered_data.hpp index d831736d..a863d551 100644 --- a/src/duckdb/src/include/duckdb/main/buffered_data/buffered_data.hpp +++ b/src/duckdb/src/include/duckdb/main/buffered_data/buffered_data.hpp @@ -15,6 +15,7 @@ #include "duckdb/common/optional_idx.hpp" #include "duckdb/execution/physical_operator_states.hpp" #include "duckdb/common/enums/pending_execution_result.hpp" +#include "duckdb/common/shared_ptr.hpp" namespace duckdb { diff --git a/src/duckdb/src/include/duckdb/main/capi/cast/generic.hpp b/src/duckdb/src/include/duckdb/main/capi/cast/generic.hpp index ac01ec75..aac1d213 100644 --- a/src/duckdb/src/include/duckdb/main/capi/cast/generic.hpp +++ b/src/duckdb/src/include/duckdb/main/capi/cast/generic.hpp @@ -65,8 +65,8 @@ RESULT_TYPE GetInternalCValue(duckdb_result *result, idx_t col, idx_t row) { case DUCKDB_TYPE_BLOB: return TryCastCInternal(result, col, row); default: { // LCOV_EXCL_START - // invalid type for C to C++ conversion - D_ASSERT(0); + // Invalid type for C to C++ conversion. Internally, we set the null mask to NULL. + // This is a deprecated code path. Use the Vector Interface for nested and complex types. return FetchDefaultValue::Operation(); } // LCOV_EXCL_STOP } diff --git a/src/duckdb/src/include/duckdb/main/client_config.hpp b/src/duckdb/src/include/duckdb/main/client_config.hpp index d4eebc1a..d66766c4 100644 --- a/src/duckdb/src/include/duckdb/main/client_config.hpp +++ b/src/duckdb/src/include/duckdb/main/client_config.hpp @@ -16,9 +16,11 @@ #include "duckdb/common/progress_bar/progress_bar.hpp" namespace duckdb { + class ClientContext; class PhysicalResultCollector; class PreparedStatementData; +class HTTPLogger; typedef std::function(ClientContext &context, PreparedStatementData &data)> get_result_collector_t; @@ -115,6 +117,12 @@ struct ClientConfig { //! Defaults to PhysicalMaterializedCollector get_result_collector_t result_collector = nullptr; + //! If HTTP logging is enabled or not. + bool enable_http_logging = false; + //! The file to save query HTTP logging information to, instead of printing it to the console + //! (empty = print to console) + string http_logging_output; + public: static ClientConfig &GetConfig(ClientContext &context); static const ClientConfig &GetConfig(const ClientContext &context); diff --git a/src/duckdb/src/include/duckdb/main/client_context.hpp b/src/duckdb/src/include/duckdb/main/client_context.hpp index 34ed44e4..202b37bb 100644 --- a/src/duckdb/src/include/duckdb/main/client_context.hpp +++ b/src/duckdb/src/include/duckdb/main/client_context.hpp @@ -59,7 +59,7 @@ struct PendingQueryParameters { //! The ClientContext holds information relevant to the current client session //! during execution -class ClientContext : public std::enable_shared_from_this { +class ClientContext : public enable_shared_from_this { friend class PendingQueryResult; // LockContext friend class SimpleBufferedData; // ExecuteTaskInternal friend class StreamQueryResult; // LockContext @@ -289,22 +289,4 @@ class ClientContextLock { lock_guard client_guard; }; -class ClientContextWrapper { -public: - explicit ClientContextWrapper(const shared_ptr &context) - : client_context(context) { - - }; - shared_ptr GetContext() { - auto actual_context = client_context.lock(); - if (!actual_context) { - throw ConnectionException("Connection has already been closed"); - } - return actual_context; - } - -private: - std::weak_ptr client_context; -}; - } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/main/client_context_state.hpp b/src/duckdb/src/include/duckdb/main/client_context_state.hpp index 5f48c047..6013d862 100644 --- a/src/duckdb/src/include/duckdb/main/client_context_state.hpp +++ b/src/duckdb/src/include/duckdb/main/client_context_state.hpp @@ -17,9 +17,19 @@ class ErrorData; class MetaTransaction; class PreparedStatementData; class SQLStatement; +struct PendingQueryParameters; enum class RebindQueryInfo { DO_NOT_REBIND, ATTEMPT_TO_REBIND }; +struct PreparedStatementCallbackInfo { + PreparedStatementCallbackInfo(PreparedStatementData &prepared_statement, const PendingQueryParameters ¶meters) + : prepared_statement(prepared_statement), parameters(parameters) { + } + + PreparedStatementData &prepared_statement; + const PendingQueryParameters ¶meters; +}; + //! ClientContextState is virtual base class for ClientContext-local (or Query-Local, using QueryEnd callback) state //! e.g. caches that need to live as long as a ClientContext or Query. class ClientContextState { @@ -48,7 +58,7 @@ class ClientContextState { PreparedStatementMode mode) { return RebindQueryInfo::DO_NOT_REBIND; } - virtual RebindQueryInfo OnExecutePrepared(ClientContext &context, PreparedStatementData &prepared_statement, + virtual RebindQueryInfo OnExecutePrepared(ClientContext &context, PreparedStatementCallbackInfo &info, RebindQueryInfo current_rebind) { return RebindQueryInfo::DO_NOT_REBIND; } diff --git a/src/duckdb/src/include/duckdb/main/client_context_wrapper.hpp b/src/duckdb/src/include/duckdb/main/client_context_wrapper.hpp new file mode 100644 index 00000000..2ee70345 --- /dev/null +++ b/src/duckdb/src/include/duckdb/main/client_context_wrapper.hpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/main/client_context_wrapper.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/common/shared_ptr.hpp" + +namespace duckdb { + +class ClientContext; + +class ClientContextWrapper { +public: + explicit ClientContextWrapper(const shared_ptr &context); + shared_ptr GetContext(); + shared_ptr TryGetContext(); + +private: + weak_ptr client_context; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/main/client_data.hpp b/src/duckdb/src/include/duckdb/main/client_data.hpp index 596cb9f9..77785975 100644 --- a/src/duckdb/src/include/duckdb/main/client_data.hpp +++ b/src/duckdb/src/include/duckdb/main/client_data.hpp @@ -26,6 +26,7 @@ class HTTPState; class QueryProfiler; class PreparedStatementData; class SchemaCatalogEntry; +class HTTPLogger; struct RandomEngine; struct ClientData { @@ -35,6 +36,9 @@ struct ClientData { //! Query profiler shared_ptr profiler; + //! HTTP logger + shared_ptr http_logger; + //! The set of temporary objects that belong to this client shared_ptr temporary_objects; //! The set of bound prepared statements that belong to this client diff --git a/src/duckdb/src/include/duckdb/main/config.hpp b/src/duckdb/src/include/duckdb/main/config.hpp index b514d0a3..fe47d933 100644 --- a/src/duckdb/src/include/duckdb/main/config.hpp +++ b/src/duckdb/src/include/duckdb/main/config.hpp @@ -89,6 +89,27 @@ struct ExtensionOption { Value default_value; }; +class SerializationCompatibility { +public: + static SerializationCompatibility FromString(const string &input); + static SerializationCompatibility Default(); + static SerializationCompatibility Latest(); + +public: + bool Compare(idx_t property_version) const; + +public: + //! The user provided version + string duckdb_version; + //! The max version that should be serialized + idx_t serialization_version; + //! Whether this was set by a manual SET/PRAGMA or default + bool manually_set; + +protected: + SerializationCompatibility() = default; +}; + struct DBConfigOptions { //! Database file path. May be empty for in-memory mode string database_path; @@ -116,12 +137,14 @@ struct DBConfigOptions { #endif //! Override for the default extension repository string custom_extension_repo = ""; - //! Override for the default autoload extensoin repository + //! Override for the default autoload extension repository string autoinstall_extension_repo = ""; //! The maximum memory used by the database system (in bytes). Default: 80% of System available memory - idx_t maximum_memory = (idx_t)-1; + idx_t maximum_memory = DConstants::INVALID_INDEX; + //! The maximum size of the 'temp_directory' folder when set (in bytes). Default: 90% of available disk space. + idx_t maximum_swap_space = DConstants::INVALID_INDEX; //! The maximum amount of CPU threads used by the database system. Default: all available. - idx_t maximum_threads = (idx_t)-1; + idx_t maximum_threads = DConstants::INVALID_INDEX; //! The number of external threads that work on DuckDB tasks. Default: 1. //! Must be smaller or equal to maximum_threads. idx_t external_threads = 1; @@ -132,6 +155,8 @@ struct DBConfigOptions { //! Whether or not to invoke filesystem trim on free blocks after checkpoint. This will reclaim //! space for sparse files, on platforms that support it. bool trim_free_blocks = false; + //! Record timestamps of buffer manager unpin() events. Usable by custom eviction policies. + bool buffer_manager_track_eviction_timestamps = false; //! Whether or not to allow printing unredacted secrets bool allow_unredacted_secrets = false; //! The collation type of the database @@ -150,6 +175,8 @@ struct DBConfigOptions { bool force_checkpoint = false; //! Run a checkpoint on successful shutdown and delete the WAL, to leave only a single database file behind bool checkpoint_on_shutdown = true; + //! Serialize the metadata on checkpoint with compatibility for a given DuckDB version. + SerializationCompatibility serialization_compatibility = SerializationCompatibility::Default(); //! Debug flag that decides when a checkpoing should be aborted. Only used for testing purposes. CheckpointAbort checkpoint_abort = CheckpointAbort::NO_ABORT; //! Initialize the database with the standard set of DuckDB functions @@ -175,6 +202,8 @@ struct DBConfigOptions { string extension_directory; //! Whether unsigned extensions should be loaded bool allow_unsigned_extensions = false; + //! Whether community extensions should be loaded + bool allow_community_extensions = true; //! Whether extensions with missing metadata should be loaded bool allow_extensions_metadata_mismatch = false; //! Enable emitting FSST Vectors @@ -197,6 +226,8 @@ struct DBConfigOptions { string custom_user_agent; //! Use old implicit casting style (i.e. allow everything to be implicitly casted to VARCHAR) bool old_implicit_casting = false; + //! Whether or not to abort if a serialization exception is thrown during WAL playback (when reading truncated WAL) + bool abort_on_wal_failure = false; bool operator==(const DBConfigOptions &other) const; }; @@ -254,6 +285,7 @@ struct DBConfig { DUCKDB_API static vector GetOptions(); DUCKDB_API static idx_t GetOptionCount(); DUCKDB_API static vector GetOptionNames(); + DUCKDB_API static bool IsInMemoryDatabase(const char *database_path); DUCKDB_API void AddExtensionOption(const string &name, string description, LogicalType parameter, const Value &default_value = Value(), set_option_callback_t function = nullptr); @@ -285,6 +317,7 @@ struct DBConfig { DUCKDB_API IndexTypeSet &GetIndexTypes(); static idx_t GetSystemMaxThreads(FileSystem &fs); void SetDefaultMaxMemory(); + void SetDefaultTempDirectory(); OrderType ResolveOrder(OrderType order_type) const; OrderByNullType ResolveNullOrder(OrderType order_type, OrderByNullType null_type) const; diff --git a/src/duckdb/src/include/duckdb/main/connection_manager.hpp b/src/duckdb/src/include/duckdb/main/connection_manager.hpp index b59ce503..bb21a276 100644 --- a/src/duckdb/src/include/duckdb/main/connection_manager.hpp +++ b/src/duckdb/src/include/duckdb/main/connection_manager.hpp @@ -17,15 +17,6 @@ namespace duckdb { class ClientContext; class DatabaseInstance; -struct ClientLockWrapper { - ClientLockWrapper(mutex &client_lock, shared_ptr connection) - : connection(std::move(connection)), connection_lock(make_uniq>(client_lock)) { - } - - shared_ptr connection; - unique_ptr> connection_lock; -}; - class ConnectionManager { public: ConnectionManager(); @@ -34,18 +25,17 @@ class ConnectionManager { void RemoveConnection(ClientContext &context); vector> GetConnectionList(); - - void LockClients(vector &client_locks, ClientContext &context); + const reference_map_t> &GetConnectionListReference() const { + return connections; + } + idx_t GetConnectionCount() const; static ConnectionManager &Get(DatabaseInstance &db); static ConnectionManager &Get(ClientContext &context); -public: - mutex connections_lock; - unordered_map> connections; - - mutex lock_clients_lock; - bool is_locking; +private: + mutable mutex connections_lock; + reference_map_t> connections; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/main/database.hpp b/src/duckdb/src/include/duckdb/main/database.hpp index 7b84253e..0dfb245d 100644 --- a/src/duckdb/src/include/duckdb/main/database.hpp +++ b/src/duckdb/src/include/duckdb/main/database.hpp @@ -12,6 +12,7 @@ #include "duckdb/main/valid_checker.hpp" #include "duckdb/common/winapi.hpp" #include "duckdb/main/extension.hpp" +#include "duckdb/main/extension_install_info.hpp" #include "duckdb/main/settings.hpp" namespace duckdb { @@ -27,17 +28,7 @@ class ObjectCache; struct AttachInfo; class DatabaseFileSystem; -struct ExtensionInfo { - explicit ExtensionInfo(const std::string &version) : extension_version(version) { - } - ExtensionInfo() : ExtensionInfo("defaultme") { - } - ExtensionInfo(const ExtensionInfo &x) : ExtensionInfo(x.extension_version) { - } - std::string extension_version; -}; - -class DatabaseInstance : public std::enable_shared_from_this { +class DatabaseInstance : public enable_shared_from_this { friend class DuckDB; public: @@ -57,15 +48,15 @@ class DatabaseInstance : public std::enable_shared_from_this { DUCKDB_API ObjectCache &GetObjectCache(); DUCKDB_API ConnectionManager &GetConnectionManager(); DUCKDB_API ValidChecker &GetValidChecker(); - DUCKDB_API void SetExtensionLoaded(const std::string &extension_name, const std::string &extension_version = ""); + DUCKDB_API void SetExtensionLoaded(const string &extension_name, ExtensionInstallInfo &install_info); idx_t NumberOfThreads(); DUCKDB_API static DatabaseInstance &GetDatabase(ClientContext &context); DUCKDB_API static const DatabaseInstance &GetDatabase(const ClientContext &context); - DUCKDB_API const unordered_set &LoadedExtensions(); - DUCKDB_API const unordered_map &LoadedExtensionsData(); + DUCKDB_API const unordered_set &LoadedExtensions(); + DUCKDB_API const unordered_map &LoadedExtensionsData(); DUCKDB_API bool ExtensionIsLoaded(const string &name); DUCKDB_API SettingLookupResult TryGetCurrentSetting(const string &key, Value &result) const; @@ -77,7 +68,7 @@ class DatabaseInstance : public std::enable_shared_from_this { void Initialize(const char *path, DBConfig *config); void CreateMainDatabase(); - void Configure(DBConfig &config); + void Configure(DBConfig &config, const char *path); private: shared_ptr buffer_manager; @@ -85,8 +76,8 @@ class DatabaseInstance : public std::enable_shared_from_this { unique_ptr scheduler; unique_ptr object_cache; unique_ptr connection_manager; - unordered_set loaded_extensions; - unordered_map loaded_extensions_data; + unordered_set loaded_extensions; + unordered_map loaded_extensions_data; ValidChecker db_validity; unique_ptr db_file_system; }; @@ -105,14 +96,28 @@ class DuckDB { shared_ptr instance; public: + // Load a statically loaded extension by its class template - void LoadExtension() { + void LoadStaticExtension() { T extension; if (ExtensionIsLoaded(extension.Name())) { return; } extension.Load(*this); - instance->SetExtensionLoaded(extension.Name()); + ExtensionInstallInfo install_info; + install_info.mode = ExtensionInstallMode::STATICALLY_LINKED; + install_info.version = extension.Version(); + instance->SetExtensionLoaded(extension.Name(), install_info); + } + + // DEPRECATED function that some extensions may still use to call their own Load method from the + // _init function of their loadable extension. Don't use this. Instead opt for a static LoadInternal function called + // from both the _init function and the Extension::Load. (see autocomplete extension) + // TODO: when to remove this function? + template + void LoadExtension() { + T extension; + extension.Load(*this); } DUCKDB_API FileSystem &GetFileSystem(); @@ -122,7 +127,7 @@ class DuckDB { DUCKDB_API static const char *LibraryVersion(); DUCKDB_API static idx_t StandardVectorSize(); DUCKDB_API static string Platform(); - DUCKDB_API bool ExtensionIsLoaded(const std::string &name); + DUCKDB_API bool ExtensionIsLoaded(const string &name); }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/main/extension.hpp b/src/duckdb/src/include/duckdb/main/extension.hpp index 5c57996d..996a7fa6 100644 --- a/src/duckdb/src/include/duckdb/main/extension.hpp +++ b/src/duckdb/src/include/duckdb/main/extension.hpp @@ -21,6 +21,31 @@ class Extension { DUCKDB_API virtual void Load(DuckDB &db) = 0; DUCKDB_API virtual std::string Name() = 0; + DUCKDB_API virtual std::string Version() const { + return ""; + } +}; + +//! The parsed extension metadata footer +struct ParsedExtensionMetaData { + static constexpr const idx_t FOOTER_SIZE = 512; + static constexpr const idx_t SIGNATURE_SIZE = 256; + static constexpr const char *EXPECTED_MAGIC_VALUE = { + "4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + + string magic_value; + + string platform; + string duckdb_version; + string extension_version; + string signature; + + bool AppearsValid() { + return magic_value == EXPECTED_MAGIC_VALUE; + } + + // Returns an error string describing which parts of the metadata are mismatcheds + string GetInvalidMetadataError(); }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/main/extension_entries.hpp b/src/duckdb/src/include/duckdb/main/extension_entries.hpp index c7b3b7e4..0ae567e2 100644 --- a/src/duckdb/src/include/duckdb/main/extension_entries.hpp +++ b/src/duckdb/src/include/duckdb/main/extension_entries.hpp @@ -35,6 +35,7 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = { {"current_localtime", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, {"current_localtimestamp", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, {"dbgen", "tpch", CatalogType::TABLE_FUNCTION_ENTRY}, + {"delta_scan", "delta", CatalogType::TABLE_FUNCTION_ENTRY}, {"drop_fts_index", "fts", CatalogType::PRAGMA_FUNCTION_ENTRY}, {"dsdgen", "tpcds", CatalogType::TABLE_FUNCTION_ENTRY}, {"excel_text", "excel", CatalogType::SCALAR_FUNCTION_ENTRY}, @@ -54,6 +55,136 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = { {"iceberg_scan", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY}, {"iceberg_snapshots", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY}, {"icu_calendar_names", "icu", CatalogType::TABLE_FUNCTION_ENTRY}, + {"icu_collate_af", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_am", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ar", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ar_sa", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_as", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_az", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_be", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_bg", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_bn", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_bo", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_br", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_bs", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ca", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ceb", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_chr", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_cs", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_cy", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_da", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_de", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_de_at", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_dsb", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_dz", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ee", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_el", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_en", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_en_us", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_eo", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_es", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_et", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_fa", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_fa_af", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ff", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_fi", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_fil", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_fo", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_fr", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_fr_ca", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_fy", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ga", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_gl", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_gu", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ha", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_haw", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_he", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_he_il", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_hi", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_hr", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_hsb", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_hu", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_hy", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_id", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_id_id", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ig", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_is", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_it", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ja", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ka", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_kk", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_kl", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_km", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_kn", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ko", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_kok", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ku", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ky", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_lb", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_lkt", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ln", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_lo", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_lt", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_lv", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_mk", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ml", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_mn", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_mr", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ms", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_mt", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_my", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_nb", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_nb_no", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ne", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_nl", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_nn", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_om", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_or", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_pa", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_pa_in", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_pl", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ps", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_pt", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ro", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ru", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_sa", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_se", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_si", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_sk", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_sl", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_smn", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_sq", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_sr", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_sr_ba", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_sr_me", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_sr_rs", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_sv", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_sw", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ta", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_te", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_th", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_tk", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_to", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_tr", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ug", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_uk", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_ur", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_uz", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_vi", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_wae", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_wo", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_xh", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_yi", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_yo", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_yue", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_yue_cn", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_zh", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_zh_cn", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_zh_hk", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_zh_mo", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_zh_sg", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_zh_tw", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"icu_collate_zu", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, {"icu_sort_key", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, {"json", "json", CatalogType::MACRO_ENTRY}, {"json_array", "json", CatalogType::SCALAR_FUNCTION_ENTRY}, @@ -82,6 +213,9 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = { {"json_valid", "json", CatalogType::SCALAR_FUNCTION_ENTRY}, {"load_aws_credentials", "aws", CatalogType::TABLE_FUNCTION_ENTRY}, {"make_timestamptz", "icu", CatalogType::SCALAR_FUNCTION_ENTRY}, + {"mysql_clear_cache", "mysql_scanner", CatalogType::TABLE_FUNCTION_ENTRY}, + {"mysql_execute", "mysql_scanner", CatalogType::TABLE_FUNCTION_ENTRY}, + {"mysql_query", "mysql_scanner", CatalogType::TABLE_FUNCTION_ENTRY}, {"parquet_file_metadata", "parquet", CatalogType::TABLE_FUNCTION_ENTRY}, {"parquet_kv_metadata", "parquet", CatalogType::TABLE_FUNCTION_ENTRY}, {"parquet_metadata", "parquet", CatalogType::TABLE_FUNCTION_ENTRY}, @@ -252,11 +386,18 @@ static constexpr ExtensionEntry EXTENSION_SETTINGS[] = { {"calendar", "icu"}, {"enable_server_cert_verification", "httpfs"}, {"force_download", "httpfs"}, + {"hf_max_per_page", "httpfs"}, + {"hnsw_ef_search", "vss"}, + {"hnsw_enable_experimental_persistence", "vss"}, {"http_keep_alive", "httpfs"}, {"http_retries", "httpfs"}, {"http_retry_backoff", "httpfs"}, {"http_retry_wait_ms", "httpfs"}, {"http_timeout", "httpfs"}, + {"mysql_bit1_as_boolean", "mysql_scanner"}, + {"mysql_debug_show_queries", "mysql_scanner"}, + {"mysql_experimental_filter_pushdown", "mysql_scanner"}, + {"mysql_tinyint1_as_boolean", "mysql_scanner"}, {"pg_array_as_varchar", "postgres_scanner"}, {"pg_connection_cache", "postgres_scanner"}, {"pg_connection_limit", "postgres_scanner"}, @@ -319,9 +460,9 @@ static constexpr ExtensionEntry EXTENSION_COLLATIONS[] = { // Note: these are currently hardcoded in scripts/generate_extensions_function.py // TODO: automate by passing though to script via duckdb static constexpr ExtensionEntry EXTENSION_FILE_PREFIXES[] = { - {"http://", "httpfs"}, {"https://", "httpfs"}, {"s3://", "httpfs"}, {"s3a://", "httpfs"}, - {"s3n://", "httpfs"}, {"gcs://", "httpfs"}, {"gs://", "httpfs"}, {"r2://", "httpfs"}, - {"azure://", "azure"}, {"az://", "azure"}, {"abfss://", "azure"}}; // END_OF_EXTENSION_FILE_PREFIXES + {"http://", "httpfs"}, {"https://", "httpfs"}, {"s3://", "httpfs"}, {"s3a://", "httpfs"}, {"s3n://", "httpfs"}, + {"gcs://", "httpfs"}, {"gs://", "httpfs"}, {"r2://", "httpfs"}, {"azure://", "azure"}, {"az://", "azure"}, + {"abfss://", "azure"}, {"hf://", "httpfs"}}; // END_OF_EXTENSION_FILE_PREFIXES // Note: these are currently hardcoded in scripts/generate_extensions_function.py // TODO: automate by passing though to script via duckdb @@ -339,18 +480,22 @@ static constexpr ExtensionEntry EXTENSION_FILE_CONTAINS[] = {{".parquet?", "parq // Note: these are currently hardcoded in scripts/generate_extensions_function.py // TODO: automate by passing though to script via duckdb static constexpr ExtensionEntry EXTENSION_SECRET_TYPES[] = { - {"s3", "httpfs"}, {"r2", "httpfs"}, {"gcs", "httpfs"}, {"azure", "azure"}}; // EXTENSION_SECRET_TYPES + {"s3", "httpfs"}, {"r2", "httpfs"}, {"gcs", "httpfs"}, + {"azure", "azure"}, {"huggingface", "httpfs"}, {"bearer", "httpfs"}}; // EXTENSION_SECRET_TYPES // Note: these are currently hardcoded in scripts/generate_extensions_function.py // TODO: automate by passing though to script via duckdb static constexpr ExtensionEntry EXTENSION_SECRET_PROVIDERS[] = { - {"s3/config", "httpfs"}, {"gcs/config", "httpfs"}, {"r2/config", "httpfs"}, - {"s3/credential_chain", "aws"}, {"gcs/credential_chain", "aws"}, {"r2/credential_chain", "aws"}, - {"azure/config", "azure"}, {"azure/credential_chain", "azure"}}; // EXTENSION_SECRET_PROVIDERS + {"s3/config", "httpfs"}, {"gcs/config", "httpfs"}, + {"r2/config", "httpfs"}, {"s3/credential_chain", "aws"}, + {"gcs/credential_chain", "aws"}, {"r2/credential_chain", "aws"}, + {"azure/config", "azure"}, {"azure/credential_chain", "azure"}, + {"huggingface/config", "httfps"}, {"huggingface/credential_chain", "httpfs"}, + {"bearer/config", "httpfs"}}; // EXTENSION_SECRET_PROVIDERS static constexpr const char *AUTOLOADABLE_EXTENSIONS[] = { - "aws", "azure", "autocomplete", "excel", "fts", "httpfs", "inet", - "icu", "json", "parquet", "sqlite_scanner", "sqlsmith", "postgres_scanner", "tpcds", - "tpch"}; // END_OF_AUTOLOADABLE_EXTENSIONS + "aws", "azure", "autocomplete", "delta", "excel", "fts", "httpfs", + "inet", "icu", "json", "parquet", "sqlite_scanner", "sqlsmith", "postgres_scanner", + "tpcds", "tpch"}; // END_OF_AUTOLOADABLE_EXTENSIONS } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/main/extension_helper.hpp b/src/duckdb/src/include/duckdb/main/extension_helper.hpp index 8d886468..c88f95b7 100644 --- a/src/duckdb/src/include/duckdb/main/extension_helper.hpp +++ b/src/duckdb/src/include/duckdb/main/extension_helper.hpp @@ -8,12 +8,18 @@ #pragma once -#include #include "duckdb.hpp" #include "duckdb/main/extension_entries.hpp" +#include "duckdb/main/extension_install_info.hpp" + +#include + +#include namespace duckdb { + class DuckDB; +class HTTPLogger; enum class ExtensionLoadResult : uint8_t { LOADED_EXTENSION = 0, EXTENSION_UNKNOWN = 1, NOT_LOADED = 2 }; @@ -31,11 +37,47 @@ struct ExtensionAlias { struct ExtensionInitResult { string filename; string filebase; - string extension_version; + + // The deserialized install from the `.duckdb_extension.info` file + unique_ptr install_info; void *lib_hdl; }; +// Tags describe what happened during the updating process +enum class ExtensionUpdateResultTag : uint8_t { + // Fallback for when installation information is missing + UNKNOWN = 0, + + // Either a fresh file was downloaded and versions are identical + NO_UPDATE_AVAILABLE = 1, + // Only extensions from repositories can be updated + NOT_A_REPOSITORY = 2, + // Only known, currently installed extensions can be updated + NOT_INSTALLED = 3, + // Statically loaded extensions can not be updated; they are baked into the DuckDB executable + STATICALLY_LOADED = 4, + // This means the .info file written during installation was missing or malformed + MISSING_INSTALL_INFO = 5, + + // The extension was re-downloaded from the repository, but due to a lack of version information + // its impossible to tell if the extension is actually updated + REDOWNLOADED = 254, + // The version was updated to a new version + UPDATED = 255, +}; + +struct ExtensionUpdateResult { + ExtensionUpdateResultTag tag = ExtensionUpdateResultTag::UNKNOWN; + + string extension_name; + string repository; + + string extension_version; + string prev_version; + string installed_version; +}; + class ExtensionHelper { public: static void LoadAllExtensions(DuckDB &db); @@ -43,10 +85,14 @@ class ExtensionHelper { static ExtensionLoadResult LoadExtension(DuckDB &db, const std::string &extension); //! Install an extension - static void InstallExtension(ClientContext &context, const string &extension, bool force_install, - const string &respository = ""); - static void InstallExtension(DBConfig &config, FileSystem &fs, const string &extension, bool force_install, - const string &respository = ""); + static unique_ptr InstallExtension(ClientContext &context, const string &extension, + bool force_install, + optional_ptr repository = nullptr, + const string &version = ""); + static unique_ptr InstallExtension(DBConfig &config, FileSystem &fs, const string &extension, + bool force_install, + optional_ptr repository = nullptr, + const string &version = ""); //! Load an extension static void LoadExternalExtension(ClientContext &context, const string &extension); static void LoadExternalExtension(DatabaseInstance &db, FileSystem &fs, const string &extension); @@ -58,12 +104,25 @@ class ExtensionHelper { //! Autoload an extension (depending on config, potentially a nop. Returns false on failure) DUCKDB_API static bool TryAutoLoadExtension(ClientContext &context, const string &extension_name) noexcept; + //! Update all extensions, return a vector of extension names that were updated; + static vector UpdateExtensions(ClientContext &context); + static vector UpdateExtensions(DatabaseInstance &db, FileSystem &fs); + //! Update a specific extension + static ExtensionUpdateResult UpdateExtension(ClientContext &context, const string &extension_name); + static ExtensionUpdateResult UpdateExtension(DatabaseInstance &db, FileSystem &fs, const string &extension_name); + //! Get the extension directory base on the current config static string ExtensionDirectory(ClientContext &context); static string ExtensionDirectory(DBConfig &config, FileSystem &fs); + static bool CheckExtensionSignature(FileHandle &handle, ParsedExtensionMetaData &parsed_metadata, + const bool allow_community_extensions); + static ParsedExtensionMetaData ParseExtensionMetaData(const char *metadata); + static ParsedExtensionMetaData ParseExtensionMetaData(FileHandle &handle); + //! Get the extension url template, containing placeholders for version, platform and extension name - static string ExtensionUrlTemplate(optional_ptr config, const string &repository); + static string ExtensionUrlTemplate(optional_ptr config, const ExtensionRepository &repository, + const string &version); //! Return the extension url template with the variables replaced static string ExtensionFinalizeUrlTemplate(const string &url, const string &name); @@ -77,11 +136,14 @@ class ExtensionHelper { static ExtensionAlias GetExtensionAlias(idx_t index); //! Get public signing keys for extension signing - static const vector GetPublicKeys(); + static const vector GetPublicKeys(bool allow_community_extension = false); // Returns extension name, or empty string if not a replacement open path static string ExtractExtensionPrefixFromPath(const string &path); + // Returns the user-readable name of a repository URL + static string GetRepositoryName(const string &repository_base_url); + //! Apply any known extension aliases, return the lowercase name static string ApplyExtensionAlias(const string &extension_name); @@ -147,9 +209,16 @@ class ExtensionHelper { //! For tagged releases we use the tag, else we use the git commit hash static const string GetVersionDirectoryName(); + static bool IsRelease(const string &version_tag); + static bool CreateSuggestions(const string &extension_name, string &message); + private: - static void InstallExtensionInternal(DBConfig &config, FileSystem &fs, const string &local_path, - const string &extension, bool force_install, const string &repository); + static unique_ptr InstallExtensionInternal(DBConfig &config, FileSystem &fs, + const string &local_path, const string &extension, + bool force_install, const string &version, + optional_ptr repository, + optional_ptr http_logger = nullptr, + optional_ptr context = nullptr); static const vector PathComponents(); static string DefaultExtensionFolder(FileSystem &fs); static bool AllowAutoInstall(const string &extension); @@ -158,8 +227,6 @@ class ExtensionHelper { string &error); //! Version tags occur with and without 'v', tag in extension path is always with 'v' static const string NormalizeVersionTag(const string &version_tag); - static bool IsRelease(const string &version_tag); - static bool CreateSuggestions(const string &extension_name, string &message); private: static ExtensionLoadResult LoadExtensionInternal(DuckDB &db, const std::string &extension, bool initial_load); diff --git a/src/duckdb/src/include/duckdb/main/extension_install_info.hpp b/src/duckdb/src/include/duckdb/main/extension_install_info.hpp new file mode 100644 index 00000000..64b7b520 --- /dev/null +++ b/src/duckdb/src/include/duckdb/main/extension_install_info.hpp @@ -0,0 +1,89 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/main/extension_install_info.hpp +// +// +//===----------------------------------------------------------------------===// + +#include "duckdb/common/types.hpp" +#include "duckdb/main/config.hpp" + +#pragma once + +namespace duckdb { +class FileSystem; + +enum class ExtensionInstallMode : uint8_t { + // Fallback for when install info is missing + UNKNOWN = 0, + //! Extension was installed using a url deduced from a repository base url + REPOSITORY = 1, + //! Extension was install from a custom path, this could be either local or remote + CUSTOM_PATH = 2, + //! Extension was statically linked + STATICALLY_LINKED = 3, + //! Extension is not installed, for example the extension might be directly loaded without installing + NOT_INSTALLED = 4 +}; + +class ExtensionInstallInfo { +public: + //! How the extension was installed + ExtensionInstallMode mode = ExtensionInstallMode::UNKNOWN; + //! (optional) Full path where the extension came from + string full_path; + //! (optional) Repository url where the extension came from + string repository_url; + //! (optional) Version of the extension + string version; + + void Serialize(Serializer &serializer) const; + + //! Try to read install info. returns ExtensionInstallMode::UNKNOWN on missing file, and throws on corrupt file + static unique_ptr TryReadInfoFile(FileSystem &fs, const string &info_file_path, + const string &extension_name); + + static unique_ptr Deserialize(Deserializer &deserializer); +}; + +struct ExtensionRepository { + //! All currently available repositories + static constexpr const char *CORE_REPOSITORY_URL = "http://extensions.duckdb.org"; + static constexpr const char *CORE_NIGHTLY_REPOSITORY_URL = "http://nightly-extensions.duckdb.org"; + static constexpr const char *COMMUNITY_REPOSITORY_URL = "http://community-extensions.duckdb.org"; + + //! Debugging repositories (target local, relative paths that are produced by DuckDB's build system) + static constexpr const char *BUILD_DEBUG_REPOSITORY_PATH = "./build/debug/repository"; + static constexpr const char *BUILD_RELEASE_REPOSITORY_PATH = "./build/release/repository"; + + //! The default is CORE + static constexpr const char *DEFAULT_REPOSITORY_URL = CORE_REPOSITORY_URL; + + //! Returns the repository name is this is a known repository, or the full url if it is not + static string GetRepository(const string &repository_url); + //! Try to convert a repository to a url, will return empty string if the repository is unknown + static string TryGetRepositoryUrl(const string &repository); + //! Try to convert a url to a known repository name, will return empty string if the repository is unknown + static string TryConvertUrlToKnownRepository(const string &url); + + //! Get the default repository, optionally passing a config to allow + static ExtensionRepository GetDefaultRepository(optional_ptr config); + static ExtensionRepository GetDefaultRepository(ClientContext &context); + + static ExtensionRepository GetCoreRepository(); + static ExtensionRepository GetRepositoryByUrl(const string &url); + + ExtensionRepository(); + ExtensionRepository(const string &name, const string &url); + + //! Print the name if it has one, or the full path if not + string ToReadableString(); + + //! Repository name + string name; + //! Repository path/url + string path; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/main/extension_util.hpp b/src/duckdb/src/include/duckdb/main/extension_util.hpp index bbfae5f3..6d790344 100644 --- a/src/duckdb/src/include/duckdb/main/extension_util.hpp +++ b/src/duckdb/src/include/duckdb/main/extension_util.hpp @@ -12,6 +12,7 @@ #include "duckdb/function/cast/cast_function_set.hpp" #include "duckdb/function/function_set.hpp" #include "duckdb/main/secret/secret.hpp" +#include "duckdb/parser/parsed_data/create_type_info.hpp" namespace duckdb { struct CreateMacroInfo; @@ -59,7 +60,8 @@ class ExtensionUtil { DUCKDB_API static void AddFunctionOverload(DatabaseInstance &db, TableFunctionSet function); //! Registers a new type - DUCKDB_API static void RegisterType(DatabaseInstance &db, string type_name, LogicalType type); + DUCKDB_API static void RegisterType(DatabaseInstance &db, string type_name, LogicalType type, + bind_type_modifiers_function_t bind_type_modifiers = nullptr); //! Registers a new secret type DUCKDB_API static void RegisterSecretType(DatabaseInstance &db, SecretType secret_type); diff --git a/src/duckdb/src/include/duckdb/main/external_dependencies.hpp b/src/duckdb/src/include/duckdb/main/external_dependencies.hpp index 4523d913..ed6afd4a 100644 --- a/src/duckdb/src/include/duckdb/main/external_dependencies.hpp +++ b/src/duckdb/src/include/duckdb/main/external_dependencies.hpp @@ -6,17 +6,59 @@ // //===----------------------------------------------------------------------===// +#include "duckdb/common/case_insensitive_map.hpp" +#include + #pragma once namespace duckdb { -enum class ExternalDependenciesType : uint8_t { PYTHON_DEPENDENCY }; +class DependencyItem { +public: + virtual ~DependencyItem() {}; + +public: + template + TARGET &Cast() { + DynamicCastCheck(this); + return reinterpret_cast(*this); + } + template + const TARGET &Cast() const { + DynamicCastCheck(this); + return reinterpret_cast(*this); + } +}; + +using dependency_scan_t = std::function item)>; class ExternalDependency { public: - explicit ExternalDependency(ExternalDependenciesType type_p) : type(type_p) {}; - virtual ~ExternalDependency() {}; - ExternalDependenciesType type; + explicit ExternalDependency() { + } + ~ExternalDependency() { + } + +public: + void AddDependency(const string &name, shared_ptr item) { + objects[name] = std::move(item); + } + shared_ptr GetDependency(const string &name) const { + auto it = objects.find(name); + if (it == objects.end()) { + return nullptr; + } + return it->second; + } + void ScanDependencies(const dependency_scan_t &callback) { + for (auto &kv : objects) { + callback(kv.first, kv.second); + } + } + +private: + //! The objects encompassed by this dependency + case_insensitive_map_t> objects; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/main/materialized_query_result.hpp b/src/duckdb/src/include/duckdb/main/materialized_query_result.hpp index 483f6de1..25c50d98 100644 --- a/src/duckdb/src/include/duckdb/main/materialized_query_result.hpp +++ b/src/duckdb/src/include/duckdb/main/materialized_query_result.hpp @@ -53,6 +53,9 @@ class MaterializedQueryResult : public QueryResult { //! Returns a reference to the underlying column data collection ColumnDataCollection &Collection(); + //! Takes ownership of the collection, 'collection' is null after this operation + unique_ptr TakeCollection(); + private: unique_ptr collection; //! Row collection, only created if GetValue is called diff --git a/src/duckdb/src/include/duckdb/main/relation.hpp b/src/duckdb/src/include/duckdb/main/relation.hpp index c16cb2a3..f53770d8 100644 --- a/src/duckdb/src/include/duckdb/main/relation.hpp +++ b/src/duckdb/src/include/duckdb/main/relation.hpp @@ -17,6 +17,7 @@ #include "duckdb/parser/column_definition.hpp" #include "duckdb/common/named_parameter_map.hpp" #include "duckdb/main/client_context.hpp" +#include "duckdb/main/client_context_wrapper.hpp" #include "duckdb/main/external_dependencies.hpp" #include "duckdb/parser/statement/explain_statement.hpp" #include "duckdb/parser/parsed_expression.hpp" @@ -28,15 +29,14 @@ namespace duckdb { struct BoundStatement; -class ClientContextWrapper; class Binder; class LogicalOperator; class QueryNode; class TableRef; -class Relation : public std::enable_shared_from_this { +class Relation : public enable_shared_from_this { public: - Relation(const std::shared_ptr &context, RelationType type) : context(context), type(type) { + Relation(const shared_ptr &context, RelationType type) : context(context), type(type) { } Relation(ClientContextWrapper &context, RelationType type) : context(context.GetContext()), type(type) { } @@ -44,10 +44,8 @@ class Relation : public std::enable_shared_from_this { } ClientContextWrapper context; - RelationType type; - - shared_ptr extra_dependencies; + vector> external_dependencies; public: DUCKDB_API virtual const vector &Columns() = 0; @@ -172,6 +170,7 @@ class Relation : public std::enable_shared_from_this { virtual Relation *ChildRelation() { return nullptr; } + void AddExternalDependency(shared_ptr dependency); DUCKDB_API vector> GetAllDependencies(); protected: diff --git a/src/duckdb/src/include/duckdb/main/relation/materialized_relation.hpp b/src/duckdb/src/include/duckdb/main/relation/materialized_relation.hpp new file mode 100644 index 00000000..74825fe4 --- /dev/null +++ b/src/duckdb/src/include/duckdb/main/relation/materialized_relation.hpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/main/relation/materialized_relation.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/main/relation.hpp" +#include "duckdb/parser/parsed_expression.hpp" + +namespace duckdb { + +class MaterializedRelation : public Relation { +public: + MaterializedRelation(const shared_ptr &context, unique_ptr &&collection, + vector names, string alias = "materialized"); + MaterializedRelation(const shared_ptr &context, const string &values, vector names, + string alias = "materialized"); + + unique_ptr collection; + vector columns; + string alias; + +public: + const vector &Columns() override; + string ToString(idx_t depth) override; + string GetAlias() override; + unique_ptr GetTableRef() override; + unique_ptr GetQueryNode() override; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/main/relation/query_relation.hpp b/src/duckdb/src/include/duckdb/main/relation/query_relation.hpp index 67cfcc06..f35a8133 100644 --- a/src/duckdb/src/include/duckdb/main/relation/query_relation.hpp +++ b/src/duckdb/src/include/duckdb/main/relation/query_relation.hpp @@ -16,7 +16,7 @@ class SelectStatement; class QueryRelation : public Relation { public: - QueryRelation(const std::shared_ptr &context, unique_ptr select_stmt, string alias); + QueryRelation(const shared_ptr &context, unique_ptr select_stmt, string alias); ~QueryRelation() override; unique_ptr select_stmt; diff --git a/src/duckdb/src/include/duckdb/main/relation/table_function_relation.hpp b/src/duckdb/src/include/duckdb/main/relation/table_function_relation.hpp index 394e92ba..9d605c68 100644 --- a/src/duckdb/src/include/duckdb/main/relation/table_function_relation.hpp +++ b/src/duckdb/src/include/duckdb/main/relation/table_function_relation.hpp @@ -14,11 +14,11 @@ namespace duckdb { class TableFunctionRelation : public Relation { public: - TableFunctionRelation(const std::shared_ptr &context, string name, vector parameters, + TableFunctionRelation(const shared_ptr &context, string name, vector parameters, named_parameter_map_t named_parameters, shared_ptr input_relation_p = nullptr, bool auto_init = true); - TableFunctionRelation(const std::shared_ptr &context, string name, vector parameters, + TableFunctionRelation(const shared_ptr &context, string name, vector parameters, shared_ptr input_relation_p = nullptr, bool auto_init = true); ~TableFunctionRelation() override { } diff --git a/src/duckdb/src/include/duckdb/main/relation/table_relation.hpp b/src/duckdb/src/include/duckdb/main/relation/table_relation.hpp index 77a950ce..a14ce054 100644 --- a/src/duckdb/src/include/duckdb/main/relation/table_relation.hpp +++ b/src/duckdb/src/include/duckdb/main/relation/table_relation.hpp @@ -15,7 +15,7 @@ namespace duckdb { class TableRelation : public Relation { public: - TableRelation(const std::shared_ptr &context, unique_ptr description); + TableRelation(const shared_ptr &context, unique_ptr description); unique_ptr description; diff --git a/src/duckdb/src/include/duckdb/main/relation/value_relation.hpp b/src/duckdb/src/include/duckdb/main/relation/value_relation.hpp index b8aa47c0..81fb8c4e 100644 --- a/src/duckdb/src/include/duckdb/main/relation/value_relation.hpp +++ b/src/duckdb/src/include/duckdb/main/relation/value_relation.hpp @@ -15,9 +15,9 @@ namespace duckdb { class ValueRelation : public Relation { public: - ValueRelation(const std::shared_ptr &context, const vector> &values, - vector names, string alias = "values"); - ValueRelation(const std::shared_ptr &context, const string &values, vector names, + ValueRelation(const shared_ptr &context, const vector> &values, vector names, + string alias = "values"); + ValueRelation(const shared_ptr &context, const string &values, vector names, string alias = "values"); vector>> expressions; diff --git a/src/duckdb/src/include/duckdb/main/relation/view_relation.hpp b/src/duckdb/src/include/duckdb/main/relation/view_relation.hpp index 8a8afa26..75f63910 100644 --- a/src/duckdb/src/include/duckdb/main/relation/view_relation.hpp +++ b/src/duckdb/src/include/duckdb/main/relation/view_relation.hpp @@ -14,7 +14,7 @@ namespace duckdb { class ViewRelation : public Relation { public: - ViewRelation(const std::shared_ptr &context, string schema_name, string view_name); + ViewRelation(const shared_ptr &context, string schema_name, string view_name); string schema_name; string view_name; diff --git a/src/duckdb/src/include/duckdb/main/settings.hpp b/src/duckdb/src/include/duckdb/main/settings.hpp index 0badad65..10d9fe30 100644 --- a/src/duckdb/src/include/duckdb/main/settings.hpp +++ b/src/duckdb/src/include/duckdb/main/settings.hpp @@ -225,6 +225,15 @@ struct AllowUnsignedExtensionsSetting { static Value GetSetting(const ClientContext &context); }; +struct AllowCommunityExtensionsSetting { + static constexpr const char *Name = "allow_community_extensions"; + static constexpr const char *Description = "Allow to load community built extensions"; + static constexpr const LogicalTypeId InputType = LogicalTypeId::BOOLEAN; + static void SetGlobal(DatabaseInstance *db, DBConfig &config, const Value ¶meter); + static void ResetGlobal(DatabaseInstance *db, DBConfig &config); + static Value GetSetting(const ClientContext &context); +}; + struct AllowExtensionsMetadataMismatchSetting { static constexpr const char *Name = "allow_extensions_metadata_mismatch"; static constexpr const char *Description = "Allow to load extensions with not compatible metadata"; @@ -291,6 +300,15 @@ struct EnableObjectCacheSetting { static Value GetSetting(const ClientContext &context); }; +struct StorageCompatibilityVersion { + static constexpr const char *Name = "storage_compatibility_version"; + static constexpr const char *Description = "Serialize on checkpoint with compatibility for a given duckdb version"; + static constexpr const LogicalTypeId InputType = LogicalTypeId::VARCHAR; + static void SetGlobal(DatabaseInstance *db, DBConfig &config, const Value ¶meter); + static void ResetGlobal(DatabaseInstance *db, DBConfig &config); + static Value GetSetting(const ClientContext &context); +}; + struct EnableHTTPMetadataCacheSetting { static constexpr const char *Name = "enable_http_metadata_cache"; static constexpr const char *Description = "Whether or not the global http metadata is used to cache HTTP metadata"; @@ -471,6 +489,16 @@ struct MaximumMemorySetting { static Value GetSetting(const ClientContext &context); }; +struct MaximumTempDirectorySize { + static constexpr const char *Name = "max_temp_directory_size"; + static constexpr const char *Description = + "The maximum amount of data stored inside the 'temp_directory' (when set) (e.g. 1GB)"; + static constexpr const LogicalTypeId InputType = LogicalTypeId::VARCHAR; + static void SetGlobal(DatabaseInstance *db, DBConfig &config, const Value ¶meter); + static void ResetGlobal(DatabaseInstance *db, DBConfig &config); + static Value GetSetting(const ClientContext &context); +}; + struct OldImplicitCasting { static constexpr const char *Name = "old_implicit_casting"; static constexpr const char *Description = "Allow implicit casting to/from VARCHAR"; @@ -661,4 +689,23 @@ struct CustomUserAgentSetting { static Value GetSetting(const ClientContext &context); }; +struct EnableHTTPLoggingSetting { + static constexpr const char *Name = "enable_http_logging"; + static constexpr const char *Description = "Enables HTTP logging"; + static constexpr const LogicalTypeId InputType = LogicalTypeId::BOOLEAN; + static void SetLocal(ClientContext &context, const Value ¶meter); + static void ResetLocal(ClientContext &context); + static Value GetSetting(const ClientContext &context); +}; + +struct HTTPLoggingOutputSetting { + static constexpr const char *Name = "http_logging_output"; + static constexpr const char *Description = + "The file to which HTTP logging output should be saved, or empty to print to the terminal"; + static constexpr const LogicalTypeId InputType = LogicalTypeId::VARCHAR; + static void SetLocal(ClientContext &context, const Value ¶meter); + static void ResetLocal(ClientContext &context); + static Value GetSetting(const ClientContext &context); +}; + } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp b/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp index 70ba4fdf..c8c87fd5 100644 --- a/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp +++ b/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp @@ -18,7 +18,7 @@ class Optimizer; class FilterPushdown { public: - explicit FilterPushdown(Optimizer &optimizer); + explicit FilterPushdown(Optimizer &optimizer, bool convert_mark_joins = true); //! Perform filter pushdown unique_ptr Rewrite(unique_ptr op); @@ -38,9 +38,11 @@ class FilterPushdown { }; private: - vector> filters; Optimizer &optimizer; + FilterCombiner combiner; + bool convert_mark_joins; + vector> filters; //! Push down a LogicalAggregate op unique_ptr PushdownAggregate(unique_ptr op); //! Push down a distinct operator @@ -90,8 +92,6 @@ class FilterPushdown { void GenerateFilters(); //! if there are filters in this FilterPushdown node, push them into the combiner void PushFilters(); - - FilterCombiner combiner; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/optimizer/join_order/cost_model.hpp b/src/duckdb/src/include/duckdb/optimizer/join_order/cost_model.hpp index 49895406..446a127e 100644 --- a/src/duckdb/src/include/duckdb/optimizer/join_order/cost_model.hpp +++ b/src/duckdb/src/include/duckdb/optimizer/join_order/cost_model.hpp @@ -26,7 +26,7 @@ class CostModel { void InitCostModel(); //! Compute cost of a join relation set - double ComputeCost(JoinNode &left, JoinNode &right); + double ComputeCost(DPJoinNode &left, DPJoinNode &right); //! Cardinality Estimator used to calculate cost CardinalityEstimator cardinality_estimator; diff --git a/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp b/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp index 8f973c95..b68f9a0a 100644 --- a/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp +++ b/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp @@ -14,40 +14,33 @@ namespace duckdb { struct NeighborInfo; -class JoinNode { +class DPJoinNode { public: //! Represents a node in the join plan JoinRelationSet &set; //! information on how left and right are connected optional_ptr info; + bool is_leaf; //! left and right plans - optional_ptr left; - optional_ptr right; + JoinRelationSet &left_set; + JoinRelationSet &right_set; //! The cost of the join node. The cost is stored here so that the cost of //! a join node stays in sync with how the join node is constructed. Storing the cost in an unordered_set //! in the cost model is error prone. If the plan enumerator join node is updated and not the cost model //! the whole Join Order Optimizer can start exhibiting undesired behavior. double cost; - //! used only to populate logical operators with estimated caridnalities after the best join plan has been found. + //! used only to populate logical operators with estimated cardinalities after the best join plan has been found. idx_t cardinality; //! Create an intermediate node in the join tree. base_cardinality = estimated_props.cardinality - JoinNode(JoinRelationSet &set, optional_ptr info, JoinNode &left, JoinNode &right, double cost); + DPJoinNode(JoinRelationSet &set, optional_ptr info, JoinRelationSet &left, JoinRelationSet &right, + double cost); //! Create a leaf node in the join tree //! set cost to 0 for leaf nodes //! cost will be the cost to *produce* an intermediate table - explicit JoinNode(JoinRelationSet &set); - - bool operator==(const JoinNode &other) { - return other.set.ToString().compare(set.ToString()) == 0; - } - -private: -public: - void Print(); - string ToString(); + explicit DPJoinNode(JoinRelationSet &set); }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp b/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp index 720ec4ab..5ff52b21 100644 --- a/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp +++ b/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp @@ -31,19 +31,12 @@ class JoinOrderOptimizer { //! Perform join reordering inside a plan unique_ptr Optimize(unique_ptr plan, optional_ptr stats = nullptr); - unique_ptr CreateJoinTree(JoinRelationSet &set, - const vector> &possible_connections, JoinNode &left, - JoinNode &right); - private: ClientContext &context; //! manages the query graph, relations, and edges between relations QueryGraphManager query_graph_manager; - //! The optimal join plan found for the specific JoinRelationSet* - unordered_map> plans; - //! The set of filters extracted from the query graph vector> filters; //! The set of filter infos created from the extracted filters @@ -54,51 +47,7 @@ class JoinOrderOptimizer { CardinalityEstimator cardinality_estimator; - bool full_plan_found; - bool must_update_full_plan; unordered_set join_nodes_in_full_plan; - - //! Extract the bindings referred to by an Expression - bool ExtractBindings(Expression &expression, unordered_set &bindings); - - //! Get column bindings from a filter - void GetColumnBinding(Expression &expression, ColumnBinding &binding); - - //! Traverse the query tree to find (1) base relations, (2) existing join conditions and (3) filters that can be - //! rewritten into joins. Returns true if there are joins in the tree that can be reordered, false otherwise. - bool ExtractJoinRelations(LogicalOperator &input_op, vector> &filter_operators, - optional_ptr parent = nullptr); - - //! Emit a pair as a potential join candidate. Returns the best plan found for the (left, right) connection (either - //! the newly created plan, or an existing plan) - JoinNode &EmitPair(JoinRelationSet &left, JoinRelationSet &right, const vector> &info); - //! Tries to emit a potential join candidate pair. Returns false if too many pairs have already been emitted, - //! cancelling the dynamic programming step. - bool TryEmitPair(JoinRelationSet &left, JoinRelationSet &right, const vector> &info); - - bool EnumerateCmpRecursive(JoinRelationSet &left, JoinRelationSet &right, unordered_set &exclusion_set); - //! Emit a relation set node - bool EmitCSG(JoinRelationSet &node); - //! Enumerate the possible connected subgraphs that can be joined together in the join graph - bool EnumerateCSGRecursive(JoinRelationSet &node, unordered_set &exclusion_set); - //! Rewrite a logical query plan given the join plan - unique_ptr RewritePlan(unique_ptr plan, JoinNode &node); - //! Generate cross product edges inside the side - void GenerateCrossProducts(); - //! Perform the join order solving - void SolveJoinOrder(); - //! Solve the join order exactly using dynamic programming. Returns true if it was completed successfully (i.e. did - //! not time-out) - bool SolveJoinOrderExactly(); - //! Solve the join order approximately using a greedy algorithm - void SolveJoinOrderApproximately(); - - void UpdateDPTree(JoinNode &new_plan); - - void UpdateJoinNodesInFullPlan(JoinNode &node); - bool NodeInFullPlan(JoinNode &node); - - GenerateJoinRelation GenerateJoins(vector> &extracted_relations, JoinNode &node); }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/optimizer/join_order/plan_enumerator.hpp b/src/duckdb/src/include/duckdb/optimizer/join_order/plan_enumerator.hpp index 19d6a40f..46aa5ce4 100644 --- a/src/duckdb/src/include/duckdb/optimizer/join_order/plan_enumerator.hpp +++ b/src/duckdb/src/include/duckdb/optimizer/join_order/plan_enumerator.hpp @@ -30,38 +30,36 @@ class PlanEnumerator { public: explicit PlanEnumerator(QueryGraphManager &query_graph_manager, CostModel &cost_model, const QueryGraphEdges &query_graph) - : query_graph(query_graph), query_graph_manager(query_graph_manager), cost_model(cost_model), - full_plan_found(false), must_update_full_plan(false) { + : query_graph(query_graph), query_graph_manager(query_graph_manager), cost_model(cost_model) { } //! Perform the join order solving - unique_ptr SolveJoinOrder(); + void SolveJoinOrder(); void InitLeafPlans(); - static unique_ptr BuildSideProbeSideSwaps(unique_ptr plan); + const reference_map_t> &GetPlans() const; private: + //! The set of edges used in the join optimizer QueryGraphEdges const &query_graph; //! The total amount of join pairs that have been considered idx_t pairs = 0; - //! The set of edges used in the join optimizer + //! Grant access to the set manager and the relation manager QueryGraphManager &query_graph_manager; //! Cost model to evaluate cost of joins CostModel &cost_model; //! A map to store the optimal join plan found for a specific JoinRelationSet* - reference_map_t> plans; + reference_map_t> plans; - bool full_plan_found; - bool must_update_full_plan; unordered_set join_nodes_in_full_plan; - unique_ptr CreateJoinTree(JoinRelationSet &set, - const vector> &possible_connections, JoinNode &left, - JoinNode &right); + unique_ptr CreateJoinTree(JoinRelationSet &set, + const vector> &possible_connections, DPJoinNode &left, + DPJoinNode &right); //! Emit a pair as a potential join candidate. Returns the best plan found for the (left, right) connection (either //! the newly created plan, or an existing plan) - JoinNode &EmitPair(JoinRelationSet &left, JoinRelationSet &right, const vector> &info); + DPJoinNode &EmitPair(JoinRelationSet &left, JoinRelationSet &right, const vector> &info); //! Tries to emit a potential join candidate pair. Returns false if too many pairs have already been emitted, //! cancelling the dynamic programming step. bool TryEmitPair(JoinRelationSet &left, JoinRelationSet &right, const vector> &info); @@ -79,11 +77,6 @@ class PlanEnumerator { bool SolveJoinOrderExactly(); //! Solve the join order approximately using a greedy algorithm void SolveJoinOrderApproximately(); - - void UpdateDPTree(JoinNode &new_plan); - - void UpdateJoinNodesInFullPlan(JoinNode &node); - bool NodeInFullPlan(JoinNode &node); }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp b/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp index c65d5131..fe38ff27 100644 --- a/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp +++ b/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp @@ -72,7 +72,7 @@ class QueryGraphManager { bool Build(LogicalOperator &op); //! Reconstruct the logical plan using the plan found by the plan enumerator - unique_ptr Reconstruct(unique_ptr plan, JoinNode &node); + unique_ptr Reconstruct(unique_ptr plan); //! Get a reference to the QueryGraphEdges structure that stores edges between //! nodes and hypernodes. @@ -92,6 +92,9 @@ class QueryGraphManager { unique_ptr LeftRightOptimizations(unique_ptr op); void TryFlipChildren(LogicalOperator &op, idx_t cardinality_ratio = 1); + //! A map to store the optimal join plan found for a specific JoinRelationSet* + optional_ptr>> plans; + private: vector> filter_operators; @@ -103,14 +106,9 @@ class QueryGraphManager { void GetColumnBinding(Expression &expression, ColumnBinding &binding); - bool ExtractBindings(Expression &expression, unordered_set &bindings); - bool LeftCardLessThanRight(LogicalOperator &op); - void CreateHyperGraphEdges(); - GenerateJoinRelation GenerateJoins(vector> &extracted_relations, JoinNode &node); - - unique_ptr RewritePlan(unique_ptr plan, JoinNode &node); + GenerateJoinRelation GenerateJoins(vector> &extracted_relations, JoinRelationSet &set); }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/optimizer/matcher/set_matcher.hpp b/src/duckdb/src/include/duckdb/optimizer/matcher/set_matcher.hpp index a709a1b5..11a991d2 100644 --- a/src/duckdb/src/include/duckdb/optimizer/matcher/set_matcher.hpp +++ b/src/duckdb/src/include/duckdb/optimizer/matcher/set_matcher.hpp @@ -9,6 +9,7 @@ #pragma once #include "duckdb/common/common.hpp" +#include "duckdb/common/numeric_utils.hpp" #include "duckdb/common/unordered_set.hpp" namespace duckdb { @@ -59,7 +60,7 @@ class SetMatcher { return true; } else { // we did not find a match! remove any bindings we added in the call to Match() - bindings.erase(bindings.begin() + previous_binding_count, bindings.end()); + bindings.erase(bindings.begin() + NumericCast(previous_binding_count), bindings.end()); } } } diff --git a/src/duckdb/src/include/duckdb/optimizer/optimizer_extension.hpp b/src/duckdb/src/include/duckdb/optimizer/optimizer_extension.hpp index bd2b0c8f..6ccc6277 100644 --- a/src/duckdb/src/include/duckdb/optimizer/optimizer_extension.hpp +++ b/src/duckdb/src/include/duckdb/optimizer/optimizer_extension.hpp @@ -13,14 +13,22 @@ namespace duckdb { +class Optimizer; +class ClientContext; + //! The OptimizerExtensionInfo holds static information relevant to the optimizer extension struct OptimizerExtensionInfo { virtual ~OptimizerExtensionInfo() { } }; -typedef void (*optimize_function_t)(ClientContext &context, OptimizerExtensionInfo *info, - unique_ptr &plan); +struct OptimizerExtensionInput { + ClientContext &context; + Optimizer &optimizer; + optional_ptr info; +}; + +typedef void (*optimize_function_t)(OptimizerExtensionInput &input, unique_ptr &plan); class OptimizerExtension { public: diff --git a/src/duckdb/src/include/duckdb/optimizer/rule/list.hpp b/src/duckdb/src/include/duckdb/optimizer/rule/list.hpp index e10f2727..361de546 100644 --- a/src/duckdb/src/include/duckdb/optimizer/rule/list.hpp +++ b/src/duckdb/src/include/duckdb/optimizer/rule/list.hpp @@ -11,3 +11,4 @@ #include "duckdb/optimizer/rule/enum_comparison.hpp" #include "duckdb/optimizer/rule/regex_optimizations.hpp" #include "duckdb/optimizer/rule/ordered_aggregate_optimizer.hpp" +#include "duckdb/optimizer/rule/timestamp_comparison.hpp" diff --git a/src/duckdb/src/include/duckdb/optimizer/rule/timestamp_comparison.hpp b/src/duckdb/src/include/duckdb/optimizer/rule/timestamp_comparison.hpp new file mode 100644 index 00000000..a38ed64a --- /dev/null +++ b/src/duckdb/src/include/duckdb/optimizer/rule/timestamp_comparison.hpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/optimizer/rule/timestamp_comparison.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/optimizer/rule.hpp" +#include "duckdb/function/scalar/string_functions.hpp" + +namespace duckdb { + +class TimeStampComparison : public Rule { +public: + explicit TimeStampComparison(ClientContext &context, ExpressionRewriter &rewriter); + + unique_ptr Apply(LogicalOperator &op, vector> &bindings, bool &changes_made, + bool is_root) override; + + unique_ptr ApplyRule(BoundFunctionExpression *expr, ScalarFunction function, string pattern, + bool is_not_like); + +private: + ClientContext &context; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parallel/event.hpp b/src/duckdb/src/include/duckdb/parallel/event.hpp index 794d1344..f259cf55 100644 --- a/src/duckdb/src/include/duckdb/parallel/event.hpp +++ b/src/duckdb/src/include/duckdb/parallel/event.hpp @@ -16,7 +16,7 @@ namespace duckdb { class Executor; class Task; -class Event : public std::enable_shared_from_this { +class Event : public enable_shared_from_this { public: explicit Event(Executor &executor); virtual ~Event() = default; diff --git a/src/duckdb/src/include/duckdb/parallel/interrupt.hpp b/src/duckdb/src/include/duckdb/parallel/interrupt.hpp index fe5348bc..f3c54aa2 100644 --- a/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +++ b/src/duckdb/src/include/duckdb/parallel/interrupt.hpp @@ -11,6 +11,7 @@ #include "duckdb/common/atomic.hpp" #include "duckdb/common/mutex.hpp" #include "duckdb/parallel/task.hpp" +#include "duckdb/common/shared_ptr.hpp" #include #include diff --git a/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp b/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp index 5bf58ef8..f8f954fb 100644 --- a/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +++ b/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp @@ -14,7 +14,7 @@ namespace duckdb { //! MetaPipeline represents a set of pipelines that all have the same sink -class MetaPipeline : public std::enable_shared_from_this { +class MetaPipeline : public enable_shared_from_this { //! We follow these rules when building: //! 1. For joins, build out the blocking side before going down the probe side //! - The current streaming pipeline will have a dependency on it (dependency across MetaPipelines) diff --git a/src/duckdb/src/include/duckdb/parallel/pipeline.hpp b/src/duckdb/src/include/duckdb/parallel/pipeline.hpp index 28781200..cb53777a 100644 --- a/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +++ b/src/duckdb/src/include/duckdb/parallel/pipeline.hpp @@ -66,7 +66,7 @@ class PipelineBuildState { }; //! The Pipeline class represents an execution pipeline starting at a -class Pipeline : public std::enable_shared_from_this { +class Pipeline : public enable_shared_from_this { friend class Executor; friend class PipelineExecutor; friend class PipelineEvent; diff --git a/src/duckdb/src/include/duckdb/parallel/task.hpp b/src/duckdb/src/include/duckdb/parallel/task.hpp index 2deadcbe..2bcafeea 100644 --- a/src/duckdb/src/include/duckdb/parallel/task.hpp +++ b/src/duckdb/src/include/duckdb/parallel/task.hpp @@ -22,7 +22,7 @@ enum class TaskExecutionMode : uint8_t { PROCESS_ALL, PROCESS_PARTIAL }; enum class TaskExecutionResult : uint8_t { TASK_FINISHED, TASK_NOT_FINISHED, TASK_ERROR, TASK_BLOCKED }; //! Generic parallel task -class Task : public std::enable_shared_from_this { +class Task : public enable_shared_from_this { public: virtual ~Task() { } diff --git a/src/duckdb/src/include/duckdb/parser/base_expression.hpp b/src/duckdb/src/include/duckdb/parser/base_expression.hpp index aed84f5e..a64baf72 100644 --- a/src/duckdb/src/include/duckdb/parser/base_expression.hpp +++ b/src/duckdb/src/include/duckdb/parser/base_expression.hpp @@ -79,7 +79,7 @@ class BaseExpression { static bool Equals(const BaseExpression &left, const BaseExpression &right) { return left.Equals(right); } - bool operator==(const BaseExpression &rhs) { + bool operator==(const BaseExpression &rhs) const { return Equals(rhs); } diff --git a/src/duckdb/src/include/duckdb/parser/column_definition.hpp b/src/duckdb/src/include/duckdb/parser/column_definition.hpp index 79d1110f..fa5cc8d3 100644 --- a/src/duckdb/src/include/duckdb/parser/column_definition.hpp +++ b/src/duckdb/src/include/duckdb/parser/column_definition.hpp @@ -104,6 +104,8 @@ class ColumnDefinition { unique_ptr expression; //! Comment on this column Value comment; + //! Tags on this column + unordered_map tags; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp index a2f13da2..88db356a 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp @@ -64,6 +64,7 @@ struct AlterInfo : public ParseInfo { public: virtual CatalogType GetCatalogType() const = 0; virtual unique_ptr Copy() const = 0; + virtual string ToString() const = 0; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/alter_scalar_function_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/alter_scalar_function_info.hpp index b33d81d6..625f25f3 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/alter_scalar_function_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/alter_scalar_function_info.hpp @@ -40,6 +40,7 @@ struct AddScalarFunctionOverloadInfo : public AlterScalarFunctionInfo { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp index a518d396..fc7944c3 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp @@ -40,6 +40,7 @@ struct AddTableFunctionOverloadInfo : public AlterTableFunctionInfo { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp index c07f05fc..30c53dc1 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp @@ -35,6 +35,7 @@ struct ChangeOwnershipInfo : public AlterInfo { public: CatalogType GetCatalogType() const override; unique_ptr Copy() const override; + string ToString() const override; }; //===--------------------------------------------------------------------===// @@ -50,6 +51,7 @@ struct SetCommentInfo : public AlterInfo { public: CatalogType GetCatalogType() const override; unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); @@ -104,6 +106,7 @@ struct RenameColumnInfo : public AlterTableInfo { public: unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); @@ -124,6 +127,7 @@ struct RenameTableInfo : public AlterTableInfo { public: unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); @@ -146,6 +150,7 @@ struct AddColumnInfo : public AlterTableInfo { public: unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); @@ -170,6 +175,7 @@ struct RemoveColumnInfo : public AlterTableInfo { public: unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); string GetColumnName() const override { @@ -197,6 +203,7 @@ struct ChangeColumnTypeInfo : public AlterTableInfo { public: unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); string GetColumnName() const override { @@ -221,6 +228,7 @@ struct SetDefaultInfo : public AlterTableInfo { public: unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); @@ -245,6 +253,7 @@ struct AlterForeignKeyInfo : public AlterTableInfo { public: unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); @@ -264,6 +273,7 @@ struct SetNotNullInfo : public AlterTableInfo { public: unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); @@ -283,6 +293,7 @@ struct DropNotNullInfo : public AlterTableInfo { public: unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); @@ -322,6 +333,7 @@ struct RenameViewInfo : public AlterViewInfo { public: unique_ptr Copy() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp index 0137592b..603faa1a 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp @@ -35,6 +35,7 @@ struct AttachInfo : public ParseInfo { public: unique_ptr Copy() const; + string ToString() const; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/comment_on_column_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/comment_on_column_info.hpp index b13aaacc..c274ffb5 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/comment_on_column_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/comment_on_column_info.hpp @@ -12,6 +12,7 @@ #include "duckdb/common/types/value.hpp" #include "duckdb/parser/parsed_data/alter_info.hpp" #include "duckdb/parser/qualified_name.hpp" +#include "duckdb/catalog/catalog_entry_retriever.hpp" namespace duckdb { class ClientContext; @@ -35,9 +36,10 @@ struct SetColumnCommentInfo : public AlterInfo { Value comment_value; public: - optional_ptr TryResolveCatalogEntry(ClientContext &context); + optional_ptr TryResolveCatalogEntry(CatalogEntryRetriever &retriever); unique_ptr Copy() const override; CatalogType GetCatalogType() const override; + string ToString() const override; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp index 75e8322a..46cb8358 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp @@ -16,6 +16,8 @@ namespace duckdb { +class QueryNode; + struct CopyInfo : public ParseInfo { public: static constexpr const ParseInfoType TYPE = ParseInfoType::COPY_INFO; @@ -40,20 +42,16 @@ struct CopyInfo : public ParseInfo { string file_path; //! Set of (key, value) options case_insensitive_map_t> options; + // The SQL statement used instead of a table when copying data out to a file + unique_ptr select_statement; public: - unique_ptr Copy() const { - auto result = make_uniq(); - result->catalog = catalog; - result->schema = schema; - result->table = table; - result->select_list = select_list; - result->file_path = file_path; - result->is_from = is_from; - result->format = format; - result->options = options; - return result; - } + static string CopyOptionsToString(const string &format, const case_insensitive_map_t> &options); + +public: + unique_ptr Copy() const; + string ToString() const; + string TablePartToString() const; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp index 50637103..1af6c979 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp @@ -44,8 +44,12 @@ struct CreateInfo : public ParseInfo { bool internal; //! The SQL string of the CREATE statement string sql; + //! The inherent dependencies of the created entry + LogicalDependencyList dependencies; //! User provided comment Value comment; + //! Key-value tags with additional metadata + unordered_map tags; public: void Serialize(Serializer &serializer) const override; @@ -58,8 +62,8 @@ struct CreateInfo : public ParseInfo { DUCKDB_API virtual unique_ptr GetAlterInfo() const; virtual string ToString() const { - throw InternalException("ToString not supported for this type of CreateInfo: '%s'", - EnumUtil::ToString(info_type)); + throw NotImplementedException("ToString not supported for this type of CreateInfo: '%s'", + EnumUtil::ToString(info_type)); } }; diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp index 33d5a844..39ab3a89 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp @@ -13,41 +13,14 @@ namespace duckdb { struct CreateSchemaInfo : public CreateInfo { - CreateSchemaInfo() : CreateInfo(CatalogType::SCHEMA_ENTRY) { - } + CreateSchemaInfo(); public: - unique_ptr Copy() const override { - auto result = make_uniq(); - CopyProperties(*result); - return std::move(result); - } - DUCKDB_API void Serialize(Serializer &serializer) const override; DUCKDB_API static unique_ptr Deserialize(Deserializer &deserializer); - string ToString() const override { - string ret = ""; - switch (on_conflict) { - case OnCreateConflict::ALTER_ON_CONFLICT: { - ret += "CREATE SCHEMA " + schema + " ON CONFLICT INSERT OR REPLACE;"; - break; - } - case OnCreateConflict::IGNORE_ON_CONFLICT: { - ret += "CREATE SCHEMA " + schema + " IF NOT EXISTS;"; - break; - } - case OnCreateConflict::REPLACE_ON_CONFLICT: { - ret += "CREATE OR REPLACE SCHEMA " + schema + ";"; - break; - } - case OnCreateConflict::ERROR_ON_CONFLICT: { - ret += "CREATE SCHEMA " + schema + ";"; - break; - } - } - return ret; - } + unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp index de8fcc57..ebb1fb45 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp @@ -52,6 +52,8 @@ struct CreateSequenceInfo : public CreateInfo { public: DUCKDB_API void Serialize(Serializer &serializer) const override; DUCKDB_API static unique_ptr Deserialize(Deserializer &deserializer); + + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp index 79f1efaa..00551cb4 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp @@ -15,9 +15,18 @@ namespace duckdb { +struct BindTypeModifiersInput { + ClientContext &context; + const LogicalType &type; + const vector &modifiers; +}; + +//! The type to bind type modifiers to a type +typedef LogicalType (*bind_type_modifiers_function_t)(BindTypeModifiersInput &input); + struct CreateTypeInfo : public CreateInfo { CreateTypeInfo(); - CreateTypeInfo(string name_p, LogicalType type_p); + CreateTypeInfo(string name_p, LogicalType type_p, bind_type_modifiers_function_t bind_modifiers_p = nullptr); //! Name of the Type string name; @@ -25,6 +34,8 @@ struct CreateTypeInfo : public CreateInfo { LogicalType type; //! Used by create enum from query unique_ptr query; + //! Bind type modifiers to the type + bind_type_modifiers_function_t bind_modifiers; public: unique_ptr Copy() const override; diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp index 3b54f902..272ac116 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp @@ -46,6 +46,7 @@ struct CreateViewInfo : public CreateInfo { DUCKDB_API void Serialize(Serializer &serializer) const override; DUCKDB_API static unique_ptr Deserialize(Deserializer &deserializer); + string ToString() const override; }; diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp index 8c0fdedc..a97bafcb 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp @@ -27,6 +27,7 @@ struct DetachInfo : public ParseInfo { public: unique_ptr Copy() const; + string ToString() const; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp index 84169013..40955edc 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp @@ -44,6 +44,7 @@ struct DropInfo : public ParseInfo { public: virtual unique_ptr Copy() const; + string ToString() const; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp index a5246b4e..b3f26a9b 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp @@ -26,11 +26,14 @@ struct ExportedTableData { //! Path to be exported string file_path; + //! Not Null columns, if any + vector not_null_columns; }; struct ExportedTableInfo { - ExportedTableInfo(TableCatalogEntry &entry, ExportedTableData table_data) - : entry(entry), table_data(std::move(table_data)) { + ExportedTableInfo(TableCatalogEntry &entry, ExportedTableData table_data_p, vector ¬_null_columns_p) + : entry(entry), table_data(std::move(table_data_p)) { + table_data.not_null_columns = not_null_columns_p; } TableCatalogEntry &entry; diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp index b595fa76..bc092a41 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp @@ -24,16 +24,13 @@ struct LoadInfo : public ParseInfo { string filename; string repository; + bool repo_is_alias; + string version; LoadType load_type; public: - unique_ptr Copy() const { - auto result = make_uniq(); - result->filename = filename; - result->repository = repository; - result->load_type = load_type; - return result; - } + unique_ptr Copy() const; + string ToString() const; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp index 5d395c6a..8810c6c9 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp @@ -9,9 +9,12 @@ #pragma once #include "duckdb/common/common.hpp" +#include "duckdb/common/enums/catalog_type.hpp" namespace duckdb { +enum class CatalogType : uint8_t; + enum class ParseInfoType : uint8_t { ALTER_INFO, ATTACH_INFO, @@ -28,7 +31,8 @@ enum class ParseInfoType : uint8_t { VACUUM_INFO, COMMENT_ON_INFO, COMMENT_ON_COLUMN_INFO, - COPY_DATABASE_INFO + COPY_DATABASE_INFO, + UPDATE_EXTENSIONS_INFO }; struct ParseInfo { @@ -54,6 +58,8 @@ struct ParseInfo { virtual void Serialize(Serializer &serializer) const; static unique_ptr Deserialize(Deserializer &deserializer); + static string QualifierToString(const string &catalog, const string &schema, const string &name); + static string TypeToString(CatalogType type); }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp index 5f76623b..bbf01242 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp @@ -33,17 +33,8 @@ struct PragmaInfo : public ParseInfo { case_insensitive_map_t> named_parameters; public: - unique_ptr Copy() const { - auto result = make_uniq(); - result->name = name; - for (auto ¶m : parameters) { - result->parameters.push_back(param->Copy()); - } - for (auto &entry : named_parameters) { - result->named_parameters.insert(make_pair(entry.first, entry.second->Copy())); - } - return result; - } + unique_ptr Copy() const; + string ToString() const; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp index 59c68914..b1cb2203 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp @@ -28,6 +28,8 @@ struct TransactionInfo : public ParseInfo { void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); + string ToString() const; + private: TransactionInfo(); }; diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/update_extensions_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/update_extensions_info.hpp new file mode 100644 index 00000000..b43ab895 --- /dev/null +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/update_extensions_info.hpp @@ -0,0 +1,36 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/parser/parsed_data/update_extensions_info.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/parser/parsed_data/parse_info.hpp" + +namespace duckdb { + +struct UpdateExtensionsInfo : public ParseInfo { +public: + static constexpr const ParseInfoType TYPE = ParseInfoType::UPDATE_EXTENSIONS_INFO; + +public: + UpdateExtensionsInfo() : ParseInfo(TYPE) { + } + + vector extensions_to_update; + +public: + unique_ptr Copy() const { + auto result = make_uniq(); + result->extensions_to_update = extensions_to_update; + return result; + } + + void Serialize(Serializer &serializer) const override; + static unique_ptr Deserialize(Deserializer &deserializer); +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp b/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp index 6bd8fe6a..5540d38a 100644 --- a/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +++ b/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp @@ -44,6 +44,7 @@ struct VacuumInfo : public ParseInfo { public: unique_ptr Copy(); + string ToString() const; void Serialize(Serializer &serializer) const override; static unique_ptr Deserialize(Deserializer &deserializer); diff --git a/src/duckdb/src/include/duckdb/parser/parser_extension.hpp b/src/duckdb/src/include/duckdb/parser/parser_extension.hpp index baf60fb2..d530c6af 100644 --- a/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +++ b/src/duckdb/src/include/duckdb/parser/parser_extension.hpp @@ -33,6 +33,7 @@ struct ParserExtensionParseData { } virtual unique_ptr Copy() const = 0; + virtual string ToString() const = 0; }; struct ParserExtensionParseResult { diff --git a/src/duckdb/src/include/duckdb/parser/query_node.hpp b/src/duckdb/src/include/duckdb/parser/query_node.hpp index cdd2d728..ec03da09 100644 --- a/src/duckdb/src/include/duckdb/parser/query_node.hpp +++ b/src/duckdb/src/include/duckdb/parser/query_node.hpp @@ -12,7 +12,7 @@ #include "duckdb/parser/parsed_expression.hpp" #include "duckdb/parser/result_modifier.hpp" #include "duckdb/parser/common_table_expression_info.hpp" -#include "duckdb/common/case_insensitive_map.hpp" +#include "duckdb/common/insertion_order_preserving_map.hpp" #include "duckdb/common/exception.hpp" namespace duckdb { @@ -34,7 +34,7 @@ class CommonTableExpressionMap { public: CommonTableExpressionMap(); - case_insensitive_map_t> map; + InsertionOrderPreservingMap> map; public: string ToString() const; diff --git a/src/duckdb/src/include/duckdb/parser/sql_statement.hpp b/src/duckdb/src/include/duckdb/parser/sql_statement.hpp index d8ebc1a2..5f9e655e 100644 --- a/src/duckdb/src/include/duckdb/parser/sql_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/sql_statement.hpp @@ -44,10 +44,7 @@ class SQLStatement { SQLStatement(const SQLStatement &other) = default; public: - virtual string ToString() const { - throw InternalException("ToString not supported for this type of SQLStatement: '%s'", - StatementTypeToString(type)); - } + virtual string ToString() const = 0; //! Create a copy of this SelectStatement DUCKDB_API virtual unique_ptr Copy() const = 0; diff --git a/src/duckdb/src/include/duckdb/parser/statement/alter_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/alter_statement.hpp index 67bd648e..08b26eb4 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/alter_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/alter_statement.hpp @@ -28,6 +28,7 @@ class AlterStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/attach_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/attach_statement.hpp index 3f1adcc1..6ee7fb4e 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/attach_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/attach_statement.hpp @@ -27,6 +27,7 @@ class AttachStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/call_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/call_statement.hpp index 7fd8fa51..afd5d256 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/call_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/call_statement.hpp @@ -28,5 +28,6 @@ class CallStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/copy_database_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/copy_database_statement.hpp index a1f2cfe4..d206bc5f 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/copy_database_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/copy_database_statement.hpp @@ -27,13 +27,12 @@ class CopyDatabaseStatement : public SQLStatement { string to_database; CopyDatabaseType copy_type; - string ToString() const override; - protected: CopyDatabaseStatement(const CopyDatabaseStatement &other); public: DUCKDB_API unique_ptr Copy() const override; + string ToString() const override; private: }; diff --git a/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp index 4ac59c5b..3b75a99a 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp @@ -22,10 +22,8 @@ class CopyStatement : public SQLStatement { CopyStatement(); unique_ptr info; - // The SQL statement used instead of a table when copying data out to a file - unique_ptr select_statement; + string ToString() const override; - string CopyOptionsToString(const string &format, const case_insensitive_map_t> &options) const; protected: CopyStatement(const CopyStatement &other); diff --git a/src/duckdb/src/include/duckdb/parser/statement/detach_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/detach_statement.hpp index 3d1380cd..64ab65cf 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/detach_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/detach_statement.hpp @@ -27,6 +27,7 @@ class DetachStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/drop_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/drop_statement.hpp index d8e71e65..8b865494 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/drop_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/drop_statement.hpp @@ -27,6 +27,7 @@ class DropStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/execute_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/execute_statement.hpp index 81ca82f5..2a15165d 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/execute_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/execute_statement.hpp @@ -29,5 +29,6 @@ class ExecuteStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/explain_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/explain_statement.hpp index f6f6086a..8e499ef4 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/explain_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/explain_statement.hpp @@ -30,6 +30,7 @@ class ExplainStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/export_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/export_statement.hpp index 58215e39..97430a93 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/export_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/export_statement.hpp @@ -29,6 +29,7 @@ class ExportStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/extension_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/extension_statement.hpp index c75f0668..ddc2aab2 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/extension_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/extension_statement.hpp @@ -27,6 +27,7 @@ class ExtensionStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp index 0f6a6624..8174b5cb 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp @@ -85,6 +85,7 @@ class InsertStatement : public SQLStatement { public: static string OnConflictActionToString(OnConflictAction action); + string ToString() const override; unique_ptr Copy() const override; diff --git a/src/duckdb/src/include/duckdb/parser/statement/list.hpp b/src/duckdb/src/include/duckdb/parser/statement/list.hpp index d9d04e17..a0d04ce5 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/list.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/list.hpp @@ -21,4 +21,5 @@ #include "duckdb/parser/statement/set_statement.hpp" #include "duckdb/parser/statement/transaction_statement.hpp" #include "duckdb/parser/statement/update_statement.hpp" +#include "duckdb/parser/statement/update_extensions_statement.hpp" #include "duckdb/parser/statement/vacuum_statement.hpp" diff --git a/src/duckdb/src/include/duckdb/parser/statement/load_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/load_statement.hpp index 2333e8f9..3667adb7 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/load_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/load_statement.hpp @@ -25,6 +25,7 @@ class LoadStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; unique_ptr info; }; diff --git a/src/duckdb/src/include/duckdb/parser/statement/logical_plan_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/logical_plan_statement.hpp index 811d1b86..39800335 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/logical_plan_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/logical_plan_statement.hpp @@ -27,6 +27,9 @@ class LogicalPlanStatement : public SQLStatement { unique_ptr Copy() const override { throw NotImplementedException("PLAN_STATEMENT"); } + string ToString() const override { + throw NotImplementedException("PLAN STATEMENT"); + } }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/multi_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/multi_statement.hpp index ef1dfc1c..42a26ff6 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/multi_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/multi_statement.hpp @@ -26,6 +26,7 @@ class MultiStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/pragma_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/pragma_statement.hpp index a1b1e9a2..249c468b 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/pragma_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/pragma_statement.hpp @@ -28,6 +28,7 @@ class PragmaStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/prepare_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/prepare_statement.hpp index e3df292d..c2be7598 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/prepare_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/prepare_statement.hpp @@ -28,5 +28,6 @@ class PrepareStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/relation_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/relation_statement.hpp index f23bd747..b3acb75e 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/relation_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/relation_statement.hpp @@ -27,6 +27,7 @@ class RelationStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp index 94581e2c..d0fd8b4d 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp @@ -37,6 +37,7 @@ class SelectStatement : public SQLStatement { public: //! Convert the SELECT statement to a string + DUCKDB_API string ToString() const override; //! Create a copy of this SelectStatement DUCKDB_API unique_ptr Copy() const override; diff --git a/src/duckdb/src/include/duckdb/parser/statement/set_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/set_statement.hpp index d477c9cc..14c57d3b 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/set_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/set_statement.hpp @@ -25,10 +25,7 @@ class SetStatement : public SQLStatement { SetStatement(const SetStatement &other) = default; public: - unique_ptr Copy() const override; - -public: - std::string name; + string name; SetScope scope; SetType set_type; }; @@ -42,6 +39,7 @@ class SetVariableStatement : public SetStatement { public: unique_ptr Copy() const override; + string ToString() const override; public: unique_ptr value; @@ -53,6 +51,10 @@ class ResetVariableStatement : public SetStatement { protected: ResetVariableStatement(const ResetVariableStatement &other) = default; + +public: + unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/transaction_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/transaction_statement.hpp index f34ac05f..5f7bf184 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/transaction_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/transaction_statement.hpp @@ -27,5 +27,6 @@ class TransactionStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/update_extensions_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/update_extensions_statement.hpp new file mode 100644 index 00000000..2c361b33 --- /dev/null +++ b/src/duckdb/src/include/duckdb/parser/statement/update_extensions_statement.hpp @@ -0,0 +1,36 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/parser/statement/update_extensions_statement.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/parser/parsed_expression.hpp" +#include "duckdb/parser/sql_statement.hpp" +#include "duckdb/parser/tableref.hpp" +#include "duckdb/common/vector.hpp" +#include "duckdb/parser/query_node.hpp" +#include "duckdb/parser/parsed_data/update_extensions_info.hpp" + +namespace duckdb { + +class UpdateExtensionsStatement : public SQLStatement { +public: + static constexpr const StatementType TYPE = StatementType::UPDATE_EXTENSIONS_STATEMENT; + +public: + UpdateExtensionsStatement(); + unique_ptr info; + +protected: + UpdateExtensionsStatement(const UpdateExtensionsStatement &other); + +public: + string ToString() const override; + unique_ptr Copy() const override; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/statement/vacuum_statement.hpp b/src/duckdb/src/include/duckdb/parser/statement/vacuum_statement.hpp index f84fbff0..07b04d1c 100644 --- a/src/duckdb/src/include/duckdb/parser/statement/vacuum_statement.hpp +++ b/src/duckdb/src/include/duckdb/parser/statement/vacuum_statement.hpp @@ -28,6 +28,7 @@ class VacuumStatement : public SQLStatement { public: unique_ptr Copy() const override; + string ToString() const override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/tableref.hpp b/src/duckdb/src/include/duckdb/parser/tableref.hpp index 57a7e485..d88142cf 100644 --- a/src/duckdb/src/include/duckdb/parser/tableref.hpp +++ b/src/duckdb/src/include/duckdb/parser/tableref.hpp @@ -12,6 +12,7 @@ #include "duckdb/common/optional_idx.hpp" #include "duckdb/common/enums/tableref_type.hpp" #include "duckdb/parser/parsed_data/sample_options.hpp" +#include "duckdb/main/external_dependencies.hpp" namespace duckdb { @@ -32,6 +33,8 @@ class TableRef { unique_ptr sample; //! The location in the query (if any) optional_idx query_location; + // External dependencies of this table function + shared_ptr external_dependency; public: //! Convert the object to a string diff --git a/src/duckdb/src/include/duckdb/parser/tableref/column_data_ref.hpp b/src/duckdb/src/include/duckdb/parser/tableref/column_data_ref.hpp new file mode 100644 index 00000000..300ecf3d --- /dev/null +++ b/src/duckdb/src/include/duckdb/parser/tableref/column_data_ref.hpp @@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/parser/tableref/column_data_ref.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/parser/tableref.hpp" +#include "duckdb/common/optionally_owned_ptr.hpp" +#include "duckdb/common/types/column/column_data_collection.hpp" + +namespace duckdb { +//! Represents a TableReference to a materialized result +class ColumnDataRef : public TableRef { +public: + static constexpr const TableReferenceType TYPE = TableReferenceType::COLUMN_DATA; + +public: + explicit ColumnDataRef(ColumnDataCollection &collection) + : TableRef(TableReferenceType::COLUMN_DATA), collection(collection) { + } + ColumnDataRef(vector expected_names, optionally_owned_ptr collection_p) + : TableRef(TableReferenceType::COLUMN_DATA), collection(std::move(collection_p)), + expected_names(std::move(expected_names)) { + } + +public: + //! (optionally owned) materialized column data + optionally_owned_ptr collection; + //! The set of expected names + vector expected_names; + +public: + string ToString() const override; + bool Equals(const TableRef &other_p) const override; + + unique_ptr Copy() override; + + //! Deserializes a blob back into a ColumnDataRef + void Serialize(Serializer &serializer) const override; + static unique_ptr Deserialize(Deserializer &source); +}; +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/parser/tableref/list.hpp b/src/duckdb/src/include/duckdb/parser/tableref/list.hpp index c6606dfb..c84a82b5 100644 --- a/src/duckdb/src/include/duckdb/parser/tableref/list.hpp +++ b/src/duckdb/src/include/duckdb/parser/tableref/list.hpp @@ -1,6 +1,7 @@ #include "duckdb/parser/tableref/basetableref.hpp" #include "duckdb/parser/tableref/emptytableref.hpp" #include "duckdb/parser/tableref/expressionlistref.hpp" +#include "duckdb/parser/tableref/column_data_ref.hpp" #include "duckdb/parser/tableref/joinref.hpp" #include "duckdb/parser/tableref/pivotref.hpp" #include "duckdb/parser/tableref/showref.hpp" diff --git a/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp b/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp index 7d782ca0..7cdc8caa 100644 --- a/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +++ b/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp @@ -12,7 +12,6 @@ #include "duckdb/parser/tableref.hpp" #include "duckdb/common/vector.hpp" #include "duckdb/parser/statement/select_statement.hpp" -#include "duckdb/main/external_dependencies.hpp" namespace duckdb { //! Represents a Table producing function @@ -29,9 +28,6 @@ class TableFunctionRef : public TableRef { // if the function takes a subquery as argument its in here unique_ptr subquery; - // External dependencies of this table function - unique_ptr external_dependency; - public: string ToString() const override; diff --git a/src/duckdb/src/include/duckdb/parser/tokens.hpp b/src/duckdb/src/include/duckdb/parser/tokens.hpp index e9d3bb56..f5eeb2c0 100644 --- a/src/duckdb/src/include/duckdb/parser/tokens.hpp +++ b/src/duckdb/src/include/duckdb/parser/tokens.hpp @@ -28,6 +28,7 @@ class InsertStatement; class SelectStatement; class TransactionStatement; class UpdateStatement; +class UpdateExtensionsStatement; class PrepareStatement; class ExecuteStatement; class PragmaStatement; @@ -96,6 +97,7 @@ class SubqueryRef; class TableFunctionRef; class EmptyTableRef; class ExpressionListRef; +class ColumnDataRef; class PivotRef; class ShowRef; diff --git a/src/duckdb/src/include/duckdb/parser/transformer.hpp b/src/duckdb/src/include/duckdb/parser/transformer.hpp index 40ed9071..9f4bcde4 100644 --- a/src/duckdb/src/include/duckdb/parser/transformer.hpp +++ b/src/duckdb/src/include/duckdb/parser/transformer.hpp @@ -158,6 +158,8 @@ class Transformer { unique_ptr TransformDelete(duckdb_libpgquery::PGDeleteStmt &stmt); //! Transform a Postgres duckdb_libpgquery::T_PGUpdateStmt node into a UpdateStatement unique_ptr TransformUpdate(duckdb_libpgquery::PGUpdateStmt &stmt); + //! Transform a Postgres duckdb_libpgquery::T_PGUpdateExtensionsStmt node into a UpdateExtensionsStatement + unique_ptr TransformUpdateExtensions(duckdb_libpgquery::PGUpdateExtensionsStmt &stmt); //! Transform a Postgres duckdb_libpgquery::T_PGPragmaStmt node into a PragmaStatement unique_ptr TransformPragma(duckdb_libpgquery::PGPragmaStmt &stmt); //! Transform a Postgres duckdb_libpgquery::T_PGExportStmt node into a ExportStatement @@ -321,6 +323,9 @@ class Transformer { //! Transform a Postgres TypeName string into a LogicalType LogicalType TransformTypeName(duckdb_libpgquery::PGTypeName &name); + //! Transform a list of type modifiers into a list of values + vector TransformTypeModifiers(duckdb_libpgquery::PGTypeName &name); + //! Transform a Postgres GROUP BY expression into a list of Expression bool TransformGroupBy(optional_ptr group, SelectNode &result); void TransformGroupByNode(duckdb_libpgquery::PGNode &n, GroupingExpressionMap &map, SelectNode &result, diff --git a/src/duckdb/src/include/duckdb/planner/bind_context.hpp b/src/duckdb/src/include/duckdb/planner/bind_context.hpp index cab1479d..e4b63f83 100644 --- a/src/duckdb/src/include/duckdb/planner/bind_context.hpp +++ b/src/duckdb/src/include/duckdb/planner/bind_context.hpp @@ -41,7 +41,7 @@ class BindContext { explicit BindContext(Binder &binder); //! Keep track of recursive CTE references - case_insensitive_map_t> cte_references; + case_insensitive_map_t> cte_references; public: //! Given a column name, find the matching table it belongs to. Throws an @@ -129,10 +129,10 @@ class BindContext { //! (e.g. "column_name" might return "COLUMN_NAME") string GetActualColumnName(const string &binding, const string &column_name); - case_insensitive_map_t> GetCTEBindings() { + case_insensitive_map_t> GetCTEBindings() { return cte_bindings; } - void SetCTEBindings(case_insensitive_map_t> bindings) { + void SetCTEBindings(case_insensitive_map_t> bindings) { cte_bindings = std::move(bindings); } @@ -165,6 +165,6 @@ class BindContext { vector> using_column_sets; //! The set of CTE bindings - case_insensitive_map_t> cte_bindings; + case_insensitive_map_t> cte_bindings; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/planner/binder.hpp b/src/duckdb/src/include/duckdb/planner/binder.hpp index ed646e6b..0261e115 100644 --- a/src/duckdb/src/include/duckdb/planner/binder.hpp +++ b/src/duckdb/src/include/duckdb/planner/binder.hpp @@ -43,6 +43,7 @@ class ColumnList; class ExternalDependency; class TableFunction; class TableStorageInfo; +class BoundConstraint; struct CreateInfo; struct BoundCreateTableInfo; @@ -55,6 +56,7 @@ struct PivotColumnEntry; struct UnpivotEntry; enum class BindingMode : uint8_t { STANDARD_BINDING, EXTRACT_NAMES }; +enum class BinderType : uint8_t { REGULAR_BINDER, VIEW_BINDER }; struct CorrelatedColumnInfo { ColumnBinding binding; @@ -81,13 +83,13 @@ struct CorrelatedColumnInfo { tables and columns in the catalog. In the process, it also resolves types of all expressions. */ -class Binder : public std::enable_shared_from_this { +class Binder : public enable_shared_from_this { friend class ExpressionBinder; friend class RecursiveDependentJoinPlanner; public: DUCKDB_API static shared_ptr CreateBinder(ClientContext &context, optional_ptr parent = nullptr, - bool inherit_ctes = true); + BinderType binder_type = BinderType::REGULAR_BINDER); //! The client context ClientContext &context; @@ -102,8 +104,6 @@ class Binder : public std::enable_shared_from_this { vector correlated_columns; //! The set of parameter expressions bound by this binder optional_ptr parameters; - //! Statement properties - StatementProperties properties; //! The alias for the currently processing subquery, if it exists string alias; //! Macro parameter bindings (if any) @@ -119,7 +119,20 @@ class Binder : public std::enable_shared_from_this { unique_ptr BindCreateTableInfo(unique_ptr info); unique_ptr BindCreateTableInfo(unique_ptr info, SchemaCatalogEntry &schema); - + unique_ptr BindCreateTableInfo(unique_ptr info, SchemaCatalogEntry &schema, + vector> &bound_defaults); + static unique_ptr BindCreateTableCheckpoint(unique_ptr info, + SchemaCatalogEntry &schema); + static vector> BindConstraints(ClientContext &context, + const vector> &constraints, + const string &table_name, const ColumnList &columns); + vector> BindConstraints(const vector> &constraints, + const string &table_name, const ColumnList &columns); + vector> BindConstraints(const TableCatalogEntry &table); + vector> BindNewConstraints(vector> &constraints, + const string &table_name, const ColumnList &columns); + + void SetCatalogLookupCallback(catalog_entry_callback_t callback); void BindCreateViewInfo(CreateViewInfo &base); SchemaCatalogEntry &BindSchema(CreateInfo &info); SchemaCatalogEntry &BindCreateFunctionInfo(CreateInfo &info); @@ -135,6 +148,10 @@ class Binder : public std::enable_shared_from_this { //! Generates an unused index for a table idx_t GenerateTableIndex(); + optional_ptr GetCatalogEntry(CatalogType type, const string &catalog, const string &schema, + const string &name, OnEntryNotFound on_entry_not_found, + QueryErrorContext &error_context); + //! Add a common table expression to the binder void AddCTE(const string &name, CommonTableExpressionInfo &cte); //! Find all candidate common table expression by name; returns empty vector if none exists @@ -167,8 +184,8 @@ class Binder : public std::enable_shared_from_this { void BindVacuumTable(LogicalVacuum &vacuum, unique_ptr &root); static void BindSchemaOrCatalog(ClientContext &context, string &catalog, string &schema); - static void BindLogicalType(ClientContext &context, LogicalType &type, optional_ptr catalog = nullptr, - const string &schema = INVALID_SCHEMA); + void BindLogicalType(LogicalType &type, optional_ptr catalog = nullptr, + const string &schema = INVALID_SCHEMA); bool HasMatchingBinding(const string &table_name, const string &column_name, ErrorData &error); bool HasMatchingBinding(const string &schema_name, const string &table_name, const string &column_name, @@ -187,6 +204,8 @@ class Binder : public std::enable_shared_from_this { void SetCanContainNulls(bool can_contain_nulls); void SetAlwaysRequireRebind(); + StatementProperties &GetStatementProperties(); + private: //! The parent binder (if any) shared_ptr parent; @@ -198,8 +217,8 @@ class Binder : public std::enable_shared_from_this { bool has_unplanned_dependent_joins = false; //! Whether or not outside dependent joins have been planned and flattened bool is_outside_flattened = true; - //! Whether CTEs should reference the parent binder (if it exists) - bool inherit_ctes = true; + //! What kind of node we are binding using this binder + BinderType binder_type = BinderType::REGULAR_BINDER; //! Whether or not the binder can contain NULLs as the root of expressions bool can_contain_nulls = false; //! The root statement of the query that is currently being parsed @@ -210,8 +229,12 @@ class Binder : public std::enable_shared_from_this { unordered_set table_names; //! The set of bound views reference_set_t bound_views; + //! Used to retrieve CatalogEntry's + CatalogEntryRetriever entry_retriever; //! Unnamed subquery index idx_t unnamed_subquery_index = 1; + //! Statement properties + StatementProperties prop; private: //! Get the root binder (binder with no parent) @@ -261,6 +284,7 @@ class Binder : public std::enable_shared_from_this { BoundStatement Bind(AttachStatement &stmt); BoundStatement Bind(DetachStatement &stmt); BoundStatement Bind(CopyDatabaseStatement &stmt); + BoundStatement Bind(UpdateExtensionsStatement &stmt); BoundStatement BindReturning(vector> returning_list, TableCatalogEntry &table, const string &alias, idx_t update_table_index, @@ -291,6 +315,7 @@ class Binder : public std::enable_shared_from_this { unique_ptr Bind(TableFunctionRef &ref); unique_ptr Bind(EmptyTableRef &ref); unique_ptr Bind(ExpressionListRef &ref); + unique_ptr Bind(ColumnDataRef &ref); unique_ptr Bind(PivotRef &expr); unique_ptr Bind(ShowRef &ref); @@ -309,11 +334,11 @@ class Binder : public std::enable_shared_from_this { bool BindTableInTableOutFunction(vector> &expressions, unique_ptr &subquery, ErrorData &error); unique_ptr BindTableFunction(TableFunction &function, vector parameters); - unique_ptr - BindTableFunctionInternal(TableFunction &table_function, const string &function_name, vector parameters, - named_parameter_map_t named_parameters, vector input_table_types, - vector input_table_names, const vector &column_name_alias, - unique_ptr external_dependency); + unique_ptr BindTableFunctionInternal(TableFunction &table_function, const TableFunctionRef &ref, + vector parameters, + named_parameter_map_t named_parameters, + vector input_table_types, + vector input_table_names); unique_ptr CreatePlan(BoundBaseTableRef &ref); unique_ptr CreatePlan(BoundJoinRef &ref); @@ -321,6 +346,7 @@ class Binder : public std::enable_shared_from_this { unique_ptr CreatePlan(BoundTableFunction &ref); unique_ptr CreatePlan(BoundEmptyTableRef &ref); unique_ptr CreatePlan(BoundExpressionListRef &ref); + unique_ptr CreatePlan(BoundColumnDataRef &ref); unique_ptr CreatePlan(BoundCTERef &ref); unique_ptr CreatePlan(BoundPivotRef &ref); @@ -379,9 +405,9 @@ class Binder : public std::enable_shared_from_this { unique_ptr BindSummarize(ShowRef &ref); public: - // This should really be a private constructor, but make_shared does not allow it... + // This should really be a private constructor, but make_shared_ptr does not allow it... // If you are thinking about calling this, you should probably call Binder::CreateBinder - Binder(bool i_know_what_i_am_doing, ClientContext &context, shared_ptr parent, bool inherit_ctes); + Binder(bool i_know_what_i_am_doing, ClientContext &context, shared_ptr parent, BinderType binder_type); }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp b/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp index b864b25a..97800348 100644 --- a/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp +++ b/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp @@ -52,6 +52,7 @@ class BoundSubqueryRef; class BoundTableFunction; class BoundEmptyTableRef; class BoundExpressionListRef; +class BoundColumnDataRef; class BoundCTERef; class BoundPivotRef; diff --git a/src/duckdb/src/include/duckdb/planner/expression_binder.hpp b/src/duckdb/src/include/duckdb/planner/expression_binder.hpp index 2f43ab0a..7bfd5a93 100644 --- a/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +++ b/src/duckdb/src/include/duckdb/planner/expression_binder.hpp @@ -18,6 +18,7 @@ #include "duckdb/parser/parsed_expression.hpp" #include "duckdb/parser/tokens.hpp" #include "duckdb/planner/expression.hpp" +#include "duckdb/catalog/catalog_entry_retriever.hpp" #include "duckdb/planner/expression/bound_lambda_expression.hpp" #include "duckdb/function/scalar_function.hpp" @@ -90,6 +91,7 @@ class ExpressionBinder { return bound_columns; } + void SetCatalogLookupCallback(catalog_entry_callback_t callback); ErrorData Bind(unique_ptr &expr, idx_t depth, bool root_expression = false); //! Returns the STRUCT_EXTRACT operator expression @@ -194,6 +196,9 @@ class ExpressionBinder { virtual string UnsupportedAggregateMessage(); virtual string UnsupportedUnnestMessage(); + optional_ptr GetCatalogEntry(CatalogType type, const string &catalog, const string &schema, + const string &name, OnEntryNotFound on_entry_not_found, + QueryErrorContext &error_context); Binder &binder; ClientContext &context; diff --git a/src/duckdb/src/include/duckdb/planner/expression_binder/alter_binder.hpp b/src/duckdb/src/include/duckdb/planner/expression_binder/alter_binder.hpp index 2633a092..dd77e2b0 100644 --- a/src/duckdb/src/include/duckdb/planner/expression_binder/alter_binder.hpp +++ b/src/duckdb/src/include/duckdb/planner/expression_binder/alter_binder.hpp @@ -14,22 +14,23 @@ namespace duckdb { class TableCatalogEntry; -//! The ALTER binder is responsible for binding an expression within alter statements +//! The AlterBinder binds expressions in ALTER statements. class AlterBinder : public ExpressionBinder { public: AlterBinder(Binder &binder, ClientContext &context, TableCatalogEntry &table, vector &bound_columns, LogicalType target_type); - TableCatalogEntry &table; - vector &bound_columns; - protected: + BindResult BindLambdaReference(LambdaRefExpression &expr, idx_t depth); + BindResult BindColumnReference(ColumnRefExpression &expr, idx_t depth); BindResult BindExpression(unique_ptr &expr_ptr, idx_t depth, bool root_expression = false) override; - BindResult BindColumn(ColumnRefExpression &expr); - string UnsupportedAggregateMessage() override; + +private: + TableCatalogEntry &table; + vector &bound_columns; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp b/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp index 919779fc..4cb65dab 100644 --- a/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp +++ b/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp @@ -14,13 +14,14 @@ namespace duckdb { -//! The HAVING binder is responsible for binding an expression within the HAVING clause of a SQL statement +//! The HAVING binder is responsible for binding an expression within the HAVING clause of a SQL statement. class HavingBinder : public BaseSelectBinder { public: HavingBinder(Binder &binder, ClientContext &context, BoundSelectNode &node, BoundGroupInformation &info, AggregateHandling aggregate_handling); protected: + BindResult BindLambdaReference(LambdaRefExpression &expr, idx_t depth); BindResult BindWindow(WindowExpression &expr, idx_t depth) override; BindResult BindColumnRef(unique_ptr &expr_ptr, idx_t depth, bool root_expression) override; diff --git a/src/duckdb/src/include/duckdb/planner/expression_binder/index_binder.hpp b/src/duckdb/src/include/duckdb/planner/expression_binder/index_binder.hpp index 4f7f5517..0d2ac67f 100644 --- a/src/duckdb/src/include/duckdb/planner/expression_binder/index_binder.hpp +++ b/src/duckdb/src/include/duckdb/planner/expression_binder/index_binder.hpp @@ -12,17 +12,21 @@ #include "duckdb/common/unordered_map.hpp" #include "duckdb/parser/parsed_data/create_index_info.hpp" #include "duckdb/planner/expression_binder.hpp" +#include "duckdb/execution/index/bound_index.hpp" +#include "duckdb/execution/index/unbound_index.hpp" namespace duckdb { class BoundColumnRefExpression; -//! The IndexBinder is responsible for binding an expression within an index statement +//! The IndexBinder is responsible for binding indexes, as well as expressions within an index statement class IndexBinder : public ExpressionBinder { public: IndexBinder(Binder &binder, ClientContext &context, optional_ptr table = nullptr, optional_ptr info = nullptr); + unique_ptr BindIndex(const UnboundIndex &index); + protected: BindResult BindExpression(unique_ptr &expr_ptr, idx_t depth, bool root_expression = false) override; diff --git a/src/duckdb/src/include/duckdb/planner/logical_operator.hpp b/src/duckdb/src/include/duckdb/planner/logical_operator.hpp index 98aa0fd6..dcb9cb2e 100644 --- a/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +++ b/src/duckdb/src/include/duckdb/planner/logical_operator.hpp @@ -11,7 +11,6 @@ #include "duckdb/catalog/catalog.hpp" #include "duckdb/common/common.hpp" #include "duckdb/common/enums/logical_operator_type.hpp" -#include "duckdb/optimizer/join_order/estimated_properties.hpp" #include "duckdb/planner/column_binding.hpp" #include "duckdb/planner/expression.hpp" #include "duckdb/planner/logical_operator_visitor.hpp" diff --git a/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp b/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp index 55c09970..6d27b679 100644 --- a/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +++ b/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp @@ -10,6 +10,7 @@ #include "duckdb/common/types/column/column_data_collection.hpp" #include "duckdb/planner/logical_operator.hpp" +#include "duckdb/common/optionally_owned_ptr.hpp" namespace duckdb { @@ -20,13 +21,16 @@ class LogicalColumnDataGet : public LogicalOperator { public: LogicalColumnDataGet(idx_t table_index, vector types, unique_ptr collection); + LogicalColumnDataGet(idx_t table_index, vector types, ColumnDataCollection &to_scan); + LogicalColumnDataGet(idx_t table_index, vector types, + optionally_owned_ptr to_scan); //! The table index in the current bind context idx_t table_index; //! The types of the chunk vector chunk_types; - //! The chunk collection to scan - unique_ptr collection; + //! (optionally owned) column data collection + optionally_owned_ptr collection; public: vector GetColumnBindings() override; diff --git a/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp b/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp index 005d955b..513370ea 100644 --- a/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +++ b/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp @@ -9,6 +9,7 @@ #pragma once #include "duckdb/planner/logical_operator.hpp" +#include "duckdb/planner/bound_constraint.hpp" namespace duckdb { class TableCatalogEntry; @@ -23,6 +24,7 @@ class LogicalDelete : public LogicalOperator { TableCatalogEntry &table; idx_t table_index; bool return_chunk; + vector> bound_constraints; public: void Serialize(Serializer &serializer) const override; diff --git a/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp b/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp index 9303a2f5..28a3686f 100644 --- a/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +++ b/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp @@ -28,6 +28,13 @@ class LogicalExport : public LogicalOperator { unique_ptr copy_info; BoundExportData exported_tables; + void Serialize(Serializer &serializer) const override { + throw NotImplementedException("FIXME: Serialize LogicalExport statement"); + } + unique_ptr Deserialize(Deserializer &deserializer) { + throw NotImplementedException("FIXME: Deserialize LogicalExport statement"); + } + public: protected: void ResolveTypes() override { diff --git a/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp b/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp index 0c31fd6e..c8eb3997 100644 --- a/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +++ b/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp @@ -37,6 +37,8 @@ class LogicalInsert : public LogicalOperator { bool return_chunk; //! The default statements used by the table vector> bound_defaults; + //! The constraints used by the table + vector> bound_constraints; //! Which action to take on conflict OnConflictAction action_type; diff --git a/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp b/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp index 745ca629..cc19ea6b 100644 --- a/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +++ b/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp @@ -19,15 +19,15 @@ class LogicalTopN : public LogicalOperator { static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_TOP_N; public: - LogicalTopN(vector orders, int64_t limit, int64_t offset) + LogicalTopN(vector orders, idx_t limit, idx_t offset) : LogicalOperator(LogicalOperatorType::LOGICAL_TOP_N), orders(std::move(orders)), limit(limit), offset(offset) { } vector orders; //! The maximum amount of elements to emit - int64_t limit; + idx_t limit; //! The offset from the start to begin emitting elements - int64_t offset; + idx_t offset; public: vector GetColumnBindings() override { diff --git a/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp b/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp index 9215ff69..587341ab 100644 --- a/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +++ b/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp @@ -9,6 +9,7 @@ #pragma once #include "duckdb/planner/logical_operator.hpp" +#include "duckdb/planner/bound_constraint.hpp" namespace duckdb { class TableCatalogEntry; @@ -28,6 +29,7 @@ class LogicalUpdate : public LogicalOperator { bool return_chunk; vector columns; vector> bound_defaults; + vector> bound_constraints; bool update_is_del_and_insert; public: diff --git a/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp b/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp index fe71dfbd..049aca82 100644 --- a/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +++ b/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp @@ -36,10 +36,6 @@ struct BoundCreateTableInfo { ColumnDependencyManager column_dependency_manager; //! List of constraints on the table vector> constraints; - //! List of bound constraints on the table - vector> bound_constraints; - //! Bound default values - vector> bound_defaults; //! Dependents of the table (in e.g. default values) LogicalDependencyList dependencies; //! The existing table data on disk (if any) diff --git a/src/duckdb/src/include/duckdb/planner/table_binding.hpp b/src/duckdb/src/include/duckdb/planner/table_binding.hpp index aa288a12..551ab9b0 100644 --- a/src/duckdb/src/include/duckdb/planner/table_binding.hpp +++ b/src/duckdb/src/include/duckdb/planner/table_binding.hpp @@ -133,12 +133,12 @@ struct DummyBinding : public Binding { public: //! Binding macros - BindResult Bind(ColumnRefExpression &colref, idx_t depth) override; + BindResult Bind(ColumnRefExpression &col_ref, idx_t depth) override; //! Binding lambdas - BindResult Bind(LambdaRefExpression &lambdaref, idx_t depth); + BindResult Bind(LambdaRefExpression &lambda_ref, idx_t depth); - //! Given the parameter colref, returns a copy of the argument that was supplied for this parameter - unique_ptr ParamToArg(ColumnRefExpression &colref); + //! Returns a copy of the col_ref parameter as a parsed expression + unique_ptr ParamToArg(ColumnRefExpression &col_ref); }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/planner/tableref/bound_column_data_ref.hpp b/src/duckdb/src/include/duckdb/planner/tableref/bound_column_data_ref.hpp new file mode 100644 index 00000000..025bc471 --- /dev/null +++ b/src/duckdb/src/include/duckdb/planner/tableref/bound_column_data_ref.hpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/planner/tableref/bound_column_data_ref.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/planner/bound_tableref.hpp" +#include "duckdb/common/optionally_owned_ptr.hpp" +#include "duckdb/common/types/column/column_data_collection.hpp" + +namespace duckdb { +//! Represents a TableReference to a base table in the schema +class BoundColumnDataRef : public BoundTableRef { +public: + static constexpr const TableReferenceType TYPE = TableReferenceType::COLUMN_DATA; + +public: + explicit BoundColumnDataRef(optionally_owned_ptr collection) + : BoundTableRef(TableReferenceType::COLUMN_DATA), collection(std::move(collection)) { + } + //! The (optionally owned) materialized column data to scan + optionally_owned_ptr collection; + //! The index in the bind context + idx_t bind_index; +}; +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/planner/tableref/list.hpp b/src/duckdb/src/include/duckdb/planner/tableref/list.hpp index 1452daaf..f1c614c4 100644 --- a/src/duckdb/src/include/duckdb/planner/tableref/list.hpp +++ b/src/duckdb/src/include/duckdb/planner/tableref/list.hpp @@ -4,5 +4,6 @@ #include "duckdb/planner/tableref/bound_expressionlistref.hpp" #include "duckdb/planner/tableref/bound_joinref.hpp" #include "duckdb/planner/tableref/bound_subqueryref.hpp" +#include "duckdb/planner/tableref/bound_column_data_ref.hpp" #include "duckdb/planner/tableref/bound_table_function.hpp" #include "duckdb/planner/tableref/bound_pivotref.hpp" diff --git a/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp b/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp index 92a646c8..6b8b27bb 100644 --- a/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp +++ b/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp @@ -11,6 +11,7 @@ #include "duckdb/common/atomic.hpp" #include "duckdb/common/common.hpp" #include "duckdb/common/mutex.hpp" +#include "duckdb/common/numeric_utils.hpp" #include "duckdb/storage/storage_info.hpp" #include "duckdb/common/file_buffer.hpp" #include "duckdb/common/enums/memory_tag.hpp" @@ -76,7 +77,7 @@ class BlockHandle { D_ASSERT(buffer); // resize and adjust current memory buffer->Resize(block_size); - memory_usage += memory_delta; + memory_usage = NumericCast(NumericCast(memory_usage) + memory_delta); D_ASSERT(memory_usage == buffer->AllocSize()); } @@ -121,8 +122,10 @@ class BlockHandle { MemoryTag tag; //! Pointer to loaded data (if any) unique_ptr buffer; - //! Internal eviction timestamp - atomic eviction_timestamp; + //! Internal eviction sequence number + atomic eviction_seq_num; + //! LRU timestamp (for age-based eviction) + atomic lru_timestamp_msec; //! Whether or not the buffer can be destroyed (only used for temporary buffers) bool can_destroy; //! The memory usage of the block (when loaded). If we are pinning/loading diff --git a/src/duckdb/src/include/duckdb/storage/buffer/buffer_pool.hpp b/src/duckdb/src/include/duckdb/storage/buffer/buffer_pool.hpp index 9b9b3fd7..4ffd7a9f 100644 --- a/src/duckdb/src/include/duckdb/storage/buffer/buffer_pool.hpp +++ b/src/duckdb/src/include/duckdb/storage/buffer/buffer_pool.hpp @@ -20,13 +20,10 @@ struct EvictionQueue; struct BufferEvictionNode { BufferEvictionNode() { } - BufferEvictionNode(weak_ptr handle_p, idx_t timestamp_p) - : handle(std::move(handle_p)), timestamp(timestamp_p) { - D_ASSERT(!handle.expired()); - } + BufferEvictionNode(weak_ptr handle_p, idx_t eviction_seq_num); weak_ptr handle; - idx_t timestamp; + idx_t handle_sequence_number; bool CanUnload(BlockHandle &handle_p); shared_ptr TryGetBlockHandle(); @@ -41,14 +38,14 @@ class BufferPool { friend class StandardBufferManager; public: - explicit BufferPool(idx_t maximum_memory); + explicit BufferPool(idx_t maximum_memory, bool track_eviction_timestamps); virtual ~BufferPool(); //! Set a new memory limit to the buffer pool, throws an exception if the new limit is too low and not enough //! blocks can be evicted void SetLimit(idx_t limit, const char *exception_postscript); - void IncreaseUsedMemory(MemoryTag tag, idx_t size); + void UpdateUsedMemory(MemoryTag tag, int64_t size); idx_t GetUsedMemory() const; @@ -72,6 +69,16 @@ class BufferPool { virtual EvictionResult EvictBlocks(MemoryTag tag, idx_t extra_memory, idx_t memory_limit, unique_ptr *buffer = nullptr); + //! Purge all blocks that haven't been pinned within the last N seconds + idx_t PurgeAgedBlocks(uint32_t max_age_sec); + + //! Iterate over all purgable blocks and invoke the callback. If the callback returns true + //! iteration continues. + //! - Callback signature is: bool((BufferEvictionNode &, const std::shared_ptr &) + //! - Callback is invoked while holding the corresponding BlockHandle mutex. + template + void IterateUnloadableBlocks(FN fn); + //! Tries to dequeue an element from the eviction queue, but only after acquiring the purge queue lock. bool TryDequeueWithLock(BufferEvictionNode &node); //! Bulk purge dead nodes from the eviction queue. Then, enqueue those that are still alive. @@ -98,6 +105,8 @@ class BufferPool { atomic current_memory; //! The maximum amount of memory that the buffer manager can keep (in bytes) atomic maximum_memory; + //! Record timestamps of buffer manager unpin() events. Usable by custom eviction policies. + bool track_eviction_timestamps; //! Eviction queue unique_ptr queue; //! Memory manager for concurrently used temporary memory, e.g., for physical operators diff --git a/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp b/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp index b6cdb161..b0598f0c 100644 --- a/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +++ b/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp @@ -40,10 +40,17 @@ class BufferManager { virtual void ReAllocate(shared_ptr &handle, idx_t block_size) = 0; virtual BufferHandle Pin(shared_ptr &handle) = 0; virtual void Unpin(shared_ptr &handle) = 0; + //! Returns the currently allocated memory virtual idx_t GetUsedMemory() const = 0; //! Returns the maximum available memory virtual idx_t GetMaxMemory() const = 0; + //! Returns the currently used swap space + virtual idx_t GetUsedSwap() = 0; + //! Returns the maximum swap space that can be used + virtual optional_idx GetMaxSwap() const = 0; + + //! Returns a new block of memory that is smaller than Storage::BLOCK_SIZE virtual shared_ptr RegisterSmallMemory(idx_t block_size); virtual DUCKDB_API Allocator &GetBufferAllocator(); virtual DUCKDB_API void ReserveMemory(idx_t size); @@ -51,19 +58,21 @@ class BufferManager { virtual vector GetMemoryUsageInfo() const = 0; //! Set a new memory limit to the buffer manager, throws an exception if the new limit is too low and not enough //! blocks can be evicted - virtual void SetLimit(idx_t limit = (idx_t)-1); + virtual void SetMemoryLimit(idx_t limit = (idx_t)-1); + virtual void SetSwapLimit(optional_idx limit = optional_idx()); + virtual vector GetTemporaryFiles(); virtual const string &GetTemporaryDirectory() const; virtual void SetTemporaryDirectory(const string &new_dir); virtual bool HasTemporaryDirectory() const; + //! Construct a managed buffer. virtual unique_ptr ConstructManagedBuffer(idx_t size, unique_ptr &&source, FileBufferType type = FileBufferType::MANAGED_BUFFER); //! Get the underlying buffer pool responsible for managing the buffers virtual BufferPool &GetBufferPool() const; - //! Get the manager that assigns reservations for temporary memory, e.g., for query intermediates - virtual TemporaryMemoryManager &GetTemporaryMemoryManager(); + virtual DatabaseInstance &GetDatabase() = 0; // Static methods DUCKDB_API static BufferManager &GetBufferManager(DatabaseInstance &db); DUCKDB_API static const BufferManager &GetBufferManager(const DatabaseInstance &db); @@ -77,6 +86,9 @@ class BufferManager { //! Returns the maximum available memory for a given query idx_t GetQueryMaxMemory() const; + //! Get the manager that assigns reservations for temporary memory, e.g., for query intermediates + virtual TemporaryMemoryManager &GetTemporaryMemoryManager(); + protected: virtual void PurgeQueue() = 0; virtual void AddToEvictionQueue(shared_ptr &handle); diff --git a/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp b/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp index 2c5f78e9..191a9385 100644 --- a/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +++ b/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp @@ -32,6 +32,7 @@ class RowGroupWriter { virtual void WriteColumnDataPointers(ColumnCheckpointState &column_checkpoint_state, Serializer &serializer) = 0; + virtual CheckpointType GetCheckpointType() const = 0; virtual MetadataWriter &GetPayloadWriter() = 0; PartialBlockManager &GetPartialBlockManager() { @@ -47,18 +48,20 @@ class RowGroupWriter { class SingleFileRowGroupWriter : public RowGroupWriter { public: SingleFileRowGroupWriter(TableCatalogEntry &table, PartialBlockManager &partial_block_manager, - MetadataWriter &table_data_writer) - : RowGroupWriter(table, partial_block_manager), table_data_writer(table_data_writer) { - } - - //! MetadataWriter is a cursor on a given BlockManager. This returns the - //! cursor against which we should write payload data for the specified RowGroup. - MetadataWriter &table_data_writer; + TableDataWriter &writer, MetadataWriter &table_data_writer); public: void WriteColumnDataPointers(ColumnCheckpointState &column_checkpoint_state, Serializer &serializer) override; + CheckpointType GetCheckpointType() const override; MetadataWriter &GetPayloadWriter() override; + +private: + //! Underlying writer object + TableDataWriter &writer; + //! MetadataWriter is a cursor on a given BlockManager. This returns the + //! cursor against which we should write payload data for the specified RowGroup. + MetadataWriter &table_data_writer; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp b/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp index 4ab7a905..dfcfec47 100644 --- a/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +++ b/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp @@ -35,6 +35,7 @@ class TableDataWriter { virtual unique_ptr GetRowGroupWriter(RowGroup &row_group) = 0; virtual void AddRowGroup(RowGroupPointer &&row_group_pointer, unique_ptr writer); + virtual CheckpointType GetCheckpointType() const = 0; TaskScheduler &GetScheduler(); @@ -52,6 +53,7 @@ class SingleFileTableDataWriter : public TableDataWriter { public: void FinalizeTable(const TableStatistics &global_stats, DataTableInfo *info, Serializer &serializer) override; unique_ptr GetRowGroupWriter(RowGroup &row_group) override; + CheckpointType GetCheckpointType() const override; private: SingleFileCheckpointWriter &checkpoint_manager; diff --git a/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp b/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp index 9899565c..d72ba118 100644 --- a/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +++ b/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp @@ -40,7 +40,7 @@ class CheckpointWriter { protected: virtual void WriteEntry(CatalogEntry &entry, Serializer &serializer); virtual void WriteSchema(SchemaCatalogEntry &schema, Serializer &serializer); - virtual void WriteTable(TableCatalogEntry &table, Serializer &serializer); + virtual void WriteTable(TableCatalogEntry &table, Serializer &serializer) = 0; virtual void WriteView(ViewCatalogEntry &table, Serializer &serializer); virtual void WriteSequence(SequenceCatalogEntry &table, Serializer &serializer); virtual void WriteMacro(ScalarMacroCatalogEntry &table, Serializer &serializer); @@ -60,18 +60,19 @@ class CheckpointReader { Catalog &catalog; protected: - virtual void LoadCheckpoint(ClientContext &context, MetadataReader &reader); - virtual void ReadEntry(ClientContext &context, Deserializer &deserializer); - virtual void ReadSchema(ClientContext &context, Deserializer &deserializer); - virtual void ReadTable(ClientContext &context, Deserializer &deserializer); - virtual void ReadView(ClientContext &context, Deserializer &deserializer); - virtual void ReadSequence(ClientContext &context, Deserializer &deserializer); - virtual void ReadMacro(ClientContext &context, Deserializer &deserializer); - virtual void ReadTableMacro(ClientContext &context, Deserializer &deserializer); - virtual void ReadIndex(ClientContext &context, Deserializer &deserializer); - virtual void ReadType(ClientContext &context, Deserializer &deserializer); - - virtual void ReadTableData(ClientContext &context, Deserializer &deserializer, BoundCreateTableInfo &bound_info); + virtual void LoadCheckpoint(CatalogTransaction transaction, MetadataReader &reader); + virtual void ReadEntry(CatalogTransaction transaction, Deserializer &deserializer); + virtual void ReadSchema(CatalogTransaction transaction, Deserializer &deserializer); + virtual void ReadTable(CatalogTransaction transaction, Deserializer &deserializer); + virtual void ReadView(CatalogTransaction transaction, Deserializer &deserializer); + virtual void ReadSequence(CatalogTransaction transaction, Deserializer &deserializer); + virtual void ReadMacro(CatalogTransaction transaction, Deserializer &deserializer); + virtual void ReadTableMacro(CatalogTransaction transaction, Deserializer &deserializer); + virtual void ReadIndex(CatalogTransaction transaction, Deserializer &deserializer); + virtual void ReadType(CatalogTransaction transaction, Deserializer &deserializer); + + virtual void ReadTableData(CatalogTransaction transaction, Deserializer &deserializer, + BoundCreateTableInfo &bound_info); }; class SingleFileCheckpointReader final : public CheckpointReader { @@ -80,7 +81,7 @@ class SingleFileCheckpointReader final : public CheckpointReader { : CheckpointReader(Catalog::GetCatalog(storage.GetAttached())), storage(storage) { } - void LoadFromStorage(optional_ptr context = nullptr); + void LoadFromStorage(); MetadataManager &GetMetadataManager(); //! The database @@ -96,7 +97,7 @@ class SingleFileCheckpointWriter final : public CheckpointWriter { friend class SingleFileTableDataWriter; public: - SingleFileCheckpointWriter(AttachedDatabase &db, BlockManager &block_manager); + SingleFileCheckpointWriter(AttachedDatabase &db, BlockManager &block_manager, CheckpointType checkpoint_type); //! Checkpoint the current state of the WAL and flush it to the main storage. This should be called BEFORE any //! connection is available because right now the checkpointing cannot be done online. (TODO) @@ -107,6 +108,12 @@ class SingleFileCheckpointWriter final : public CheckpointWriter { unique_ptr GetTableDataWriter(TableCatalogEntry &table) override; BlockManager &GetBlockManager(); + CheckpointType GetCheckpointType() const { + return checkpoint_type; + } + +public: + void WriteTable(TableCatalogEntry &table, Serializer &serializer) override; private: //! The metadata writer is responsible for writing schema information @@ -116,6 +123,8 @@ class SingleFileCheckpointWriter final : public CheckpointWriter { //! Because this is single-file storage, we can share partial blocks across //! an entire checkpoint. PartialBlockManager partial_block_manager; + //! Checkpoint type + CheckpointType checkpoint_type; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/compression/alp/algorithm/alp.hpp b/src/duckdb/src/include/duckdb/storage/compression/alp/algorithm/alp.hpp index d71189de..d0bf9897 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/alp/algorithm/alp.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/alp/algorithm/alp.hpp @@ -107,10 +107,10 @@ struct AlpCompression { */ static int64_t NumberToInt64(T n) { if (IsImpossibleToEncode(n)) { - return AlpConstants::ENCODING_UPPER_LIMIT; + return NumericCast(AlpConstants::ENCODING_UPPER_LIMIT); } n = n + AlpTypedConstants::MAGIC_NUMBER - AlpTypedConstants::MAGIC_NUMBER; - return static_cast(n); + return NumericCast(n); } /* @@ -185,7 +185,7 @@ struct AlpCompression { // Evaluate factor/exponent compression size (we optimize for FOR) uint64_t delta = (static_cast(max_encoded_value) - static_cast(min_encoded_value)); - estimated_bits_per_value = std::ceil(std::log2(delta + 1)); + estimated_bits_per_value = NumericCast(std::ceil(std::log2(delta + 1))); estimated_compression_size += n_values * estimated_bits_per_value; estimated_compression_size += exceptions_count * (EXACT_TYPE_BITSIZE + (AlpConstants::EXCEPTION_POSITION_SIZE * 8)); @@ -254,7 +254,8 @@ struct AlpCompression { static void FindBestFactorAndExponent(const T *input_vector, idx_t n_values, State &state) { //! We sample equidistant values within a vector; to do this we skip a fixed number of values vector vector_sample; - uint32_t idx_increments = MaxValue(1, (int32_t)std::ceil((double)n_values / AlpConstants::SAMPLES_PER_VECTOR)); + auto idx_increments = MaxValue( + 1, UnsafeNumericCast(std::ceil((double)n_values / AlpConstants::SAMPLES_PER_VECTOR))); for (idx_t i = 0; i < n_values; i += idx_increments) { vector_sample.push_back(input_vector[i]); } @@ -358,9 +359,9 @@ struct AlpCompression { BitpackingPrimitives::PackBuffer(state.values_encoded, u_encoded_integers, n_values, bit_width); } - state.bit_width = bit_width; // in bits - state.bp_size = bp_size; // in bytes - state.frame_of_reference = min_value; + state.bit_width = bit_width; // in bits + state.bp_size = bp_size; // in bytes + state.frame_of_reference = static_cast(min_value); // understood this can be negative } /* diff --git a/src/duckdb/src/include/duckdb/storage/compression/alp/alp_compress.hpp b/src/duckdb/src/include/duckdb/storage/compression/alp/alp_compress.hpp index fc7d8869..e4021d93 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/alp/alp_compress.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/alp/alp_compress.hpp @@ -183,10 +183,10 @@ struct AlpCompressionState : public CompressionState { // Verify that the metadata_ptr is not smaller than the space used by the data D_ASSERT(dataptr + metadata_offset <= metadata_ptr); - idx_t bytes_used_by_metadata = dataptr + Storage::BLOCK_SIZE - metadata_ptr; + auto bytes_used_by_metadata = UnsafeNumericCast(dataptr + Storage::BLOCK_SIZE - metadata_ptr); // Initially the total segment size is the size of the block - idx_t total_segment_size = Storage::BLOCK_SIZE; + auto total_segment_size = Storage::BLOCK_SIZE; //! We compact the block if the space used is less than a threshold const auto used_space_percentage = diff --git a/src/duckdb/src/include/duckdb/storage/compression/alp/alp_constants.hpp b/src/duckdb/src/include/duckdb/storage/compression/alp/alp_constants.hpp index 55353dda..9a7a36f9 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/alp/alp_constants.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/alp/alp_constants.hpp @@ -70,11 +70,12 @@ struct AlpTypedConstants { static constexpr float MAGIC_NUMBER = 12582912.0; //! 2^22 + 2^23 static constexpr uint8_t MAX_EXPONENT = 10; - static constexpr const float EXP_ARR[] = {1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, - 1000000.0, 10000000.0, 100000000.0, 1000000000.0, 10000000000.0}; + static constexpr const float EXP_ARR[] = {1.0F, 10.0F, 100.0F, 1000.0F, + 10000.0F, 100000.0F, 1000000.0F, 10000000.0F, + 100000000.0F, 1000000000.0F, 10000000000.0F}; - static constexpr float FRAC_ARR[] = {1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001, - 0.000001, 0.0000001, 0.00000001, 0.000000001, 0.0000000001}; + static constexpr float FRAC_ARR[] = {1.0F, 0.1F, 0.01F, 0.001F, 0.0001F, 0.00001F, + 0.000001F, 0.0000001F, 0.00000001F, 0.000000001F, 0.0000000001F}; }; template <> diff --git a/src/duckdb/src/include/duckdb/storage/compression/alp/alp_fetch.hpp b/src/duckdb/src/include/duckdb/storage/compression/alp/alp_fetch.hpp index 81d3d2ac..54a9964d 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/alp/alp_fetch.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/alp/alp_fetch.hpp @@ -28,7 +28,7 @@ void AlpFetchRow(ColumnSegment &segment, ColumnFetchState &state, row_t row_id, using EXACT_TYPE = typename FloatingToExact::TYPE; AlpScanState scan_state(segment); - scan_state.Skip(segment, row_id); + scan_state.Skip(segment, UnsafeNumericCast(row_id)); auto result_data = FlatVector::GetData(result); result_data[result_idx] = (EXACT_TYPE)0; diff --git a/src/duckdb/src/include/duckdb/storage/compression/alp/alp_utils.hpp b/src/duckdb/src/include/duckdb/storage/compression/alp/alp_utils.hpp index 1b77e219..75292b82 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/alp/alp_utils.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/alp/alp_utils.hpp @@ -40,9 +40,9 @@ class AlpUtils { auto n_lookup_values = NumericCast(MinValue(current_vector_n_values, (idx_t)AlpConstants::ALP_VECTOR_SIZE)); //! We sample equidistant values within a vector; to do this we jump a fixed number of values - uint32_t n_sampled_increments = - MaxValue(1, (int32_t)std::ceil((double)n_lookup_values / AlpConstants::SAMPLES_PER_VECTOR)); - uint32_t n_sampled_values = std::ceil((double)n_lookup_values / n_sampled_increments); + uint32_t n_sampled_increments = MaxValue( + 1, UnsafeNumericCast(std::ceil((double)n_lookup_values / AlpConstants::SAMPLES_PER_VECTOR))); + uint32_t n_sampled_values = NumericCast(std::ceil((double)n_lookup_values / n_sampled_increments)); D_ASSERT(n_sampled_values < AlpConstants::ALP_VECTOR_SIZE); AlpSamplingParameters sampling_params = {n_lookup_values, n_sampled_increments, n_sampled_values}; diff --git a/src/duckdb/src/include/duckdb/storage/compression/alprd/algorithm/alprd.hpp b/src/duckdb/src/include/duckdb/storage/compression/alprd/algorithm/alprd.hpp index 66d8262a..ce99e1a0 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/alprd/algorithm/alprd.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/alprd/algorithm/alprd.hpp @@ -105,7 +105,8 @@ struct AlpRDCompression { // The left parts bit width after compression is determined by how many elements are in the dictionary uint64_t actual_dictionary_size = MinValue(AlpRDConstants::MAX_DICTIONARY_SIZE, left_parts_sorted_repetitions.size()); - uint8_t left_bit_width = MaxValue(1, std::ceil(std::log2(actual_dictionary_size))); + uint8_t left_bit_width = + MaxValue(1, NumericCast(std::ceil(std::log2(actual_dictionary_size)))); if (PERSIST_DICT) { for (idx_t dict_idx = 0; dict_idx < actual_dictionary_size; dict_idx++) { diff --git a/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp b/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp index e88fdae6..e37d873a 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp @@ -126,13 +126,15 @@ idx_t AlpRDFinalAnalyze(AnalyzeState &state) { //! Overhead per vector: Pointer to data + Exceptions count double per_vector_overhead = AlpRDConstants::METADATA_POINTER_SIZE + AlpRDConstants::EXCEPTIONS_COUNT_SIZE; - uint32_t n_vectors = std::ceil((double)analyze_state.total_values_count / AlpRDConstants::ALP_VECTOR_SIZE); + uint32_t n_vectors = + NumericCast(std::ceil((double)analyze_state.total_values_count / AlpRDConstants::ALP_VECTOR_SIZE)); auto estimated_size = (estimed_compressed_bytes * factor_of_sampling) + (n_vectors * per_vector_overhead); - uint32_t estimated_n_blocks = std::ceil(estimated_size / (Storage::BLOCK_SIZE - per_segment_overhead)); + uint32_t estimated_n_blocks = + NumericCast(std::ceil(estimated_size / (Storage::BLOCK_SIZE - per_segment_overhead))); auto final_analyze_size = estimated_size + (estimated_n_blocks * per_segment_overhead); - return final_analyze_size; + return NumericCast(final_analyze_size); } } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_compress.hpp b/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_compress.hpp index 5ff07dd7..3f2a8aca 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_compress.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_compress.hpp @@ -185,10 +185,10 @@ struct AlpRDCompressionState : public CompressionState { // Verify that the metadata_ptr is not smaller than the space used by the data D_ASSERT(dataptr + metadata_offset <= metadata_ptr); - idx_t bytes_used_by_metadata = dataptr + Storage::BLOCK_SIZE - metadata_ptr; + auto bytes_used_by_metadata = UnsafeNumericCast(dataptr + Storage::BLOCK_SIZE - metadata_ptr); // Initially the total segment size is the size of the block - idx_t total_segment_size = Storage::BLOCK_SIZE; + auto total_segment_size = Storage::BLOCK_SIZE; //! We compact the block if the space used is less than a threshold const auto used_space_percentage = diff --git a/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_fetch.hpp b/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_fetch.hpp index 0128b8db..35923019 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_fetch.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_fetch.hpp @@ -27,7 +27,7 @@ template void AlpRDFetchRow(ColumnSegment &segment, ColumnFetchState &state, row_t row_id, Vector &result, idx_t result_idx) { using EXACT_TYPE = typename FloatingToExact::TYPE; AlpRDScanState scan_state(segment); - scan_state.Skip(segment, row_id); + scan_state.Skip(segment, UnsafeNumericCast(row_id)); auto result_data = FlatVector::GetData(result); result_data[result_idx] = (EXACT_TYPE)0; diff --git a/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/bit_reader.hpp b/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/bit_reader.hpp index 57512f27..a2910e63 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/bit_reader.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/bit_reader.hpp @@ -150,7 +150,7 @@ struct BitReader { result = result << 8 | InnerReadByte(i); } result = result << remainder | InnerRead(remainder, bytes); - index += (bytes << 3) + remainder; + index += static_cast(bytes << 3) + remainder; return result; } diff --git a/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_fetch.hpp b/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_fetch.hpp index c8e4edb9..5d6be51e 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_fetch.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_fetch.hpp @@ -29,7 +29,7 @@ void ChimpFetchRow(ColumnSegment &segment, ColumnFetchState &state, row_t row_id using INTERNAL_TYPE = typename ChimpType::TYPE; ChimpScanState scan_state(segment); - scan_state.Skip(segment, row_id); + scan_state.Skip(segment, UnsafeNumericCast(row_id)); auto result_data = FlatVector::GetData(result); if (scan_state.GroupFinished() && scan_state.total_value_count < scan_state.segment_count) { diff --git a/src/duckdb/src/include/duckdb/storage/compression/patas/patas_fetch.hpp b/src/duckdb/src/include/duckdb/storage/compression/patas/patas_fetch.hpp index fd416cfc..8e20ae67 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/patas/patas_fetch.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/patas/patas_fetch.hpp @@ -29,7 +29,7 @@ void PatasFetchRow(ColumnSegment &segment, ColumnFetchState &state, row_t row_id using EXACT_TYPE = typename FloatingToExact::TYPE; PatasScanState scan_state(segment); - scan_state.Skip(segment, row_id); + scan_state.Skip(segment, UnsafeNumericCast(row_id)); auto result_data = FlatVector::GetData(result); result_data[result_idx] = (EXACT_TYPE)0; diff --git a/src/duckdb/src/include/duckdb/storage/data_table.hpp b/src/duckdb/src/include/duckdb/storage/data_table.hpp index c6ae98a9..58788712 100644 --- a/src/duckdb/src/include/duckdb/storage/data_table.hpp +++ b/src/duckdb/src/include/duckdb/storage/data_table.hpp @@ -41,6 +41,9 @@ class WriteAheadLog; class TableDataWriter; class ConflictManager; class TableScanState; +struct TableDeleteState; +struct ConstraintState; +struct TableUpdateState; enum class VerifyExistenceType : uint8_t; //! DataTable represents a physical table on disk @@ -60,16 +63,18 @@ class DataTable { //! Constructs a DataTable as a delta on an existing data table but with one column added new constraint explicit DataTable(ClientContext &context, DataTable &parent, unique_ptr constraint); - //! The table info - shared_ptr info; - //! The set of physical columns stored by this DataTable - vector column_definitions; //! A reference to the database instance AttachedDatabase &db; public: + AttachedDatabase &GetAttached(); + TableIOManager &GetTableIOManager(); + + bool IsTemporary() const; + //! Returns a list of types of the table vector GetTypes(); + const vector &Columns() const; void InitializeScan(TableScanState &state, const vector &column_ids, TableFilterSet *table_filter = nullptr); @@ -92,26 +97,34 @@ class DataTable { const Vector &row_ids, idx_t fetch_count, ColumnFetchState &state); //! Initializes an append to transaction-local storage - void InitializeLocalAppend(LocalAppendState &state, ClientContext &context); + void InitializeLocalAppend(LocalAppendState &state, TableCatalogEntry &table, ClientContext &context, + const vector> &bound_constraints); //! Append a DataChunk to the transaction-local storage of the table. void LocalAppend(LocalAppendState &state, TableCatalogEntry &table, ClientContext &context, DataChunk &chunk, bool unsafe = false); //! Finalizes a transaction-local append void FinalizeLocalAppend(LocalAppendState &state); //! Append a chunk to the transaction-local storage of this table - void LocalAppend(TableCatalogEntry &table, ClientContext &context, DataChunk &chunk); + void LocalAppend(TableCatalogEntry &table, ClientContext &context, DataChunk &chunk, + const vector> &bound_constraints); //! Append a column data collection to the transaction-local storage of this table - void LocalAppend(TableCatalogEntry &table, ClientContext &context, ColumnDataCollection &collection); + void LocalAppend(TableCatalogEntry &table, ClientContext &context, ColumnDataCollection &collection, + const vector> &bound_constraints); //! Merge a row group collection into the transaction-local storage void LocalMerge(ClientContext &context, RowGroupCollection &collection); //! Creates an optimistic writer for this table - used for optimistically writing parallel appends OptimisticDataWriter &CreateOptimisticWriter(ClientContext &context); void FinalizeOptimisticWriter(ClientContext &context, OptimisticDataWriter &writer); + unique_ptr InitializeDelete(TableCatalogEntry &table, ClientContext &context, + const vector> &bound_constraints); //! Delete the entries with the specified row identifier from the table - idx_t Delete(TableCatalogEntry &table, ClientContext &context, Vector &row_ids, idx_t count); + idx_t Delete(TableDeleteState &state, ClientContext &context, Vector &row_ids, idx_t count); + + unique_ptr InitializeUpdate(TableCatalogEntry &table, ClientContext &context, + const vector> &bound_constraints); //! Update the entries with the specified row identifier from the table - void Update(TableCatalogEntry &table, ClientContext &context, Vector &row_ids, + void Update(TableUpdateState &state, ClientContext &context, Vector &row_ids, const vector &column_ids, DataChunk &data); //! Update a single (sub-)column along a column path //! The column_path vector is a *path* towards a column within the table @@ -170,12 +183,17 @@ class DataTable { //! Sets statistics of a physical column within the table void SetDistinct(column_t column_id, unique_ptr distinct_stats); + //! Obtains a shared lock to prevent checkpointing while operations are running + unique_ptr GetSharedCheckpointLock(); + //! Obtains a lock during a checkpoint operation that prevents other threads from reading this table + unique_ptr GetCheckpointLock(); //! Checkpoint the table to the specified table data writer void Checkpoint(TableDataWriter &writer, Serializer &serializer); void CommitDropTable(); void CommitDropColumn(idx_t index); - idx_t GetTotalRows(); + idx_t ColumnCount() const; + idx_t GetTotalRows() const; vector GetColumnSegmentInfo(); static bool IsForeignKeyIndex(const vector &fk_keys, Index &index, ForeignKeyType fk_type); @@ -186,22 +204,39 @@ class DataTable { //! FIXME: This is only necessary until we treat all indexes as catalog entries, allowing to alter constraints bool IndexNameIsUnique(const string &name); + //! Initialize constraint verification state + unique_ptr InitializeConstraintState(TableCatalogEntry &table, + const vector> &bound_constraints); //! Verify constraints with a chunk from the Append containing all columns of the table - void VerifyAppendConstraints(TableCatalogEntry &table, ClientContext &context, DataChunk &chunk, - ConflictManager *conflict_manager = nullptr); + void VerifyAppendConstraints(ConstraintState &state, ClientContext &context, DataChunk &chunk, + optional_ptr conflict_manager = nullptr); + + shared_ptr &GetDataTableInfo(); + + void InitializeIndexes(ClientContext &context); + bool HasIndexes() const; + void AddIndex(unique_ptr index); + bool HasForeignKeyIndex(const vector &keys, ForeignKeyType type); + void SetIndexStorageInfo(vector index_storage_info); + void VacuumIndexes(); + + string GetTableName() const; + void SetTableName(string new_name); + + TableStorageInfo GetStorageInfo(); public: static void VerifyUniqueIndexes(TableIndexList &indexes, ClientContext &context, DataChunk &chunk, - ConflictManager *conflict_manager); + optional_ptr conflict_manager); private: //! Verify the new added constraints against current persistent&local data - void VerifyNewConstraint(ClientContext &context, DataTable &parent, const BoundConstraint *constraint); + void VerifyNewConstraint(LocalStorage &local_storage, DataTable &parent, const BoundConstraint &constraint); //! Verify constraints with a chunk from the Update containing only the specified column_ids - void VerifyUpdateConstraints(ClientContext &context, TableCatalogEntry &table, DataChunk &chunk, + void VerifyUpdateConstraints(ConstraintState &state, ClientContext &context, DataChunk &chunk, const vector &column_ids); //! Verify constraints with a chunk from the Delete containing all columns of the table - void VerifyDeleteConstraints(TableCatalogEntry &table, ClientContext &context, DataChunk &chunk); + void VerifyDeleteConstraints(TableDeleteState &state, ClientContext &context, DataChunk &chunk); void InitializeScanWithOffset(TableScanState &state, const vector &column_ids, idx_t start_row, idx_t end_row); @@ -214,6 +249,10 @@ class DataTable { DataChunk &chunk); private: + //! The table info + shared_ptr info; + //! The set of physical columns stored by this DataTable + vector column_definitions; //! Lock for appending entries to the table mutex append_lock; //! The row groups of the table diff --git a/src/duckdb/src/include/duckdb/storage/index.hpp b/src/duckdb/src/include/duckdb/storage/index.hpp index f5e89486..d838f60a 100644 --- a/src/duckdb/src/include/duckdb/storage/index.hpp +++ b/src/duckdb/src/include/duckdb/storage/index.hpp @@ -12,7 +12,6 @@ #include "duckdb/common/types/constraint_conflict_info.hpp" #include "duckdb/common/types/data_chunk.hpp" #include "duckdb/common/unordered_set.hpp" -#include "duckdb/execution/expression_executor.hpp" #include "duckdb/parser/parsed_expression.hpp" #include "duckdb/planner/expression.hpp" #include "duckdb/storage/table_storage_info.hpp" @@ -29,127 +28,64 @@ struct IndexScanState; //! The index is an abstract base class that serves as the basis for indexes class Index { -public: - Index(const string &name, const string &index_type, IndexConstraintType index_constraint_type, - const vector &column_ids, TableIOManager &table_io_manager, - const vector> &unbound_expressions, AttachedDatabase &db); - virtual ~Index() = default; +protected: + Index(const vector &column_ids, TableIOManager &table_io_manager, AttachedDatabase &db); - //! The name of the index - string name; - //! The index type (ART, B+-tree, Skip-List, ...) - string index_type; - //! The index constraint type - IndexConstraintType index_constraint_type; //! The logical column ids of the indexed table vector column_ids; - - //! Associated table io manager - TableIOManager &table_io_manager; //! Unordered set of column_ids used by the index unordered_set column_id_set; - //! Unbound expressions used by the index during optimizations - vector> unbound_expressions; - //! The physical types stored in the index - vector types; - //! The logical types of the expressions - vector logical_types; +public: + //! Associated table io manager + TableIOManager &table_io_manager; //! Attached database instance AttachedDatabase &db; public: - //! Returns true if the index is a unknown index, and false otherwise - virtual bool IsUnknown() { - return false; - } + virtual ~Index() = default; - //! Obtain a lock on the index - void InitializeLock(IndexLock &state); - //! Called when data is appended to the index. The lock obtained from InitializeLock must be held - virtual ErrorData Append(IndexLock &state, DataChunk &entries, Vector &row_identifiers) = 0; - //! Obtains a lock and calls Append while holding that lock - ErrorData Append(DataChunk &entries, Vector &row_identifiers); - //! Verify that data can be appended to the index without a constraint violation - virtual void VerifyAppend(DataChunk &chunk) = 0; - //! Verify that data can be appended to the index without a constraint violation using the conflict manager - virtual void VerifyAppend(DataChunk &chunk, ConflictManager &conflict_manager) = 0; - //! Performs constraint checking for a chunk of input data - virtual void CheckConstraintsForChunk(DataChunk &input, ConflictManager &conflict_manager) = 0; - - //! Deletes all data from the index. The lock obtained from InitializeLock must be held - virtual void CommitDrop(IndexLock &index_lock) = 0; - //! Deletes all data from the index - void CommitDrop(); - //! Delete a chunk of entries from the index. The lock obtained from InitializeLock must be held - virtual void Delete(IndexLock &state, DataChunk &entries, Vector &row_identifiers) = 0; - //! Obtains a lock and calls Delete while holding that lock - void Delete(DataChunk &entries, Vector &row_identifiers); - - //! Insert a chunk of entries into the index - virtual ErrorData Insert(IndexLock &lock, DataChunk &input, Vector &row_identifiers) = 0; - - //! Merge another index into this index. The lock obtained from InitializeLock must be held, and the other - //! index must also be locked during the merge - virtual bool MergeIndexes(IndexLock &state, Index &other_index) = 0; - //! Obtains a lock and calls MergeIndexes while holding that lock - bool MergeIndexes(Index &other_index); - - //! Traverses an ART and vacuums the qualifying nodes. The lock obtained from InitializeLock must be held - virtual void Vacuum(IndexLock &state) = 0; - //! Obtains a lock and calls Vacuum while holding that lock - void Vacuum(); - - //! Returns the in-memory usage of the index. The lock obtained from InitializeLock must be held - virtual idx_t GetInMemorySize(IndexLock &state) = 0; - //! Returns the in-memory usage of the index - idx_t GetInMemorySize(); - - //! Returns the string representation of an index, or only traverses and verifies the index - virtual string VerifyAndToString(IndexLock &state, const bool only_verify) = 0; - //! Obtains a lock and calls VerifyAndToString while holding that lock - string VerifyAndToString(const bool only_verify); - - //! Returns true if the index is affected by updates on the specified column IDs, and false otherwise - bool IndexIsUpdated(const vector &column_ids) const; + //! Returns true if the index is a bound index, and false otherwise + virtual bool IsBound() const = 0; + + //! The index type (ART, B+-tree, Skip-List, ...) + virtual const string &GetIndexType() const = 0; + + //! The name of the index + virtual const string &GetIndexName() const = 0; + + //! The index constraint type + virtual IndexConstraintType GetConstraintType() const = 0; //! Returns unique flag - bool IsUnique() { + bool IsUnique() const { + auto index_constraint_type = GetConstraintType(); return (index_constraint_type == IndexConstraintType::UNIQUE || index_constraint_type == IndexConstraintType::PRIMARY); } + //! Returns primary key flag - bool IsPrimary() { + bool IsPrimary() const { + auto index_constraint_type = GetConstraintType(); return (index_constraint_type == IndexConstraintType::PRIMARY); } + //! Returns foreign key flag - bool IsForeign() { + bool IsForeign() const { + auto index_constraint_type = GetConstraintType(); return (index_constraint_type == IndexConstraintType::FOREIGN); } - //! Returns all index storage information for serialization - virtual IndexStorageInfo GetStorageInfo(const bool get_buffers); - - //! Execute the index expressions on an input chunk - void ExecuteExpressions(DataChunk &input, DataChunk &result); - static string AppendRowError(DataChunk &input, idx_t index); - - //! Throw a constraint violation exception - virtual string GetConstraintViolationMessage(VerifyExistenceType verify_type, idx_t failed_index, - DataChunk &input) = 0; - -protected: - //! Lock used for any changes to the index - mutex lock; + const vector &GetColumnIds() const { + return column_ids; + } -private: - //! Bound expressions used during expression execution - vector> bound_expressions; - //! Expression executor to execute the index expressions - ExpressionExecutor executor; + const unordered_set &GetColumnIdSet() const { + return column_id_set; + } - //! Bind the unbound expressions of the index - unique_ptr BindExpression(unique_ptr expr); + // All indexes can be dropped, even if they are unbound + virtual void CommitDrop() = 0; public: template diff --git a/src/duckdb/src/include/duckdb/storage/object_cache.hpp b/src/duckdb/src/include/duckdb/storage/object_cache.hpp index 25b6ab69..5ef1a673 100644 --- a/src/duckdb/src/include/duckdb/storage/object_cache.hpp +++ b/src/duckdb/src/include/duckdb/storage/object_cache.hpp @@ -43,7 +43,7 @@ class ObjectCache { if (!object || object->GetObjectType() != T::ObjectType()) { return nullptr; } - return std::static_pointer_cast(object); + return shared_ptr_cast(object); } template @@ -52,7 +52,7 @@ class ObjectCache { auto entry = cache.find(key); if (entry == cache.end()) { - auto value = make_shared(args...); + auto value = make_shared_ptr(args...); cache[key] = value; return value; } @@ -60,7 +60,7 @@ class ObjectCache { if (!object || object->GetObjectType() != T::ObjectType()) { return nullptr; } - return std::static_pointer_cast(object); + return shared_ptr_cast(object); } void Put(string key, shared_ptr value) { diff --git a/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp b/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp index 4feb456d..802d51ba 100644 --- a/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp +++ b/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp @@ -26,7 +26,7 @@ class OptimisticDataWriter { //! Final flush of the optimistic writer - fully flushes the partial block manager void FinalFlush(); //! Flushes a specific row group to disk - void FlushToDisk(RowGroup *row_group); + void FlushToDisk(RowGroup &row_group); //! Merge the partially written blocks from one optimistic writer into another void Merge(OptimisticDataWriter &other); //! Rollback diff --git a/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp b/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp index 935f0126..b4892649 100644 --- a/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +++ b/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp @@ -85,7 +85,7 @@ struct PartialBlockAllocation { unique_ptr partial_block; }; -enum class CheckpointType { FULL_CHECKPOINT, APPEND_TO_TABLE }; +enum class PartialBlockType { FULL_CHECKPOINT, APPEND_TO_TABLE }; //! Enables sharing blocks across some scope. Scope is whatever we want to share //! blocks across. It may be an entire checkpoint or just a single row group. @@ -101,7 +101,7 @@ class PartialBlockManager { static constexpr const idx_t MAX_BLOCK_MAP_SIZE = 1u << 31; public: - PartialBlockManager(BlockManager &block_manager, CheckpointType checkpoint_type, + PartialBlockManager(BlockManager &block_manager, PartialBlockType partial_block_type, uint32_t max_partial_block_size = DEFAULT_MAX_PARTIAL_BLOCK_SIZE, uint32_t max_use_count = DEFAULT_MAX_USE_COUNT); virtual ~PartialBlockManager(); @@ -130,7 +130,7 @@ class PartialBlockManager { protected: BlockManager &block_manager; - CheckpointType checkpoint_type; + PartialBlockType partial_block_type; mutex partial_block_lock; //! A map of (available space -> PartialBlock) for partially filled blocks //! This is a multimap because there might be outstanding partial blocks with diff --git a/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp b/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp index 7f6e3447..91e54b89 100644 --- a/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +++ b/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp @@ -50,6 +50,8 @@ class StandardBufferManager : public BufferManager { idx_t GetUsedMemory() const final; idx_t GetMaxMemory() const final; + idx_t GetUsedSwap() final; + optional_idx GetMaxSwap() const final; //! Allocate an in-memory buffer with a single pin. //! The allocated memory is released when the buffer handle is destroyed. @@ -64,7 +66,8 @@ class StandardBufferManager : public BufferManager { //! Set a new memory limit to the buffer manager, throws an exception if the new limit is too low and not enough //! blocks can be evicted - void SetLimit(idx_t limit = (idx_t)-1) final; + void SetMemoryLimit(idx_t limit = (idx_t)-1) final; + void SetSwapLimit(optional_idx limit = optional_idx()) final; //! Returns informaton about memory usage vector GetMemoryUsageInfo() const override; @@ -73,14 +76,14 @@ class StandardBufferManager : public BufferManager { vector GetTemporaryFiles() final; const string &GetTemporaryDirectory() const final { - return temp_directory; + return temporary_directory.path; } void SetTemporaryDirectory(const string &new_dir) final; DUCKDB_API Allocator &GetBufferAllocator() final; - DatabaseInstance &GetDatabase() { + DatabaseInstance &GetDatabase() override { return db; } @@ -136,17 +139,27 @@ class StandardBufferManager : public BufferManager { //! overwrites the data within with garbage. Any readers that do not hold the pin will notice void VerifyZeroReaders(shared_ptr &handle); +protected: + // These are stored here because temp_directory creation is lazy + // so we need to store information related to the temporary directory before it's created + struct TemporaryFileData { + //! The directory name where temporary files are stored + string path; + //! Lock for creating the temp handle (marked mutable so 'GetMaxSwap' can be const) + mutable mutex lock; + //! Handle for the temporary directory + unique_ptr handle; + //! The maximum swap space that can be used + optional_idx maximum_swap_space = optional_idx(); + }; + protected: //! The database instance DatabaseInstance &db; //! The buffer pool BufferPool &buffer_pool; - //! The directory name where temporary files are stored - string temp_directory; - //! Lock for creating the temp handle - mutex temp_handle_lock; - //! Handle for the temporary directory - unique_ptr temp_directory_handle; + //! The variables related to temporary file management + TemporaryFileData temporary_directory; //! The temporary id used for managed buffers atomic temporary_id; //! Allocator associated with the buffer manager, that passes all allocations through this buffer manager diff --git a/src/duckdb/src/include/duckdb/storage/storage_info.hpp b/src/duckdb/src/include/duckdb/storage/storage_info.hpp index 1acdbba6..aa4482bf 100644 --- a/src/duckdb/src/include/duckdb/storage/storage_info.hpp +++ b/src/duckdb/src/include/duckdb/storage/storage_info.hpp @@ -29,7 +29,7 @@ using block_id_t = int64_t; struct Storage { //! The size of a hard disk sector, only really needed for Direct IO - constexpr static idx_t SECTOR_SIZE = 4096; + constexpr static idx_t SECTOR_SIZE = 4096U; //! Block header size for blocks written to the storage constexpr static idx_t BLOCK_HEADER_SIZE = sizeof(uint64_t); //! Size of a memory slot managed by the StorageManager. This is the quantum of allocation for Blocks on DuckDB. We @@ -39,7 +39,7 @@ struct Storage { constexpr static idx_t BLOCK_SIZE = BLOCK_ALLOC_SIZE - BLOCK_HEADER_SIZE; //! The size of the headers. This should be small and written more or less atomically by the hard disk. We default //! to the page size, which is 4KB. (1 << 12) - constexpr static idx_t FILE_HEADER_SIZE = 4096; + constexpr static idx_t FILE_HEADER_SIZE = 4096U; //! The number of rows per row group (must be a multiple of the vector size) constexpr static const idx_t ROW_GROUP_SIZE = STANDARD_ROW_GROUPS_SIZE; //! The number of vectors per row group @@ -48,7 +48,10 @@ struct Storage { //! The version number of the database storage format extern const uint64_t VERSION_NUMBER; -const char *GetDuckDBVersion(idx_t version_number); +string GetDuckDBVersion(idx_t version_number); +optional_idx GetStorageVersion(const char *version_string); +optional_idx GetSerializationVersion(const char *version_string); +vector GetSerializationCandidates(); //! The MainHeader is the first header in the storage file. The MainHeader is typically written only once for a database //! file. diff --git a/src/duckdb/src/include/duckdb/storage/storage_lock.hpp b/src/duckdb/src/include/duckdb/storage/storage_lock.hpp index b8a6ceb8..739aef76 100644 --- a/src/duckdb/src/include/duckdb/storage/storage_lock.hpp +++ b/src/duckdb/src/include/duckdb/storage/storage_lock.hpp @@ -11,42 +11,46 @@ #include "duckdb/common/constants.hpp" #include "duckdb/common/atomic.hpp" #include "duckdb/common/mutex.hpp" +#include "duckdb/common/shared_ptr.hpp" namespace duckdb { -class StorageLock; +struct StorageLockInternals; enum class StorageLockType { SHARED = 0, EXCLUSIVE = 1 }; class StorageLockKey { public: - StorageLockKey(StorageLock &lock, StorageLockType type); + StorageLockKey(shared_ptr internals, StorageLockType type); ~StorageLockKey(); + StorageLockType GetType() const { + return type; + } + private: - StorageLock &lock; + shared_ptr internals; StorageLockType type; }; class StorageLock { - friend class StorageLockKey; - public: StorageLock(); + ~StorageLock(); //! Get an exclusive lock unique_ptr GetExclusiveLock(); //! Get a shared lock unique_ptr GetSharedLock(); + //! Try to get an exclusive lock - if we cannot get it immediately we return `nullptr` + unique_ptr TryGetExclusiveLock(); + //! This is a special method that only exists for checkpointing + //! This method takes a shared lock, and returns an exclusive lock if the parameter is the only active shared lock + //! If this method succeeds, we have **both** a shared and exclusive lock active (which normally is not allowed) + //! But this behavior is required for checkpointing + unique_ptr TryUpgradeCheckpointLock(StorageLockKey &lock); private: - mutex exclusive_lock; - atomic read_count; - -private: - //! Release an exclusive lock - void ReleaseExclusiveLock(); - //! Release a shared lock - void ReleaseSharedLock(); + shared_ptr internals; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/storage_manager.hpp b/src/duckdb/src/include/duckdb/storage/storage_manager.hpp index e0c07b6b..12ac6012 100644 --- a/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +++ b/src/duckdb/src/include/duckdb/storage/storage_manager.hpp @@ -14,6 +14,7 @@ #include "duckdb/storage/table_io_manager.hpp" #include "duckdb/storage/write_ahead_log.hpp" #include "duckdb/storage/database_size.hpp" +#include "duckdb/common/enums/checkpoint_type.hpp" namespace duckdb { class BlockManager; @@ -34,6 +35,17 @@ class StorageCommitState { virtual void FlushCommit() = 0; }; +struct CheckpointOptions { + CheckpointOptions() + : wal_action(CheckpointWALAction::DONT_DELETE_WAL), action(CheckpointAction::CHECKPOINT_IF_REQUIRED), + type(CheckpointType::FULL_CHECKPOINT) { + } + + CheckpointWALAction wal_action; + CheckpointAction action; + CheckpointType type; +}; + //! StorageManager is responsible for managing the physical storage of the //! database on disk class StorageManager { @@ -46,20 +58,27 @@ class StorageManager { static StorageManager &Get(Catalog &catalog); //! Initialize a database or load an existing database from the given path - void Initialize(optional_ptr context); + void Initialize(); DatabaseInstance &GetDatabase(); AttachedDatabase &GetAttached() { return db; } - //! Get the WAL of the StorageManager, returns nullptr if in-memory - optional_ptr GetWriteAheadLog(); + //! Gets the size of the WAL, or zero, if there is no WAL. + int64_t GetWALSize(); + //! Gets the WAL of the StorageManager, or nullptr, if there is no WAL. + optional_ptr GetWAL(); + //! Deletes the WAL file, and resets the unique pointer. + void ResetWAL(); //! Returns the database file path - string GetDBPath() { + string GetDBPath() const { return path; } + bool IsLoaded() const { + return load_complete; + } //! The path to the WAL, derived from the database file path string GetWALPath(); bool InMemory(); @@ -67,13 +86,13 @@ class StorageManager { virtual bool AutomaticCheckpoint(idx_t estimated_wal_bytes) = 0; virtual unique_ptr GenStorageCommitState(Transaction &transaction, bool checkpoint) = 0; virtual bool IsCheckpointClean(MetaBlockPointer checkpoint_id) = 0; - virtual void CreateCheckpoint(bool delete_wal = false, bool force_checkpoint = false) = 0; + virtual void CreateCheckpoint(CheckpointOptions options = CheckpointOptions()) = 0; virtual DatabaseSize GetDatabaseSize() = 0; virtual vector GetMetadataInfo() = 0; virtual shared_ptr GetTableIOManager(BoundCreateTableInfo *info) = 0; protected: - virtual void LoadDatabase(optional_ptr context = nullptr) = 0; + virtual void LoadDatabase() = 0; protected: //! The database this storage manager belongs to @@ -115,12 +134,12 @@ class SingleFileStorageManager : public StorageManager { bool AutomaticCheckpoint(idx_t estimated_wal_bytes) override; unique_ptr GenStorageCommitState(Transaction &transaction, bool checkpoint) override; bool IsCheckpointClean(MetaBlockPointer checkpoint_id) override; - void CreateCheckpoint(bool delete_wal, bool force_checkpoint) override; + void CreateCheckpoint(CheckpointOptions options) override; DatabaseSize GetDatabaseSize() override; vector GetMetadataInfo() override; shared_ptr GetTableIOManager(BoundCreateTableInfo *info) override; protected: - void LoadDatabase(optional_ptr context = nullptr) override; + void LoadDatabase() override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp b/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp index c4545e5f..a57b851e 100644 --- a/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +++ b/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp @@ -149,8 +149,9 @@ struct UncompressedStringStorage { // place the dictionary offset into the set of vectors // note: for overflow strings we write negative value + D_ASSERT(*dictionary_size <= int32_t(Storage::BLOCK_SIZE)); - result_data[target_idx] = -(*dictionary_size); + result_data[target_idx] = -NumericCast((*dictionary_size)); } else { // string fits in block, append to dictionary and increment dictionary position D_ASSERT(string_length < NumericLimits::Maximum()); @@ -162,7 +163,7 @@ struct UncompressedStringStorage { // place the dictionary offset into the set of vectors D_ASSERT(*dictionary_size <= int32_t(Storage::BLOCK_SIZE)); - result_data[target_idx] = *dictionary_size; + result_data[target_idx] = NumericCast(*dictionary_size); } D_ASSERT(RemainingSpace(segment, handle) <= Storage::BLOCK_SIZE); #ifdef DEBUG diff --git a/src/duckdb/src/include/duckdb/storage/table/append_state.hpp b/src/duckdb/src/include/duckdb/storage/table/append_state.hpp index 42cd29be..0e22d17b 100644 --- a/src/duckdb/src/include/duckdb/storage/table/append_state.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/append_state.hpp @@ -14,6 +14,7 @@ #include "duckdb/common/vector.hpp" #include "duckdb/function/compression_function.hpp" #include "duckdb/transaction/transaction_data.hpp" +#include "duckdb/planner/bound_constraint.hpp" namespace duckdb { class ColumnSegment; @@ -21,6 +22,7 @@ class DataTable; class LocalTableStorage; class RowGroup; class UpdateSegment; +class TableCatalogEntry; struct TableAppendState; @@ -69,9 +71,19 @@ struct TableAppendState { TransactionData transaction; }; +struct ConstraintState { + explicit ConstraintState(TableCatalogEntry &table_p, const vector> &bound_constraints) + : table(table_p), bound_constraints(bound_constraints) { + } + + TableCatalogEntry &table; + const vector> &bound_constraints; +}; + struct LocalAppendState { TableAppendState append_state; LocalTableStorage *storage; + unique_ptr constraint_state; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/table/array_column_data.hpp b/src/duckdb/src/include/duckdb/storage/table/array_column_data.hpp index 2e676045..8ce7835f 100644 --- a/src/duckdb/src/include/duckdb/storage/table/array_column_data.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/array_column_data.hpp @@ -31,8 +31,10 @@ class ArrayColumnData : public ColumnData { void InitializeScan(ColumnScanState &state) override; void InitializeScanWithOffset(ColumnScanState &state, idx_t row_idx) override; - idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result) override; - idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates) override; + idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t scan_count) override; + idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates, + idx_t scan_count) override; idx_t ScanCount(ColumnScanState &state, Vector &result, idx_t count) override; void Skip(ColumnScanState &state, idx_t count = STANDARD_VECTOR_SIZE) override; @@ -53,8 +55,7 @@ class ArrayColumnData : public ColumnData { unique_ptr CreateCheckpointState(RowGroup &row_group, PartialBlockManager &partial_block_manager) override; - unique_ptr Checkpoint(RowGroup &row_group, PartialBlockManager &partial_block_manager, - ColumnCheckpointInfo &checkpoint_info) override; + unique_ptr Checkpoint(RowGroup &row_group, ColumnCheckpointInfo &info) override; void DeserializeColumn(Deserializer &source, BaseStatistics &target_stats) override; diff --git a/src/duckdb/src/include/duckdb/storage/table/column_data.hpp b/src/duckdb/src/include/duckdb/storage/table/column_data.hpp index 55020f58..fe21efec 100644 --- a/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/column_data.hpp @@ -16,6 +16,7 @@ #include "duckdb/storage/table/segment_tree.hpp" #include "duckdb/storage/table/column_segment_tree.hpp" #include "duckdb/common/mutex.hpp" +#include "duckdb/common/enums/scan_vector_type.hpp" namespace duckdb { class ColumnData; @@ -29,10 +30,17 @@ struct TransactionData; struct TableScanOptions; struct DataTableInfo; +struct RowGroupWriteInfo; struct ColumnCheckpointInfo { - explicit ColumnCheckpointInfo(CompressionType compression_type_p) : compression_type(compression_type_p) {}; - CompressionType compression_type; + ColumnCheckpointInfo(RowGroupWriteInfo &info, idx_t column_idx) : info(info), column_idx(column_idx) { + } + + RowGroupWriteInfo &info; + idx_t column_idx; + +public: + CompressionType GetCompressionType(); }; class ColumnData { @@ -46,7 +54,7 @@ class ColumnData { //! The start row idx_t start; //! The count of the column data - idx_t count; + atomic count; //! The block manager BlockManager &block_manager; //! Table info for the column @@ -76,15 +84,22 @@ class ColumnData { //! The root type of the column const LogicalType &RootType() const; //! Whether or not the column has any updates - virtual bool HasUpdates() const; + bool HasUpdates() const; + //! Whether or not we can scan an entire vector + virtual ScanVectorType GetVectorScanType(ColumnScanState &state, idx_t scan_count); //! Initialize a scan of the column virtual void InitializeScan(ColumnScanState &state); //! Initialize a scan starting at the specified offset virtual void InitializeScanWithOffset(ColumnScanState &state, idx_t row_idx); //! Scan the next vector from the column - virtual idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result); - virtual idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates); + idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result); + idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates); + virtual idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t scan_count); + virtual idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates, + idx_t scan_count); + virtual void ScanCommittedRange(idx_t row_group_start, idx_t offset_in_row_group, idx_t count, Vector &result); virtual idx_t ScanCount(ColumnScanState &state, Vector &result, idx_t count); //! Select @@ -124,8 +139,7 @@ class ColumnData { virtual unique_ptr CreateCheckpointState(RowGroup &row_group, PartialBlockManager &partial_block_manager); - virtual unique_ptr - Checkpoint(RowGroup &row_group, PartialBlockManager &partial_block_manager, ColumnCheckpointInfo &checkpoint_info); + virtual unique_ptr Checkpoint(RowGroup &row_group, ColumnCheckpointInfo &info); virtual void CheckpointScan(ColumnSegment &segment, ColumnScanState &state, idx_t row_group_start, idx_t count, Vector &scan_vector); @@ -155,11 +169,12 @@ class ColumnData { void AppendTransientSegment(SegmentLock &l, idx_t start_row); //! Scans a base vector from the column - idx_t ScanVector(ColumnScanState &state, Vector &result, idx_t remaining, bool has_updates); + idx_t ScanVector(ColumnScanState &state, Vector &result, idx_t remaining, ScanVectorType scan_type); //! Scans a vector from the column merged with any potential updates //! If ALLOW_UPDATES is set to false, the function will instead throw an exception if any updates are found template - idx_t ScanVector(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result); + idx_t ScanVector(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t target_scan); void ClearUpdates(); void FetchUpdates(TransactionData transaction, idx_t vector_index, Vector &result, idx_t scan_count, @@ -168,6 +183,8 @@ class ColumnData { void UpdateInternal(TransactionData transaction, idx_t column_index, Vector &update_vector, row_t *row_ids, idx_t update_count, Vector &base_vector); + idx_t GetVectorCount(idx_t vector_index) const; + protected: //! The segments holding the data of this column segment ColumnSegmentTree data; @@ -175,6 +192,8 @@ class ColumnData { mutable mutex update_lock; //! The updates for this column segment unique_ptr updates; + //! The lock for the stats + mutable mutex stats_lock; //! The stats of the root segment unique_ptr stats; //! Total transient allocation size diff --git a/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp b/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp index fa119716..e403c9cb 100644 --- a/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp @@ -17,6 +17,7 @@ #include "duckdb/function/compression_function.hpp" #include "duckdb/storage/table/segment_base.hpp" #include "duckdb/storage/buffer/block_handle.hpp" +#include "duckdb/common/enums/scan_vector_type.hpp" namespace duckdb { class ColumnSegment; @@ -64,7 +65,7 @@ class ColumnSegment : public SegmentBase { public: void InitializeScan(ColumnScanState &state); //! Scan one vector from this segment - void Scan(ColumnScanState &state, idx_t scan_count, Vector &result, idx_t result_offset, bool entire_vector); + void Scan(ColumnScanState &state, idx_t scan_count, Vector &result, idx_t result_offset, ScanVectorType scan_type); //! Fetch a value of the specific row id and append it to the result void FetchRow(ColumnFetchState &state, row_t row_id, Vector &result, idx_t result_idx); diff --git a/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp b/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp index 598d80e2..e7fa3bd3 100644 --- a/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp @@ -11,25 +11,51 @@ #include "duckdb/common/atomic.hpp" #include "duckdb/common/common.hpp" #include "duckdb/storage/table/table_index_list.hpp" +#include "duckdb/storage/storage_lock.hpp" namespace duckdb { class DatabaseInstance; class TableIOManager; struct DataTableInfo { + friend class DataTable; + +public: DataTableInfo(AttachedDatabase &db, shared_ptr table_io_manager_p, string schema, string table); //! Initialize any unknown indexes whose types might now be present after an extension load, optionally throwing an //! exception if an index can't be initialized - void InitializeIndexes(ClientContext &context, bool throw_on_failure = false); + void InitializeIndexes(ClientContext &context, const char *index_type = nullptr); + + //! Whether or not the table is temporary + bool IsTemporary() const; + + AttachedDatabase &GetDB() { + return db; + } + + TableIOManager &GetIOManager() { + return *table_io_manager; + } + TableIndexList &GetIndexes() { + return indexes; + } + const vector &GetIndexStorageInfo() const { + return index_storage_infos; + } + + string GetSchemaName(); + string GetTableName(); + void SetTableName(string name); + +private: //! The database instance of the table AttachedDatabase &db; //! The table IO manager shared_ptr table_io_manager; - //! The amount of elements in the table. Note that this number signifies the amount of COMMITTED entries in the - //! table. It can be inaccurate inside of transactions. More work is needed to properly support that. - atomic cardinality; + //! Lock for modifying the name + mutex name_lock; //! The schema of the table string schema; //! The name of the table @@ -38,8 +64,8 @@ struct DataTableInfo { TableIndexList indexes; //! Index storage information of the indexes created by this table vector index_storage_infos; - - bool IsTemporary() const; + //! Lock held while checkpointing + StorageLock checkpoint_lock; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/table/delete_state.hpp b/src/duckdb/src/include/duckdb/storage/table/delete_state.hpp new file mode 100644 index 00000000..6d25df4a --- /dev/null +++ b/src/duckdb/src/include/duckdb/storage/table/delete_state.hpp @@ -0,0 +1,23 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/storage/table/delete_state.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/storage/table/append_state.hpp" + +namespace duckdb { +class TableCatalogEntry; + +struct TableDeleteState { + unique_ptr constraint_state; + bool has_delete_constraints = false; + DataChunk verify_chunk; + vector col_ids; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp b/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp index 3140ea37..8a29d585 100644 --- a/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp @@ -31,8 +31,10 @@ class ListColumnData : public ColumnData { void InitializeScan(ColumnScanState &state) override; void InitializeScanWithOffset(ColumnScanState &state, idx_t row_idx) override; - idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result) override; - idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates) override; + idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t scan_count) override; + idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates, + idx_t scan_count) override; idx_t ScanCount(ColumnScanState &state, Vector &result, idx_t count) override; void Skip(ColumnScanState &state, idx_t count = STANDARD_VECTOR_SIZE) override; @@ -53,8 +55,7 @@ class ListColumnData : public ColumnData { unique_ptr CreateCheckpointState(RowGroup &row_group, PartialBlockManager &partial_block_manager) override; - unique_ptr Checkpoint(RowGroup &row_group, PartialBlockManager &partial_block_manager, - ColumnCheckpointInfo &checkpoint_info) override; + unique_ptr Checkpoint(RowGroup &row_group, ColumnCheckpointInfo &info) override; void DeserializeColumn(Deserializer &deserializer, BaseStatistics &target_stats) override; diff --git a/src/duckdb/src/include/duckdb/storage/table/row_group.hpp b/src/duckdb/src/include/duckdb/storage/table/row_group.hpp index 6265279f..43bf21ca 100644 --- a/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/row_group.hpp @@ -17,6 +17,7 @@ #include "duckdb/parser/column_list.hpp" #include "duckdb/storage/table/segment_base.hpp" #include "duckdb/storage/block.hpp" +#include "duckdb/common/enums/checkpoint_type.hpp" namespace duckdb { class AttachedDatabase; @@ -43,6 +44,17 @@ struct RowGroupAppendState; class MetadataManager; class RowVersionManager; +struct RowGroupWriteInfo { + RowGroupWriteInfo(PartialBlockManager &manager, const vector &compression_types, + CheckpointType checkpoint_type = CheckpointType::FULL_CHECKPOINT) + : manager(manager), compression_types(compression_types), checkpoint_type(checkpoint_type) { + } + + PartialBlockManager &manager; + const vector &compression_types; + CheckpointType checkpoint_type; +}; + struct RowGroupWriteData { vector> states; vector statistics; @@ -77,7 +89,7 @@ class RowGroup : public SegmentBase { ExpressionExecutor &executor, CollectionScanState &scan_state, DataChunk &scan_chunk); unique_ptr AddColumn(RowGroupCollection &collection, ColumnDefinition &new_column, - ExpressionExecutor &executor, Expression &default_value, Vector &intermediate); + ExpressionExecutor &executor, Vector &intermediate); unique_ptr RemoveColumn(RowGroupCollection &collection, idx_t removed_column); void CommitDrop(); @@ -117,7 +129,7 @@ class RowGroup : public SegmentBase { //! Delete the given set of rows in the version manager idx_t Delete(TransactionData transaction, DataTable &table, row_t *row_ids, idx_t count); - RowGroupWriteData WriteToDisk(PartialBlockManager &manager, const vector &compression_types); + RowGroupWriteData WriteToDisk(RowGroupWriteInfo &info); //! Returns the number of committed rows (count - committed deletes) idx_t GetCommittedRowCount(); RowGroupWriteData WriteToDisk(RowGroupWriter &writer); @@ -171,7 +183,6 @@ class RowGroup : public SegmentBase { private: mutex row_group_lock; - mutex stats_lock; vector column_pointers; unique_ptr[]> is_loaded; vector deletes_pointers; diff --git a/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp b/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp index 85d99ba1..251377b3 100644 --- a/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp @@ -90,7 +90,8 @@ class RowGroupCollection { void Checkpoint(TableDataWriter &writer, TableStatistics &global_stats); - void InitializeVacuumState(VacuumState &state, vector> &segments); + void InitializeVacuumState(CollectionCheckpointState &checkpoint_state, VacuumState &state, + vector> &segments); bool ScheduleVacuumTasks(CollectionCheckpointState &checkpoint_state, VacuumState &state, idx_t segment_idx); void ScheduleCheckpointTask(CollectionCheckpointState &checkpoint_state, idx_t segment_idx); @@ -101,7 +102,7 @@ class RowGroupCollection { const vector &GetTypes() const; shared_ptr AddColumn(ClientContext &context, ColumnDefinition &new_column, - Expression &default_value); + ExpressionExecutor &default_executor); shared_ptr RemoveColumn(idx_t col_idx); shared_ptr AlterType(ClientContext &context, idx_t changed_idx, const LogicalType &target_type, vector bound_columns, Expression &cast_expr); diff --git a/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp b/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp index 7b8160fd..b14813dc 100644 --- a/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp @@ -157,6 +157,8 @@ class TableScanState { CollectionScanState local_state; //! Options for scanning TableScanOptions options; + //! Shared lock over the checkpoint to prevent checkpoints while reading + unique_ptr checkpoint_lock; public: void Initialize(vector column_ids, TableFilterSet *table_filters = nullptr); @@ -192,6 +194,8 @@ struct ParallelTableScanState { ParallelCollectionScanState scan_state; //! Parallel scan state for the transaction-local state ParallelCollectionScanState local_state; + //! Shared lock over the checkpoint to prevent checkpoints while reading + unique_ptr checkpoint_lock; }; class CreateIndexScanState : public TableScanState { diff --git a/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp b/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp index e2778bc3..e267d2e3 100644 --- a/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp @@ -83,11 +83,11 @@ class SegmentTree { if (index < 0) { // load all segments LoadAllSegments(l); - index = nodes.size() + index; + index += nodes.size(); if (index < 0) { return nullptr; } - return nodes[index].node.get(); + return nodes[UnsafeNumericCast(index)].node.get(); } else { // lazily load segments until we reach the specific segment while (idx_t(index) >= nodes.size() && LoadNextSegment(l)) { @@ -95,7 +95,7 @@ class SegmentTree { if (idx_t(index) >= nodes.size()) { return nullptr; } - return nodes[index].node.get(); + return nodes[UnsafeNumericCast(index)].node.get(); } } //! Gets the next segment @@ -116,7 +116,7 @@ class SegmentTree { #ifdef DEBUG D_ASSERT(nodes[segment->index].node.get() == segment); #endif - return GetSegmentByIndex(l, segment->index + 1); + return GetSegmentByIndex(l, UnsafeNumericCast(segment->index + 1)); } //! Gets a pointer to the last segment. Useful for appends. @@ -182,7 +182,7 @@ class SegmentTree { if (segment_start >= nodes.size() - 1) { return; } - nodes.erase(nodes.begin() + segment_start + 1, nodes.end()); + nodes.erase(nodes.begin() + UnsafeNumericCast(segment_start) + 1, nodes.end()); } //! Get the segment index of the column segment for the given row diff --git a/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp b/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp index 9ad0780d..7f88d361 100644 --- a/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp @@ -23,16 +23,17 @@ class StandardColumnData : public ColumnData { ValidityColumnData validity; public: - bool HasUpdates() const override; - void SetStart(idx_t new_start) override; bool CheckZonemap(ColumnScanState &state, TableFilter &filter) override; + ScanVectorType GetVectorScanType(ColumnScanState &state, idx_t scan_count) override; void InitializeScan(ColumnScanState &state) override; void InitializeScanWithOffset(ColumnScanState &state, idx_t row_idx) override; - idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result) override; - idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates) override; + idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t target_count) override; + idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates, + idx_t target_count) override; idx_t ScanCount(ColumnScanState &state, Vector &result, idx_t count) override; void InitializeAppend(ColumnAppendState &state) override; @@ -51,8 +52,7 @@ class StandardColumnData : public ColumnData { unique_ptr CreateCheckpointState(RowGroup &row_group, PartialBlockManager &partial_block_manager) override; - unique_ptr Checkpoint(RowGroup &row_group, PartialBlockManager &partial_block_manager, - ColumnCheckpointInfo &checkpoint_info) override; + unique_ptr Checkpoint(RowGroup &row_group, ColumnCheckpointInfo &info) override; void CheckpointScan(ColumnSegment &segment, ColumnScanState &state, idx_t row_group_start, idx_t count, Vector &scan_vector) override; diff --git a/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp b/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp index 723b2b9f..80d10255 100644 --- a/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp @@ -32,8 +32,10 @@ class StructColumnData : public ColumnData { void InitializeScan(ColumnScanState &state) override; void InitializeScanWithOffset(ColumnScanState &state, idx_t row_idx) override; - idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result) override; - idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates) override; + idx_t Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t scan_count) override; + idx_t ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates, + idx_t scan_count) override; idx_t ScanCount(ColumnScanState &state, Vector &result, idx_t count) override; void Skip(ColumnScanState &state, idx_t count = STANDARD_VECTOR_SIZE) override; @@ -54,8 +56,7 @@ class StructColumnData : public ColumnData { unique_ptr CreateCheckpointState(RowGroup &row_group, PartialBlockManager &partial_block_manager) override; - unique_ptr Checkpoint(RowGroup &row_group, PartialBlockManager &partial_block_manager, - ColumnCheckpointInfo &checkpoint_info) override; + unique_ptr Checkpoint(RowGroup &row_group, ColumnCheckpointInfo &info) override; void DeserializeColumn(Deserializer &source, BaseStatistics &target_stats) override; diff --git a/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp b/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp index 397bf282..2520ba5c 100644 --- a/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp @@ -10,6 +10,7 @@ #include "duckdb/common/mutex.hpp" #include "duckdb/storage/index.hpp" +#include "duckdb/parser/constraint.hpp" namespace duckdb { @@ -29,6 +30,29 @@ class TableIndexList { } } } + + //! Scan the indexes, invoking the callback method for every bound entry of a specific type + template + void ScanBound(FUNC &&callback) { + lock_guard lock(indexes_lock); + for (auto &index : indexes) { + if (index->IsBound() && T::TYPE_NAME == index->GetIndexType()) { + if (callback(index->Cast())) { + break; + } + } + } + } + + // Bind any unbound indexes of the specified type and invoke the callback method for every bound entry of the + // specified type, regardless if it was bound before or not + template + void BindAndScan(ClientContext &context, DataTableInfo &table_info, FUNC &&callback) { + // FIXME: optimize this by only looping through the indexes once without re-acquiring the lock + InitializeIndexes(context, table_info, T::TYPE_NAME); + ScanBound(callback); + } + //! Returns a reference to the indexes of this table const vector> &Indexes() const { return indexes; @@ -43,7 +67,7 @@ class TableIndexList { bool NameIsUnique(const string &name); //! Initializes unknown indexes that might now be present after an extension load, optionally throwing an exception //! if a index cant be initialized - void InitializeIndexes(ClientContext &context, DataTableInfo &table_info, bool throw_on_failure = false); + void InitializeIndexes(ClientContext &context, DataTableInfo &table_info, const char *index_type = nullptr); bool Empty(); idx_t Count(); void Move(TableIndexList &other); diff --git a/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp b/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp index 05837184..633d4694 100644 --- a/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp @@ -43,8 +43,11 @@ class TableStatistics { void MergeStats(TableStatisticsLock &lock, idx_t i, BaseStatistics &stats); void CopyStats(TableStatistics &other); + void CopyStats(TableStatisticsLock &lock, TableStatistics &other); unique_ptr CopyStats(idx_t i); - ColumnStatistics &GetStats(idx_t i); + //! Get a reference to the stats - this requires us to hold the lock. + //! The reference can only be safely accessed while the lock is held + ColumnStatistics &GetStats(TableStatisticsLock &lock, idx_t i); bool Empty(); @@ -55,7 +58,7 @@ class TableStatistics { private: //! The statistics lock - mutex stats_lock; + shared_ptr stats_lock; //! Column statistics vector> column_stats; //! The table sample diff --git a/src/duckdb/src/include/duckdb/storage/table/update_state.hpp b/src/duckdb/src/include/duckdb/storage/table/update_state.hpp new file mode 100644 index 00000000..0a8193c5 --- /dev/null +++ b/src/duckdb/src/include/duckdb/storage/table/update_state.hpp @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// DuckDB +// +// duckdb/storage/table/update_state.hpp +// +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include "duckdb/storage/table/append_state.hpp" + +namespace duckdb { +class TableCatalogEntry; + +struct TableUpdateState { + unique_ptr constraint_state; +}; + +} // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/table/validity_column_data.hpp b/src/duckdb/src/include/duckdb/storage/table/validity_column_data.hpp index ba203d35..d02d09f9 100644 --- a/src/duckdb/src/include/duckdb/storage/table/validity_column_data.hpp +++ b/src/duckdb/src/include/duckdb/storage/table/validity_column_data.hpp @@ -20,6 +20,7 @@ class ValidityColumnData : public ColumnData { public: bool CheckZonemap(ColumnScanState &state, TableFilter &filter) override; + void AppendData(BaseStatistics &stats, ColumnAppendState &state, UnifiedVectorFormat &vdata, idx_t count) override; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/temporary_file_manager.hpp b/src/duckdb/src/include/duckdb/storage/temporary_file_manager.hpp index bfb22ee9..e5587547 100644 --- a/src/duckdb/src/include/duckdb/storage/temporary_file_manager.hpp +++ b/src/duckdb/src/include/duckdb/storage/temporary_file_manager.hpp @@ -23,8 +23,11 @@ namespace duckdb { // BlockIndexManager //===--------------------------------------------------------------------===// +class TemporaryFileManager; + struct BlockIndexManager { public: + explicit BlockIndexManager(TemporaryFileManager &manager); BlockIndexManager(); public: @@ -37,12 +40,14 @@ struct BlockIndexManager { bool HasFreeBlocks(); private: + void SetMaxIndex(idx_t blocks); idx_t GetNewBlockIndexInternal(); private: idx_t max_index; set free_indexes; set indexes_in_use; + optional_ptr manager; }; //===--------------------------------------------------------------------===// @@ -69,7 +74,8 @@ class TemporaryFileHandle { constexpr static idx_t MAX_ALLOWED_INDEX_BASE = 4000; public: - TemporaryFileHandle(idx_t temp_file_count, DatabaseInstance &db, const string &temp_directory, idx_t index); + TemporaryFileHandle(idx_t temp_file_count, DatabaseInstance &db, const string &temp_directory, idx_t index, + TemporaryFileManager &manager); public: struct TemporaryFileLock { @@ -103,15 +109,13 @@ class TemporaryFileHandle { BlockIndexManager index_manager; }; -class TemporaryFileManager; - //===--------------------------------------------------------------------===// // TemporaryDirectoryHandle //===--------------------------------------------------------------------===// class TemporaryDirectoryHandle { public: - TemporaryDirectoryHandle(DatabaseInstance &db, string path_p); + TemporaryDirectoryHandle(DatabaseInstance &db, string path_p, optional_idx max_swap_space); ~TemporaryDirectoryHandle(); TemporaryFileManager &GetTempFile(); @@ -130,6 +134,7 @@ class TemporaryDirectoryHandle { class TemporaryFileManager { public: TemporaryFileManager(DatabaseInstance &db, const string &temp_directory_p); + ~TemporaryFileManager(); public: struct TemporaryManagerLock { @@ -145,6 +150,13 @@ class TemporaryFileManager { unique_ptr ReadTemporaryBuffer(block_id_t id, unique_ptr reusable_buffer); void DeleteTemporaryBuffer(block_id_t id); vector GetTemporaryFiles(); + idx_t GetTotalUsedSpaceInBytes(); + optional_idx GetMaxSwapSpace() const; + void SetMaxSwapSpace(optional_idx limit); + //! Register temporary file size growth + void IncreaseSizeOnDisk(idx_t amount); + //! Register temporary file size decrease + void DecreaseSizeOnDisk(idx_t amount); private: void EraseUsedBlock(TemporaryManagerLock &lock, block_id_t id, TemporaryFileHandle *handle, @@ -164,6 +176,10 @@ class TemporaryFileManager { unordered_map used_blocks; //! Manager of in-use temporary file indexes BlockIndexManager index_manager; + //! The size in bytes of the temporary files that are currently alive + atomic size_on_disk; + //! The max amount of disk space that can be used + idx_t max_swap_space; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp b/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp index 6398a20b..97485b13 100644 --- a/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +++ b/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp @@ -44,7 +44,7 @@ class WriteAheadLogDeserializer; class WriteAheadLog { public: //! Initialize the WAL in the specified directory - explicit WriteAheadLog(AttachedDatabase &database, const string &path); + explicit WriteAheadLog(AttachedDatabase &database, const string &wal_path); virtual ~WriteAheadLog(); //! Skip writing to the WAL @@ -54,11 +54,16 @@ class WriteAheadLog { //! Replay the WAL static bool Replay(AttachedDatabase &database, unique_ptr handle); - //! Returns the current size of the WAL in bytes - int64_t GetWALSize(); //! Gets the total bytes written to the WAL since startup idx_t GetTotalWritten(); + //! A WAL is initialized, if a writer to a file exists. + bool Initialized() { + return writer != nullptr; + } + //! Initializes the file of the WAL by creating the file writer. + BufferedFileWriter &Initialize(); + //! Returns the WAL file writer. BufferedFileWriter &GetWriter() { return *writer; } @@ -76,7 +81,7 @@ class WriteAheadLog { void WriteCreateSequence(const SequenceCatalogEntry &entry); void WriteDropSequence(const SequenceCatalogEntry &entry); - void WriteSequenceValue(const SequenceCatalogEntry &entry, SequenceValue val); + void WriteSequenceValue(SequenceValue val); void WriteCreateMacro(const ScalarMacroCatalogEntry &entry); void WriteDropMacro(const ScalarMacroCatalogEntry &entry); @@ -90,7 +95,7 @@ class WriteAheadLog { void WriteCreateType(const TypeCatalogEntry &entry); void WriteDropType(const TypeCatalogEntry &entry); //! Sets the table used for subsequent insert/delete/update commands - void WriteSetTable(string &schema, string &table); + void WriteSetTable(const string &schema, const string &table); void WriteAlter(const AlterInfo &info); diff --git a/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp b/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp index 85807265..5bae2edc 100644 --- a/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +++ b/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp @@ -9,13 +9,17 @@ #pragma once #include "duckdb/transaction/transaction.hpp" +#include "duckdb/common/reference_map.hpp" namespace duckdb { class RowVersionManager; +class DuckTransactionManager; +class StorageLockKey; +struct UndoBufferProperties; class DuckTransaction : public Transaction { public: - DuckTransaction(TransactionManager &manager, ClientContext &context, transaction_t start_time, + DuckTransaction(DuckTransactionManager &manager, ClientContext &context, transaction_t start_time, transaction_t transaction_id); ~DuckTransaction() override; @@ -25,8 +29,6 @@ class DuckTransaction : public Transaction { transaction_t transaction_id; //! The commit id of this transaction, if it has successfully been committed transaction_t commit_id; - //! Map of all sequences that were used during the transaction and the value they had in this transaction - unordered_map sequence_usage; //! Highest active query when the transaction finished, used for cleaning up transaction_t highest_active_query; @@ -37,11 +39,13 @@ class DuckTransaction : public Transaction { void PushCatalogEntry(CatalogEntry &entry, data_ptr_t extra_data = nullptr, idx_t extra_data_size = 0); + void SetReadWrite() override; + //! Commit the current transaction with the given commit identifier. Returns an error message if the transaction //! commit failed, or an empty string if the commit was sucessful ErrorData Commit(AttachedDatabase &db, transaction_t commit_id, bool checkpoint) noexcept; //! Returns whether or not a commit of this transaction should trigger an automatic checkpoint - bool AutomaticCheckpoint(AttachedDatabase &db); + bool AutomaticCheckpoint(AttachedDatabase &db, const UndoBufferProperties &properties); //! Rollback void Rollback() noexcept; @@ -49,9 +53,11 @@ class DuckTransaction : public Transaction { void Cleanup(); bool ChangesMade(); + UndoBufferProperties GetUndoProperties(); void PushDelete(DataTable &table, RowVersionManager &info, idx_t vector_idx, row_t rows[], idx_t count, idx_t base_row); + void PushSequenceUsage(SequenceCatalogEntry &entry, const SequenceData &data); void PushAppend(DataTable &table, idx_t row_start, idx_t row_count); UpdateInfo *CreateUpdateInfo(idx_t type_size, idx_t entries); @@ -59,12 +65,21 @@ class DuckTransaction : public Transaction { return true; } + unique_ptr TryGetCheckpointLock(); + private: + DuckTransactionManager &transaction_manager; //! The undo buffer is used to store old versions of rows that are updated //! or deleted UndoBuffer undo_buffer; //! The set of uncommitted appends for the transaction unique_ptr storage; + //! Write lock + unique_ptr write_lock; + //! Lock for accessing sequence_usage + mutex sequence_lock; + //! Map of all sequences that were used during the transaction and the value they had in this transaction + reference_map_t> sequence_usage; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp b/src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp index 63756e97..a0378531 100644 --- a/src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp +++ b/src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp @@ -9,6 +9,8 @@ #pragma once #include "duckdb/transaction/transaction_manager.hpp" +#include "duckdb/storage/storage_lock.hpp" +#include "duckdb/common/enums/checkpoint_type.hpp" namespace duckdb { class DuckTransaction; @@ -16,8 +18,6 @@ class DuckTransaction; //! The Transaction Manager is responsible for creating and managing //! transactions class DuckTransactionManager : public TransactionManager { - friend struct CheckpointLock; - public: explicit DuckTransactionManager(AttachedDatabase &db); ~DuckTransactionManager() override; @@ -34,27 +34,46 @@ class DuckTransactionManager : public TransactionManager { void Checkpoint(ClientContext &context, bool force = false) override; - transaction_t LowestActiveId() { + transaction_t LowestActiveId() const { return lowest_active_id; } - transaction_t LowestActiveStart() { + transaction_t LowestActiveStart() const { return lowest_active_start; } + transaction_t GetLastCommit() const { + return last_commit; + } bool IsDuckTransactionManager() override { return true; } + //! Obtains a shared lock to the checkpoint lock + unique_ptr SharedCheckpointLock(); + unique_ptr TryUpgradeCheckpointLock(StorageLockKey &lock); + protected: struct CheckpointDecision { + explicit CheckpointDecision(string reason_p); + explicit CheckpointDecision(CheckpointType type); + ~CheckpointDecision(); + bool can_checkpoint; string reason; + CheckpointType type; }; private: - CheckpointDecision CanCheckpoint(optional_ptr current = nullptr); + //! Generates a new commit timestamp + transaction_t GetCommitTimestamp(); //! Remove the given transaction from the list of active transactions void RemoveTransaction(DuckTransaction &transaction) noexcept; + //! Remove the given transaction from the list of active transactions + void RemoveTransaction(DuckTransaction &transaction, bool store_transaction) noexcept; + + //! Whether or not we can checkpoint + CheckpointDecision CanCheckpoint(DuckTransaction &transaction, unique_ptr &checkpoint_lock, + const UndoBufferProperties &properties); private: //! The current start timestamp used by transactions @@ -65,6 +84,8 @@ class DuckTransactionManager : public TransactionManager { atomic lowest_active_id; //! The lowest active transaction timestamp atomic lowest_active_start; + //! The last commit timestamp + atomic last_commit; //! Set of currently running transactions vector> active_transactions; //! Set of recently committed transactions @@ -73,8 +94,10 @@ class DuckTransactionManager : public TransactionManager { vector> old_transactions; //! The lock used for transaction operations mutex transaction_lock; - - bool thread_is_checkpointing; + //! The checkpoint lock + StorageLock checkpoint_lock; + //! Lock necessary to start transactions only - used by FORCE CHECKPOINT to prevent new transactions from starting + mutex start_transaction_lock; protected: virtual void OnCommitCheckpointDecision(const CheckpointDecision &decision, DuckTransaction &transaction) { diff --git a/src/duckdb/src/include/duckdb/transaction/local_storage.hpp b/src/duckdb/src/include/duckdb/transaction/local_storage.hpp index 7481abd7..240ec7d3 100644 --- a/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +++ b/src/duckdb/src/include/duckdb/transaction/local_storage.hpp @@ -12,19 +12,21 @@ #include "duckdb/storage/table/table_index_list.hpp" #include "duckdb/storage/table/table_statistics.hpp" #include "duckdb/storage/optimistic_data_writer.hpp" +#include "duckdb/common/reference_map.hpp" namespace duckdb { class AttachedDatabase; +class Catalog; class DataTable; class Transaction; class WriteAheadLog; struct LocalAppendState; struct TableAppendState; -class LocalTableStorage : public std::enable_shared_from_this { +class LocalTableStorage : public enable_shared_from_this { public: // Create a new LocalTableStorage - explicit LocalTableStorage(DataTable &table); + explicit LocalTableStorage(ClientContext &context, DataTable &table); // Create a LocalTableStorage from an ALTER TYPE LocalTableStorage(ClientContext &context, DataTable &table, LocalTableStorage &parent, idx_t changed_idx, const LogicalType &target_type, const vector &bound_columns, Expression &cast_expr); @@ -32,7 +34,7 @@ class LocalTableStorage : public std::enable_shared_from_this LocalTableStorage(DataTable &table, LocalTableStorage &parent, idx_t drop_idx); // Create a LocalTableStorage from an ADD COLUMN LocalTableStorage(ClientContext &context, DataTable &table, LocalTableStorage &parent, ColumnDefinition &new_column, - Expression &default_value); + ExpressionExecutor &default_executor); ~LocalTableStorage(); reference table_ref; @@ -74,7 +76,7 @@ class LocalTableManager { shared_ptr MoveEntry(DataTable &table); reference_map_t> MoveEntries(); optional_ptr GetStorage(DataTable &table); - LocalTableStorage &GetOrCreateStorage(DataTable &table); + LocalTableStorage &GetOrCreateStorage(ClientContext &context, DataTable &table); idx_t EstimatedSize(); bool IsEmpty(); void InsertEntry(DataTable &table, shared_ptr entry); @@ -143,7 +145,8 @@ class LocalStorage { idx_t AddedRows(DataTable &table); - void AddColumn(DataTable &old_dt, DataTable &new_dt, ColumnDefinition &new_column, Expression &default_value); + void AddColumn(DataTable &old_dt, DataTable &new_dt, ColumnDefinition &new_column, + ExpressionExecutor &default_executor); void DropColumn(DataTable &old_dt, DataTable &new_dt, idx_t removed_column); void ChangeType(DataTable &old_dt, DataTable &new_dt, idx_t changed_idx, const LogicalType &target_type, const vector &bound_columns, Expression &cast_expr); diff --git a/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp b/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp index dabbcf6d..985e71ce 100644 --- a/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +++ b/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp @@ -46,6 +46,7 @@ class MetaTransaction { } Transaction &GetTransaction(AttachedDatabase &db); + optional_ptr TryGetTransaction(AttachedDatabase &db); void RemoveTransaction(AttachedDatabase &db); ErrorData Commit(); diff --git a/src/duckdb/src/include/duckdb/transaction/transaction.hpp b/src/duckdb/src/include/duckdb/transaction/transaction.hpp index 723c9946..a2122a68 100644 --- a/src/duckdb/src/include/duckdb/transaction/transaction.hpp +++ b/src/duckdb/src/include/duckdb/transaction/transaction.hpp @@ -13,6 +13,7 @@ #include "duckdb/transaction/undo_buffer.hpp" #include "duckdb/common/atomic.hpp" #include "duckdb/transaction/transaction_data.hpp" +#include "duckdb/common/shared_ptr.hpp" namespace duckdb { class SequenceCatalogEntry; @@ -50,9 +51,13 @@ class Transaction { public: DUCKDB_API static Transaction &Get(ClientContext &context, AttachedDatabase &db); DUCKDB_API static Transaction &Get(ClientContext &context, Catalog &catalog); + //! Returns the transaction for the given context if it has already been started + DUCKDB_API static optional_ptr TryGet(ClientContext &context, AttachedDatabase &db); //! Whether or not the transaction has made any modifications to the database so far DUCKDB_API bool IsReadOnly(); + //! Promotes the transaction to a read-write transaction + DUCKDB_API virtual void SetReadWrite(); virtual bool IsDuckTransaction() const { return false; @@ -69,6 +74,9 @@ class Transaction { DynamicCastCheck(this); return reinterpret_cast(*this); } + +private: + bool is_read_only; }; } // namespace duckdb diff --git a/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp b/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp index 9a212853..c4cc6a8e 100644 --- a/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +++ b/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp @@ -16,6 +16,14 @@ namespace duckdb { class WriteAheadLog; +struct UndoBufferProperties { + idx_t estimated_size = 0; + bool has_updates = false; + bool has_deletes = false; + bool has_catalog_changes = false; + bool has_dropped_entries = false; +}; + //! The undo buffer of a transaction is used to hold previous versions of tuples //! that might be required in the future (because of rollbacks or previous //! transactions accessing them) @@ -35,7 +43,7 @@ class UndoBuffer { data_ptr_t CreateEntry(UndoFlags type, idx_t len); bool ChangesMade(); - idx_t EstimatedSize(); + UndoBufferProperties GetProperties(); //! Cleanup the undo buffer void Cleanup(); diff --git a/src/duckdb/src/main/appender.cpp b/src/duckdb/src/main/appender.cpp index 28a62275..1a8fae39 100644 --- a/src/duckdb/src/main/appender.cpp +++ b/src/duckdb/src/main/appender.cpp @@ -376,7 +376,9 @@ void Appender::FlushInternal(ColumnDataCollection &collection) { } void InternalAppender::FlushInternal(ColumnDataCollection &collection) { - table.GetStorage().LocalAppend(table, context, collection); + auto binder = Binder::CreateBinder(context); + auto bound_constraints = binder->BindConstraints(table); + table.GetStorage().LocalAppend(table, context, collection, bound_constraints); } void BaseAppender::Close() { diff --git a/src/duckdb/src/main/attached_database.cpp b/src/duckdb/src/main/attached_database.cpp index ce9ce5f4..b854760d 100644 --- a/src/duckdb/src/main/attached_database.cpp +++ b/src/duckdb/src/main/attached_database.cpp @@ -96,14 +96,14 @@ string AttachedDatabase::ExtractDatabaseName(const string &dbpath, FileSystem &f return name; } -void AttachedDatabase::Initialize(optional_ptr context) { +void AttachedDatabase::Initialize() { if (IsSystem()) { catalog->Initialize(true); } else { catalog->Initialize(false); } if (storage) { - storage->Initialize(context); + storage->Initialize(); } } @@ -168,7 +168,9 @@ void AttachedDatabase::Close() { if (!config.options.checkpoint_on_shutdown) { return; } - storage->CreateCheckpoint(true); + CheckpointOptions options; + options.wal_action = CheckpointWALAction::DELETE_WAL; + storage->CreateCheckpoint(options); } } catch (...) { // NOLINT } diff --git a/src/duckdb/src/main/capi/appender-c.cpp b/src/duckdb/src/main/capi/appender-c.cpp index 2b0789bc..a5837636 100644 --- a/src/duckdb/src/main/capi/appender-c.cpp +++ b/src/duckdb/src/main/capi/appender-c.cpp @@ -42,13 +42,13 @@ duckdb_state duckdb_appender_destroy(duckdb_appender *appender) { if (!appender || !*appender) { return DuckDBError; } - duckdb_appender_close(*appender); + auto state = duckdb_appender_close(*appender); auto wrapper = reinterpret_cast(*appender); if (wrapper) { delete wrapper; } *appender = nullptr; - return DuckDBSuccess; + return state; } template @@ -67,7 +67,7 @@ duckdb_state duckdb_appender_run_function(duckdb_appender appender, FUN &&functi wrapper->error = error.RawMessage(); return DuckDBError; } catch (...) { // LCOV_EXCL_START - wrapper->error = "Unknown error"; + wrapper->error = "Unknown appender error."; return DuckDBError; } // LCOV_EXCL_STOP return DuckDBSuccess; @@ -199,6 +199,7 @@ duckdb_state duckdb_append_varchar(duckdb_appender appender, const char *val) { duckdb_state duckdb_append_varchar_length(duckdb_appender appender, const char *val, idx_t length) { return duckdb_append_internal(appender, string_t(val, duckdb::UnsafeNumericCast(length))); } + duckdb_state duckdb_append_blob(duckdb_appender appender, const void *data, idx_t length) { auto value = duckdb::Value::BLOB((duckdb::const_data_ptr_t)data, length); return duckdb_append_internal(appender, value); diff --git a/src/duckdb/src/main/capi/arrow-c.cpp b/src/duckdb/src/main/capi/arrow-c.cpp index 335b9369..f74d9e22 100644 --- a/src/duckdb/src/main/capi/arrow-c.cpp +++ b/src/duckdb/src/main/capi/arrow-c.cpp @@ -127,7 +127,7 @@ idx_t duckdb_arrow_rows_changed(duckdb_arrow result) { auto rows = collection.GetRows(); D_ASSERT(row_count == 1); D_ASSERT(rows.size() == 1); - rows_changed = rows[0].GetValue(0).GetValue(); + rows_changed = duckdb::NumericCast(rows[0].GetValue(0).GetValue()); } return rows_changed; } @@ -291,8 +291,8 @@ duckdb_state duckdb_arrow_scan(duckdb_connection connection, const char *table_n } typedef void (*release_fn_t)(ArrowSchema *); - std::vector release_fns(schema.n_children); - for (int64_t i = 0; i < schema.n_children; i++) { + std::vector release_fns(duckdb::NumericCast(schema.n_children)); + for (idx_t i = 0; i < duckdb::NumericCast(schema.n_children); i++) { auto child = schema.children[i]; release_fns[i] = child->release; child->release = arrow_array_stream_wrapper::EmptySchemaRelease; @@ -301,7 +301,7 @@ duckdb_state duckdb_arrow_scan(duckdb_connection connection, const char *table_n auto ret = arrow_array_stream_wrapper::Ingest(connection, table_name, stream); // Restore release functions. - for (int64_t i = 0; i < schema.n_children; i++) { + for (idx_t i = 0; i < duckdb::NumericCast(schema.n_children); i++) { schema.children[i]->release = release_fns[i]; } diff --git a/src/duckdb/src/main/capi/helper-c.cpp b/src/duckdb/src/main/capi/helper-c.cpp index 39cacbf2..6ee26e90 100644 --- a/src/duckdb/src/main/capi/helper-c.cpp +++ b/src/duckdb/src/main/capi/helper-c.cpp @@ -180,9 +180,9 @@ idx_t GetCTypeSize(duckdb_type type) { case DUCKDB_TYPE_DECIMAL: return sizeof(duckdb_hugeint); default: // LCOV_EXCL_START - // unsupported type - D_ASSERT(0); - return sizeof(const char *); + // Unsupported nested or complex type. Internally, we set the null mask to NULL. + // This is a deprecated code path. Use the Vector Interface for nested and complex types. + return 0; } // LCOV_EXCL_STOP } diff --git a/src/duckdb/src/main/capi/replacement_scan-c.cpp b/src/duckdb/src/main/capi/replacement_scan-c.cpp index 2941b25a..ff3eae4f 100644 --- a/src/duckdb/src/main/capi/replacement_scan-c.cpp +++ b/src/duckdb/src/main/capi/replacement_scan-c.cpp @@ -19,18 +19,19 @@ struct CAPIReplacementScanData : public ReplacementScanData { }; struct CAPIReplacementScanInfo { - CAPIReplacementScanInfo(CAPIReplacementScanData *data) : data(data) { + CAPIReplacementScanInfo(optional_ptr data) : data(data) { } - CAPIReplacementScanData *data; + optional_ptr data; string function_name; vector parameters; string error; }; -unique_ptr duckdb_capi_replacement_callback(ClientContext &context, const string &table_name, - ReplacementScanData *data) { - auto &scan_data = reinterpret_cast(*data); +unique_ptr duckdb_capi_replacement_callback(ClientContext &context, ReplacementScanInput &input, + optional_ptr data) { + auto &table_name = input.table_name; + auto &scan_data = data->Cast(); CAPIReplacementScanInfo info(&scan_data); scan_data.callback((duckdb_replacement_scan_info)&info, table_name.c_str(), scan_data.extra_data); diff --git a/src/duckdb/src/main/capi/result-c.cpp b/src/duckdb/src/main/capi/result-c.cpp index 81c03cc5..d3ffcadf 100644 --- a/src/duckdb/src/main/capi/result-c.cpp +++ b/src/duckdb/src/main/capi/result-c.cpp @@ -117,7 +117,7 @@ struct CDecimalConverter : public CBaseConverter { template static DST Convert(SRC input) { duckdb_hugeint result; - result.lower = input; + result.lower = static_cast(input); result.upper = 0; return result; } @@ -146,7 +146,18 @@ duckdb_state deprecated_duckdb_translate_column(MaterializedQueryResult &result, auto &collection = result.Collection(); idx_t row_count = collection.Count(); column->__deprecated_nullmask = (bool *)duckdb_malloc(sizeof(bool) * collection.Count()); - column->__deprecated_data = duckdb_malloc(GetCTypeSize(column->__deprecated_type) * row_count); + + auto type_size = GetCTypeSize(column->__deprecated_type); + if (type_size == 0) { + for (idx_t row_id = 0; row_id < row_count; row_id++) { + column->__deprecated_nullmask[row_id] = false; + } + // Unsupported type, e.g., a LIST. By returning DuckDBSuccess here, + // we allow filling other columns, and return NULL for all unsupported types. + return DuckDBSuccess; + } + + column->__deprecated_data = duckdb_malloc(type_size * row_count); if (!column->__deprecated_nullmask || !column->__deprecated_data) { // LCOV_EXCL_START // malloc failure return DuckDBError; @@ -295,7 +306,7 @@ duckdb_state DuckDBTranslateResult(unique_ptr result_p, duckdb_resu return DuckDBError; } // copy the data - // first write the meta data + // first write the metadata out->__deprecated_column_count = result.ColumnCount(); out->__deprecated_rows_changed = 0; return DuckDBSuccess; @@ -329,6 +340,7 @@ bool DeprecatedMaterializeResult(duckdb_result *result) { // malloc failure return DuckDBError; } // LCOV_EXCL_STOP + if (result_data->result->type == QueryResultType::STREAM_RESULT) { // if we are dealing with a stream result, convert it to a materialized result first auto &stream_result = (StreamQueryResult &)*result_data->result; @@ -344,16 +356,18 @@ bool DeprecatedMaterializeResult(duckdb_result *result) { result->__deprecated_columns[i].__deprecated_type = ConvertCPPTypeToC(result_data->result->types[i]); result->__deprecated_columns[i].__deprecated_name = (char *)result_data->result->names[i].c_str(); // NOLINT } + result->__deprecated_row_count = materialized.RowCount(); if (result->__deprecated_row_count > 0 && materialized.properties.return_type == StatementReturnType::CHANGED_ROWS) { // update total changes auto row_changes = materialized.GetValue(0, 0); if (!row_changes.IsNull() && row_changes.DefaultTryCastAs(LogicalType::BIGINT)) { - result->__deprecated_rows_changed = row_changes.GetValue(); + result->__deprecated_rows_changed = NumericCast(row_changes.GetValue()); } } - // now write the data + + // Now write the data and skip any unsupported columns. for (idx_t col = 0; col < column_count; col++) { auto state = deprecated_duckdb_translate_column(materialized, &result->__deprecated_columns[col], col); if (state != DuckDBSuccess) { diff --git a/src/duckdb/src/main/capi/table_function-c.cpp b/src/duckdb/src/main/capi/table_function-c.cpp index e6eb5e35..a6916e8e 100644 --- a/src/duckdb/src/main/capi/table_function-c.cpp +++ b/src/duckdb/src/main/capi/table_function-c.cpp @@ -179,7 +179,7 @@ void CTableFunction(ClientContext &context, TableFunctionInput &data_p, DataChun duckdb_table_function duckdb_create_table_function() { auto function = new duckdb::TableFunction("", {}, duckdb::CTableFunction, duckdb::CTableFunctionBind, duckdb::CTableFunctionInit, duckdb::CTableFunctionLocalInit); - function->function_info = duckdb::make_shared(); + function->function_info = duckdb::make_shared_ptr(); function->cardinality = duckdb::CTableFunctionCardinality; return function; } diff --git a/src/duckdb/src/main/client_context.cpp b/src/duckdb/src/main/client_context.cpp index c3aa1917..bec2a34c 100644 --- a/src/duckdb/src/main/client_context.cpp +++ b/src/duckdb/src/main/client_context.cpp @@ -127,7 +127,7 @@ struct DebugClientContextState : public ClientContextState { } return RebindQueryInfo::DO_NOT_REBIND; } - RebindQueryInfo OnExecutePrepared(ClientContext &context, PreparedStatementData &prepared_statement, + RebindQueryInfo OnExecutePrepared(ClientContext &context, PreparedStatementCallbackInfo &info, RebindQueryInfo current_rebind) override { return RebindQueryInfo::ATTEMPT_TO_REBIND; } @@ -312,7 +312,7 @@ ClientContext::CreatePreparedStatementInternal(ClientContextLock &lock, const st unique_ptr statement, optional_ptr> values) { StatementType statement_type = statement->type; - auto result = make_shared(statement_type); + auto result = make_shared_ptr(statement_type); auto &profiler = QueryProfiler::Get(*this); profiler.StartQuery(query, IsExplainAnalyze(statement.get()), true); @@ -482,7 +482,8 @@ ClientContext::PendingPreparedStatementInternal(ClientContextLock &lock, shared_ display_create_func = config.display_create_func ? config.display_create_func : ProgressBar::DefaultProgressBarDisplay; } - active_query->progress_bar = make_uniq(executor, config.wait_time, display_create_func); + active_query->progress_bar = + make_uniq(executor, NumericCast(config.wait_time), display_create_func); active_query->progress_bar->Start(); query_progress.Restart(); } @@ -519,7 +520,8 @@ unique_ptr ClientContext::PendingPreparedStatement(ClientCon rebind = RebindQueryInfo::ATTEMPT_TO_REBIND; } for (auto const &s : registered_state) { - auto new_rebind = s.second->OnExecutePrepared(*this, *prepared, rebind); + PreparedStatementCallbackInfo info(*prepared, parameters); + auto new_rebind = s.second->OnExecutePrepared(*this, info, rebind); if (new_rebind == RebindQueryInfo::ATTEMPT_TO_REBIND) { rebind = RebindQueryInfo::ATTEMPT_TO_REBIND; } @@ -762,6 +764,11 @@ void ClientContext::SetActiveResult(ClientContextLock &lock, BaseQueryResult &re unique_ptr ClientContext::PendingStatementOrPreparedStatementInternal( ClientContextLock &lock, const string &query, unique_ptr statement, shared_ptr &prepared, const PendingQueryParameters ¶meters) { +#ifdef DUCKDB_ALTERNATIVE_VERIFY + if (statement && statement->type != StatementType::LOGICAL_PLAN_STATEMENT) { + statement = statement->Copy(); + } +#endif // check if we are on AutoCommit. In this case we should start a transaction. if (statement && config.AnyVerification()) { // query verification is enabled @@ -784,29 +791,28 @@ unique_ptr ClientContext::PendingStatementOrPreparedStatemen statement = std::move(copied_statement); break; } + default: { #ifndef DUCKDB_ALTERNATIVE_VERIFY - case StatementType::COPY_STATEMENT: - case StatementType::INSERT_STATEMENT: - case StatementType::DELETE_STATEMENT: - case StatementType::UPDATE_STATEMENT: { - Parser parser; - ErrorData error; - try { - parser.ParseQuery(statement->ToString()); - } catch (std::exception &ex) { - error = ErrorData(ex); + bool reparse_statement = true; +#else + bool reparse_statement = false; +#endif + statement = std::move(copied_statement); + if (statement->type == StatementType::RELATION_STATEMENT) { + reparse_statement = false; } - if (error.HasError()) { - // error in verifying query - return ErrorResult(std::move(error), query); + if (reparse_statement) { + try { + Parser parser(GetParserOptions()); + ErrorData error; + parser.ParseQuery(statement->ToString()); + statement = std::move(parser.statements[0]); + } catch (const NotImplementedException &) { + // ToString was not implemented, just use the copied statement + } } - statement = std::move(parser.statements[0]); break; } -#endif - default: - statement = std::move(copied_statement); - break; } } return PendingStatementOrPreparedStatement(lock, query, std::move(statement), prepared, parameters); @@ -1120,7 +1126,10 @@ void ClientContext::Append(TableDescription &description, ColumnDataCollection & throw InvalidInputException("Failed to append: table entry has different number of columns!"); } } - table_entry.GetStorage().LocalAppend(table_entry, *this, collection); + auto binder = Binder::CreateBinder(*this); + auto bound_constraints = binder->BindConstraints(table_entry); + MetaTransaction::Get(*this).ModifyDatabase(table_entry.ParentCatalog().GetAttached()); + table_entry.GetStorage().LocalAppend(table_entry, *this, collection, bound_constraints); }); } diff --git a/src/duckdb/src/main/client_context_file_opener.cpp b/src/duckdb/src/main/client_context_file_opener.cpp index 17ddef4f..5c7387b8 100644 --- a/src/duckdb/src/main/client_context_file_opener.cpp +++ b/src/duckdb/src/main/client_context_file_opener.cpp @@ -1,5 +1,7 @@ #include "duckdb/main/client_context_file_opener.hpp" +#include "duckdb/catalog/catalog_transaction.hpp" +#include "duckdb/main/database.hpp" #include "duckdb/common/file_opener.hpp" #include "duckdb/main/client_context.hpp" @@ -18,6 +20,22 @@ optional_ptr ClientContextFileOpener::TryGetDatabase() { return context.db.get(); } +unique_ptr FileOpener::TryGetCatalogTransaction(optional_ptr opener) { + if (!opener) { + return nullptr; + } + auto context = opener->TryGetClientContext(); + if (context) { + return make_uniq(CatalogTransaction::GetSystemCatalogTransaction(*context)); + } + + auto db = opener->TryGetDatabase(); + if (db) { + return make_uniq(CatalogTransaction::GetSystemTransaction(*db)); + } + return nullptr; +} + optional_ptr FileOpener::TryGetClientContext(optional_ptr opener) { if (!opener) { return nullptr; @@ -32,6 +50,19 @@ optional_ptr FileOpener::TryGetDatabase(optional_ptrTryGetDatabase(); } +optional_ptr FileOpener::TryGetSecretManager(optional_ptr opener) { + if (!opener) { + return nullptr; + } + + auto db = opener->TryGetDatabase(); + if (!db) { + return nullptr; + } + + return &db->GetSecretManager(); +} + SettingLookupResult FileOpener::TryGetCurrentSetting(optional_ptr opener, const string &key, Value &result) { if (!opener) { diff --git a/src/duckdb/src/main/client_context_wrapper.cpp b/src/duckdb/src/main/client_context_wrapper.cpp new file mode 100644 index 00000000..d79b0930 --- /dev/null +++ b/src/duckdb/src/main/client_context_wrapper.cpp @@ -0,0 +1,22 @@ +#include "duckdb/main/client_context_wrapper.hpp" +#include "duckdb/main/client_context.hpp" + +namespace duckdb { + +ClientContextWrapper::ClientContextWrapper(const shared_ptr &context) : client_context(context) { +} + +shared_ptr ClientContextWrapper::TryGetContext() { + auto actual_context = client_context.lock(); + return actual_context; +} + +shared_ptr ClientContextWrapper::GetContext() { + auto actual_context = TryGetContext(); + if (!actual_context) { + throw ConnectionException("Connection has already been closed"); + } + return actual_context; +} + +} // namespace duckdb diff --git a/src/duckdb/src/main/client_data.cpp b/src/duckdb/src/main/client_data.cpp index 07d164b6..e9c3c98b 100644 --- a/src/duckdb/src/main/client_data.cpp +++ b/src/duckdb/src/main/client_data.cpp @@ -3,15 +3,16 @@ #include "duckdb/catalog/catalog.hpp" #include "duckdb/catalog/catalog_search_path.hpp" #include "duckdb/common/http_state.hpp" +#include "duckdb/common/opener_file_system.hpp" #include "duckdb/common/random_engine.hpp" #include "duckdb/common/serializer/buffered_file_writer.hpp" +#include "duckdb/logging/http_logger.hpp" #include "duckdb/main/attached_database.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/main/client_context_file_opener.hpp" #include "duckdb/main/database.hpp" #include "duckdb/main/database_manager.hpp" #include "duckdb/main/query_profiler.hpp" -#include "duckdb/common/opener_file_system.hpp" namespace duckdb { @@ -35,8 +36,9 @@ class ClientFileSystem : public OpenerFileSystem { ClientData::ClientData(ClientContext &context) : catalog_search_path(make_uniq(context)) { auto &db = DatabaseInstance::GetDatabase(context); - profiler = make_shared(context); - temporary_objects = make_shared(db, AttachedDatabaseType::TEMP_DATABASE); + profiler = make_shared_ptr(context); + http_logger = make_shared_ptr(context); + temporary_objects = make_shared_ptr(db, AttachedDatabaseType::TEMP_DATABASE); temporary_objects->oid = DatabaseManager::Get(db).ModifyCatalog(); random_engine = make_uniq(); file_opener = make_uniq(context); diff --git a/src/duckdb/src/main/config.cpp b/src/duckdb/src/main/config.cpp index c1e86b96..86bfacb4 100644 --- a/src/duckdb/src/main/config.cpp +++ b/src/duckdb/src/main/config.cpp @@ -1,5 +1,6 @@ #include "duckdb/main/config.hpp" +#include "duckdb/common/operator/multiply.hpp" #include "duckdb/common/operator/cast_operators.hpp" #include "duckdb/common/string_util.hpp" #include "duckdb/main/settings.hpp" @@ -9,8 +10,8 @@ #include "duckdb/common/thread.hpp" #endif -#include #include +#include namespace duckdb { @@ -58,6 +59,7 @@ static const ConfigurationOption internal_options[] = { DUCKDB_GLOBAL(AllowPersistentSecrets), DUCKDB_GLOBAL(CheckpointThresholdSetting), DUCKDB_GLOBAL(DebugCheckpointAbort), + DUCKDB_GLOBAL(StorageCompatibilityVersion), DUCKDB_LOCAL(DebugForceExternal), DUCKDB_LOCAL(DebugForceNoCrossProduct), DUCKDB_LOCAL(DebugAsOfIEJoin), @@ -71,6 +73,7 @@ static const ConfigurationOption internal_options[] = { DUCKDB_GLOBAL(EnableExternalAccessSetting), DUCKDB_GLOBAL(EnableFSSTVectors), DUCKDB_GLOBAL(AllowUnsignedExtensionsSetting), + DUCKDB_GLOBAL(AllowCommunityExtensionsSetting), DUCKDB_GLOBAL(AllowExtensionsMetadataMismatchSetting), DUCKDB_GLOBAL(AllowUnredactedSecretsSetting), DUCKDB_GLOBAL(CustomExtensionRepository), @@ -96,6 +99,7 @@ static const ConfigurationOption internal_options[] = { DUCKDB_LOCAL(IntegerDivisionSetting), DUCKDB_LOCAL(MaximumExpressionDepthSetting), DUCKDB_GLOBAL(MaximumMemorySetting), + DUCKDB_GLOBAL(MaximumTempDirectorySize), DUCKDB_GLOBAL(OldImplicitCasting), DUCKDB_GLOBAL_ALIAS("memory_limit", MaximumMemorySetting), DUCKDB_GLOBAL_ALIAS("null_order", DefaultNullOrderSetting), @@ -125,6 +129,8 @@ static const ConfigurationOption internal_options[] = { DUCKDB_GLOBAL(DuckDBApiSetting), DUCKDB_GLOBAL(CustomUserAgentSetting), DUCKDB_LOCAL(PartitionedWriteFlushThreshold), + DUCKDB_LOCAL(EnableHTTPLoggingSetting), + DUCKDB_LOCAL(HTTPLoggingOutputSetting), FINAL_SETTING}; vector DBConfig::GetOptions() { @@ -247,6 +253,21 @@ void DBConfig::AddExtensionOption(const string &name, string description, Logica } } +bool DBConfig::IsInMemoryDatabase(const char *database_path) { + if (!database_path) { + // Entirely empty + return true; + } + if (strlen(database_path) == 0) { + // '' empty string + return true; + } + if (strcmp(database_path, ":memory:") == 0) { + return true; + } + return false; +} + CastFunctionSet &DBConfig::GetCastFunctions() { return *cast_functions; } @@ -262,6 +283,14 @@ void DBConfig::SetDefaultMaxMemory() { } } +void DBConfig::SetDefaultTempDirectory() { + if (DBConfig::IsInMemoryDatabase(options.database_path.c_str())) { + options.temporary_directory = ".tmp"; + } else { + options.temporary_directory = options.database_path + ".tmp"; + } +} + void DBConfig::CheckLock(const string &name) { if (!options.lock_configuration) { // not locked @@ -398,7 +427,7 @@ idx_t DBConfig::ParseMemoryLimit(const string &arg) { throw ParserException("Unknown unit for memory_limit: %s (expected: KB, MB, GB, TB for 1000^i units or KiB, " "MiB, GiB, TiB for 1024^i unites)"); } - return (idx_t)multiplier * limit; + return NumericCast(multiplier * limit); } // Right now we only really care about access mode when comparing DBConfigs @@ -452,4 +481,44 @@ const std::string DBConfig::UserAgent() const { return user_agent; } +SerializationCompatibility SerializationCompatibility::FromString(const string &input) { + if (input.empty()) { + throw InvalidInputException("Version string can not be empty"); + } + + auto serialization_version = GetSerializationVersion(input.c_str()); + if (!serialization_version.IsValid()) { + auto candidates = GetSerializationCandidates(); + throw InvalidInputException("The version string '%s' is not a valid DuckDB version, valid options are: %s", + input, StringUtil::Join(candidates, ", ")); + } + SerializationCompatibility result; + result.duckdb_version = input; + result.serialization_version = serialization_version.GetIndex(); + result.manually_set = true; + return result; +} + +SerializationCompatibility SerializationCompatibility::Default() { +#ifdef DUCKDB_ALTERNATIVE_VERIFY + auto res = FromString("latest"); + res.manually_set = false; + return res; +#else + auto res = FromString("v0.10.2"); + res.manually_set = false; + return res; +#endif +} + +SerializationCompatibility SerializationCompatibility::Latest() { + auto res = FromString("latest"); + res.manually_set = false; + return res; +} + +bool SerializationCompatibility::Compare(idx_t property_version) const { + return property_version <= serialization_version; +} + } // namespace duckdb diff --git a/src/duckdb/src/main/connection.cpp b/src/duckdb/src/main/connection.cpp index 432ca9c2..11346a3a 100644 --- a/src/duckdb/src/main/connection.cpp +++ b/src/duckdb/src/main/connection.cpp @@ -18,7 +18,8 @@ namespace duckdb { -Connection::Connection(DatabaseInstance &database) : context(make_shared(database.shared_from_this())) { +Connection::Connection(DatabaseInstance &database) + : context(make_shared_ptr(database.shared_from_this())) { ConnectionManager::Get(database).AddConnection(*context); #ifdef DEBUG EnableProfiling(); @@ -186,7 +187,7 @@ shared_ptr Connection::Table(const string &schema_name, const string & if (!table_info) { throw CatalogException("Table '%s' does not exist!", table_name); } - return make_shared(context, std::move(table_info)); + return make_shared_ptr(context, std::move(table_info)); } shared_ptr Connection::View(const string &tname) { @@ -194,7 +195,7 @@ shared_ptr Connection::View(const string &tname) { } shared_ptr Connection::View(const string &schema_name, const string &table_name) { - return make_shared(context, schema_name, table_name); + return make_shared_ptr(context, schema_name, table_name); } shared_ptr Connection::TableFunction(const string &fname) { @@ -205,11 +206,11 @@ shared_ptr Connection::TableFunction(const string &fname) { shared_ptr Connection::TableFunction(const string &fname, const vector &values, const named_parameter_map_t &named_parameters) { - return make_shared(context, fname, values, named_parameters); + return make_shared_ptr(context, fname, values, named_parameters); } shared_ptr Connection::TableFunction(const string &fname, const vector &values) { - return make_shared(context, fname, values); + return make_shared_ptr(context, fname, values); } shared_ptr Connection::Values(const vector> &values) { @@ -219,7 +220,7 @@ shared_ptr Connection::Values(const vector> &values) { shared_ptr Connection::Values(const vector> &values, const vector &column_names, const string &alias) { - return make_shared(context, values, column_names, alias); + return make_shared_ptr(context, values, column_names, alias); } shared_ptr Connection::Values(const string &values) { @@ -228,7 +229,7 @@ shared_ptr Connection::Values(const string &values) { } shared_ptr Connection::Values(const string &values, const vector &column_names, const string &alias) { - return make_shared(context, values, column_names, alias); + return make_shared_ptr(context, values, column_names, alias); } shared_ptr Connection::ReadCSV(const string &csv_file) { @@ -237,7 +238,7 @@ shared_ptr Connection::ReadCSV(const string &csv_file) { } shared_ptr Connection::ReadCSV(const vector &csv_input, named_parameter_map_t &&options) { - return make_shared(context, csv_input, std::move(options)); + return make_shared_ptr(context, csv_input, std::move(options)); } shared_ptr Connection::ReadCSV(const string &csv_input, named_parameter_map_t &&options) { @@ -258,7 +259,7 @@ shared_ptr Connection::ReadCSV(const string &csv_file, const vector files {csv_file}; - return make_shared(context, files, std::move(options)); + return make_shared_ptr(context, files, std::move(options)); } shared_ptr Connection::ReadParquet(const string &parquet_file, bool binary_as_string) { @@ -277,7 +278,7 @@ shared_ptr Connection::RelationFromQuery(const string &query, const st } shared_ptr Connection::RelationFromQuery(unique_ptr select_stmt, const string &alias) { - return make_shared(context, std::move(select_stmt), alias); + return make_shared_ptr(context, std::move(select_stmt), alias); } void Connection::BeginTransaction() { diff --git a/src/duckdb/src/main/connection_manager.cpp b/src/duckdb/src/main/connection_manager.cpp index ef6b8017..c0b53c6f 100644 --- a/src/duckdb/src/main/connection_manager.cpp +++ b/src/duckdb/src/main/connection_manager.cpp @@ -5,7 +5,7 @@ namespace duckdb { -ConnectionManager::ConnectionManager() : is_locking(false) { +ConnectionManager::ConnectionManager() { } void ConnectionManager::AddConnection(ClientContext &context) { @@ -13,7 +13,7 @@ void ConnectionManager::AddConnection(ClientContext &context) { for (auto &callback : DBConfig::GetConfig(context).extension_callbacks) { callback->OnConnectionOpened(context); } - connections.insert(make_pair(&context, weak_ptr(context.shared_from_this()))); + connections[context] = weak_ptr(context.shared_from_this()); } void ConnectionManager::RemoveConnection(ClientContext &context) { @@ -21,10 +21,16 @@ void ConnectionManager::RemoveConnection(ClientContext &context) { for (auto &callback : DBConfig::GetConfig(context).extension_callbacks) { callback->OnConnectionClosed(context); } - connections.erase(&context); + connections.erase(context); +} + +idx_t ConnectionManager::GetConnectionCount() const { + lock_guard lock(connections_lock); + return connections.size(); } vector> ConnectionManager::GetConnectionList() { + lock_guard lock(connections_lock); vector> result; for (auto &it : connections) { auto connection = it.second.lock(); @@ -39,24 +45,4 @@ vector> ConnectionManager::GetConnectionList() { return result; } -void ConnectionManager::LockClients(vector &client_locks, ClientContext &context) { - { - lock_guard l(lock_clients_lock); - if (is_locking) { - throw TransactionException("Failed to lock clients - another thread is running FORCE CHECKPOINT"); - } - is_locking = true; - } - client_locks.emplace_back(connections_lock, nullptr); - auto connection_list = GetConnectionList(); - for (auto &con : connection_list) { - if (con.get() == &context) { - continue; - } - auto &context_lock = con->context_lock; - client_locks.emplace_back(context_lock, std::move(con)); - } - is_locking = false; -} - } // namespace duckdb diff --git a/src/duckdb/src/main/database.cpp b/src/duckdb/src/main/database.cpp index b3fe6954..b0dc7266 100644 --- a/src/duckdb/src/main/database.cpp +++ b/src/duckdb/src/main/database.cpp @@ -203,27 +203,7 @@ void DatabaseInstance::Initialize(const char *database_path, DBConfig *user_conf config_ptr = user_config; } - if (config_ptr->options.duckdb_api.empty()) { - config_ptr->SetOptionByName("duckdb_api", "cpp"); - } - - if (config_ptr->options.temporary_directory.empty() && database_path) { - // no directory specified: use default temp path - config_ptr->options.temporary_directory = string(database_path) + ".tmp"; - - // special treatment for in-memory mode - if (strcmp(database_path, IN_MEMORY_PATH) == 0) { - config_ptr->options.temporary_directory = ".tmp"; - } - } - - if (database_path) { - config_ptr->options.database_path = database_path; - } else { - config_ptr->options.database_path.clear(); - } - - Configure(*config_ptr); + Configure(*config_ptr, database_path); if (user_config && !user_config->options.use_temporary_directory) { // temporary directories explicitly disabled @@ -272,7 +252,7 @@ void DatabaseInstance::Initialize(const char *database_path, DBConfig *user_conf scheduler->RelaunchThreads(); } -DuckDB::DuckDB(const char *path, DBConfig *new_config) : instance(make_shared()) { +DuckDB::DuckDB(const char *path, DBConfig *new_config) : instance(make_shared_ptr()) { instance->Initialize(path, new_config); if (instance->config.options.load_extensions) { ExtensionHelper::LoadAllExtensions(*this); @@ -344,8 +324,23 @@ Allocator &Allocator::Get(AttachedDatabase &db) { return Allocator::Get(db.GetDatabase()); } -void DatabaseInstance::Configure(DBConfig &new_config) { +void DatabaseInstance::Configure(DBConfig &new_config, const char *database_path) { config.options = new_config.options; + + if (new_config.options.duckdb_api.empty()) { + config.SetOptionByName("duckdb_api", "cpp"); + } + + if (database_path) { + config.options.database_path = database_path; + } else { + config.options.database_path.clear(); + } + + if (new_config.options.temporary_directory.empty()) { + config.SetDefaultTempDirectory(); + } + if (config.options.access_mode == AccessMode::UNDEFINED) { config.options.access_mode = AccessMode::READ_WRITE; } @@ -358,10 +353,10 @@ void DatabaseInstance::Configure(DBConfig &new_config) { if (new_config.secret_manager) { config.secret_manager = std::move(new_config.secret_manager); } - if (config.options.maximum_memory == (idx_t)-1) { + if (config.options.maximum_memory == DConstants::INVALID_INDEX) { config.SetDefaultMaxMemory(); } - if (new_config.options.maximum_threads == (idx_t)-1) { + if (new_config.options.maximum_threads == DConstants::INVALID_INDEX) { config.options.maximum_threads = config.GetSystemMaxThreads(*config.file_system); } config.allocator = std::move(new_config.allocator); @@ -380,7 +375,8 @@ void DatabaseInstance::Configure(DBConfig &new_config) { if (new_config.buffer_pool) { config.buffer_pool = std::move(new_config.buffer_pool); } else { - config.buffer_pool = make_shared(config.options.maximum_memory); + config.buffer_pool = make_shared_ptr(config.options.maximum_memory, + config.options.buffer_manager_track_eviction_timestamps); } } @@ -393,14 +389,14 @@ const DBConfig &DBConfig::GetConfig(const ClientContext &context) { } idx_t DatabaseInstance::NumberOfThreads() { - return scheduler->NumberOfThreads(); + return NumericCast(scheduler->NumberOfThreads()); } const unordered_set &DatabaseInstance::LoadedExtensions() { return loaded_extensions; } -const unordered_map &DatabaseInstance::LoadedExtensionsData() { +const unordered_map &DatabaseInstance::LoadedExtensionsData() { return loaded_extensions_data; } @@ -417,10 +413,10 @@ bool DuckDB::ExtensionIsLoaded(const std::string &name) { return instance->ExtensionIsLoaded(name); } -void DatabaseInstance::SetExtensionLoaded(const std::string &name, const std::string &extension_version) { +void DatabaseInstance::SetExtensionLoaded(const string &name, ExtensionInstallInfo &install_info) { auto extension_name = ExtensionHelper::GetExtensionName(name); loaded_extensions.insert(extension_name); - loaded_extensions_data.insert({extension_name, ExtensionInfo(extension_version)}); + loaded_extensions_data.insert({extension_name, install_info}); auto &callbacks = DBConfig::GetConfig(*this).extension_callbacks; for (auto &callback : callbacks) { diff --git a/src/duckdb/src/main/db_instance_cache.cpp b/src/duckdb/src/main/db_instance_cache.cpp index 342af27f..a72592fd 100644 --- a/src/duckdb/src/main/db_instance_cache.cpp +++ b/src/duckdb/src/main/db_instance_cache.cpp @@ -66,7 +66,7 @@ shared_ptr DBInstanceCache::CreateInstanceInternal(const string &databas if (abs_database_path.rfind(IN_MEMORY_PATH, 0) == 0) { instance_path = IN_MEMORY_PATH; } - auto db_instance = make_shared(instance_path, &config); + auto db_instance = make_shared_ptr(instance_path, &config); if (cache_instance) { db_instances[abs_database_path] = db_instance; } diff --git a/src/duckdb/src/main/extension.cpp b/src/duckdb/src/main/extension.cpp index 4bfc5c87..8e81033b 100644 --- a/src/duckdb/src/main/extension.cpp +++ b/src/duckdb/src/main/extension.cpp @@ -1,8 +1,64 @@ #include "duckdb/main/extension.hpp" +#include "duckdb/common/string_util.hpp" +#include "duckdb/main/extension_helper.hpp" namespace duckdb { Extension::~Extension() { } +static string PrettyPrintString(const string &s) { + string res = ""; + for (auto c : s) { + if (StringUtil::CharacterIsAlpha(c) || StringUtil::CharacterIsDigit(c) || c == '_' || c == '-' || c == ' ' || + c == '.') { + res += c; + } else { + auto value = UnsafeNumericCast(c); + res += "\\x"; + uint8_t first = value / 16; + if (first < 10) { + res.push_back((char)('0' + first)); + } else { + res.push_back((char)('a' + first - 10)); + } + uint8_t second = value % 16; + if (second < 10) { + res.push_back((char)('0' + second)); + } else { + res.push_back((char)('a' + second - 10)); + } + } + } + return res; +} + +string ParsedExtensionMetaData::GetInvalidMetadataError() { + const string engine_version = string(ExtensionHelper::GetVersionDirectoryName()); + const string engine_platform = string(DuckDB::Platform()); + + if (!AppearsValid()) { + return "The file is not a DuckDB extension. The metadata at the end of the file is invalid"; + } + + string result; + if (engine_version != duckdb_version) { + result += StringUtil::Format("The file was built for DuckDB version '%s', but we can only load extensions " + "built for DuckDB version '%s'.", + PrettyPrintString(duckdb_version), engine_version); + } + if (engine_platform != platform) { + if (!result.empty()) { + result += " Also, t"; + } else { + result += "T"; + } + result += StringUtil::Format( + "he file was built for the platform '%s', but we can only load extensions built for platform '%s'.", + PrettyPrintString(platform), engine_platform); + } + + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/main/extension/extension_helper.cpp b/src/duckdb/src/main/extension/extension_helper.cpp index 818a2585..3954e232 100644 --- a/src/duckdb/src/main/extension/extension_helper.cpp +++ b/src/duckdb/src/main/extension/extension_helper.cpp @@ -1,10 +1,14 @@ #include "duckdb/main/extension_helper.hpp" #include "duckdb/common/file_system.hpp" +#include "duckdb/common/serializer/binary_deserializer.hpp" +#include "duckdb/common/serializer/buffered_file_reader.hpp" #include "duckdb/common/string_util.hpp" #include "duckdb/common/windows.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/main/database.hpp" +#include "duckdb/main/extension.hpp" +#include "duckdb/main/extension_install_info.hpp" // Note that c++ preprocessor doesn't have a nice way to clean this up so we need to set the defines we use to false // explicitly when they are undefined @@ -208,8 +212,8 @@ bool ExtensionHelper::TryAutoLoadExtension(ClientContext &context, const string try { if (dbconfig.options.autoinstall_known_extensions) { auto &config = DBConfig::GetConfig(context); - ExtensionHelper::InstallExtension(context, extension_name, false, - config.options.autoinstall_extension_repo); + auto autoinstall_repo = ExtensionRepository::GetRepositoryByUrl(config.options.autoinstall_extension_repo); + ExtensionHelper::InstallExtension(context, extension_name, false, autoinstall_repo); } ExtensionHelper::LoadExternalExtension(context, extension_name); return true; @@ -218,6 +222,153 @@ bool ExtensionHelper::TryAutoLoadExtension(ClientContext &context, const string } } +static ExtensionUpdateResult UpdateExtensionInternal(DatabaseInstance &db, FileSystem &fs, + const string &full_extension_path, const string &extension_name) { + ExtensionUpdateResult result; + result.extension_name = extension_name; + + auto &config = DBConfig::GetConfig(db); + + if (!fs.FileExists(full_extension_path)) { + result.tag = ExtensionUpdateResultTag::NOT_INSTALLED; + return result; + } + + // Extension exists, check for .info file + const string info_file_path = full_extension_path + ".info"; + if (!fs.FileExists(info_file_path)) { + result.tag = ExtensionUpdateResultTag::MISSING_INSTALL_INFO; + return result; + } + + // Parse the version of the extension before updating + auto ext_binary_handle = fs.OpenFile(full_extension_path, FileOpenFlags::FILE_FLAGS_READ); + auto parsed_metadata = ExtensionHelper::ParseExtensionMetaData(*ext_binary_handle); + if (!parsed_metadata.AppearsValid() && !config.options.allow_extensions_metadata_mismatch) { + throw IOException( + "Failed to update extension: '%s', the metadata of the extension appears invalid! To resolve this, either " + "reinstall the extension using 'FORCE INSTALL %s', manually remove the file '%s', or enable '" + "SET allow_extensions_metadata_mismatch=true'", + extension_name, extension_name, full_extension_path); + } + + result.prev_version = parsed_metadata.AppearsValid() ? parsed_metadata.extension_version : ""; + + auto extension_install_info = ExtensionInstallInfo::TryReadInfoFile(fs, info_file_path, extension_name); + + // Early out: no info file found + if (extension_install_info->mode == ExtensionInstallMode::UNKNOWN) { + result.tag = ExtensionUpdateResultTag::MISSING_INSTALL_INFO; + return result; + } + + // Early out: we can only update extensions from repositories + if (extension_install_info->mode != ExtensionInstallMode::REPOSITORY) { + result.tag = ExtensionUpdateResultTag::NOT_A_REPOSITORY; + result.installed_version = result.prev_version; + return result; + } + + auto repository_from_info = ExtensionRepository::GetRepositoryByUrl(extension_install_info->repository_url); + result.repository = repository_from_info.ToReadableString(); + + // We force install the full url found in this file, throwing + unique_ptr install_result; + try { + install_result = ExtensionHelper::InstallExtension(config, fs, extension_name, true, repository_from_info); + } catch (std::exception &e) { + ErrorData error(e); + error.Throw("Extension updating failed when trying to install '" + extension_name + "', original error: "); + } + + result.installed_version = install_result->version; + + if (result.installed_version.empty()) { + result.tag = ExtensionUpdateResultTag::REDOWNLOADED; + } else if (result.installed_version != result.prev_version) { + result.tag = ExtensionUpdateResultTag::UPDATED; + } else { + result.tag = ExtensionUpdateResultTag::NO_UPDATE_AVAILABLE; + } + + return result; +} + +vector ExtensionHelper::UpdateExtensions(ClientContext &context) { + auto &fs = FileSystem::GetFileSystem(context); + return ExtensionHelper::UpdateExtensions(DatabaseInstance::GetDatabase(context), fs); +} + +vector ExtensionHelper::UpdateExtensions(DatabaseInstance &db, FileSystem &fs) { + vector result; + + auto &config = DBConfig::GetConfig(db); + +#ifndef WASM_LOADABLE_EXTENSIONS + case_insensitive_set_t seen_extensions; + + // scan the install directory for installed extensions + auto ext_directory = ExtensionHelper::ExtensionDirectory(config, fs); + fs.ListFiles(ext_directory, [&](const string &path, bool is_directory) { + if (!StringUtil::EndsWith(path, ".duckdb_extension")) { + return; + } + + auto extension_file_name = StringUtil::GetFileName(path); + auto extension_name = StringUtil::Split(extension_file_name, ".")[0]; + + seen_extensions.insert(extension_name); + + result.push_back(UpdateExtensionInternal(db, fs, fs.JoinPath(ext_directory, path), extension_name)); + }); +#endif + + for (const auto &extension : db.LoadedExtensions()) { + if (seen_extensions.find(extension) != seen_extensions.end()) { + const auto &loaded_extension_data = db.LoadedExtensionsData(); + const auto &loaded_install_info = loaded_extension_data.find(extension); + + ExtensionUpdateResult statically_loaded_ext_result; + + if (loaded_install_info == loaded_extension_data.end()) { + statically_loaded_ext_result.tag = ExtensionUpdateResultTag::UNKNOWN; + } else if (loaded_install_info->second.mode == ExtensionInstallMode::STATICALLY_LINKED) { + statically_loaded_ext_result.tag = ExtensionUpdateResultTag::STATICALLY_LOADED; + statically_loaded_ext_result.installed_version = loaded_install_info->second.version; + } else { + statically_loaded_ext_result.tag = ExtensionUpdateResultTag::UNKNOWN; + } + + result.push_back(std::move(statically_loaded_ext_result)); + } + } + + return result; +} + +ExtensionUpdateResult ExtensionHelper::UpdateExtension(ClientContext &context, const string &extension_name) { + auto &fs = FileSystem::GetFileSystem(context); + return ExtensionHelper::UpdateExtension(DatabaseInstance::GetDatabase(context), fs, extension_name); +} + +ExtensionUpdateResult ExtensionHelper::UpdateExtension(DatabaseInstance &db, FileSystem &fs, + const string &extension_name) { + auto &config = DBConfig::GetConfig(db); + auto ext_directory = ExtensionHelper::ExtensionDirectory(config, fs); + + auto full_extension_path = fs.JoinPath(ext_directory, extension_name + ".duckdb_extension"); + + auto update_result = UpdateExtensionInternal(db, fs, full_extension_path, extension_name); + + if (update_result.tag == ExtensionUpdateResultTag::NOT_INSTALLED) { + throw InvalidInputException("Failed to update the extension '%s', the extension is not installed!", + extension_name); + } else if (update_result.tag == ExtensionUpdateResultTag::UNKNOWN) { + throw InternalException("Failed to update extension '%s', an unknown error ocurred", extension_name); + } + return update_result; +} + void ExtensionHelper::AutoLoadExtension(ClientContext &context, const string &extension_name) { return ExtensionHelper::AutoLoadExtension(*context.db, extension_name); } @@ -232,8 +383,9 @@ void ExtensionHelper::AutoLoadExtension(DatabaseInstance &db, const string &exte auto fs = FileSystem::CreateLocal(); #ifndef DUCKDB_WASM if (dbconfig.options.autoinstall_known_extensions) { - ExtensionHelper::InstallExtension(db.config, *fs, extension_name, false, - dbconfig.options.autoinstall_extension_repo); + //! Get the autoloading repository + auto repository = ExtensionRepository::GetRepositoryByUrl(dbconfig.options.autoinstall_extension_repo); + ExtensionHelper::InstallExtension(db.config, *fs, extension_name, false, repository); } #endif ExtensionHelper::LoadExternalExtension(db, *fs, extension_name); @@ -313,83 +465,83 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std // TODO: rewrite package_build.py to allow also loading out-of-tree extensions in non-cmake builds if (extension == "parquet") { #if DUCKDB_EXTENSION_PARQUET_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else // parquet extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "icu") { #if DUCKDB_EXTENSION_ICU_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else // icu extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "tpch") { #if DUCKDB_EXTENSION_TPCH_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else // icu extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "tpcds") { #if DUCKDB_EXTENSION_TPCDS_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else // icu extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "fts") { #if DUCKDB_EXTENSION_FTS_LINKED -// db.LoadExtension(); +// db.LoadStaticExtension(); #else // fts extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "httpfs") { #if DUCKDB_EXTENSION_HTTPFS_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "json") { #if DUCKDB_EXTENSION_JSON_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else // json extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "excel") { #if DUCKDB_EXTENSION_EXCEL_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else // excel extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "sqlsmith") { #if DUCKDB_EXTENSION_SQLSMITH_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else // excel extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "jemalloc") { #if DUCKDB_EXTENSION_JEMALLOC_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else // jemalloc extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "autocomplete") { #if DUCKDB_EXTENSION_AUTOCOMPLETE_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else // autocomplete extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; #endif } else if (extension == "inet") { #if DUCKDB_EXTENSION_INET_LINKED - db.LoadExtension(); + db.LoadStaticExtension(); #else // inet extension required but not build: skip this test return ExtensionLoadResult::NOT_LOADED; @@ -621,11 +773,238 @@ EMS5gLv50CzQqJXK9mNzPuYXNUIc4Pw4ssVWe0OfN3Od90gl5uFUwk/G9lWSYnBN -----END PUBLIC KEY----- )", nullptr}; -const vector ExtensionHelper::GetPublicKeys() { +static const char *const community_public_keys[] = { + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv+Jki3aiZt0eOzShgD2g +BYPjPpkhHowOwPzUKtTVPob7vxyzd2wPyWDF/Zn6sN8QzravAdlXFE3SNF7ayO86 +IPHhMxO6P2YlxbipyKzPOUJsasXBiwYw2aSvb0RtwnYwD5lJs8Tz2ET1RQCFgXGc +LW7bDjKRbHSME0Me5rLRWVztOqULeoMeY1oCOmKKeAYxjFOASJJfQF9oQxkuu3j1 +qpcXnfHldlPGzFM77OFlWFtlc9QW4WNoxkO3HwskFW6ZRaQipM8vgSzkIfPFESGL +TtDRw+RcUPqmS6NVW8nhaiptBIMXy+9cP/l1LGmGwrZRhWP0YBlk6V9MUMzjyo+R +JQIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtXl28loGwAH3ZGQXXgJQ +3omhIEiUb3z9Petjl+jmdtEQnMNUFEZiXkfJB02UFWBL1OoKKnjiGhcr5oGiIZKR +CoaL6SfmWe//7o8STM44stE0exzZcv8W4tWwjrzSWQnwh2JgSnHN64xoDQjdvG3X +9uQ1xXMXghWOKqEpgArpJQkHoPW3CD5sCS2NLFrBG6KgX0W+GTV5HaKhTMr2754F +l260drcBJZhLFCeesze2DXtQC+R9D25Zwn2ehHHd2Fd1M10ZL/iKN8NeerB4Jnph +w6E3orA0DusDLDLtpJUHhmpLoU/1eYQFQOpGw2ce5I88Tkx7SKnCRy1UiE7BA82W +YQIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvTgQ+mJs8vG/TQTJ6sV+ +tACTZTbmp8NkgTuwEyHZSNhX6W8FYwAqPzbePo7wudsUdBWV8j+kUYaBiqeiPUp0 +7neO/3oTUQkMJLq9FeIXfoYkS3+/5CIuvsfas6PJP9U2ge6MV1Ndgbd7a12cmX8V +4eNwQRDv/H4zgL7YI2ZZSG1loxgMffZrpflNB87t/f0QYdmnwphMC5RqxiCkDZPA +a5/5KbmD6kjLh8RRRw3lAZbPQe5r7o2Xqqwg9gc6rQ/WFBB1Oj+Q5Bggqznl6dCB +JcLOA7rhYatv/mvt1h6ogQwQ9FGRM3PifV9boZxOQGBAkMD6ngpd5kVoOxdygC7v +twIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7KvnA+Ixj4ZCLR+aXSFz +ICGbQdVrZ/hhjImDQcWgWY+z/bEbybslDvy5KEPrxTNxKZ0VfFFAVEUj2cw8B5KI +naK8U2VIpdD6LpEJvkOuWKg3bym4COhyAcRNqKKu/GPzS90wICJ2aaayF1mVoCIL +dsp2ZShSIVRJa55gVvfRN1ZEkqBnZryKNt/h3DNqqq2Sn3n3HIZ8H9oEO+L+2Efe +kyET7o9OHy6QZXhf4SJ8QlQAwxxe/L4bln8CBlBHKrUNNqxpjhC37EnY2jpuu3a9 +EZcNFj8R4qIJx7hcltntZyKrEIXqc6I6x4oZ4qhZj3RQ5Lr+pJ++idoc1LmBS3k5 +yQIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7SF+5RZ9jXyruBkhxhk2 +BSWPbohevxxv++7Uw0HXC/3Xw4jzii0tYaJ6O8QWXyggEAkvmONblAN1rfiz+h5M +oJUQwHjTTZ8BmKUmWrNayVokUXLu4IpCAHk4uSXfx4U/AINnNfWW7z8mUJf6nGsM +XePuKPBRUsw+JmTWOXEIVrkc/66B+gpgi+DwRFLUPh96D8XRAhp7QbHE9UMD3HpA +mPMX7ICVsVS+NGdCHNsdWfH4noaESjgmMdApKekgeeo8Zu1pvQ3y8iew1xOQVBoR +V+PCGWAJYB7ulqBBkRz+NhPLWw7wRA4yLNcZVlZuDFxH9EoavWdfIyYYUn4efSz9 +tQIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAszmZ6Slv/oJvFpOLtSMx +58AKMia9y+qcVfw77/Alb3b+Qi5L2uy6nHfJElT7RIeeXhJ8mFglZ70MecTfj0jl +5WhW+yMg6jmPCJL2JMt/oeC4iY4Cf/3C9RHU4IO13VN4dnVQ5S+SEEmSbXnno9Pe +06yyVgZeJ0REJMV1JZj9gOPc/wbeLHsx4UC5qsu32Ammy6J7tS+k7JvRc9CPOEpe +IhWoZmpONydcI6IRfyH2xl4uLY3hWDrRei0I2zGH45G2hPNeTtRh27t+SzXO7h9j +y072CgHytRgQBiH711i8fe4bHMmtVPhPjFrbuzbJSgE7SyikrWIHMDsnPz443bdR +cQIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAleywAb7xZKYTFE08gGA9 +ffTeYPRcECl/J060fUziIiFu0NHTOZO+a4BH2X+E1WjjNNQkbn00g+op4nqg3/U+ +UaKuXNjWY2Rvd8s91fUD0YOdRpPmsTm2QqhgmYYzO8Oh3YXBNRpXaqALbjL9Nahw +YEAsI3o5yenZGUIEk3JaZFHsAZPL5wGgDVpZgmVUHJ0EO8N5LQh01aHxnP5+ey2z +L5h6IdWLubb07wEBk5bnmIvdhd6dIBzUql27BAqvxKJbW0/okjrhIgcIANDCavfV +L8UP7MCGnfozK7VIl5DG85gCQVAD8+lGUDzOuhzZjl7XKpkFAIWaS8pl4AJbJuG8 +nwIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxiKgcR7Kb1CGTNczbuX+ +S7OFpnVLDD5XGVKvYWxL+2By2QRFPWtMs8c24omLIgZ/CWBFPraMiNKS4+V9ar2C +wJhToJnAOKyayA0Gw2wNZx1mgHAZ/5mT+ImfkmZu2HPwtzJmJDQlESD4p40BWBNa +ZpWFGPMKn4GqvOOSGevC/r9inXm6NaPkM+B/piVDEgiJ7g/kpoqImmNb/c2/3XG5 +3kbDIHdbd2m3A3jWCjNGSANKsR5C0/rZtvsA8tjDlNWIuKmkU3C2nfj3UduU4dNP +Cisod/pDY8ov0U9sdkM9XZsTXjtbAIGLzMshmOv4ajRFUueGnsZW0GRqp9DSnKmj +2QIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuh334hUmJcdDJUSmeXqE +GUfGnASD2QrnuoS+gsXgW5BQW8YMDFASvADQhoDUdcwZMlAF+p+CxKCX/gBp40nC +5eyPXv1e0K6PFcCdHtJq8MhGYAr1sy+7cOpzv0r9whobYUykGoHjdwZeu3VbA3uz +go80oYQlwY+v4zZFafCz3cXw8u7n/9PlddgeqHuIPsNZLocICuBUxwg5rHTzycg2 +Pa68CRselONGN12V0/wlOg+NZpKCym58CM9SS/0v4YZ6LnmINo8gdRYnGE2zhvey +pHR8IJ8WSJXbl8NwyIY1AmtT/Z0dbAclfD8Wt/w5KA/sttnQzrB7fPsLRyLP1Alq +iQIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvWuRMEbez/Ud2o/0KA04 +K9u3HePWud9rEqMsPv2HlclH3k+cezoUJzVre0lopv3R4aG3LDoFETrgGgUVrfPG +z3Zh7vyk0kb4IGkv+kLQu/cWQXyNzigxV+WQnpIWQ28vrP45y5f+GhwwgzFaDAQR +u1o1HH1FEnP7SSzHVvisNTecY95+F5AOvtOOUg4VlegXdUeGZHEza/0D9V8gODPL +DzbOJDDiqX8ahhRnIZyGEg6y7QqftZFz7j0siCHTXXYJBOcPjD4TqTUNpGvBox44 +wgLlLcDsZ/n2Ck4doLXxVz9F80VKOriHSk+qIwseykKVzWQDQTOMOsjCmQsDvram +RwIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyJmGd1GuBv/WD80IcVyr +dZcmuYe/7azLuV1wsgtH4gsUx+ifUwLZUhLFGOTAPFitbFYPPdhQKncO+BcbvOIo +9FGKj9jGVpMU6C+0JQfi+koESevtO1tYzG8c2dMOGNUO0Hlj2Hezm3tZY4nAbo1J +DYqQSY7qvOYZPFvOS/zL+q2vMx93w9jDHJK4iU02ovAqK9xCWfTp4W7rtbDeTgiX +W/75rMG8DWI1ZHA2JXAOFPsiOHa0/yyvCvUIWvRuNHqTTN5NFiJRIcbTCKKbNwNM +xcNkBQCx4xwOqD9TkDbHpBOC/pfW7j3ygJdYRjFFqm10+KwPACYo/f0n4n4DI8Zz +twIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnmxbunsK+2pL8Cva9F8E +9o/dQ35TuIqcgpl9/oIc++x+6G5/8UT5mgGCQTITJRIAPnHsZ9XEnMxTAuSCDkYG +CA3JMl1MT7Zxu8TQJBPiXxOaAE1UmA13JuQ2Uu0v7T6TucQxR9KMvcdCxOZ5cBU4 +uyJObnZVy/WjM2vWcWDUaYGfMss3eYxcDpavspBANdtSZfv11+8/VC+gEGBOe+oW +zDR+BlQx//MAzwSP5HVQcmLHsT073IvkoUWJUxSCCwlLe60ylpY16BLT6dB0RU8B +sxFcIwmYg0kq19EEPPvZLvRKjG/TJRm1MFzOE5LP2VxLGdMltWYEVsBZHTcWU7HR +8wIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlo7eDZOpCptanajUtDK3 +q8Q/ykxmDDw6lVSiLBm54zwMxaqfM+tV/xqalvIVv3BrucRkCs6H+R0bpd7XhbE5 +a7ZFSrWCBf1V6y/NZrEn4qcRbk/WsG4UFqu7CG4r+EgQ4nmoIH/A5+e8FUcur3Y8 +2ie9Foi1CUpZojWYZJeHKbb2yYn4MFHszEb5w9HVxY+i9jR1B8Rvn6OEK3OYDrtA +KnPXp4OiDx6CviYEmipX815PPj7Sv8KKL96JqGWjC4kYw6ALgV/GxiX++tv6rh2O +paW9MBv1y+5oZ8ls5S2T/LXbxDpjUEKC9guSSWmsPHRMxOumXsw0H43grC3Ce8Ui +CwIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ACgf0kJeQgDh+vHj2aj +K/6FQ794MknLxlwTARGlktoVwZgW/qc6vMZsILRUP1gb/gPXdpSTqqad/GLG4f5R +1Ji1It6BniJOPWu1YyTz0C/BXzTGWbwPnIaawbpQE8n4A+tjGGvAoauPtzr0bWfV +XOXPfIW9XB51dcaVTZgHN55Y8Yd/Pcu9/lqXqXyE23tDLXR/QgGpwK9VxTSbRmuC +WspwqWY6L3MIw+3HIXERTM1uNhc9oHxMOCRbJmUghG0wCWB0ed3Xhbnl9mHlX+l1 +rfCJAP4lVWKFjkKBNUejaf+WHxASMjrQubgHLZ2fpf3Ra8TfI3rgPABsAqEIFw3T +QwIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt635/P50bMbEDTapjAQz +ARTb3y8jMHxVruX0tJU1tycmkX3J8tBALmc6TkSHNTJcQmR8L8Sj3h76l/vuL373 +HFSGZ4xghBQqR1lUd2kVomoh+rzEte+0rHWm0JMhjmTQBx+AkDCOw4z3vi5AxWx0 +4EbYpQm2akVGKXQrQPyds0UirmdLACCH6WM6exgAXr75DB4PUpG85oI9Q+5ee1Km ++4atVJ4FNa6ZnjWccrlMYT0W7a0Y7feJPAPvfizrs2MG9/ijyBX34eCWA5dtUSIm +2uqI6DxITZlLTvXVDSKQGlq5TEGMvRULWTatqWy4g+tOZ8rSbRuj32pcBnXlwuVu +7QIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwqO3yWSLKqz1uQ54iFd/ +VcQzgT6chLVuhktt7EFvi3tKaQqz2h2KPkDR+MssRV/BZ/41GNlR6r6p5CaPVDDe +Cuj5IcxrIFZIOBMBi1YZ/bknF9edJacINxNfGK/lXBNEAdUvxcOxX8WeP69uvl2l +SKyO3yAdx6HOyL9if95bYQD19HYPZzbfccPX1aD4pjnej6uMfd7yZErH7i8y0oj4 +eSKSe1CisjFlR9NzRGO42jU9rtqnAFH9sK5wU9xKQ7bQwlz7yKBF2RuuQweMpXb6 +lSObI7ZqYN+7jkf9F5hKRx4kX3+MMBeYmFOy1aYZ08u6sdJ2ua/hFNSDRg7e/UCe +AwIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkJihnfMECaa6YCg6avam +cb8Sy1GshJ7c7+EW6C4vnspSSvEi04AEBB29pnEF9+VO6VSUHLxunVCpbmKFaLH+ +5fDLnc/wCkjPQww49da9MEScCmVGjROlmog65cxQbv4lfxyw55sFV3s/5CPcGlVc +1gojHRABrx4YocpeYies04mEVoOYg1DBG4Uf+aFd5+hm3ZtBa4mqTK2iQa4ILkHa +a0/Us1drRuDjjI4zSbgRzy9x0JVDvqDdLubHyaEf7d7SdrKzodhydG84qpsPFxIj +LK7Bu5v7P4ZTJmxMG3PBM2kB//hlYVR4vO4VEu66mQIM6km+vT9cwxz77qIJhLn3 +ywIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9NbP7ijUxZh4j0NVF6yO +IZ0rzROwl4pP4HGeN+Woyi9+qpdE874WlVoquGEpsshF4Ojzbu2BtXuihb783awa +GLx66MYPeID1FjTKmuCJ2aluOP+DkVo6K1EoqVJXyeIxZzVSqhSIuAdb/vmPlgLz +Fzdk3FgNNOERuGV363DRGz1YxZVnJeSs76g+/9ddhMk8cqIRup5S4YgTOSr0vKem +1E6lyE8IbLoq9J7w5Ur8VjzE2cI+eLKGFqr46Q8pf0pJq72gd+Z3mH5D2LmvEtAR +9jAQXVlLfHauQR2M0K6mqDy9GxL19OU4tGO+GY86VvDTU+wZppAZRz9AKoL1fwfI +BQIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjrI16GdC2zJriLbyzcre +AqvckBSTMd4bdGaodUBNBTBVbITsOw/k7D62y2hSZHt2nHOyEVkJINJHADrpNZuY +ybS4ssEXxD8+NnjATqQxDMuSz8lUj/Jnf49uzLh84fep3DTksDcQX6Nvio5q8Xbh +HRgvl5I+tPfLtme0oW9cVuVja2i5lHB3SzYCW9Kk/V4/d2WiceYf91a1Nae6m7QV +5bmbYoHmsxT8refTQq+5lAhzVXYU9QRgiKdbE8sSmkV+YiZEtGijefUXgmOxx3I9 +B3y03796WBS/RHpSzdMNJw/xPWJcSEMqaUdSYr0DuPCnrn7ojFeF/EFC47CBq5DU +swIDAQAB +-----END PUBLIC KEY----- +)", + R"( +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjS1+My6OhQCCD1DgrzKu +db4Fvc3aqqEhQyjqMLnalp0uoGFpSLoPsZiPGloTE8FSs1ZBFKQ8h2SsGwSdhRKF +xIqoOnS0B/ORjGJxTj7Q2YWjzkCZUD4Ul2AxIbv3TmZM2LeyHJL3A71tSuck8EQY +PE2aj1tLzXsSfRaByy5xwXiU6UpnwCY1xb8tK8QxavRCo5T9Si9tNsolStoNVXV0 +k9EbTcRNnxCvab/oqjvgyRuSmIES00v8jZOGQZQUpw02RN6yCBeX2i8GPsGjj/T9 +6Gu1Z3G4zUjLlJxl8vjo8KIDaQ8NVWT0j7gx9Knvb5tWnAORI1aJA8AHQvaoOT1W +1wIDAQAB +-----END PUBLIC KEY----- +)", nullptr}; + +const vector ExtensionHelper::GetPublicKeys(bool allow_community_extensions) { vector keys; for (idx_t i = 0; public_keys[i]; i++) { keys.emplace_back(public_keys[i]); } + if (allow_community_extensions) { + for (idx_t i = 0; community_public_keys[i]; i++) { + keys.emplace_back(community_public_keys[i]); + } + } return keys; } diff --git a/src/duckdb/src/main/extension/extension_install.cpp b/src/duckdb/src/main/extension/extension_install.cpp index 7e182510..d188cb5d 100644 --- a/src/duckdb/src/main/extension/extension_install.cpp +++ b/src/duckdb/src/main/extension/extension_install.cpp @@ -1,8 +1,13 @@ +#include "duckdb/common/exception/http_exception.hpp" #include "duckdb/common/gzip_file_system.hpp" -#include "duckdb/common/types/uuid.hpp" +#include "duckdb/common/local_file_system.hpp" +#include "duckdb/common/serializer/binary_serializer.hpp" #include "duckdb/common/string_util.hpp" -#include "duckdb/common/exception/http_exception.hpp" +#include "duckdb/common/types/uuid.hpp" +#include "duckdb/logging/http_logger.hpp" +#include "duckdb/main/client_data.hpp" #include "duckdb/main/extension_helper.hpp" +#include "duckdb/main/extension_install_info.hpp" #ifndef DISABLE_DUCKDB_REMOTE_INSTALL #ifndef DUCKDB_DISABLE_EXTENSION_LOAD @@ -128,26 +133,33 @@ bool ExtensionHelper::CreateSuggestions(const string &extension_name, string &me return false; } -void ExtensionHelper::InstallExtension(DBConfig &config, FileSystem &fs, const string &extension, bool force_install, - const string &repository) { +unique_ptr ExtensionHelper::InstallExtension(DBConfig &config, FileSystem &fs, + const string &extension, bool force_install, + optional_ptr repository, + const string &version) { #ifdef WASM_LOADABLE_EXTENSIONS // Install is currently a no-op - return; + return nullptr; #endif string local_path = ExtensionDirectory(config, fs); - InstallExtensionInternal(config, fs, local_path, extension, force_install, repository); + return InstallExtensionInternal(config, fs, local_path, extension, force_install, version, repository); } -void ExtensionHelper::InstallExtension(ClientContext &context, const string &extension, bool force_install, - const string &repository) { +unique_ptr ExtensionHelper::InstallExtension(ClientContext &context, const string &extension, + bool force_install, + optional_ptr repository, + const string &version) { #ifdef WASM_LOADABLE_EXTENSIONS // Install is currently a no-op - return; + return nullptr; #endif - auto &config = DBConfig::GetConfig(context); + auto &db_config = DBConfig::GetConfig(context); auto &fs = FileSystem::GetFileSystem(context); string local_path = ExtensionDirectory(context); - InstallExtensionInternal(config, fs, local_path, extension, force_install, repository); + optional_ptr http_logger = + ClientConfig::GetConfig(context).enable_http_logging ? context.client_data->http_logger.get() : nullptr; + return InstallExtensionInternal(db_config, fs, local_path, extension, force_install, version, repository, + http_logger, context); } unsafe_unique_array ReadExtensionFileFromDisk(FileSystem &fs, const string &path, idx_t &file_size) { @@ -159,7 +171,7 @@ unsafe_unique_array ReadExtensionFileFromDisk(FileSystem &fs, const stri return in_buffer; } -void WriteExtensionFileToDisk(FileSystem &fs, const string &path, void *data, idx_t data_size) { +static void WriteExtensionFileToDisk(FileSystem &fs, const string &path, void *data, idx_t data_size) { auto target_file = fs.OpenFile(path, FileFlags::FILE_FLAGS_WRITE | FileFlags::FILE_FLAGS_APPEND | FileFlags::FILE_FLAGS_FILE_CREATE_NEW); target_file->Write(data, data_size); @@ -167,25 +179,28 @@ void WriteExtensionFileToDisk(FileSystem &fs, const string &path, void *data, id target_file.reset(); } -string ExtensionHelper::ExtensionUrlTemplate(optional_ptr db_config, const string &repository) { - string versioned_path = "/${REVISION}/${PLATFORM}/${NAME}.duckdb_extension"; +static void WriteExtensionMetadataFileToDisk(FileSystem &fs, const string &path, ExtensionInstallInfo &metadata) { + auto file_writer = BufferedFileWriter(fs, path); + BinarySerializer::Serialize(metadata, file_writer); + file_writer.Sync(); +} + +string ExtensionHelper::ExtensionUrlTemplate(optional_ptr db_config, + const ExtensionRepository &repository, const string &version) { + string versioned_path; + if (!version.empty()) { + versioned_path = "/${NAME}/" + version + "/${REVISION}/${PLATFORM}/${NAME}.duckdb_extension"; + } else { + versioned_path = "/${REVISION}/${PLATFORM}/${NAME}.duckdb_extension"; + } #ifdef WASM_LOADABLE_EXTENSIONS - string default_endpoint = "https://extensions.duckdb.org"; + string default_endpoint = DEFAULT_REPOSITORY; versioned_path = versioned_path + ".wasm"; #else - string default_endpoint = "http://extensions.duckdb.org"; + string default_endpoint = ExtensionRepository::DEFAULT_REPOSITORY_URL; versioned_path = versioned_path + ".gz"; #endif - string custom_endpoint = db_config ? db_config->options.custom_extension_repo : string(); - string endpoint; - if (!repository.empty()) { - endpoint = repository; - } else if (!custom_endpoint.empty()) { - endpoint = custom_endpoint; - } else { - endpoint = default_endpoint; - } - string url_template = endpoint + versioned_path; + string url_template = repository.path + versioned_path; return url_template; } @@ -196,56 +211,128 @@ string ExtensionHelper::ExtensionFinalizeUrlTemplate(const string &url_template, return url; } -void ExtensionHelper::InstallExtensionInternal(DBConfig &config, FileSystem &fs, const string &local_path, - const string &extension, bool force_install, const string &repository) { -#ifdef DUCKDB_DISABLE_EXTENSION_LOAD - throw PermissionException("Installing external extensions is disabled through a compile time flag"); -#else - if (!config.options.enable_external_access) { - throw PermissionException("Installing extensions is disabled through configuration"); +static void CheckExtensionMetadataOnInstall(DBConfig &config, void *in_buffer, idx_t file_size, + ExtensionInstallInfo &info, const string &extension_name) { + if (file_size < ParsedExtensionMetaData::FOOTER_SIZE) { + throw IOException("Failed to install '%s', file too small to be a valid DuckDB extension!", extension_name); } - auto extension_name = ApplyExtensionAlias(fs.ExtractBaseName(extension)); - string local_extension_path = fs.JoinPath(local_path, extension_name + ".duckdb_extension"); - if (fs.FileExists(local_extension_path) && !force_install) { - return; + auto parsed_metadata = ExtensionHelper::ParseExtensionMetaData(static_cast(in_buffer) + + (file_size - ParsedExtensionMetaData::FOOTER_SIZE)); + + auto metadata_mismatch_error = parsed_metadata.GetInvalidMetadataError(); + + if (!metadata_mismatch_error.empty() && !config.options.allow_extensions_metadata_mismatch) { + throw IOException("Failed to install '%s'\n%s", extension_name, metadata_mismatch_error); } - auto uuid = UUID::ToString(UUID::GenerateRandomUUID()); - string temp_path = local_extension_path + ".tmp-" + uuid; - if (fs.FileExists(temp_path)) { - fs.RemoveFile(temp_path); + info.version = parsed_metadata.extension_version; +} + +// Note: since this method is not atomic, this can fail in different ways, that should all be handled properly by +// DuckDB: +// 1. Crash after extension removal: extension is now uninstalled, metadata file still present +// 2. Crash after metadata removal: extension is now uninstalled, extension dir is clean +// 3. Crash after extension move: extension is now uninstalled, new metadata file present +static void WriteExtensionFiles(FileSystem &fs, const string &temp_path, const string &local_extension_path, + void *in_buffer, idx_t file_size, ExtensionInstallInfo &info) { + // Write extension to tmp file + WriteExtensionFileToDisk(fs, temp_path, in_buffer, file_size); + + // Write metadata to tmp file + auto metadata_tmp_path = temp_path + ".info"; + auto metadata_file_path = local_extension_path + ".info"; + WriteExtensionMetadataFileToDisk(fs, metadata_tmp_path, info); + + // First remove the local extension we are about to replace + if (fs.FileExists(local_extension_path)) { + fs.RemoveFile(local_extension_path); } - auto is_http_url = StringUtil::Contains(extension, "http://"); - if (ExtensionHelper::IsFullPath(extension)) { - if (fs.FileExists(extension)) { - idx_t file_size; - auto in_buffer = ReadExtensionFileFromDisk(fs, extension, file_size); - WriteExtensionFileToDisk(fs, temp_path, in_buffer.get(), file_size); - if (fs.FileExists(local_extension_path) && force_install) { - fs.RemoveFile(local_extension_path); - } - fs.MoveFile(temp_path, local_extension_path); - return; - } else if (!is_http_url) { - throw IOException("Failed to read extension from \"%s\": no such file", extension); + // Then remove the old metadata file + if (fs.FileExists(metadata_file_path)) { + fs.RemoveFile(metadata_file_path); + } + + fs.MoveFile(metadata_tmp_path, metadata_file_path); + fs.MoveFile(temp_path, local_extension_path); +} + +// Install an extension using a filesystem +static unique_ptr DirectInstallExtension(DBConfig &config, FileSystem &fs, const string &path, + const string &temp_path, const string &extension_name, + const string &local_extension_path, bool force_install, + optional_ptr repository, + optional_ptr context) { + string file = fs.ConvertSeparators(path); + + // Try autoloading httpfs for loading extensions over https + if (context) { + auto &db = DatabaseInstance::GetDatabase(*context); + if (StringUtil::StartsWith(path, "https://") && !db.ExtensionIsLoaded("httpfs") && + db.config.options.autoload_known_extensions) { + ExtensionHelper::AutoLoadExtension(*context, "httpfs"); } } -#ifdef DISABLE_DUCKDB_REMOTE_INSTALL - throw BinderException("Remote extension installation is disabled through configuration"); -#else + // Check if file exists + bool exists = fs.FileExists(file); - string url_template = ExtensionUrlTemplate(&config, repository); + // Recheck without .gz + if (!exists && StringUtil::EndsWith(file, ".gz")) { + file = file.substr(0, file.size() - 3); + exists = fs.FileExists(file); + } - if (is_http_url) { - url_template = extension; - extension_name = ""; + // Throw error on failure + if (!exists) { + if (!fs.IsRemoteFile(file)) { + throw IOException("Failed to copy local extension \"%s\" at PATH \"%s\"\n", extension_name, file); + } + if (StringUtil::StartsWith(file, "https://")) { + throw IOException("Failed to install remote extension \"%s\" from url \"%s\"", extension_name, file); + } } - string url = ExtensionFinalizeUrlTemplate(url_template, extension_name); + idx_t file_size; + auto in_buffer = ReadExtensionFileFromDisk(fs, file, file_size); + + ExtensionInstallInfo info; + string decompressed_data; + void *extension_decompressed; + idx_t extension_decompressed_size; + + if (GZipFileSystem::CheckIsZip(const_char_ptr_cast(in_buffer.get()), file_size)) { + decompressed_data = GZipFileSystem::UncompressGZIPString(const_char_ptr_cast(in_buffer.get()), file_size); + extension_decompressed = (void *)decompressed_data.data(); + extension_decompressed_size = decompressed_data.size(); + } else { + extension_decompressed = (void *)in_buffer.get(); + extension_decompressed_size = file_size; + } + + CheckExtensionMetadataOnInstall(config, extension_decompressed, extension_decompressed_size, info, extension_name); + + if (!repository) { + info.mode = ExtensionInstallMode::CUSTOM_PATH; + info.full_path = file; + } else { + info.mode = ExtensionInstallMode::REPOSITORY; + info.full_path = file; + info.repository_url = repository->path; + } + + WriteExtensionFiles(fs, temp_path, local_extension_path, extension_decompressed, extension_decompressed_size, info); + + return make_uniq(info); +} + +static unique_ptr InstallFromHttpUrl(DBConfig &config, const string &url, + const string &extension_name, const string &temp_path, + const string &local_extension_path, bool force_install, + optional_ptr repository, + optional_ptr http_logger) { string no_http = StringUtil::Replace(url, "http://", ""); idx_t next = no_http.find('/', 0); @@ -253,34 +340,15 @@ void ExtensionHelper::InstallExtensionInternal(DBConfig &config, FileSystem &fs, throw IOException("No slash in URL template"); } - // Special case to install extension from a local file, useful for testing - if (!StringUtil::Contains(url_template, "http://")) { - string file = fs.ConvertSeparators(url); - if (!fs.FileExists(file)) { - // check for non-gzipped variant - file = file.substr(0, file.size() - 3); - if (!fs.FileExists(file)) { - throw IOException("Failed to copy local extension \"%s\" at PATH \"%s\"\n", extension_name, file); - } - } - auto read_handle = fs.OpenFile(file, FileFlags::FILE_FLAGS_READ); - auto test_data = std::unique_ptr {new unsigned char[read_handle->GetFileSize()]}; - read_handle->Read(test_data.get(), read_handle->GetFileSize()); - WriteExtensionFileToDisk(fs, temp_path, (void *)test_data.get(), read_handle->GetFileSize()); - - if (fs.FileExists(local_extension_path) && force_install) { - fs.RemoveFile(local_extension_path); - } - fs.MoveFile(temp_path, local_extension_path); - return; - } - // Push the substring [last, next) on to splits auto hostname_without_http = no_http.substr(0, next); auto url_local_part = no_http.substr(next); auto url_base = "http://" + hostname_without_http; duckdb_httplib::Client cli(url_base.c_str()); + if (http_logger) { + cli.set_logger(http_logger->GetLogger()); + } duckdb_httplib::Headers headers = { {"User-Agent", StringUtil::Format("%s %s", config.UserAgent(), DuckDB::SourceID())}}; @@ -291,7 +359,7 @@ void ExtensionHelper::InstallExtensionInternal(DBConfig &config, FileSystem &fs, // create suggestions string message; auto exact_match = ExtensionHelper::CreateSuggestions(extension_name, message); - if (exact_match && !IsRelease(DuckDB::LibraryVersion())) { + if (exact_match && !ExtensionHelper::IsRelease(DuckDB::LibraryVersion())) { message += "\nAre you using a development build? In this case, extensions might not (yet) be uploaded."; } if (res.error() == duckdb_httplib::Error::Success) { @@ -304,12 +372,152 @@ void ExtensionHelper::InstallExtensionInternal(DBConfig &config, FileSystem &fs, } auto decompressed_body = GZipFileSystem::UncompressGZIPString(res->body); - WriteExtensionFileToDisk(fs, temp_path, (void *)decompressed_body.data(), decompressed_body.size()); + ExtensionInstallInfo info; + CheckExtensionMetadataOnInstall(config, (void *)decompressed_body.data(), decompressed_body.size(), info, + extension_name); - if (fs.FileExists(local_extension_path) && force_install) { - fs.RemoveFile(local_extension_path); + if (repository) { + info.mode = ExtensionInstallMode::REPOSITORY; + info.full_path = url; + info.repository_url = repository->path; + } else { + info.mode = ExtensionInstallMode::CUSTOM_PATH; + info.full_path = url; } - fs.MoveFile(temp_path, local_extension_path); + + auto fs = FileSystem::CreateLocal(); + WriteExtensionFiles(*fs, temp_path, local_extension_path, (void *)decompressed_body.data(), + decompressed_body.size(), info); + + return make_uniq(info); +} + +// Install an extension using a hand-rolled http request +static unique_ptr InstallFromRepository(DBConfig &config, FileSystem &fs, const string &url, + const string &extension_name, + ExtensionRepository &repository, const string &temp_path, + const string &local_extension_path, const string &version, + bool force_install, optional_ptr http_logger, + optional_ptr context) { + string url_template = ExtensionHelper::ExtensionUrlTemplate(&config, repository, version); + string generated_url = ExtensionHelper::ExtensionFinalizeUrlTemplate(url_template, extension_name); + + // Special handling for http repository: avoid using regular filesystem (note: the filesystem is not used here) + if (StringUtil::StartsWith(repository.path, "http://")) { + return InstallFromHttpUrl(config, generated_url, extension_name, temp_path, local_extension_path, force_install, + repository, http_logger); + } + + // Default case, let the FileSystem figure it out + return DirectInstallExtension(config, fs, generated_url, temp_path, extension_name, local_extension_path, + force_install, repository, context); +} + +static bool IsHTTP(const string &path) { + return StringUtil::StartsWith(path, "http://") || !StringUtil::StartsWith(path, "https://"); +} + +static void ThrowErrorOnMismatchingExtensionOrigin(FileSystem &fs, const string &local_extension_path, + const string &extension_name, const string &extension, + optional_ptr repository) { + auto install_info = ExtensionInstallInfo::TryReadInfoFile(fs, local_extension_path + ".info", extension_name); + + string format_string = "Installing extension '%s' failed. The extension is already installed " + "but the origin is different.\n" + "Currently installed extension is from %s '%s', while the extension to be " + "installed is from %s '%s'.\n" + "To solve this rerun this command with `FORCE INSTALL`"; + string repo = "repository"; + string custom_path = "custom_path"; + + if (install_info) { + if (install_info->mode == ExtensionInstallMode::REPOSITORY && repository && + install_info->repository_url != repository->path) { + throw InvalidInputException(format_string, extension_name, repo, install_info->repository_url, repo, + repository->path); + } + if (install_info->mode == ExtensionInstallMode::REPOSITORY && ExtensionHelper::IsFullPath(extension)) { + throw InvalidInputException(format_string, extension_name, repo, install_info->repository_url, custom_path, + extension); + } + } +} + +unique_ptr +ExtensionHelper::InstallExtensionInternal(DBConfig &config, FileSystem &fs, const string &local_path, + const string &extension, bool force_install, const string &version, + optional_ptr repository, + optional_ptr http_logger, optional_ptr context) { +#ifdef DUCKDB_DISABLE_EXTENSION_LOAD + throw PermissionException("Installing external extensions is disabled through a compile time flag"); +#else + if (!config.options.enable_external_access) { + throw PermissionException("Installing extensions is disabled through configuration"); + } + + auto extension_name = ApplyExtensionAlias(fs.ExtractBaseName(extension)); + string local_extension_path = fs.JoinPath(local_path, extension_name + ".duckdb_extension"); + string temp_path = local_extension_path + ".tmp-" + UUID::ToString(UUID::GenerateRandomUUID()); + + if (fs.FileExists(local_extension_path) && !force_install) { + // File exists: throw error if origin mismatches + if (!config.options.allow_extensions_metadata_mismatch && fs.FileExists(local_extension_path + ".info")) { + ThrowErrorOnMismatchingExtensionOrigin(fs, local_extension_path, extension_name, extension, repository); + } + + // File exists, but that's okay, install is now a NOP + return nullptr; + } + + if (fs.FileExists(temp_path)) { + fs.RemoveFile(temp_path); + } + + if (ExtensionHelper::IsFullPath(extension) && repository) { + throw InvalidInputException("Cannot pass both a repository and a full path url"); + } + + // Resolve default repository if there is none set + ExtensionRepository resolved_repository; + if (!ExtensionHelper::IsFullPath(extension) && !repository) { + resolved_repository = ExtensionRepository::GetDefaultRepository(config); + repository = resolved_repository; + } + + // Install extension from local, direct url + if (ExtensionHelper::IsFullPath(extension) && !IsHTTP(extension)) { + LocalFileSystem local_fs; + return DirectInstallExtension(config, local_fs, extension, temp_path, extension, local_extension_path, + force_install, nullptr, context); + } + + // Install extension from local url based on a repository (Note that this will install it as a local file) + if (repository && !IsHTTP(repository->path)) { + LocalFileSystem local_fs; + return InstallFromRepository(config, fs, extension, extension_name, *repository, temp_path, + local_extension_path, version, force_install, http_logger, context); + } + +#ifdef DISABLE_DUCKDB_REMOTE_INSTALL + throw BinderException("Remote extension installation is disabled through configuration"); +#else + + // Full path direct installation + if (IsFullPath(extension)) { + if (StringUtil::StartsWith(extension, "http://")) { + // HTTP takes separate path to avoid dependency on httpfs extension + return InstallFromHttpUrl(config, extension, extension_name, temp_path, local_extension_path, force_install, + nullptr, http_logger); + } + + // Direct installation from local or remote path + return DirectInstallExtension(config, fs, extension, temp_path, extension, local_extension_path, force_install, + nullptr, context); + } + + // Repository installation + return InstallFromRepository(config, fs, extension, extension_name, *repository, temp_path, local_extension_path, + version, force_install, http_logger, context); #endif #endif } diff --git a/src/duckdb/src/main/extension/extension_load.cpp b/src/duckdb/src/main/extension/extension_load.cpp index 002cf4ae..65438aa8 100644 --- a/src/duckdb/src/main/extension/extension_load.cpp +++ b/src/duckdb/src/main/extension/extension_load.cpp @@ -1,7 +1,9 @@ #include "duckdb/common/dl.hpp" #include "duckdb/common/virtual_file_system.hpp" -#include "duckdb/main/extension_helper.hpp" #include "duckdb/main/error_manager.hpp" +#include "duckdb/main/extension_helper.hpp" +#include "duckdb/common/serializer/buffered_file_reader.hpp" +#include "duckdb/common/serializer/binary_deserializer.hpp" #include "mbedtls_wrapper.hpp" #ifndef DUCKDB_NO_THREADS @@ -31,18 +33,18 @@ static T LoadFunctionFromDLL(void *dll, const string &function_name, const strin return (T)function; } -static void ComputeSHA256String(const std::string &to_hash, std::string *res) { +static void ComputeSHA256String(const string &to_hash, string *res) { // Invoke MbedTls function to actually compute sha256 *res = duckdb_mbedtls::MbedTlsWrapper::ComputeSha256Hash(to_hash); } -static void ComputeSHA256FileSegment(FileHandle *handle, const idx_t start, const idx_t end, std::string *res) { +static void ComputeSHA256FileSegment(FileHandle *handle, const idx_t start, const idx_t end, string *res) { idx_t iter = start; const idx_t segment_size = 1024ULL * 8ULL; duckdb_mbedtls::MbedTlsWrapper::SHA256State state; - std::string to_hash; + string to_hash; while (iter < end) { idx_t len = std::min(end - iter, segment_size); to_hash.resize(len); @@ -64,30 +66,96 @@ static string FilterZeroAtEnd(string s) { return s; } -static string PrettyPrintString(const string &s) { - string res = ""; - for (auto c : s) { - if (StringUtil::CharacterIsAlpha(c) || StringUtil::CharacterIsDigit(c) || c == '_' || c == '-' || c == ' ' || - c == '.') { - res += c; - } else { - uint8_t value = c; - res += "\\x"; - uint8_t first = value / 16; - if (first < 10) { - res.push_back((char)('0' + first)); - } else { - res.push_back((char)('a' + first - 10)); - } - uint8_t second = value % 16; - if (second < 10) { - res.push_back((char)('0' + second)); - } else { - res.push_back((char)('a' + second - 10)); - } +ParsedExtensionMetaData ExtensionHelper::ParseExtensionMetaData(const char *metadata) { + ParsedExtensionMetaData result; + + vector metadata_field; + for (idx_t i = 0; i < 8; i++) { + string field = string(metadata + i * 32, 32); + metadata_field.emplace_back(field); + } + + std::reverse(metadata_field.begin(), metadata_field.end()); + + result.magic_value = FilterZeroAtEnd(metadata_field[0]); + result.platform = FilterZeroAtEnd(metadata_field[1]); + result.duckdb_version = FilterZeroAtEnd(metadata_field[2]); + result.extension_version = FilterZeroAtEnd(metadata_field[3]); + + result.signature = string(metadata, ParsedExtensionMetaData::FOOTER_SIZE - ParsedExtensionMetaData::SIGNATURE_SIZE); + return result; +} + +ParsedExtensionMetaData ExtensionHelper::ParseExtensionMetaData(FileHandle &handle) { + const string engine_version = string(ExtensionHelper::GetVersionDirectoryName()); + const string engine_platform = string(DuckDB::Platform()); + + string metadata_segment; + metadata_segment.resize(ParsedExtensionMetaData::FOOTER_SIZE); + + if (handle.GetFileSize() < ParsedExtensionMetaData::FOOTER_SIZE) { + throw InvalidInputException( + "File '%s' is not a DuckDB extension. Valid DuckDB extensions must be at least %llu bytes", handle.path, + ParsedExtensionMetaData::FOOTER_SIZE); + } + + handle.Read((void *)metadata_segment.data(), metadata_segment.size(), + handle.GetFileSize() - ParsedExtensionMetaData::FOOTER_SIZE); + + return ParseExtensionMetaData(metadata_segment.data()); +} + +bool ExtensionHelper::CheckExtensionSignature(FileHandle &handle, ParsedExtensionMetaData &parsed_metadata, + const bool allow_community_extensions) { + auto signature_offset = handle.GetFileSize() - ParsedExtensionMetaData::SIGNATURE_SIZE; + + const idx_t maxLenChunks = 1024ULL * 1024ULL; + const idx_t numChunks = (signature_offset + maxLenChunks - 1) / maxLenChunks; + vector hash_chunks(numChunks); + vector splits(numChunks + 1); + + for (idx_t i = 0; i < numChunks; i++) { + splits[i] = maxLenChunks * i; + } + splits.back() = signature_offset; + +#ifndef DUCKDB_NO_THREADS + vector threads; + threads.reserve(numChunks); + for (idx_t i = 0; i < numChunks; i++) { + threads.emplace_back(ComputeSHA256FileSegment, &handle, splits[i], splits[i + 1], &hash_chunks[i]); + } + + for (auto &thread : threads) { + thread.join(); + } +#else + for (idx_t i = 0; i < numChunks; i++) { + ComputeSHA256FileSegment(&handle, splits[i], splits[i + 1], &hash_chunks[i]); + } +#endif // DUCKDB_NO_THREADS + + string hash_concatenation; + hash_concatenation.reserve(32 * numChunks); // 256 bits -> 32 bytes per chunk + + for (auto &hash_chunk : hash_chunks) { + hash_concatenation += hash_chunk; + } + + string two_level_hash; + ComputeSHA256String(hash_concatenation, &two_level_hash); + + // TODO maybe we should do a stream read / hash update here + handle.Read((void *)parsed_metadata.signature.data(), parsed_metadata.signature.size(), signature_offset); + + for (auto &key : ExtensionHelper::GetPublicKeys(allow_community_extensions)) { + if (duckdb_mbedtls::MbedTlsWrapper::IsValidSha256Signature(key, parsed_metadata.signature, two_level_hash)) { + return true; + break; } } - return res; + + return false; } bool ExtensionHelper::TryInitialLoad(DBConfig &config, FileSystem &fs, const string &extension, @@ -100,8 +168,11 @@ bool ExtensionHelper::TryInitialLoad(DBConfig &config, FileSystem &fs, const str } auto filename = fs.ConvertSeparators(extension); + bool direct_load; + // shorthand case if (!ExtensionHelper::IsFullPath(extension)) { + direct_load = false; string extension_name = ApplyExtensionAlias(extension); #ifdef WASM_LOADABLE_EXTENSIONS string url_template = ExtensionUrlTemplate(&config, ""); @@ -121,7 +192,7 @@ bool ExtensionHelper::TryInitialLoad(DBConfig &config, FileSystem &fs, const str return stringOnWasmHeap; }, filename.c_str(), url.c_str()); - std::string address(str); + string address(str); free(str); filename = address; @@ -141,6 +212,7 @@ bool ExtensionHelper::TryInitialLoad(DBConfig &config, FileSystem &fs, const str filename = fs.JoinPath(local_path, extension_name + ".duckdb_extension"); #endif } else { + direct_load = true; filename = fs.ExpandPath(filename); } if (!fs.FileExists(filename)) { @@ -153,133 +225,38 @@ bool ExtensionHelper::TryInitialLoad(DBConfig &config, FileSystem &fs, const str return false; } - string metadata_segment; - metadata_segment.resize(512); - - const std::string engine_version = std::string(GetVersionDirectoryName()); - const std::string engine_platform = std::string(DuckDB::Platform()); - auto handle = fs.OpenFile(filename, FileFlags::FILE_FLAGS_READ); - idx_t file_size = handle->GetFileSize(); - - if (file_size < 1024) { - throw InvalidInputException( - "Extension \"%s\" do not have metadata compatible with DuckDB loading it " - "(version %s, platform %s). File size in particular is lower than minimum threshold of 1024", - filename, engine_version, engine_platform); - } - - auto metadata_offset = file_size - metadata_segment.size(); + // Parse the extension metadata from the extension binary + auto parsed_metadata = ParseExtensionMetaData(*handle); - handle->Read((void *)metadata_segment.data(), metadata_segment.size(), metadata_offset); + auto metadata_mismatch_error = parsed_metadata.GetInvalidMetadataError(); - std::vector metadata_field; - for (idx_t i = 0; i < 8; i++) { - metadata_field.emplace_back(metadata_segment, i * 32, 32); - } - - std::reverse(metadata_field.begin(), metadata_field.end()); - - std::string extension_duckdb_platform = FilterZeroAtEnd(metadata_field[1]); - std::string extension_duckdb_version = FilterZeroAtEnd(metadata_field[2]); - std::string extension_version = FilterZeroAtEnd(metadata_field[3]); - - string metadata_mismatch_error = ""; - { - char a[32] = {0}; - a[0] = '4'; - if (strncmp(a, metadata_field[0].data(), 32) != 0) { - // metadata do not looks right, add this to the error message - metadata_mismatch_error = - "\n" + StringUtil::Format("Extension \"%s\" do not have metadata compatible with DuckDB " - "loading it (version %s, platform %s)", - filename, engine_version, engine_platform); - } else if (engine_version != extension_duckdb_version || engine_platform != extension_duckdb_platform) { - metadata_mismatch_error = "\n" + StringUtil::Format("Extension \"%s\" (version %s, platfrom %s) does not " - "match DuckDB loading it (version %s, platform %s)", - filename, PrettyPrintString(extension_duckdb_version), - PrettyPrintString(extension_duckdb_platform), - engine_version, engine_platform); - - } else { - // All looks good - } + if (!metadata_mismatch_error.empty()) { + metadata_mismatch_error = StringUtil::Format("Failed to load '%s', %s", extension, metadata_mismatch_error); } if (!config.options.allow_unsigned_extensions) { - // signature is the last 256 bytes of the file - string signature(metadata_segment, metadata_segment.size() - 256); - - auto signature_offset = metadata_offset + metadata_segment.size() - signature.size(); - - const idx_t maxLenChunks = 1024ULL * 1024ULL; - const idx_t numChunks = (signature_offset + maxLenChunks - 1) / maxLenChunks; - std::vector hash_chunks(numChunks); - std::vector splits(numChunks + 1); - - for (idx_t i = 0; i < numChunks; i++) { - splits[i] = maxLenChunks * i; - } - splits.back() = signature_offset; + bool signature_valid = + CheckExtensionSignature(*handle, parsed_metadata, config.options.allow_community_extensions); -#ifndef DUCKDB_NO_THREADS - std::vector threads; - threads.reserve(numChunks); - for (idx_t i = 0; i < numChunks; i++) { - threads.emplace_back(ComputeSHA256FileSegment, handle.get(), splits[i], splits[i + 1], &hash_chunks[i]); - } - - for (auto &thread : threads) { - thread.join(); - } -#else - for (idx_t i = 0; i < numChunks; i++) { - ComputeSHA256FileSegment(handle.get(), splits[i], splits[i + 1], &hash_chunks[i]); - } -#endif // DUCKDB_NO_THREADS - - string hash_concatenation; - hash_concatenation.reserve(32 * numChunks); // 256 bits -> 32 bytes per chunk - - for (auto &hash_chunk : hash_chunks) { - hash_concatenation += hash_chunk; - } - - string two_level_hash; - ComputeSHA256String(hash_concatenation, &two_level_hash); - - // TODO maybe we should do a stream read / hash update here - handle->Read((void *)signature.data(), signature.size(), signature_offset); - - bool any_valid = false; - for (auto &key : ExtensionHelper::GetPublicKeys()) { - if (duckdb_mbedtls::MbedTlsWrapper::IsValidSha256Signature(key, signature, two_level_hash)) { - any_valid = true; - break; - } - } - if (!any_valid) { + if (!signature_valid) { throw IOException(config.error_manager->FormatException(ErrorType::UNSIGNED_EXTENSION, filename) + metadata_mismatch_error); } if (!metadata_mismatch_error.empty()) { // Signed extensions perform the full check - throw InvalidInputException(metadata_mismatch_error.substr(1)); + throw InvalidInputException(metadata_mismatch_error); } } else if (!config.options.allow_extensions_metadata_mismatch) { if (!metadata_mismatch_error.empty()) { - // Unsigned extensions AND configuration allowing metadata_mismatch_error, loading allowed, mainly for + // Unsigned extensions AND configuration allowing n, loading allowed, mainly for // debugging purposes - throw InvalidInputException(metadata_mismatch_error.substr(1)); + throw InvalidInputException(metadata_mismatch_error); } } - auto number_metadata_fields = 3; - D_ASSERT(number_metadata_fields == 3); // Currently hardcoded value - metadata_field.resize(number_metadata_fields + 1); - auto filebase = fs.ExtractBaseName(filename); #ifdef WASM_LOADABLE_EXTENSIONS @@ -311,10 +288,33 @@ bool ExtensionHelper::TryInitialLoad(DBConfig &config, FileSystem &fs, const str auto lowercase_extension_name = StringUtil::Lower(filebase); + // Initialize the ExtensionInitResult result.filebase = lowercase_extension_name; - result.extension_version = extension_version; result.filename = filename; result.lib_hdl = lib_hdl; + + if (!direct_load) { + auto info_file_name = filename + ".info"; + + result.install_info = ExtensionInstallInfo::TryReadInfoFile(fs, info_file_name, lowercase_extension_name); + + if (result.install_info->mode == ExtensionInstallMode::UNKNOWN) { + // The info file was missing, we just set the version, since we have it from the parsed footer + result.install_info->version = parsed_metadata.extension_version; + } + + if (result.install_info->version != parsed_metadata.extension_version) { + throw IOException("Metadata mismatch detected when loading extension '%s'\nPlease try reinstalling the " + "extension using `FORCE INSTALL '%s'`", + filename, extension); + } + } else { + result.install_info = make_uniq(); + result.install_info->mode = ExtensionInstallMode::NOT_INSTALLED; + result.install_info->full_path = filename; + result.install_info->version = parsed_metadata.extension_version; + } + return true; #endif } @@ -378,7 +378,9 @@ void ExtensionHelper::LoadExternalExtension(DatabaseInstance &db, FileSystem &fs init_fun_name, res.filename, error.RawMessage()); } - db.SetExtensionLoaded(extension, res.extension_version); + D_ASSERT(res.install_info); + + db.SetExtensionLoaded(extension, *res.install_info); #endif } diff --git a/src/duckdb/src/main/extension/extension_util.cpp b/src/duckdb/src/main/extension/extension_util.cpp index 9d72104c..f2071c78 100644 --- a/src/duckdb/src/main/extension/extension_util.cpp +++ b/src/duckdb/src/main/extension/extension_util.cpp @@ -101,6 +101,11 @@ void ExtensionUtil::RegisterCollation(DatabaseInstance &db, CreateCollationInfo auto data = CatalogTransaction::GetSystemTransaction(db); info.on_conflict = OnCreateConflict::IGNORE_ON_CONFLICT; system_catalog.CreateCollation(data, info); + + // Also register as a function for serialisation + CreateScalarFunctionInfo finfo(info.function); + finfo.on_conflict = OnCreateConflict::IGNORE_ON_CONFLICT; + system_catalog.CreateFunction(data, finfo); } void ExtensionUtil::AddFunctionOverload(DatabaseInstance &db, ScalarFunction function) { @@ -149,9 +154,10 @@ TableFunctionCatalogEntry &ExtensionUtil::GetTableFunction(DatabaseInstance &db, return catalog_entry->Cast(); } -void ExtensionUtil::RegisterType(DatabaseInstance &db, string type_name, LogicalType type) { +void ExtensionUtil::RegisterType(DatabaseInstance &db, string type_name, LogicalType type, + bind_type_modifiers_function_t bind_modifiers) { D_ASSERT(!type_name.empty()); - CreateTypeInfo info(std::move(type_name), std::move(type)); + CreateTypeInfo info(std::move(type_name), std::move(type), bind_modifiers); info.temporary = true; info.internal = true; auto &system_catalog = Catalog::GetSystemCatalog(db); diff --git a/src/duckdb/src/main/extension_install_info.cpp b/src/duckdb/src/main/extension_install_info.cpp new file mode 100644 index 00000000..933a4a96 --- /dev/null +++ b/src/duckdb/src/main/extension_install_info.cpp @@ -0,0 +1,116 @@ +#include "duckdb/main/extension_install_info.hpp" +#include "duckdb/common/string.hpp" +#include "duckdb/common/file_system.hpp" +#include "duckdb/common/serializer/buffered_file_reader.hpp" +#include "duckdb/common/serializer/binary_deserializer.hpp" + +namespace duckdb { + +string ExtensionRepository::GetRepository(const string &repository_url) { + auto resolved_repository = TryConvertUrlToKnownRepository(repository_url); + if (resolved_repository.empty()) { + return repository_url; + } + return resolved_repository; +} + +string ExtensionRepository::TryGetRepositoryUrl(const string &repository) { + if (repository == "core") { + return CORE_REPOSITORY_URL; + } else if (repository == "core_nightly") { + return CORE_NIGHTLY_REPOSITORY_URL; + } else if (repository == "community") { + return COMMUNITY_REPOSITORY_URL; + } else if (repository == "local_build_debug") { + return BUILD_DEBUG_REPOSITORY_PATH; + } else if (repository == "local_build_release") { + return BUILD_RELEASE_REPOSITORY_PATH; + } + return ""; +} + +string ExtensionRepository::TryConvertUrlToKnownRepository(const string &url) { + if (url == CORE_REPOSITORY_URL) { + return "core"; + } else if (url == CORE_NIGHTLY_REPOSITORY_URL) { + return "core_nightly"; + } else if (url == COMMUNITY_REPOSITORY_URL) { + return "community"; + } else if (url == BUILD_DEBUG_REPOSITORY_PATH) { + return "local_build_debug"; + } else if (url == BUILD_RELEASE_REPOSITORY_PATH) { + return "local_build_release"; + } + return ""; +} + +ExtensionRepository ExtensionRepository::GetDefaultRepository(optional_ptr config) { + if (config && !config->options.custom_extension_repo.empty()) { + return ExtensionRepository("", config->options.custom_extension_repo); + } + + return GetCoreRepository(); +} +ExtensionRepository ExtensionRepository::GetDefaultRepository(ClientContext &context) { + auto &config = DBConfig::GetConfig(context); + return GetDefaultRepository(config); +} + +ExtensionRepository ExtensionRepository::GetCoreRepository() { + return {"core", CORE_REPOSITORY_URL}; +} + +ExtensionRepository ExtensionRepository::GetRepositoryByUrl(const string &url) { + if (url.empty()) { + return GetCoreRepository(); + } + + auto repo_name = TryConvertUrlToKnownRepository(url); + return {repo_name, url}; +} + +ExtensionRepository::ExtensionRepository() : name("core"), path(CORE_REPOSITORY_URL) { +} +ExtensionRepository::ExtensionRepository(const string &name_p, const string &path_p) : name(name_p), path(path_p) { +} + +string ExtensionRepository::ToReadableString() { + if (!name.empty()) { + return name; + } + return path; +} + +unique_ptr ExtensionInstallInfo::TryReadInfoFile(FileSystem &fs, + const std::string &info_file_path, + const std::string &extension_name) { + unique_ptr result; + + string hint = StringUtil::Format("Try reinstalling the extension using 'FORCE INSTALL %s;'", extension_name); + + // Return empty info if the file is missing (TODO: throw error here in the future?) + if (!fs.FileExists(info_file_path)) { + return make_uniq(); + } + + BufferedFileReader file_reader(fs, info_file_path.c_str()); + if (!file_reader.Finished()) { + try { + result = BinaryDeserializer::Deserialize(file_reader); + } catch (std::exception &ex) { + ErrorData error(ex); + throw IOException( + "Failed to read info file for '%s' extension: '%s'.\nA serialization error occured: '%s'\n%s", + extension_name, info_file_path, error.RawMessage(), hint); + } + } + + if (!result) { + throw IOException("Failed to read info file for '%s' extension: '%s'.\nThe file appears to be empty!\n%s", + extension_name, info_file_path, hint); + } + + return result; +} + +} // namespace duckdb diff --git a/src/duckdb/src/main/materialized_query_result.cpp b/src/duckdb/src/main/materialized_query_result.cpp index 85bff412..d319d568 100644 --- a/src/duckdb/src/main/materialized_query_result.cpp +++ b/src/duckdb/src/main/materialized_query_result.cpp @@ -73,6 +73,17 @@ ColumnDataCollection &MaterializedQueryResult::Collection() { return *collection; } +unique_ptr MaterializedQueryResult::TakeCollection() { + if (HasError()) { + throw InvalidInputException("Attempting to get collection from an unsuccessful query result\n: Error %s", + GetError()); + } + if (!collection) { + throw InternalException("Missing collection from materialized query result"); + } + return std::move(collection); +} + unique_ptr MaterializedQueryResult::Fetch() { return FetchRaw(); } diff --git a/src/duckdb/src/main/query_profiler.cpp b/src/duckdb/src/main/query_profiler.cpp index 176b1e43..79e30206 100644 --- a/src/duckdb/src/main/query_profiler.cpp +++ b/src/duckdb/src/main/query_profiler.cpp @@ -313,7 +313,7 @@ static string DrawPadded(const string &str, idx_t width) { } else { width -= str.size(); auto half_spaces = width / 2; - auto extra_left_space = width % 2 != 0 ? 1 : 0; + auto extra_left_space = NumericCast(width % 2 != 0 ? 1 : 0); return string(half_spaces + extra_left_space, ' ') + str + string(half_spaces, ' '); } } diff --git a/src/duckdb/src/main/relation.cpp b/src/duckdb/src/main/relation.cpp index 970ab4a5..6215b037 100644 --- a/src/duckdb/src/main/relation.cpp +++ b/src/duckdb/src/main/relation.cpp @@ -39,7 +39,7 @@ shared_ptr Relation::Project(const string &expression, const string &a shared_ptr Relation::Project(const string &select_list, const vector &aliases) { auto expressions = Parser::ParseExpressionList(select_list, context.GetContext()->GetParserOptions()); - return make_shared(shared_from_this(), std::move(expressions), aliases); + return make_shared_ptr(shared_from_this(), std::move(expressions), aliases); } shared_ptr Relation::Project(const vector &expressions) { @@ -49,7 +49,7 @@ shared_ptr Relation::Project(const vector &expressions) { shared_ptr Relation::Project(vector> expressions, const vector &aliases) { - return make_shared(shared_from_this(), std::move(expressions), aliases); + return make_shared_ptr(shared_from_this(), std::move(expressions), aliases); } static vector> StringListToExpressionList(ClientContext &context, @@ -70,7 +70,7 @@ static vector> StringListToExpressionList(ClientCon shared_ptr Relation::Project(const vector &expressions, const vector &aliases) { auto result_list = StringListToExpressionList(*context.GetContext(), expressions); - return make_shared(shared_from_this(), std::move(result_list), aliases); + return make_shared_ptr(shared_from_this(), std::move(result_list), aliases); } shared_ptr Relation::Filter(const string &expression) { @@ -82,7 +82,7 @@ shared_ptr Relation::Filter(const string &expression) { } shared_ptr Relation::Filter(unique_ptr expression) { - return make_shared(shared_from_this(), std::move(expression)); + return make_shared_ptr(shared_from_this(), std::move(expression)); } shared_ptr Relation::Filter(const vector &expressions) { @@ -95,11 +95,11 @@ shared_ptr Relation::Filter(const vector &expressions) { expr = make_uniq(ExpressionType::CONJUNCTION_AND, std::move(expr), std::move(expression_list[i])); } - return make_shared(shared_from_this(), std::move(expr)); + return make_shared_ptr(shared_from_this(), std::move(expr)); } shared_ptr Relation::Limit(int64_t limit, int64_t offset) { - return make_shared(shared_from_this(), limit, offset); + return make_shared_ptr(shared_from_this(), limit, offset); } shared_ptr Relation::Order(const string &expression) { @@ -108,7 +108,7 @@ shared_ptr Relation::Order(const string &expression) { } shared_ptr Relation::Order(vector order_list) { - return make_shared(shared_from_this(), std::move(order_list)); + return make_shared_ptr(shared_from_this(), std::move(order_list)); } shared_ptr Relation::Order(const vector &expressions) { @@ -149,51 +149,51 @@ shared_ptr Relation::Join(const shared_ptr &other, } using_columns.push_back(colref.column_names[0]); } - return make_shared(shared_from_this(), other, std::move(using_columns), type, ref_type); + return make_shared_ptr(shared_from_this(), other, std::move(using_columns), type, ref_type); } else { // single expression that is not a column reference: use the expression as a join condition - return make_shared(shared_from_this(), other, std::move(expression_list[0]), type, ref_type); + return make_shared_ptr(shared_from_this(), other, std::move(expression_list[0]), type, ref_type); } } shared_ptr Relation::CrossProduct(const shared_ptr &other, JoinRefType join_ref_type) { - return make_shared(shared_from_this(), other, join_ref_type); + return make_shared_ptr(shared_from_this(), other, join_ref_type); } shared_ptr Relation::Union(const shared_ptr &other) { - return make_shared(shared_from_this(), other, SetOperationType::UNION, true); + return make_shared_ptr(shared_from_this(), other, SetOperationType::UNION, true); } shared_ptr Relation::Except(const shared_ptr &other) { - return make_shared(shared_from_this(), other, SetOperationType::EXCEPT, true); + return make_shared_ptr(shared_from_this(), other, SetOperationType::EXCEPT, true); } shared_ptr Relation::Intersect(const shared_ptr &other) { - return make_shared(shared_from_this(), other, SetOperationType::INTERSECT, true); + return make_shared_ptr(shared_from_this(), other, SetOperationType::INTERSECT, true); } shared_ptr Relation::Distinct() { - return make_shared(shared_from_this()); + return make_shared_ptr(shared_from_this()); } shared_ptr Relation::Alias(const string &alias) { - return make_shared(shared_from_this(), alias); + return make_shared_ptr(shared_from_this(), alias); } shared_ptr Relation::Aggregate(const string &aggregate_list) { auto expression_list = Parser::ParseExpressionList(aggregate_list, context.GetContext()->GetParserOptions()); - return make_shared(shared_from_this(), std::move(expression_list)); + return make_shared_ptr(shared_from_this(), std::move(expression_list)); } shared_ptr Relation::Aggregate(const string &aggregate_list, const string &group_list) { auto expression_list = Parser::ParseExpressionList(aggregate_list, context.GetContext()->GetParserOptions()); auto groups = Parser::ParseGroupByList(group_list, context.GetContext()->GetParserOptions()); - return make_shared(shared_from_this(), std::move(expression_list), std::move(groups)); + return make_shared_ptr(shared_from_this(), std::move(expression_list), std::move(groups)); } shared_ptr Relation::Aggregate(const vector &aggregates) { auto aggregate_list = StringListToExpressionList(*context.GetContext(), aggregates); - return make_shared(shared_from_this(), std::move(aggregate_list)); + return make_shared_ptr(shared_from_this(), std::move(aggregate_list)); } shared_ptr Relation::Aggregate(const vector &aggregates, const vector &groups) { @@ -204,7 +204,7 @@ shared_ptr Relation::Aggregate(const vector &aggregates, const shared_ptr Relation::Aggregate(vector> expressions, const string &group_list) { auto groups = Parser::ParseGroupByList(group_list, context.GetContext()->GetParserOptions()); - return make_shared(shared_from_this(), std::move(expressions), std::move(groups)); + return make_shared_ptr(shared_from_this(), std::move(expressions), std::move(groups)); } string Relation::GetAlias() { @@ -237,7 +237,7 @@ BoundStatement Relation::Bind(Binder &binder) { } shared_ptr Relation::InsertRel(const string &schema_name, const string &table_name) { - return make_shared(shared_from_this(), schema_name, table_name); + return make_shared_ptr(shared_from_this(), schema_name, table_name); } void Relation::Insert(const string &table_name) { @@ -255,12 +255,12 @@ void Relation::Insert(const string &schema_name, const string &table_name) { void Relation::Insert(const vector> &values) { vector column_names; - auto rel = make_shared(context.GetContext(), values, std::move(column_names), "values"); + auto rel = make_shared_ptr(context.GetContext(), values, std::move(column_names), "values"); rel->Insert(GetAlias()); } shared_ptr Relation::CreateRel(const string &schema_name, const string &table_name) { - return make_shared(shared_from_this(), schema_name, table_name); + return make_shared_ptr(shared_from_this(), schema_name, table_name); } void Relation::Create(const string &table_name) { @@ -277,7 +277,7 @@ void Relation::Create(const string &schema_name, const string &table_name) { } shared_ptr Relation::WriteCSVRel(const string &csv_file, case_insensitive_map_t> options) { - return std::make_shared(shared_from_this(), csv_file, std::move(options)); + return make_shared_ptr(shared_from_this(), csv_file, std::move(options)); } void Relation::WriteCSV(const string &csv_file, case_insensitive_map_t> options) { @@ -292,7 +292,7 @@ void Relation::WriteCSV(const string &csv_file, case_insensitive_map_t Relation::WriteParquetRel(const string &parquet_file, case_insensitive_map_t> options) { auto write_parquet = - std::make_shared(shared_from_this(), parquet_file, std::move(options)); + make_shared_ptr(shared_from_this(), parquet_file, std::move(options)); return std::move(write_parquet); } @@ -310,7 +310,7 @@ shared_ptr Relation::CreateView(const string &name, bool replace, bool } shared_ptr Relation::CreateView(const string &schema_name, const string &name, bool replace, bool temporary) { - auto view = make_shared(shared_from_this(), schema_name, name, replace, temporary); + auto view = make_shared_ptr(shared_from_this(), schema_name, name, replace, temporary); auto res = view->Execute(); if (res->HasError()) { const string prepended_message = "Failed to create view '" + name + "': "; @@ -329,7 +329,7 @@ unique_ptr Relation::Query(const string &name, const string &sql) { } unique_ptr Relation::Explain(ExplainType type) { - auto explain = make_shared(shared_from_this(), type); + auto explain = make_shared_ptr(shared_from_this(), type); return explain->Execute(); } @@ -343,12 +343,12 @@ void Relation::Delete(const string &condition) { shared_ptr Relation::TableFunction(const std::string &fname, const vector &values, const named_parameter_map_t &named_parameters) { - return make_shared(context.GetContext(), fname, values, named_parameters, - shared_from_this()); + return make_shared_ptr(context.GetContext(), fname, values, named_parameters, + shared_from_this()); } shared_ptr Relation::TableFunction(const std::string &fname, const vector &values) { - return make_shared(context.GetContext(), fname, values, shared_from_this()); + return make_shared_ptr(context.GetContext(), fname, values, shared_from_this()); } string Relation::ToString() { @@ -374,7 +374,7 @@ unique_ptr Relation::GetQueryNode() { } void Relation::Head(idx_t limit) { - auto limit_node = Limit(limit); + auto limit_node = Limit(NumericCast(limit)); limit_node->Execute()->Print(); } // LCOV_EXCL_STOP @@ -387,12 +387,16 @@ string Relation::RenderWhitespace(idx_t depth) { return string(depth * 2, ' '); } +void Relation::AddExternalDependency(shared_ptr dependency) { + external_dependencies.push_back(std::move(dependency)); +} + vector> Relation::GetAllDependencies() { vector> all_dependencies; Relation *cur = this; while (cur) { - if (cur->extra_dependencies) { - all_dependencies.push_back(cur->extra_dependencies); + for (auto &dep : cur->external_dependencies) { + all_dependencies.push_back(dep); } cur = cur->ChildRelation(); } diff --git a/src/duckdb/src/main/relation/create_view_relation.cpp b/src/duckdb/src/main/relation/create_view_relation.cpp index b9c80c07..92dcf755 100644 --- a/src/duckdb/src/main/relation/create_view_relation.cpp +++ b/src/duckdb/src/main/relation/create_view_relation.cpp @@ -9,6 +9,9 @@ CreateViewRelation::CreateViewRelation(shared_ptr child_p, string view bool temporary_p) : Relation(child_p->context, RelationType::CREATE_VIEW_RELATION), child(std::move(child_p)), view_name(std::move(view_name_p)), replace(replace_p), temporary(temporary_p) { + if (child->type == RelationType::MATERIALIZED_RELATION) { + throw NotImplementedException("Creating a VIEW from a MaterializedRelation is not supported"); + } context.GetContext()->TryBindRelation(*this, this->columns); } @@ -17,6 +20,9 @@ CreateViewRelation::CreateViewRelation(shared_ptr child_p, string sche : Relation(child_p->context, RelationType::CREATE_VIEW_RELATION), child(std::move(child_p)), schema_name(std::move(schema_name_p)), view_name(std::move(view_name_p)), replace(replace_p), temporary(temporary_p) { + if (child->type == RelationType::MATERIALIZED_RELATION) { + throw NotImplementedException("Creating a VIEW from a MaterializedRelation is not supported"); + } context.GetContext()->TryBindRelation(*this, this->columns); } diff --git a/src/duckdb/src/main/relation/materialized_relation.cpp b/src/duckdb/src/main/relation/materialized_relation.cpp new file mode 100644 index 00000000..4445240e --- /dev/null +++ b/src/duckdb/src/main/relation/materialized_relation.cpp @@ -0,0 +1,58 @@ +#include "duckdb/main/relation/materialized_relation.hpp" +#include "duckdb/parser/query_node/select_node.hpp" +#include "duckdb/main/client_context.hpp" +#include "duckdb/planner/bound_statement.hpp" +#include "duckdb/planner/operator/logical_column_data_get.hpp" +#include "duckdb/parser/tableref/column_data_ref.hpp" +#include "duckdb/parser/expression/star_expression.hpp" +#include "duckdb/common/exception.hpp" + +namespace duckdb { + +MaterializedRelation::MaterializedRelation(const shared_ptr &context, + unique_ptr &&collection_p, vector names, + string alias_p) + : Relation(context, RelationType::MATERIALIZED_RELATION), collection(std::move(collection_p)), + alias(std::move(alias_p)) { + // create constant expressions for the values + auto types = collection->Types(); + D_ASSERT(types.size() == names.size()); + + QueryResult::DeduplicateColumns(names); + for (idx_t i = 0; i < types.size(); i++) { + auto &type = types[i]; + auto &name = names[i]; + auto column_definition = ColumnDefinition(name, type); + columns.push_back(std::move(column_definition)); + } +} + +unique_ptr MaterializedRelation::GetQueryNode() { + auto result = make_uniq(); + result->select_list.push_back(make_uniq()); + result->from_table = GetTableRef(); + return std::move(result); +} + +unique_ptr MaterializedRelation::GetTableRef() { + auto table_ref = make_uniq(*collection); + for (auto &col : columns) { + table_ref->expected_names.push_back(col.Name()); + } + table_ref->alias = GetAlias(); + return std::move(table_ref); +} + +string MaterializedRelation::GetAlias() { + return alias; +} + +const vector &MaterializedRelation::Columns() { + return columns; +} + +string MaterializedRelation::ToString(idx_t depth) { + return collection->ToString(); +} + +} // namespace duckdb diff --git a/src/duckdb/src/main/relation/query_relation.cpp b/src/duckdb/src/main/relation/query_relation.cpp index f6421601..03a3d62e 100644 --- a/src/duckdb/src/main/relation/query_relation.cpp +++ b/src/duckdb/src/main/relation/query_relation.cpp @@ -2,14 +2,33 @@ #include "duckdb/main/client_context.hpp" #include "duckdb/parser/statement/select_statement.hpp" #include "duckdb/parser/tableref/subqueryref.hpp" +#include "duckdb/parser/tableref/joinref.hpp" #include "duckdb/parser/parser.hpp" +#include "duckdb/planner/bound_statement.hpp" +#include "duckdb/planner/binder.hpp" +#include "duckdb/parser/query_node/select_node.hpp" +#include "duckdb/planner/query_node/bound_select_node.hpp" namespace duckdb { -QueryRelation::QueryRelation(const std::shared_ptr &context, unique_ptr select_stmt_p, +static void InitializeTableRefDependency(TableRef &ref) { + if (ref.type == TableReferenceType::JOIN) { + auto &join_ref = ref.Cast(); + InitializeTableRefDependency(*join_ref.right); + InitializeTableRefDependency(*join_ref.left); + } else { + ref.external_dependency = make_shared_ptr(); + } +} + +QueryRelation::QueryRelation(const shared_ptr &context, unique_ptr select_stmt_p, string alias_p) : Relation(context, RelationType::QUERY_RELATION), select_stmt(std::move(select_stmt_p)), alias(std::move(alias_p)) { + if (select_stmt->node->type == QueryNodeType::SELECT_NODE) { + auto &ref = *select_stmt->node->Cast().from_table; + InitializeTableRefDependency(ref); + } context->TryBindRelation(*this, this->columns); } diff --git a/src/duckdb/src/main/relation/read_csv_relation.cpp b/src/duckdb/src/main/relation/read_csv_relation.cpp index 1500720e..4c37e301 100644 --- a/src/duckdb/src/main/relation/read_csv_relation.cpp +++ b/src/duckdb/src/main/relation/read_csv_relation.cpp @@ -30,7 +30,7 @@ static Value CreateValueFromFileList(const vector &file_list) { return Value::LIST(std::move(files)); } -ReadCSVRelation::ReadCSVRelation(const std::shared_ptr &context, const vector &input, +ReadCSVRelation::ReadCSVRelation(const shared_ptr &context, const vector &input, named_parameter_map_t &&options, string alias_p) : TableFunctionRelation(context, "read_csv_auto", {CreateValueFromFileList(input)}, nullptr, false), alias(std::move(alias_p)) { @@ -39,8 +39,10 @@ ReadCSVRelation::ReadCSVRelation(const std::shared_ptr &context, auto file_list = CreateValueFromFileList(input); + auto multi_file_reader = MultiFileReader::CreateDefault("ReadCSVRelation"); vector files; - context->RunFunctionInTransaction([&]() { files = MultiFileReader::GetFileList(*context, file_list, "CSV"); }); + context->RunFunctionInTransaction( + [&]() { files = multi_file_reader->CreateFileList(*context, file_list)->GetAllFiles(); }); D_ASSERT(!files.empty()); auto &file_name = files[0]; @@ -56,7 +58,7 @@ ReadCSVRelation::ReadCSVRelation(const std::shared_ptr &context, shared_ptr buffer_manager; context->RunFunctionInTransaction([&]() { - buffer_manager = make_shared(*context, csv_options, files[0], 0); + buffer_manager = make_shared_ptr(*context, csv_options, files[0], 0); CSVSniffer sniffer(csv_options, buffer_manager, CSVStateMachineCache::Get(*context)); auto sniffer_result = sniffer.SniffCSV(); auto &types = sniffer_result.return_types; diff --git a/src/duckdb/src/main/relation/table_relation.cpp b/src/duckdb/src/main/relation/table_relation.cpp index b4954e3d..4a0ff6e0 100644 --- a/src/duckdb/src/main/relation/table_relation.cpp +++ b/src/duckdb/src/main/relation/table_relation.cpp @@ -9,7 +9,7 @@ namespace duckdb { -TableRelation::TableRelation(const std::shared_ptr &context, unique_ptr description) +TableRelation::TableRelation(const shared_ptr &context, unique_ptr description) : Relation(context, RelationType::TABLE_RELATION), description(std::move(description)) { } @@ -56,14 +56,14 @@ void TableRelation::Update(const string &update_list, const string &condition) { vector> expressions; auto cond = ParseCondition(*context.GetContext(), condition); Parser::ParseUpdateList(update_list, update_columns, expressions, context.GetContext()->GetParserOptions()); - auto update = make_shared(context, std::move(cond), description->schema, description->table, - std::move(update_columns), std::move(expressions)); + auto update = make_shared_ptr(context, std::move(cond), description->schema, description->table, + std::move(update_columns), std::move(expressions)); update->Execute(); } void TableRelation::Delete(const string &condition) { auto cond = ParseCondition(*context.GetContext(), condition); - auto del = make_shared(context, std::move(cond), description->schema, description->table); + auto del = make_shared_ptr(context, std::move(cond), description->schema, description->table); del->Execute(); } diff --git a/src/duckdb/src/main/relation/value_relation.cpp b/src/duckdb/src/main/relation/value_relation.cpp index fe611700..3e11ed6b 100644 --- a/src/duckdb/src/main/relation/value_relation.cpp +++ b/src/duckdb/src/main/relation/value_relation.cpp @@ -8,7 +8,7 @@ namespace duckdb { -ValueRelation::ValueRelation(const std::shared_ptr &context, const vector> &values, +ValueRelation::ValueRelation(const shared_ptr &context, const vector> &values, vector names_p, string alias_p) : Relation(context, RelationType::VALUE_LIST_RELATION), names(std::move(names_p)), alias(std::move(alias_p)) { // create constant expressions for the values @@ -24,7 +24,7 @@ ValueRelation::ValueRelation(const std::shared_ptr &context, cons context->TryBindRelation(*this, this->columns); } -ValueRelation::ValueRelation(const std::shared_ptr &context, const string &values_list, +ValueRelation::ValueRelation(const shared_ptr &context, const string &values_list, vector names_p, string alias_p) : Relation(context, RelationType::VALUE_LIST_RELATION), names(std::move(names_p)), alias(std::move(alias_p)) { this->expressions = Parser::ParseValuesList(values_list, context->GetParserOptions()); diff --git a/src/duckdb/src/main/relation/view_relation.cpp b/src/duckdb/src/main/relation/view_relation.cpp index b432f5d3..f6f18067 100644 --- a/src/duckdb/src/main/relation/view_relation.cpp +++ b/src/duckdb/src/main/relation/view_relation.cpp @@ -7,7 +7,7 @@ namespace duckdb { -ViewRelation::ViewRelation(const std::shared_ptr &context, string schema_name_p, string view_name_p) +ViewRelation::ViewRelation(const shared_ptr &context, string schema_name_p, string view_name_p) : Relation(context, RelationType::VIEW_RELATION), schema_name(std::move(schema_name_p)), view_name(std::move(view_name_p)) { context->TryBindRelation(*this, this->columns); diff --git a/src/duckdb/src/main/relation/write_csv_relation.cpp b/src/duckdb/src/main/relation/write_csv_relation.cpp index 016ea018..a521f8ca 100644 --- a/src/duckdb/src/main/relation/write_csv_relation.cpp +++ b/src/duckdb/src/main/relation/write_csv_relation.cpp @@ -15,8 +15,8 @@ WriteCSVRelation::WriteCSVRelation(shared_ptr child_p, string csv_file BoundStatement WriteCSVRelation::Bind(Binder &binder) { CopyStatement copy; - copy.select_statement = child->GetQueryNode(); auto info = make_uniq(); + info->select_statement = child->GetQueryNode(); info->is_from = false; info->file_path = csv_file; info->format = "csv"; diff --git a/src/duckdb/src/main/relation/write_parquet_relation.cpp b/src/duckdb/src/main/relation/write_parquet_relation.cpp index 6cedc29c..c2d937a2 100644 --- a/src/duckdb/src/main/relation/write_parquet_relation.cpp +++ b/src/duckdb/src/main/relation/write_parquet_relation.cpp @@ -15,8 +15,8 @@ WriteParquetRelation::WriteParquetRelation(shared_ptr child_p, string BoundStatement WriteParquetRelation::Bind(Binder &binder) { CopyStatement copy; - copy.select_statement = child->GetQueryNode(); auto info = make_uniq(); + info->select_statement = child->GetQueryNode(); info->is_from = false; info->file_path = parquet_file; info->format = "parquet"; diff --git a/src/duckdb/src/main/secret/secret.cpp b/src/duckdb/src/main/secret/secret.cpp index 450e5621..097a2194 100644 --- a/src/duckdb/src/main/secret/secret.cpp +++ b/src/duckdb/src/main/secret/secret.cpp @@ -15,7 +15,7 @@ int64_t BaseSecret::MatchScore(const string &path) const { continue; } if (StringUtil::StartsWith(path, prefix)) { - longest_match = MaxValue(prefix.length(), longest_match); + longest_match = MaxValue(NumericCast(prefix.length()), longest_match); } } return longest_match; diff --git a/src/duckdb/src/main/settings/settings.cpp b/src/duckdb/src/main/settings/settings.cpp index 36d0036c..6db7a8c9 100644 --- a/src/duckdb/src/main/settings/settings.cpp +++ b/src/duckdb/src/main/settings/settings.cpp @@ -476,6 +476,36 @@ Value AllowUnsignedExtensionsSetting::GetSetting(const ClientContext &context) { return Value::BOOLEAN(config.options.allow_unsigned_extensions); } +//===--------------------------------------------------------------------===// +// Allow Community Extensions +//===--------------------------------------------------------------------===// +void AllowCommunityExtensionsSetting::SetGlobal(DatabaseInstance *db, DBConfig &config, const Value &input) { + if (db && !config.options.allow_community_extensions) { + auto new_value = input.GetValue(); + if (new_value) { + throw InvalidInputException("Cannot upgrade allow_community_extensions setting while database is running"); + } + return; + } + auto new_value = input.GetValue(); + config.options.allow_community_extensions = new_value; +} + +void AllowCommunityExtensionsSetting::ResetGlobal(DatabaseInstance *db, DBConfig &config) { + if (db && !config.options.allow_community_extensions) { + if (DBConfig().options.allow_community_extensions) { + throw InvalidInputException("Cannot upgrade allow_community_extensions setting while database is running"); + } + return; + } + config.options.allow_community_extensions = DBConfig().options.allow_community_extensions; +} + +Value AllowCommunityExtensionsSetting::GetSetting(const ClientContext &context) { + auto &config = DBConfig::GetConfig(context); + return Value::BOOLEAN(config.options.allow_community_extensions); +} + //===--------------------------------------------------------------------===// // Allow Extensions Metadata Mismatch //===--------------------------------------------------------------------===// @@ -532,6 +562,26 @@ Value EnableObjectCacheSetting::GetSetting(const ClientContext &context) { return Value::BOOLEAN(config.options.object_cache_enable); } +//===--------------------------------------------------------------------===// +// Storage Compatibility Version (for serialization) +//===--------------------------------------------------------------------===// +void StorageCompatibilityVersion::SetGlobal(DatabaseInstance *db, DBConfig &config, const Value &input) { + auto version_string = input.GetValue(); + auto serialization_compatibility = SerializationCompatibility::FromString(version_string); + config.options.serialization_compatibility = serialization_compatibility; +} + +void StorageCompatibilityVersion::ResetGlobal(DatabaseInstance *db, DBConfig &config) { + config.options.serialization_compatibility = DBConfig().options.serialization_compatibility; +} + +Value StorageCompatibilityVersion::GetSetting(const ClientContext &context) { + auto &config = DBConfig::GetConfig(context); + + auto &version_name = config.options.serialization_compatibility.duckdb_version; + return Value(version_name); +} + //===--------------------------------------------------------------------===// // Enable HTTP Metadata Cache //===--------------------------------------------------------------------===// @@ -766,7 +816,7 @@ void ExternalThreadsSetting::SetGlobal(DatabaseInstance *db, DBConfig &config, c if (new_val < 0) { throw SyntaxException("Must have a non-negative number of external threads!"); } - idx_t new_external_threads = new_val; + auto new_external_threads = NumericCast(new_val); if (db) { TaskScheduler::GetScheduler(*db).SetThreads(config.options.maximum_threads, new_external_threads); } @@ -783,7 +833,7 @@ void ExternalThreadsSetting::ResetGlobal(DatabaseInstance *db, DBConfig &config) Value ExternalThreadsSetting::GetSetting(const ClientContext &context) { auto &config = DBConfig::GetConfig(context); - return Value::BIGINT(config.options.external_threads); + return Value::BIGINT(NumericCast(config.options.external_threads)); } //===--------------------------------------------------------------------===// @@ -975,7 +1025,7 @@ Value MaximumExpressionDepthSetting::GetSetting(const ClientContext &context) { void MaximumMemorySetting::SetGlobal(DatabaseInstance *db, DBConfig &config, const Value &input) { config.options.maximum_memory = DBConfig::ParseMemoryLimit(input.ToString()); if (db) { - BufferManager::GetBufferManager(*db).SetLimit(config.options.maximum_memory); + BufferManager::GetBufferManager(*db).SetMemoryLimit(config.options.maximum_memory); } } @@ -988,6 +1038,51 @@ Value MaximumMemorySetting::GetSetting(const ClientContext &context) { return Value(StringUtil::BytesToHumanReadableString(config.options.maximum_memory)); } +//===--------------------------------------------------------------------===// +// Maximum Temp Directory Size +//===--------------------------------------------------------------------===// +void MaximumTempDirectorySize::SetGlobal(DatabaseInstance *db, DBConfig &config, const Value &input) { + auto maximum_swap_space = DBConfig::ParseMemoryLimit(input.ToString()); + if (maximum_swap_space == DConstants::INVALID_INDEX) { + // We use INVALID_INDEX to indicate that the value is not set by the user + // use one lower to indicate 'unlimited' + maximum_swap_space--; + } + if (!db) { + config.options.maximum_swap_space = maximum_swap_space; + return; + } + auto &buffer_manager = BufferManager::GetBufferManager(*db); + buffer_manager.SetSwapLimit(maximum_swap_space); + config.options.maximum_swap_space = maximum_swap_space; +} + +void MaximumTempDirectorySize::ResetGlobal(DatabaseInstance *db, DBConfig &config) { + config.options.maximum_swap_space = DConstants::INVALID_INDEX; + if (!db) { + return; + } + auto &buffer_manager = BufferManager::GetBufferManager(*db); + buffer_manager.SetSwapLimit(); +} + +Value MaximumTempDirectorySize::GetSetting(const ClientContext &context) { + auto &config = DBConfig::GetConfig(context); + if (config.options.maximum_swap_space != DConstants::INVALID_INDEX) { + // Explicitly set by the user + return Value(StringUtil::BytesToHumanReadableString(config.options.maximum_swap_space)); + } + auto &buffer_manager = BufferManager::GetBufferManager(context); + // Database is initialized, use the setting from the temporary directory + auto max_swap = buffer_manager.GetMaxSwap(); + if (max_swap.IsValid()) { + return Value(StringUtil::BytesToHumanReadableString(max_swap.GetIndex())); + } else { + // The temp directory has not been used yet + return Value(StringUtil::BytesToHumanReadableString(0)); + } +} + //===--------------------------------------------------------------------===// // Old Implicit Casting //===--------------------------------------------------------------------===// @@ -1017,7 +1112,7 @@ void PartitionedWriteFlushThreshold::SetLocal(ClientContext &context, const Valu } Value PartitionedWriteFlushThreshold::GetSetting(const ClientContext &context) { - return Value::BIGINT(ClientConfig::GetConfig(context).partitioned_write_flush_threshold); + return Value::BIGINT(NumericCast(ClientConfig::GetConfig(context).partitioned_write_flush_threshold)); } //===--------------------------------------------------------------------===// @@ -1047,11 +1142,11 @@ void PerfectHashThresholdSetting::SetLocal(ClientContext &context, const Value & if (bits < 0 || bits > 32) { throw ParserException("Perfect HT threshold out of range: should be within range 0 - 32"); } - ClientConfig::GetConfig(context).perfect_ht_threshold = bits; + ClientConfig::GetConfig(context).perfect_ht_threshold = NumericCast(bits); } Value PerfectHashThresholdSetting::GetSetting(const ClientContext &context) { - return Value::BIGINT(ClientConfig::GetConfig(context).perfect_ht_threshold); + return Value::BIGINT(NumericCast(ClientConfig::GetConfig(context).perfect_ht_threshold)); } //===--------------------------------------------------------------------===// @@ -1066,7 +1161,7 @@ void PivotFilterThreshold::SetLocal(ClientContext &context, const Value &input) } Value PivotFilterThreshold::GetSetting(const ClientContext &context) { - return Value::BIGINT(ClientConfig::GetConfig(context).pivot_filter_threshold); + return Value::BIGINT(NumericCast(ClientConfig::GetConfig(context).pivot_filter_threshold)); } //===--------------------------------------------------------------------===// @@ -1081,7 +1176,7 @@ void PivotLimitSetting::SetLocal(ClientContext &context, const Value &input) { } Value PivotLimitSetting::GetSetting(const ClientContext &context) { - return Value::BIGINT(ClientConfig::GetConfig(context).pivot_limit); + return Value::BIGINT(NumericCast(ClientConfig::GetConfig(context).pivot_limit)); } //===--------------------------------------------------------------------===// @@ -1276,7 +1371,8 @@ void TempDirectorySetting::SetGlobal(DatabaseInstance *db, DBConfig &config, con } void TempDirectorySetting::ResetGlobal(DatabaseInstance *db, DBConfig &config) { - config.options.temporary_directory = DBConfig().options.temporary_directory; + config.SetDefaultTempDirectory(); + config.options.use_temporary_directory = DBConfig().options.use_temporary_directory; if (db) { auto &buffer_manager = BufferManager::GetBufferManager(*db); @@ -1297,7 +1393,7 @@ void ThreadsSetting::SetGlobal(DatabaseInstance *db, DBConfig &config, const Val if (new_val < 1) { throw SyntaxException("Must have at least 1 thread!"); } - idx_t new_maximum_threads = new_val; + auto new_maximum_threads = NumericCast(new_val); if (db) { TaskScheduler::GetScheduler(*db).SetThreads(new_maximum_threads, config.options.external_threads); } @@ -1314,7 +1410,7 @@ void ThreadsSetting::ResetGlobal(DatabaseInstance *db, DBConfig &config) { Value ThreadsSetting::GetSetting(const ClientContext &context) { auto &config = DBConfig::GetConfig(context); - return Value::BIGINT(config.options.maximum_threads); + return Value::BIGINT(NumericCast(config.options.maximum_threads)); } //===--------------------------------------------------------------------===// @@ -1403,4 +1499,34 @@ Value CustomUserAgentSetting::GetSetting(const ClientContext &context) { return Value(config.options.custom_user_agent); } +//===--------------------------------------------------------------------===// +// EnableHTTPLogging Setting +//===--------------------------------------------------------------------===// +void EnableHTTPLoggingSetting::ResetLocal(ClientContext &context) { + ClientConfig::GetConfig(context).enable_http_logging = ClientConfig().enable_http_logging; +} + +void EnableHTTPLoggingSetting::SetLocal(ClientContext &context, const Value &input) { + ClientConfig::GetConfig(context).enable_http_logging = input.GetValue(); +} + +Value EnableHTTPLoggingSetting::GetSetting(const ClientContext &context) { + return Value(ClientConfig::GetConfig(context).enable_http_logging); +} + +//===--------------------------------------------------------------------===// +// HTTPLoggingOutput Setting +//===--------------------------------------------------------------------===// +void HTTPLoggingOutputSetting::ResetLocal(ClientContext &context) { + ClientConfig::GetConfig(context).http_logging_output = ClientConfig().http_logging_output; +} + +void HTTPLoggingOutputSetting::SetLocal(ClientContext &context, const Value &input) { + ClientConfig::GetConfig(context).http_logging_output = input.GetValue(); +} + +Value HTTPLoggingOutputSetting::GetSetting(const ClientContext &context) { + return Value(ClientConfig::GetConfig(context).http_logging_output); +} + } // namespace duckdb diff --git a/src/duckdb/src/optimizer/common_aggregate_optimizer.cpp b/src/duckdb/src/optimizer/common_aggregate_optimizer.cpp index da13092c..435b94cd 100644 --- a/src/duckdb/src/optimizer/common_aggregate_optimizer.cpp +++ b/src/duckdb/src/optimizer/common_aggregate_optimizer.cpp @@ -47,7 +47,7 @@ void CommonAggregateOptimizer::ExtractCommonAggregates(LogicalAggregate &aggr) { } else { // aggregate already exists! we can remove this entry total_erased++; - aggr.expressions.erase(aggr.expressions.begin() + i); + aggr.expressions.erase_at(i); i--; // we need to remap any references to this aggregate so they point to the other aggregate ColumnBinding original_binding(aggr.aggregate_index, original_index); diff --git a/src/duckdb/src/optimizer/filter_combiner.cpp b/src/duckdb/src/optimizer/filter_combiner.cpp index cd6f3319..97cabfba 100644 --- a/src/duckdb/src/optimizer/filter_combiner.cpp +++ b/src/duckdb/src/optimizer/filter_combiner.cpp @@ -67,7 +67,7 @@ FilterResult FilterCombiner::AddConstantComparison(vector &column_id table_filters.PushFilter(column_index, std::move(upper_bound)); table_filters.PushFilter(column_index, make_uniq()); - remaining_filters.erase(remaining_filters.begin() + rem_fil_idx); + remaining_filters.erase_at(rem_fil_idx); } } @@ -971,7 +971,7 @@ unique_ptr FilterCombiner::FindTransitiveFilter(Expression &expr) { auto &comparison = remaining_filters[i]->Cast(); if (expr.Equals(*comparison.right) && comparison.type != ExpressionType::COMPARE_NOTEQUAL) { auto filter = std::move(remaining_filters[i]); - remaining_filters.erase(remaining_filters.begin() + i); + remaining_filters.erase_at(i); return filter; } } diff --git a/src/duckdb/src/optimizer/filter_pushdown.cpp b/src/duckdb/src/optimizer/filter_pushdown.cpp index 35d756a9..856b031f 100644 --- a/src/duckdb/src/optimizer/filter_pushdown.cpp +++ b/src/duckdb/src/optimizer/filter_pushdown.cpp @@ -9,7 +9,8 @@ namespace duckdb { using Filter = FilterPushdown::Filter; -FilterPushdown::FilterPushdown(Optimizer &optimizer) : optimizer(optimizer), combiner(optimizer.context) { +FilterPushdown::FilterPushdown(Optimizer &optimizer, bool convert_mark_joins) + : optimizer(optimizer), combiner(optimizer.context), convert_mark_joins(convert_mark_joins) { } unique_ptr FilterPushdown::Rewrite(unique_ptr op) { @@ -144,7 +145,7 @@ unique_ptr FilterPushdown::PushFinalFilters(unique_ptr FilterPushdown::FinishPushdown(unique_ptr op) { // unhandled type, first perform filter pushdown in its children for (auto &child : op->children) { - FilterPushdown pushdown(optimizer); + FilterPushdown pushdown(optimizer, convert_mark_joins); child = pushdown.Rewrite(std::move(child)); } // now push any existing filters diff --git a/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp b/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp index 8cf884e3..4745b00a 100644 --- a/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +++ b/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp @@ -50,7 +50,7 @@ bool CardinalityEstimator::SingleRelationFilter(FilterInfo &filter_info) { vector CardinalityEstimator::DetermineMatchingEquivalentSets(FilterInfo *filter_info) { vector matching_equivalent_sets; - auto equivalent_relation_index = 0; + idx_t equivalent_relation_index = 0; for (const RelationsToTDom &r2tdom : relations_to_tdoms) { auto &i_set = r2tdom.equivalent_relations; @@ -246,7 +246,7 @@ double CardinalityEstimator::EstimateCardinalityWithSet(JoinRelationSet &new_set denom *= match.denom; } // can happen if a table has cardinality 0, or a tdom is set to 0 - if (denom == 0) { + if (denom <= 1) { denom = 1; } auto result = numerator / denom; @@ -259,7 +259,7 @@ template <> idx_t CardinalityEstimator::EstimateCardinalityWithSet(JoinRelationSet &new_set) { auto cardinality_as_double = EstimateCardinalityWithSet(new_set); auto max = NumericLimits::Maximum(); - if (cardinality_as_double > max) { + if (cardinality_as_double >= max) { return max; } return (idx_t)cardinality_as_double; diff --git a/src/duckdb/src/optimizer/join_order/cost_model.cpp b/src/duckdb/src/optimizer/join_order/cost_model.cpp index a0ceeb72..bfe64412 100644 --- a/src/duckdb/src/optimizer/join_order/cost_model.cpp +++ b/src/duckdb/src/optimizer/join_order/cost_model.cpp @@ -8,7 +8,7 @@ CostModel::CostModel(QueryGraphManager &query_graph_manager) : query_graph_manager(query_graph_manager), cardinality_estimator() { } -double CostModel::ComputeCost(JoinNode &left, JoinNode &right) { +double CostModel::ComputeCost(DPJoinNode &left, DPJoinNode &right) { auto &combination = query_graph_manager.set_manager.Union(left.set, right.set); auto join_card = cardinality_estimator.EstimateCardinalityWithSet(combination); auto join_cost = join_card; diff --git a/src/duckdb/src/optimizer/join_order/join_node.cpp b/src/duckdb/src/optimizer/join_order/join_node.cpp index ef8baa08..031f56ce 100644 --- a/src/duckdb/src/optimizer/join_order/join_node.cpp +++ b/src/duckdb/src/optimizer/join_order/join_node.cpp @@ -6,35 +6,12 @@ namespace duckdb { -JoinNode::JoinNode(JoinRelationSet &set) : set(set) { +DPJoinNode::DPJoinNode(JoinRelationSet &set) : set(set), info(nullptr), is_leaf(true), left_set(set), right_set(set) { } -JoinNode::JoinNode(JoinRelationSet &set, optional_ptr info, JoinNode &left, JoinNode &right, double cost) - : set(set), info(info), left(&left), right(&right), cost(cost) { -} - -unique_ptr EstimatedProperties::Copy() { - auto result = make_uniq(cardinality, cost); - return result; -} - -string JoinNode::ToString() { - string result = "-------------------------------\n"; - result += set.ToString() + "\n"; - result += "cost = " + to_string(cost) + "\n"; - result += "left = \n"; - if (left) { - result += left->ToString(); - } - result += "right = \n"; - if (right) { - result += right->ToString(); - } - return result; -} - -void JoinNode::Print() { - Printer::Print(ToString()); +DPJoinNode::DPJoinNode(JoinRelationSet &set, optional_ptr info, JoinRelationSet &left, + JoinRelationSet &right, double cost) + : set(set), info(info), is_leaf(false), left_set(left), right_set(right), cost(cost) { } } // namespace duckdb diff --git a/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp b/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp index 1b259a3c..61e81205 100644 --- a/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +++ b/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp @@ -5,7 +5,6 @@ #include "duckdb/common/limits.hpp" #include "duckdb/common/pair.hpp" #include "duckdb/planner/expression/list.hpp" -#include "duckdb/planner/expression_iterator.hpp" #include "duckdb/planner/operator/list.hpp" namespace duckdb { @@ -32,7 +31,7 @@ unique_ptr JoinOrderOptimizer::Optimize(unique_ptr new_logical_plan = nullptr; @@ -46,13 +45,11 @@ unique_ptr JoinOrderOptimizer::Optimize(unique_ptr> AddSuperSets(const vector> ¤t, const vector &all_neighbors) { vector> ret; @@ -110,10 +91,14 @@ void PlanEnumerator::GenerateCrossProducts() { // query_graph = query_graph_manager.GetQueryGraph(); } +const reference_map_t> &PlanEnumerator::GetPlans() const { + return plans; +} + //! Create a new JoinTree node by joining together two previous JoinTree nodes -unique_ptr PlanEnumerator::CreateJoinTree(JoinRelationSet &set, - const vector> &possible_connections, - JoinNode &left, JoinNode &right) { +unique_ptr PlanEnumerator::CreateJoinTree(JoinRelationSet &set, + const vector> &possible_connections, + DPJoinNode &left, DPJoinNode &right) { // for the hash join we want the right side (build side) to have the smallest cardinality // also just a heuristic but for now... // FIXME: we should probably actually benchmark that as well @@ -126,13 +111,13 @@ unique_ptr PlanEnumerator::CreateJoinTree(JoinRelationSet &set, } auto cost = cost_model.ComputeCost(left, right); - auto result = make_uniq(set, best_connection, left, right, cost); + auto result = make_uniq(set, best_connection, left.set, right.set, cost); result->cardinality = cost_model.cardinality_estimator.EstimateCardinalityWithSet(set); return result; } -JoinNode &PlanEnumerator::EmitPair(JoinRelationSet &left, JoinRelationSet &right, - const vector> &info) { +DPJoinNode &PlanEnumerator::EmitPair(JoinRelationSet &left, JoinRelationSet &right, + const vector> &info) { // get the left and right join plans auto left_plan = plans.find(left); auto right_plan = plans.find(right); @@ -150,33 +135,11 @@ JoinNode &PlanEnumerator::EmitPair(JoinRelationSet &left, JoinRelationSet &right old_cost = entry->second->cost; } if (entry == plans.end() || new_cost < old_cost) { - // the new plan costs less than the old plan. Update our DP tree and cost tree - auto &result = *new_plan; - - if (full_plan_found && - join_nodes_in_full_plan.find(new_plan->set.ToString()) != join_nodes_in_full_plan.end()) { - must_update_full_plan = true; - } - if (new_set.count == query_graph_manager.relation_manager.NumRelations()) { - full_plan_found = true; - // If we find a full plan, we need to keep track of which nodes are in the full plan. - // It's possible the DP algorithm updates a node in the current full plan, then moves on - // to the SolveApproximately. SolveApproximately may find a full plan with a higher cost than - // what SolveExactly found. In this case, we revert to the SolveExactly plan, but it is - // possible to get use-after-free errors if the SolveApproximately algorithm updated some (but not all) - // nodes in the SolveExactly plan - // If we know a node in the full plan is updated, we can prevent ourselves from exiting the - // DP algorithm until the last plan updated is a full plan - UpdateJoinNodesInFullPlan(result); - if (must_update_full_plan) { - must_update_full_plan = false; - } - } - - D_ASSERT(new_plan); + // the new plan costs less than the old plan. Update our DP table. plans[new_set] = std::move(new_plan); - return result; + return *plans[new_set]; } + // Create join node from the plan currently in the DP table. return *entry->second; } @@ -186,7 +149,7 @@ bool PlanEnumerator::TryEmitPair(JoinRelationSet &left, JoinRelationSet &right, // If a full plan is created, it's possible a node in the plan gets updated. When this happens, make sure you keep // emitting pairs until you emit another final plan. Another final plan is guaranteed to be produced because of // our symmetry guarantees. - if (pairs >= 10000 && !must_update_full_plan) { + if (pairs >= 10000) { // when the amount of pairs gets too large we exit the dynamic programming and resort to a greedy algorithm // FIXME: simple heuristic currently // at 10K pairs stop searching exactly and switch to heuristic @@ -218,7 +181,7 @@ bool PlanEnumerator::EmitCSG(JoinRelationSet &node) { D_ASSERT(neighbors[i] > neighbors[i + 1]); } - // Dphyp paper missiing this. + // Dphyp paper missing this. // Because we are traversing in reverse order, we need to add neighbors whose number is smaller than the current // node to exclusion_set // This avoids duplicated enumeration @@ -353,46 +316,6 @@ bool PlanEnumerator::SolveJoinOrderExactly() { return true; } -void PlanEnumerator::UpdateDPTree(JoinNode &new_plan) { - if (!NodeInFullPlan(new_plan)) { - // if the new node is not in the full plan, feel free to return - // because you won't be updating the full plan. - return; - } - auto &new_set = new_plan.set; - // now update every plan that uses this plan - unordered_set exclusion_set; - for (idx_t i = 0; i < new_set.count; i++) { - exclusion_set.insert(new_set.relations[i]); - } - auto neighbors = query_graph.GetNeighbors(new_set, exclusion_set); - auto all_neighbors = GetAllNeighborSets(neighbors); - for (const auto &neighbor : all_neighbors) { - auto &neighbor_relation = query_graph_manager.set_manager.GetJoinRelation(neighbor); - auto &combined_set = query_graph_manager.set_manager.Union(new_set, neighbor_relation); - - auto combined_set_plan = plans.find(combined_set); - if (combined_set_plan == plans.end()) { - continue; - } - - double combined_set_plan_cost = combined_set_plan->second->cost; // combined_set_plan->second->GetCost(); - auto connections = query_graph.GetConnections(new_set, neighbor_relation); - // recurse and update up the tree if the combined set produces a plan with a lower cost - // only recurse on neighbor relations that have plans. - auto right_plan = plans.find(neighbor_relation); - if (right_plan == plans.end()) { - continue; - } - auto &updated_plan = EmitPair(new_set, neighbor_relation, connections); - // <= because the child node has already been replaced. You need to - // replace the parent node as well in this case - if (updated_plan.cost < combined_set_plan_cost) { - UpdateDPTree(updated_plan); - } - } -} - void PlanEnumerator::SolveJoinOrderApproximately() { // at this point, we exited the dynamic programming but did not compute the final join order because it took too // long instead, we use a greedy heuristic to obtain a join ordering now we use Greedy Operator Ordering to @@ -405,8 +328,10 @@ void PlanEnumerator::SolveJoinOrderApproximately() { // now in every step of the algorithm, we greedily pick the join between the to-be-joined relations that has the // smallest cost. This is O(r^2) per step, and every step will reduce the total amount of relations to-be-joined // by 1, so the total cost is O(r^3) in the amount of relations + // long is needed to prevent clang-tidy complaints. (idx_t) cannot be added to an iterator position because it + // is unsigned. idx_t best_left = 0, best_right = 0; - optional_ptr best_connection; + optional_ptr best_connection; for (idx_t i = 0; i < join_relations.size(); i++) { auto left = join_relations[i]; for (idx_t j = i + 1; j < join_relations.size(); j++) { @@ -415,17 +340,16 @@ void PlanEnumerator::SolveJoinOrderApproximately() { auto connection = query_graph.GetConnections(left, right); if (!connection.empty()) { // we can check the cost of this connection - auto &node = EmitPair(left, right, connection); + auto node = EmitPair(left, right, connection); // update the DP tree in case a plan created by the DP algorithm uses the node // that was potentially just updated by EmitPair. You will get a use-after-free // error if future plans rely on the old node that was just replaced. // if node in FullPath, then updateDP tree. - UpdateDPTree(node); if (!best_connection || node.cost < best_connection->cost) { // best pair found so far - best_connection = &node; + best_connection = &EmitPair(left, right, connection); best_left = i; best_right = j; } @@ -435,14 +359,14 @@ void PlanEnumerator::SolveJoinOrderApproximately() { if (!best_connection) { // could not find a connection, but we were not done with finding a completed plan // we have to add a cross product; we add it between the two smallest relations - optional_ptr smallest_plans[2]; - idx_t smallest_index[2]; + optional_ptr smallest_plans[2]; + size_t smallest_index[2]; D_ASSERT(join_relations.size() >= 2); // first just add the first two join relations. It doesn't matter the cost as the JOO // will swap them on estimated cardinality anyway. for (idx_t i = 0; i < 2; i++) { - auto current_plan = plans[join_relations[i]].get(); + optional_ptr current_plan = plans[join_relations[i]]; smallest_plans[i] = current_plan; smallest_index[i] = i; } @@ -451,7 +375,7 @@ void PlanEnumerator::SolveJoinOrderApproximately() { // add them if they have lower estimated cardinality. for (idx_t i = 2; i < join_relations.size(); i++) { // get the plan for this relation - auto current_plan = plans[join_relations[i].get()].get(); + optional_ptr current_plan = plans[join_relations[i]]; // check if the cardinality is smaller than the smallest two found so far for (idx_t j = 0; j < 2; j++) { if (!smallest_plans[j] || smallest_plans[j]->cost > current_plan->cost) { @@ -478,7 +402,6 @@ void PlanEnumerator::SolveJoinOrderApproximately() { best_left = smallest_index[0]; best_right = smallest_index[1]; - UpdateDPTree(*best_connection); // the code below assumes best_right > best_left if (best_left > best_right) { std::swap(best_left, best_right); @@ -489,10 +412,12 @@ void PlanEnumerator::SolveJoinOrderApproximately() { // important to erase the biggest element first // if we erase the smallest element first the index of the biggest element changes + auto &new_set = query_graph_manager.set_manager.Union(join_relations.at(best_left).get(), + join_relations.at(best_right).get()); D_ASSERT(best_right > best_left); - join_relations.erase(join_relations.begin() + best_right); - join_relations.erase(join_relations.begin() + best_left); - join_relations.push_back(best_connection->set); + join_relations.erase(join_relations.begin() + (int64_t)best_right); + join_relations.erase(join_relations.begin() + (int64_t)best_left); + join_relations.push_back(new_set); } } @@ -510,9 +435,10 @@ void PlanEnumerator::InitLeafPlans() { for (idx_t i = 0; i < relation_stats.size(); i++) { auto stats = relation_stats.at(i); auto &relation_set = query_graph_manager.set_manager.GetJoinRelation(i); - auto join_node = make_uniq(relation_set); + auto join_node = make_uniq(relation_set); join_node->cost = 0; join_node->cardinality = stats.cardinality; + D_ASSERT(join_node->set.count == 1); plans[relation_set] = std::move(join_node); cost_model.cardinality_estimator.InitCardinalityEstimatorProps(&relation_set, stats); } @@ -521,7 +447,7 @@ void PlanEnumerator::InitLeafPlans() { // the plan enumeration is a straight implementation of the paper "Dynamic Programming Strikes Back" by Guido // Moerkotte and Thomas Neumannn, see that paper for additional info/documentation bonus slides: // https://db.in.tum.de/teaching/ws1415/queryopt/chapter3.pdf?lang=de -unique_ptr PlanEnumerator::SolveJoinOrder() { +void PlanEnumerator::SolveJoinOrder() { bool force_no_cross_product = query_graph_manager.context.config.force_no_cross_product; // first try to solve the join order exactly if (!SolveJoinOrderExactly()) { @@ -549,7 +475,6 @@ unique_ptr PlanEnumerator::SolveJoinOrder() { //! solve the join order again, returning the final plan return SolveJoinOrder(); } - return std::move(final_plan->second); } } // namespace duckdb diff --git a/src/duckdb/src/optimizer/join_order/query_graph_manager.cpp b/src/duckdb/src/optimizer/join_order/query_graph_manager.cpp index b8835265..e9786597 100644 --- a/src/duckdb/src/optimizer/join_order/query_graph_manager.cpp +++ b/src/duckdb/src/optimizer/join_order/query_graph_manager.cpp @@ -2,7 +2,6 @@ #include "duckdb/common/assert.hpp" #include "duckdb/common/enums/join_type.hpp" -#include "duckdb/common/printer.hpp" #include "duckdb/common/string_util.hpp" #include "duckdb/execution/physical_plan_generator.hpp" #include "duckdb/optimizer/join_order/join_relation.hpp" @@ -22,7 +21,6 @@ static bool Disjoint(const unordered_set &a, const unordered_set &b) { } bool QueryGraphManager::Build(LogicalOperator &op) { - vector> filter_operators; // have the relation manager extract the join relations and create a reference list of all the // filter operators. auto can_reorder = relation_manager.ExtractJoinRelations(op, filter_operators); @@ -116,29 +114,81 @@ static unique_ptr ExtractJoinRelation(unique_ptrop) { // found it! take ownership o/**/f it from the parent auto result = std::move(children[i]); - children.erase(children.begin() + i); + children.erase_at(i); return result; } } throw InternalException("Could not find relation in parent node (?)"); } -unique_ptr QueryGraphManager::Reconstruct(unique_ptr plan, JoinNode &node) { - return RewritePlan(std::move(plan), node); +unique_ptr QueryGraphManager::Reconstruct(unique_ptr plan) { + // now we have to rewrite the plan + bool root_is_join = plan->children.size() > 1; + + unordered_set bindings; + for (idx_t i = 0; i < relation_manager.NumRelations(); i++) { + bindings.insert(i); + } + auto &total_relation = set_manager.GetJoinRelation(bindings); + + // first we will extract all relations from the main plan + vector> extracted_relations; + extracted_relations.reserve(relation_manager.NumRelations()); + for (auto &relation : relation_manager.GetRelations()) { + extracted_relations.push_back(ExtractJoinRelation(relation)); + } + + // now we generate the actual joins + auto join_tree = GenerateJoins(extracted_relations, total_relation); + + // perform the final pushdown of remaining filters + for (auto &filter : filters_and_bindings) { + // check if the filter has already been extracted + if (filter->filter) { + // if not we need to push it + join_tree.op = PushFilter(std::move(join_tree.op), std::move(filter->filter)); + } + } + + // find the first join in the relation to know where to place this node + if (root_is_join) { + // first node is the join, return it immediately + return std::move(join_tree.op); + } + D_ASSERT(plan->children.size() == 1); + // have to move up through the relations + auto op = plan.get(); + auto parent = plan.get(); + while (op->type != LogicalOperatorType::LOGICAL_CROSS_PRODUCT && + op->type != LogicalOperatorType::LOGICAL_COMPARISON_JOIN && + op->type != LogicalOperatorType::LOGICAL_ASOF_JOIN) { + D_ASSERT(op->children.size() == 1); + parent = op; + op = op->children[0].get(); + } + // have to replace at this node + parent->children[0] = std::move(join_tree.op); + return plan; } GenerateJoinRelation QueryGraphManager::GenerateJoins(vector> &extracted_relations, - JoinNode &node) { + JoinRelationSet &set) { optional_ptr left_node; optional_ptr right_node; optional_ptr result_relation; unique_ptr result_operator; - if (node.left && node.right && node.info) { - // generate the left and right children - auto left = GenerateJoins(extracted_relations, *node.left); - auto right = GenerateJoins(extracted_relations, *node.right); - if (node.info->filters.empty()) { + auto dp_entry = plans->find(set); + if (dp_entry == plans->end()) { + throw InternalException("Join Order Optimizer Error: No full plan was created"); + } + auto &node = dp_entry->second; + if (!dp_entry->second->is_leaf) { + + // generate the left and right children + auto left = GenerateJoins(extracted_relations, node->left_set); + auto right = GenerateJoins(extracted_relations, node->right_set); + if (dp_entry->second->info->filters.empty()) { // no filters, create a cross product result_operator = LogicalCrossProduct::Create(std::move(left.op), std::move(right.op)); } else { @@ -150,7 +200,7 @@ GenerateJoinRelation QueryGraphManager::GenerateJoins(vectorchildren.push_back(std::move(right.op)); // set the join conditions from the join node - for (auto &filter_ref : node.info->filters) { + for (auto &filter_ref : node->info->filters) { auto f = filter_ref.get(); // extract the filter from the operator it originally belonged to D_ASSERT(filters_and_bindings[f->filter_index]->filter); @@ -185,23 +235,23 @@ GenerateJoinRelation QueryGraphManager::GenerateJoins(vectorset.count == 1); + D_ASSERT(extracted_relations[node->set.relations[0]]); + result_relation = &node->set; + result_operator = std::move(extracted_relations[result_relation->relations[0]]); } // TODO: this is where estimated properties start coming into play. // when creating the result operator, we should ask the cost model and cardinality estimator what // the cost and cardinality are // result_operator->estimated_props = node.estimated_props->Copy(); - result_operator->estimated_cardinality = node.cardinality; + result_operator->estimated_cardinality = node->cardinality; result_operator->has_estimated_cardinality = true; if (result_operator->type == LogicalOperatorType::LOGICAL_FILTER && result_operator->children[0]->type == LogicalOperatorType::LOGICAL_GET) { // FILTER on top of GET, add estimated properties to both // auto &filter_props = *result_operator->estimated_props; auto &child_operator = *result_operator->children[0]; - child_operator.estimated_cardinality = node.cardinality; + child_operator.estimated_cardinality = node->cardinality; child_operator.has_estimated_cardinality = true; } // check if we should do a pushdown on this node @@ -292,49 +342,6 @@ void QueryGraphManager::CreateQueryGraphCrossProduct(JoinRelationSet &left, Join query_graph.CreateEdge(right, left, nullptr); } -unique_ptr QueryGraphManager::RewritePlan(unique_ptr plan, JoinNode &node) { - // now we have to rewrite the plan - bool root_is_join = plan->children.size() > 1; - - // first we will extract all relations from the main plan - vector> extracted_relations; - extracted_relations.reserve(relation_manager.NumRelations()); - for (auto &relation : relation_manager.GetRelations()) { - extracted_relations.push_back(ExtractJoinRelation(relation)); - } - - // now we generate the actual joins - auto join_tree = GenerateJoins(extracted_relations, node); - // perform the final pushdown of remaining filters - for (auto &filter : filters_and_bindings) { - // check if the filter has already been extracted - if (filter->filter) { - // if not we need to push it - join_tree.op = PushFilter(std::move(join_tree.op), std::move(filter->filter)); - } - } - - // find the first join in the relation to know where to place this node - if (root_is_join) { - // first node is the join, return it immediately - return std::move(join_tree.op); - } - D_ASSERT(plan->children.size() == 1); - // have to move up through the relations - auto op = plan.get(); - auto parent = plan.get(); - while (op->type != LogicalOperatorType::LOGICAL_CROSS_PRODUCT && - op->type != LogicalOperatorType::LOGICAL_COMPARISON_JOIN && - op->type != LogicalOperatorType::LOGICAL_ASOF_JOIN) { - D_ASSERT(op->children.size() == 1); - parent = op; - op = op->children[0].get(); - } - // have to replace at this node - parent->children[0] = std::move(join_tree.op); - return plan; -} - static void FlipChildren(LogicalOperator &op) { std::swap(op.children[0], op.children[1]); if (op.type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN || op.type == LogicalOperatorType::LOGICAL_DELIM_JOIN) { diff --git a/src/duckdb/src/optimizer/join_order/relation_manager.cpp b/src/duckdb/src/optimizer/join_order/relation_manager.cpp index 3a0fbf0e..3df21b77 100644 --- a/src/duckdb/src/optimizer/join_order/relation_manager.cpp +++ b/src/duckdb/src/optimizer/join_order/relation_manager.cpp @@ -183,7 +183,8 @@ bool RelationManager::ExtractJoinRelations(LogicalOperator &input_op, auto &aggr = op->Cast(); auto operator_stats = RelationStatisticsHelper::ExtractAggregationStats(aggr, child_stats); if (!datasource_filters.empty()) { - operator_stats.cardinality *= RelationStatisticsHelper::DEFAULT_SELECTIVITY; + operator_stats.cardinality = NumericCast(static_cast(operator_stats.cardinality) * + RelationStatisticsHelper::DEFAULT_SELECTIVITY); } AddAggregateOrWindowRelation(input_op, parent, operator_stats, op->type); return true; @@ -196,7 +197,8 @@ bool RelationManager::ExtractJoinRelations(LogicalOperator &input_op, auto &window = op->Cast(); auto operator_stats = RelationStatisticsHelper::ExtractWindowStats(window, child_stats); if (!datasource_filters.empty()) { - operator_stats.cardinality *= RelationStatisticsHelper::DEFAULT_SELECTIVITY; + operator_stats.cardinality = NumericCast(static_cast(operator_stats.cardinality) * + RelationStatisticsHelper::DEFAULT_SELECTIVITY); } AddAggregateOrWindowRelation(input_op, parent, operator_stats, op->type); return true; diff --git a/src/duckdb/src/optimizer/join_order/relation_statistics_helper.cpp b/src/duckdb/src/optimizer/join_order/relation_statistics_helper.cpp index 94f5ddeb..79af3bd8 100644 --- a/src/duckdb/src/optimizer/join_order/relation_statistics_helper.cpp +++ b/src/duckdb/src/optimizer/join_order/relation_statistics_helper.cpp @@ -121,8 +121,8 @@ RelationStats RelationStatisticsHelper::ExtractGetStats(LogicalGet &get, ClientC // and there are other table filters (i.e cost > 50), use default selectivity. bool has_equality_filter = (cardinality_after_filters != base_table_cardinality); if (!has_equality_filter && !get.table_filters.filters.empty()) { - cardinality_after_filters = - MaxValue(base_table_cardinality * RelationStatisticsHelper::DEFAULT_SELECTIVITY, 1); + cardinality_after_filters = MaxValue( + NumericCast(base_table_cardinality * RelationStatisticsHelper::DEFAULT_SELECTIVITY), 1U); } if (base_table_cardinality == 0) { cardinality_after_filters = 0; @@ -345,7 +345,7 @@ RelationStats RelationStatisticsHelper::ExtractAggregationStats(LogicalAggregate // most likely we are running on parquet files. Therefore we divide by 2. new_card = (double)child_stats.cardinality / 2; } - stats.cardinality = new_card; + stats.cardinality = NumericCast(new_card); stats.column_names = child_stats.column_names; stats.stats_initialized = true; auto num_child_columns = aggr.GetColumnBindings().size(); diff --git a/src/duckdb/src/optimizer/optimizer.cpp b/src/duckdb/src/optimizer/optimizer.cpp index b4bbd37c..b4ffab84 100644 --- a/src/duckdb/src/optimizer/optimizer.cpp +++ b/src/duckdb/src/optimizer/optimizer.cpp @@ -43,6 +43,7 @@ Optimizer::Optimizer(Binder &binder, ClientContext &context) : context(context), rewriter.rules.push_back(make_uniq(rewriter)); rewriter.rules.push_back(make_uniq(rewriter)); rewriter.rules.push_back(make_uniq(rewriter)); + rewriter.rules.push_back(make_uniq(context, rewriter)); #ifdef DEBUG for (auto &rule : rewriter.rules) { @@ -193,7 +194,8 @@ unique_ptr Optimizer::Optimize(unique_ptr plan for (auto &optimizer_extension : DBConfig::GetConfig(context).optimizer_extensions) { RunOptimizer(OptimizerType::EXTENSION, [&]() { - optimizer_extension.optimize_function(context, optimizer_extension.optimizer_info.get(), plan); + OptimizerExtensionInput input {GetContext(), *this, optimizer_extension.optimizer_info.get()}; + optimizer_extension.optimize_function(input, plan); }); } diff --git a/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp b/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp index 396980d5..cb6db666 100644 --- a/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp +++ b/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp @@ -37,7 +37,7 @@ unique_ptr FilterPushdown::PushdownAggregate(unique_ptr FilterPushdown::PushdownAggregate(unique_ptr(std::move(op)); } // erase the filter from here - filters.erase(filters.begin() + i); + filters.erase_at(i); i--; } child_pushdown.GenerateFilters(); diff --git a/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp b/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp index facc77d5..e65f4b4f 100644 --- a/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +++ b/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp @@ -8,7 +8,7 @@ using Filter = FilterPushdown::Filter; unique_ptr FilterPushdown::PushdownCrossProduct(unique_ptr op) { D_ASSERT(op->children.size() > 1); - FilterPushdown left_pushdown(optimizer), right_pushdown(optimizer); + FilterPushdown left_pushdown(optimizer, convert_mark_joins), right_pushdown(optimizer, convert_mark_joins); vector> join_expressions; auto join_ref_type = JoinRefType::REGULAR; switch (op->type) { diff --git a/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp b/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp index 47cfdfd6..fae4b3f6 100644 --- a/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +++ b/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp @@ -64,7 +64,7 @@ unique_ptr FilterPushdown::PushdownLeftJoin(unique_ptrtype == LogicalOperatorType::LOGICAL_DELIM_JOIN) { return FinishPushdown(std::move(op)); } - FilterPushdown left_pushdown(optimizer), right_pushdown(optimizer); + FilterPushdown left_pushdown(optimizer, convert_mark_joins), right_pushdown(optimizer, convert_mark_joins); // for a comparison join we create a FilterCombiner that checks if we can push conditions on LHS join conditions // into the RHS of the join FilterCombiner filter_combiner(optimizer); @@ -91,7 +91,7 @@ unique_ptr FilterPushdown::PushdownLeftJoin(unique_ptr FilterPushdown::PushdownMarkJoin(unique_ptrtype == LogicalOperatorType::LOGICAL_DELIM_JOIN || op->type == LogicalOperatorType::LOGICAL_ASOF_JOIN); right_bindings.insert(comp_join.mark_index); - FilterPushdown left_pushdown(optimizer), right_pushdown(optimizer); + FilterPushdown left_pushdown(optimizer, convert_mark_joins), right_pushdown(optimizer, convert_mark_joins); #ifdef DEBUG bool simplified_mark_join = false; #endif @@ -27,7 +27,7 @@ unique_ptr FilterPushdown::PushdownMarkJoin(unique_ptr FilterPushdown::PushdownMarkJoin(unique_ptrfilter->type == ExpressionType::BOUND_COLUMN_REF) { + if (filters[i]->filter->type == ExpressionType::BOUND_COLUMN_REF && convert_mark_joins) { // filter just references the marker: turn into semi join #ifdef DEBUG simplified_mark_join = true; #endif join.join_type = JoinType::SEMI; - filters.erase(filters.begin() + i); + filters.erase_at(i); i--; continue; } @@ -61,13 +61,13 @@ unique_ptr FilterPushdown::PushdownMarkJoin(unique_ptr FilterPushdown::PushdownProjection(unique_ptr> remain_expressions; diff --git a/src/duckdb/src/optimizer/pushdown/pushdown_semi_anti_join.cpp b/src/duckdb/src/optimizer/pushdown/pushdown_semi_anti_join.cpp index c9506fe0..7d240e3f 100644 --- a/src/duckdb/src/optimizer/pushdown/pushdown_semi_anti_join.cpp +++ b/src/duckdb/src/optimizer/pushdown/pushdown_semi_anti_join.cpp @@ -17,7 +17,7 @@ unique_ptr FilterPushdown::PushdownSemiAntiJoin(unique_ptrchildren[0] = Rewrite(std::move(op->children[0])); - FilterPushdown right_pushdown(optimizer); + FilterPushdown right_pushdown(optimizer, convert_mark_joins); op->children[1] = right_pushdown.Rewrite(std::move(op->children[1])); bool left_empty = op->children[0]->type == LogicalOperatorType::LOGICAL_EMPTY_RESULT; diff --git a/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp b/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp index 315fe5dc..5d3dce97 100644 --- a/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp +++ b/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp @@ -40,7 +40,7 @@ unique_ptr FilterPushdown::PushdownSetOperation(unique_ptr(); diff --git a/src/duckdb/src/optimizer/pushdown/pushdown_single_join.cpp b/src/duckdb/src/optimizer/pushdown/pushdown_single_join.cpp index 028dc092..f205c606 100644 --- a/src/duckdb/src/optimizer/pushdown/pushdown_single_join.cpp +++ b/src/duckdb/src/optimizer/pushdown/pushdown_single_join.cpp @@ -9,7 +9,7 @@ unique_ptr FilterPushdown::PushdownSingleJoin(unique_ptr &left_bindings, unordered_set &right_bindings) { D_ASSERT(op->Cast().join_type == JoinType::SINGLE); - FilterPushdown left_pushdown(optimizer), right_pushdown(optimizer); + FilterPushdown left_pushdown(optimizer, convert_mark_joins), right_pushdown(optimizer, convert_mark_joins); // now check the set of filters for (idx_t i = 0; i < filters.size(); i++) { auto side = JoinSide::GetJoinSide(filters[i]->bindings, left_bindings, right_bindings); @@ -17,7 +17,7 @@ unique_ptr FilterPushdown::PushdownSingleJoin(unique_ptr &list, idx_t table_id auto entry = column_references.find(current_binding); if (entry == column_references.end()) { // this entry is not referred to, erase it from the set of expressions - list.erase(list.begin() + col_idx); + list.erase_at(col_idx); offset++; col_idx--; } else if (offset > 0 && replace) { diff --git a/src/duckdb/src/optimizer/rule/arithmetic_simplification.cpp b/src/duckdb/src/optimizer/rule/arithmetic_simplification.cpp index b319c60d..bd4e0821 100644 --- a/src/duckdb/src/optimizer/rule/arithmetic_simplification.cpp +++ b/src/duckdb/src/optimizer/rule/arithmetic_simplification.cpp @@ -26,7 +26,7 @@ unique_ptr ArithmeticSimplificationRule::Apply(LogicalOperator &op, bool &changes_made, bool is_root) { auto &root = bindings[0].get().Cast(); auto &constant = bindings[1].get().Cast(); - int constant_child = root.children[0].get() == &constant ? 0 : 1; + idx_t constant_child = root.children[0].get() == &constant ? 0 : 1; D_ASSERT(root.children.size() == 2); (void)root; // any arithmetic operator involving NULL is always NULL diff --git a/src/duckdb/src/optimizer/rule/case_simplification.cpp b/src/duckdb/src/optimizer/rule/case_simplification.cpp index 61c6ed35..2dbbecef 100644 --- a/src/duckdb/src/optimizer/rule/case_simplification.cpp +++ b/src/duckdb/src/optimizer/rule/case_simplification.cpp @@ -25,14 +25,14 @@ unique_ptr CaseSimplificationRule::Apply(LogicalOperator &op, vector auto condition = constant_value.DefaultCastAs(LogicalType::BOOLEAN); if (condition.IsNull() || !BooleanValue::Get(condition)) { // the condition is always false: remove this case check - root.case_checks.erase(root.case_checks.begin() + i); + root.case_checks.erase_at(i); i--; } else { // the condition is always true // move the THEN clause to the ELSE of the case root.else_expr = std::move(case_check.then_expr); // remove this case check and any case checks after this one - root.case_checks.erase(root.case_checks.begin() + i, root.case_checks.end()); + root.case_checks.erase(root.case_checks.begin() + NumericCast(i), root.case_checks.end()); break; } } diff --git a/src/duckdb/src/optimizer/rule/conjunction_simplification.cpp b/src/duckdb/src/optimizer/rule/conjunction_simplification.cpp index 070237cb..14fd80a9 100644 --- a/src/duckdb/src/optimizer/rule/conjunction_simplification.cpp +++ b/src/duckdb/src/optimizer/rule/conjunction_simplification.cpp @@ -1,3 +1,4 @@ + #include "duckdb/optimizer/rule/conjunction_simplification.hpp" #include "duckdb/execution/expression_executor.hpp" @@ -19,7 +20,7 @@ unique_ptr ConjunctionSimplificationRule::RemoveExpression(BoundConj for (idx_t i = 0; i < conj.children.size(); i++) { if (conj.children[i].get() == &expr) { // erase the expression - conj.children.erase(conj.children.begin() + i); + conj.children.erase_at(i); break; } } diff --git a/src/duckdb/src/optimizer/rule/constant_folding.cpp b/src/duckdb/src/optimizer/rule/constant_folding.cpp index 6b7d20c4..7702b460 100644 --- a/src/duckdb/src/optimizer/rule/constant_folding.cpp +++ b/src/duckdb/src/optimizer/rule/constant_folding.cpp @@ -1,3 +1,4 @@ + #include "duckdb/optimizer/rule/constant_folding.hpp" #include "duckdb/common/exception.hpp" diff --git a/src/duckdb/src/optimizer/rule/distributivity.cpp b/src/duckdb/src/optimizer/rule/distributivity.cpp index 509960c0..b6a889af 100644 --- a/src/duckdb/src/optimizer/rule/distributivity.cpp +++ b/src/duckdb/src/optimizer/rule/distributivity.cpp @@ -35,7 +35,7 @@ unique_ptr DistributivityRule::ExtractExpression(BoundConjunctionExp for (idx_t i = 0; i < and_expr.children.size(); i++) { if (and_expr.children[i]->Equals(expr)) { result = std::move(and_expr.children[i]); - and_expr.children.erase(and_expr.children.begin() + i); + and_expr.children.erase_at(i); break; } } diff --git a/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp b/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp index 500d639a..a8985838 100644 --- a/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp +++ b/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp @@ -1,3 +1,4 @@ + #include "duckdb/optimizer/rule/empty_needle_removal.hpp" #include "duckdb/execution/expression_executor.hpp" diff --git a/src/duckdb/src/optimizer/rule/enum_comparison.cpp b/src/duckdb/src/optimizer/rule/enum_comparison.cpp index 8b052578..aeb5e224 100644 --- a/src/duckdb/src/optimizer/rule/enum_comparison.cpp +++ b/src/duckdb/src/optimizer/rule/enum_comparison.cpp @@ -1,3 +1,4 @@ + #include "duckdb/optimizer/rule/enum_comparison.hpp" #include "duckdb/execution/expression_executor.hpp" diff --git a/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp b/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp index e1ad4fd9..07e43377 100644 --- a/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp +++ b/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp @@ -1,3 +1,4 @@ + #include "duckdb/execution/expression_executor.hpp" #include "duckdb/optimizer/rule/in_clause_simplification.hpp" #include "duckdb/planner/expression/list.hpp" diff --git a/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp b/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp index 5aa9a4b7..93c9c801 100644 --- a/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp +++ b/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp @@ -1,5 +1,3 @@ -#include "duckdb/optimizer/rule/ordered_aggregate_optimizer.hpp" - #include "duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp" #include "duckdb/function/function_binder.hpp" #include "duckdb/optimizer/matcher/expression_matcher.hpp" @@ -8,6 +6,7 @@ #include "duckdb/planner/expression/bound_constant_expression.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/planner/operator/logical_aggregate.hpp" +#include "duckdb/optimizer/rule/ordered_aggregate_optimizer.hpp" namespace duckdb { diff --git a/src/duckdb/src/optimizer/rule/timestamp_comparison.cpp b/src/duckdb/src/optimizer/rule/timestamp_comparison.cpp new file mode 100644 index 00000000..3b1d22ee --- /dev/null +++ b/src/duckdb/src/optimizer/rule/timestamp_comparison.cpp @@ -0,0 +1,107 @@ + +#include "duckdb/optimizer/rule/timestamp_comparison.hpp" +#include "duckdb/optimizer/matcher/expression_matcher.hpp" +#include "duckdb/planner/expression_iterator.hpp" +#include "duckdb/common/constants.hpp" +#include "duckdb/execution/expression_executor.hpp" +#include "duckdb/planner/expression/bound_cast_expression.hpp" +#include "duckdb/planner/expression/bound_conjunction_expression.hpp" +#include "duckdb/planner/expression/bound_comparison_expression.hpp" +#include "duckdb/planner/expression/bound_constant_expression.hpp" +#include "duckdb/optimizer/matcher/type_matcher_id.hpp" +#include "duckdb/optimizer/expression_rewriter.hpp" +#include "duckdb/common/types.hpp" +#include "duckdb/common/operator/add.hpp" + +namespace duckdb { + +TimeStampComparison::TimeStampComparison(ClientContext &context, ExpressionRewriter &rewriter) + : Rule(rewriter), context(context) { + // match on a ComparisonExpression that is an Equality and has a VARCHAR and ENUM as its children + auto op = make_uniq(); + op->policy = SetMatcher::Policy::UNORDERED; + // Enum requires expression to be root + op->expr_type = make_uniq(ExpressionType::COMPARE_EQUAL); + + // one side is timestamp cast to date + auto left = make_uniq(); + left->type = make_uniq(LogicalTypeId::DATE); + left->matcher = make_uniq(); + left->matcher->expr_class = ExpressionClass::BOUND_COLUMN_REF; + left->matcher->type = make_uniq(LogicalTypeId::TIMESTAMP); + op->matchers.push_back(std::move(left)); + + // other side is varchar to date? + auto right = make_uniq(); + right->type = make_uniq(LogicalTypeId::DATE); + right->matcher = make_uniq(); + right->matcher->expr_class = ExpressionClass::BOUND_CONSTANT; + right->matcher->type = make_uniq(LogicalTypeId::VARCHAR); + op->matchers.push_back(std::move(right)); + + root = std::move(op); +} + +static void ExpressionIsConstant(Expression &expr, bool &is_constant) { + if (expr.type == ExpressionType::BOUND_COLUMN_REF) { + is_constant = false; + return; + } + ExpressionIterator::EnumerateChildren(expr, [&](Expression &child) { ExpressionIsConstant(child, is_constant); }); +} + +unique_ptr TimeStampComparison::Apply(LogicalOperator &op, vector> &bindings, + bool &changes_made, bool is_root) { + auto cast_constant = bindings[3].get().Copy(); + auto cast_columnref = bindings[2].get().Copy(); + auto is_constant = true; + ExpressionIsConstant(*cast_constant, is_constant); + if (!is_constant) { + // means the matchers are flipped, so we need to flip our bindings + // for some reason an extra binding is added in this case. + cast_constant = bindings[4].get().Copy(); + cast_columnref = bindings[3].get().Copy(); + } + auto new_expr = make_uniq(ExpressionType::CONJUNCTION_AND); + + Value result; + if (ExpressionExecutor::TryEvaluateScalar(context, *cast_constant, result)) { + D_ASSERT(result.type() == LogicalType::DATE); + auto original_val = result.GetValue(); + auto no_seconds = dtime_t(0); + + // original date as timestamp with no seconds + auto original_val_ts = Value::TIMESTAMP(original_val, no_seconds); + auto original_val_for_comparison = make_uniq(original_val_ts); + + // add one day and validate the new date + // code is inspired by AddOperator::Operation(date_t left, int32_t right). The function wasn't used directly + // since it throws errors that I cannot catch here. + + auto date_t_copy = result.GetValue(); + date_t date_t_result; + // attempt to add 1 day + if (!TryAddOperator::Operation(date_t_copy, 1, date_t_result)) { + // don't rewrite the expression and let the expression executor handle the invalid date + return nullptr; + } + + auto result_as_val = Value::DATE(date_t_result); + auto original_val_plus_on_date_ts = Value::TIMESTAMP(result_as_val.GetValue()); + + auto val_for_comparison = make_uniq(original_val_plus_on_date_ts); + + auto left_copy = cast_columnref->Copy(); + auto right_copy = cast_columnref->Copy(); + auto lt_eq_expr = make_uniq_base( + ExpressionType::COMPARE_LESSTHAN, std::move(right_copy), std::move(val_for_comparison)); + auto gt_eq_expr = make_uniq_base( + ExpressionType::COMPARE_GREATERTHANOREQUALTO, std::move(left_copy), std::move(original_val_for_comparison)); + new_expr->children.push_back(std::move(gt_eq_expr)); + new_expr->children.push_back(std::move(lt_eq_expr)); + return std::move(new_expr); + } + return nullptr; +} + +} // namespace duckdb diff --git a/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp b/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp index 8c6fa087..d4431afa 100644 --- a/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp +++ b/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp @@ -46,7 +46,7 @@ unique_ptr StatisticsPropagator::PropagateExpression(BoundConjun } } if (prune_child) { - expr.children.erase(expr.children.begin() + expr_idx); + expr.children.erase_at(expr_idx); expr_idx--; continue; } diff --git a/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp b/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp index 2d97357c..0733fc74 100644 --- a/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp +++ b/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp @@ -28,8 +28,8 @@ unique_ptr StatisticsPropagator::PropagateExpression(BoundOperat // this child is always NULL, we can remove it from the coalesce // UNLESS there is only one node remaining if (expr.children.size() > 1) { - expr.children.erase(expr.children.begin() + i); - child_stats.erase(child_stats.begin() + i); + expr.children.erase_at(i); + child_stats.erase_at(i); i--; } } else if (!child_stats[i]->CanHaveNull()) { @@ -37,8 +37,8 @@ unique_ptr StatisticsPropagator::PropagateExpression(BoundOperat // this is the last coalesce node that influences the result // we can erase any children after this node if (i + 1 < expr.children.size()) { - expr.children.erase(expr.children.begin() + i + 1, expr.children.end()); - child_stats.erase(child_stats.begin() + i + 1, child_stats.end()); + expr.children.erase(expr.children.begin() + NumericCast(i + 1), expr.children.end()); + child_stats.erase(child_stats.begin() + NumericCast(i + 1), child_stats.end()); } break; } diff --git a/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp b/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp index 68fdfdeb..6bd1d30c 100644 --- a/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +++ b/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp @@ -227,7 +227,7 @@ unique_ptr StatisticsPropagator::PropagateStatistics(LogicalFilt node_stats = PropagateStatistics(filter.children[0]); if (filter.children[0]->type == LogicalOperatorType::LOGICAL_EMPTY_RESULT) { ReplaceWithEmptyResult(node_ptr); - return make_uniq(0, 0); + return make_uniq(0U, 0U); } // then propagate to each of the expressions @@ -238,7 +238,7 @@ unique_ptr StatisticsPropagator::PropagateStatistics(LogicalFilt if (ExpressionIsConstant(*condition, Value::BOOLEAN(true))) { // filter is always true; it is useless to execute it // erase this condition - filter.expressions.erase(filter.expressions.begin() + i); + filter.expressions.erase_at(i); i--; if (filter.expressions.empty()) { // just break. The physical filter planner will plan a projection instead @@ -248,7 +248,7 @@ unique_ptr StatisticsPropagator::PropagateStatistics(LogicalFilt ExpressionIsConstantOrNull(*condition, Value::BOOLEAN(false))) { // filter is always false or null; this entire filter should be replaced by an empty result block ReplaceWithEmptyResult(node_ptr); - return make_uniq(0, 0); + return make_uniq(0U, 0U); } else { // cannot prune this filter: propagate statistics from the filter UpdateFilterStatistics(*condition); diff --git a/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp b/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp index 0d3d2c73..c5d4fff9 100644 --- a/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +++ b/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp @@ -86,7 +86,7 @@ unique_ptr StatisticsPropagator::PropagateStatistics(LogicalGet case FilterPropagateResult::FILTER_ALWAYS_FALSE: // filter is always false; this entire filter should be replaced by an empty result block ReplaceWithEmptyResult(node_ptr); - return make_uniq(0, 0); + return make_uniq(0U, 0U); default: // general case: filter can be true or false, update this columns' statistics UpdateFilterStatistics(stats, *filter); diff --git a/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp b/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp index 16541cf6..e0710b6a 100644 --- a/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +++ b/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp @@ -85,7 +85,7 @@ void StatisticsPropagator::PropagateStatistics(LogicalComparisonJoin &join, uniq } if (join.conditions.size() > 1) { // there are multiple conditions: erase this condition - join.conditions.erase(join.conditions.begin() + i); + join.conditions.erase_at(i); // remove the corresponding statistics join.join_stats.clear(); i--; @@ -187,7 +187,8 @@ void StatisticsPropagator::MultiplyCardinalities(unique_ptr &sta return; } stats->estimated_cardinality = MaxValue(stats->estimated_cardinality, new_stats.estimated_cardinality); - auto new_max = Hugeint::Multiply(stats->max_cardinality, new_stats.max_cardinality); + auto new_max = Hugeint::Multiply(NumericCast(stats->max_cardinality), + NumericCast(new_stats.max_cardinality)); if (new_max < NumericLimits::Maximum()) { int64_t result; if (!Hugeint::TryCast(new_max, result)) { @@ -357,7 +358,9 @@ void StatisticsPropagator::CreateFilterFromJoinStats(unique_ptr child->expressions.emplace_back(std::move(filter_expr)); } - FilterPushdown filter_pushdown(optimizer); + // not allowed to let filter pushdowwn change mark joins to semi joins. + // semi joins are potentially slower AND the conversion can ruin column binding information + FilterPushdown filter_pushdown(optimizer, false); child = filter_pushdown.Rewrite(std::move(child)); PropagateExpression(expr); } diff --git a/src/duckdb/src/optimizer/statistics/operator/propagate_set_operation.cpp b/src/duckdb/src/optimizer/statistics/operator/propagate_set_operation.cpp index 2f697719..4c8c33cc 100644 --- a/src/duckdb/src/optimizer/statistics/operator/propagate_set_operation.cpp +++ b/src/duckdb/src/optimizer/statistics/operator/propagate_set_operation.cpp @@ -10,7 +10,8 @@ void StatisticsPropagator::AddCardinalities(unique_ptr &stats, N return; } stats->estimated_cardinality += new_stats.estimated_cardinality; - auto new_max = Hugeint::Add(stats->max_cardinality, new_stats.max_cardinality); + auto new_max = + Hugeint::Add(NumericCast(stats->max_cardinality), NumericCast(new_stats.max_cardinality)); if (new_max < NumericLimits::Maximum()) { int64_t result; if (!Hugeint::TryCast(new_max, result)) { diff --git a/src/duckdb/src/optimizer/topn_optimizer.cpp b/src/duckdb/src/optimizer/topn_optimizer.cpp index ca64e570..7c227cc7 100644 --- a/src/duckdb/src/optimizer/topn_optimizer.cpp +++ b/src/duckdb/src/optimizer/topn_optimizer.cpp @@ -29,8 +29,8 @@ unique_ptr TopN::Optimize(unique_ptr op) { if (CanOptimize(*op)) { auto &limit = op->Cast(); auto &order_by = (op->children[0])->Cast(); - auto limit_val = int64_t(limit.limit_val.GetConstantValue()); - int64_t offset_val = 0; + auto limit_val = limit.limit_val.GetConstantValue(); + idx_t offset_val = 0; if (limit.offset_val.Type() == LimitNodeType::CONSTANT_VALUE) { offset_val = limit.offset_val.GetConstantValue(); } diff --git a/src/duckdb/src/parallel/executor.cpp b/src/duckdb/src/parallel/executor.cpp index 41e71028..408eb1ea 100644 --- a/src/duckdb/src/parallel/executor.cpp +++ b/src/duckdb/src/parallel/executor.cpp @@ -73,10 +73,11 @@ void Executor::SchedulePipeline(const shared_ptr &meta_pipeline, S // create events/stack for the base pipeline auto base_pipeline = meta_pipeline->GetBasePipeline(); - auto base_initialize_event = make_shared(base_pipeline); - auto base_event = make_shared(base_pipeline); - auto base_finish_event = make_shared(base_pipeline); - auto base_complete_event = make_shared(base_pipeline->executor, event_data.initial_schedule); + auto base_initialize_event = make_shared_ptr(base_pipeline); + auto base_event = make_shared_ptr(base_pipeline); + auto base_finish_event = make_shared_ptr(base_pipeline); + auto base_complete_event = + make_shared_ptr(base_pipeline->executor, event_data.initial_schedule); PipelineEventStack base_stack(*base_initialize_event, *base_event, *base_finish_event, *base_complete_event); events.push_back(std::move(base_initialize_event)); events.push_back(std::move(base_event)); @@ -96,7 +97,7 @@ void Executor::SchedulePipeline(const shared_ptr &meta_pipeline, S D_ASSERT(pipeline); // create events/stack for this pipeline - auto pipeline_event = make_shared(pipeline); + auto pipeline_event = make_shared_ptr(pipeline); auto finish_group = meta_pipeline->GetFinishGroup(*pipeline); if (finish_group) { @@ -115,7 +116,7 @@ void Executor::SchedulePipeline(const shared_ptr &meta_pipeline, S event_map.insert(make_pair(reference(*pipeline), pipeline_stack)); } else if (meta_pipeline->HasFinishEvent(*pipeline)) { // this pipeline has its own finish event (despite going into the same sink - Finalize twice!) - auto pipeline_finish_event = make_shared(pipeline); + auto pipeline_finish_event = make_shared_ptr(pipeline); PipelineEventStack pipeline_stack(base_stack.pipeline_initialize_event, *pipeline_event, *pipeline_finish_event, base_stack.pipeline_complete_event); events.push_back(std::move(pipeline_finish_event)); @@ -359,7 +360,7 @@ void Executor::InitializeInternal(PhysicalOperator &plan) { // build and ready the pipelines PipelineBuildState state; - auto root_pipeline = make_shared(*this, state, nullptr); + auto root_pipeline = make_shared_ptr(*this, state, nullptr); root_pipeline->Build(*physical_plan); root_pipeline->Ready(); @@ -570,7 +571,7 @@ shared_ptr Executor::CreateChildPipeline(Pipeline ¤t, PhysicalOp D_ASSERT(op.IsSource()); // found another operator that is a source, schedule a child pipeline // 'op' is the source, and the sink is the same - auto child_pipeline = make_shared(*this); + auto child_pipeline = make_shared_ptr(*this); child_pipeline->sink = current.sink; child_pipeline->source = &op; @@ -639,7 +640,9 @@ bool Executor::GetPipelinesProgress(double ¤t_progress, uint64_t ¤t_ for (size_t i = 0; i < progress.size(); i++) { progress[i] = MaxValue(0.0, MinValue(100.0, progress[i])); - current_cardinality += double(progress[i]) * double(cardinality[i]) / double(100); + current_cardinality = NumericCast(static_cast( + current_cardinality + + static_cast(progress[i]) * static_cast(cardinality[i]) / static_cast(100))); current_progress += progress[i] * double(cardinality[i]) / double(total_cardinality); D_ASSERT(current_cardinality <= total_cardinality); } diff --git a/src/duckdb/src/parallel/meta_pipeline.cpp b/src/duckdb/src/parallel/meta_pipeline.cpp index ded1cb24..d383fe95 100644 --- a/src/duckdb/src/parallel/meta_pipeline.cpp +++ b/src/duckdb/src/parallel/meta_pipeline.cpp @@ -82,7 +82,7 @@ void MetaPipeline::Ready() { } MetaPipeline &MetaPipeline::CreateChildMetaPipeline(Pipeline ¤t, PhysicalOperator &op) { - children.push_back(make_shared(executor, state, &op)); + children.push_back(make_shared_ptr(executor, state, &op)); auto child_meta_pipeline = children.back().get(); // child MetaPipeline must finish completely before this MetaPipeline can start current.AddDependency(child_meta_pipeline->GetBasePipeline()); @@ -92,7 +92,7 @@ MetaPipeline &MetaPipeline::CreateChildMetaPipeline(Pipeline ¤t, PhysicalO } Pipeline &MetaPipeline::CreatePipeline() { - pipelines.emplace_back(make_shared(executor)); + pipelines.emplace_back(make_shared_ptr(executor)); state.SetPipelineSink(*pipelines.back(), sink, next_batch_index++); return *pipelines.back(); } diff --git a/src/duckdb/src/parallel/pipeline.cpp b/src/duckdb/src/parallel/pipeline.cpp index e0ace608..643cb7c8 100644 --- a/src/duckdb/src/parallel/pipeline.cpp +++ b/src/duckdb/src/parallel/pipeline.cpp @@ -110,9 +110,9 @@ bool Pipeline::ScheduleParallel(shared_ptr &event) { "Attempting to schedule a pipeline where the sink requires batch index but source does not support it"); } } - idx_t max_threads = source_state->MaxThreads(); + auto max_threads = source_state->MaxThreads(); auto &scheduler = TaskScheduler::GetScheduler(executor.context); - idx_t active_threads = scheduler.NumberOfThreads(); + auto active_threads = NumericCast(scheduler.NumberOfThreads()); if (max_threads > active_threads) { max_threads = active_threads; } diff --git a/src/duckdb/src/parallel/task_scheduler.cpp b/src/duckdb/src/parallel/task_scheduler.cpp index 50364833..d11b144b 100644 --- a/src/duckdb/src/parallel/task_scheduler.cpp +++ b/src/duckdb/src/parallel/task_scheduler.cpp @@ -2,6 +2,7 @@ #include "duckdb/common/chrono.hpp" #include "duckdb/common/exception.hpp" +#include "duckdb/common/numeric_utils.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/main/database.hpp" @@ -108,7 +109,11 @@ TaskScheduler::TaskScheduler(DatabaseInstance &db) TaskScheduler::~TaskScheduler() { #ifndef DUCKDB_NO_THREADS - RelaunchThreadsInternal(0); + try { + RelaunchThreadsInternal(0); + } catch (...) { + // nothing we can do in the destructor if this fails + } #endif } @@ -260,7 +265,8 @@ void TaskScheduler::SetAllocatorFlushTreshold(idx_t threshold) { void TaskScheduler::Signal(idx_t n) { #ifndef DUCKDB_NO_THREADS - queue->semaphore.signal(n); + typedef std::make_signed::type ssize_t; + queue->semaphore.signal(NumericCast(n)); #endif } @@ -279,7 +285,7 @@ void TaskScheduler::RelaunchThreads() { void TaskScheduler::RelaunchThreadsInternal(int32_t n) { #ifndef DUCKDB_NO_THREADS auto &config = DBConfig::GetConfig(db); - idx_t new_thread_count = n; + auto new_thread_count = NumericCast(n); if (threads.size() == new_thread_count) { current_thread_count = NumericCast(threads.size() + config.options.external_threads); return; diff --git a/src/duckdb/src/parser/column_definition.cpp b/src/duckdb/src/parser/column_definition.cpp index e73fdb02..245bcd47 100644 --- a/src/duckdb/src/parser/column_definition.cpp +++ b/src/duckdb/src/parser/column_definition.cpp @@ -23,6 +23,7 @@ ColumnDefinition ColumnDefinition::Copy() const { copy.compression_type = compression_type; copy.category = category; copy.comment = comment; + copy.tags = tags; return copy; } diff --git a/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp b/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp index 66faf519..db76fd51 100644 --- a/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +++ b/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp @@ -29,15 +29,17 @@ string ForeignKeyConstraint::ToString() const { base += "."; } base += info.table; - base += "("; - - for (idx_t i = 0; i < pk_columns.size(); i++) { - if (i > 0) { - base += ", "; + if (!pk_columns.empty()) { + base += "("; + + for (idx_t i = 0; i < pk_columns.size(); i++) { + if (i > 0) { + base += ", "; + } + base += KeywordHelper::WriteOptionallyQuoted(pk_columns[i]); } - base += KeywordHelper::WriteOptionallyQuoted(pk_columns[i]); + base += ")"; } - base += ")"; return base; } diff --git a/src/duckdb/src/parser/expression/star_expression.cpp b/src/duckdb/src/parser/expression/star_expression.cpp index c632603e..a3b4dd04 100644 --- a/src/duckdb/src/parser/expression/star_expression.cpp +++ b/src/duckdb/src/parser/expression/star_expression.cpp @@ -28,7 +28,7 @@ string StarExpression::ToString() const { if (!first_entry) { result += ", "; } - result += entry; + result += KeywordHelper::WriteOptionallyQuoted(entry); first_entry = false; } result += ")"; @@ -42,7 +42,7 @@ string StarExpression::ToString() const { } result += entry.second->ToString(); result += " AS "; - result += entry.first; + result += KeywordHelper::WriteOptionallyQuoted(entry.first); first_entry = false; } result += ")"; diff --git a/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp b/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp index 363019cf..269a87d6 100644 --- a/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp +++ b/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp @@ -35,4 +35,8 @@ unique_ptr AddScalarFunctionOverloadInfo::Copy() const { return make_uniq_base(GetAlterEntryData(), new_overloads); } +string AddScalarFunctionOverloadInfo::ToString() const { + throw NotImplementedException("NOT PARSABLE CURRENTLY"); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp b/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp index 347eb3fd..e7ce608c 100644 --- a/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp +++ b/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp @@ -35,4 +35,8 @@ unique_ptr AddTableFunctionOverloadInfo::Copy() const { return make_uniq_base(GetAlterEntryData(), new_overloads); } +string AddTableFunctionOverloadInfo::ToString() const { + throw NotImplementedException("NOT PARSABLE"); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/alter_table_info.cpp b/src/duckdb/src/parser/parsed_data/alter_table_info.cpp index 977c66d6..175ef5f7 100644 --- a/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +++ b/src/duckdb/src/parser/parsed_data/alter_table_info.cpp @@ -1,4 +1,5 @@ #include "duckdb/parser/parsed_data/alter_table_info.hpp" +#include "duckdb/common/extra_type_info.hpp" #include "duckdb/parser/constraint.hpp" @@ -25,6 +26,21 @@ unique_ptr ChangeOwnershipInfo::Copy() const { owner_name, if_not_found); } +string ChangeOwnershipInfo::ToString() const { + string result = ""; + + result += "ALTER "; + result += TypeToString(entry_catalog_type); + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += QualifierToString(catalog, schema, name); + result += " OWNED BY "; + result += QualifierToString(catalog, owner_schema, owner_name); + result += ";"; + return result; +} + //===--------------------------------------------------------------------===// // SetCommentInfo //===--------------------------------------------------------------------===// @@ -44,6 +60,20 @@ unique_ptr SetCommentInfo::Copy() const { if_not_found); } +string SetCommentInfo::ToString() const { + string result = ""; + + result += "COMMENT ON "; + result += ParseInfo::TypeToString(entry_catalog_type); + result += " "; + result += QualifierToString(catalog, schema, name); + result += " IS "; + result += comment_value.ToSQLString(); + + result += ";"; + return result; +} + SetCommentInfo::SetCommentInfo() : AlterInfo(AlterType::SET_COMMENT) { } @@ -82,6 +112,21 @@ unique_ptr RenameColumnInfo::Copy() const { return make_uniq_base(GetAlterEntryData(), old_name, new_name); } +string RenameColumnInfo::ToString() const { + string result = ""; + result += "ALTER TABLE "; + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += QualifierToString(catalog, schema, name); + result += " RENAME COLUMN "; + result += KeywordHelper::WriteOptionallyQuoted(old_name); + result += " TO "; + result += KeywordHelper::WriteOptionallyQuoted(new_name); + result += ";"; + return result; +} + //===--------------------------------------------------------------------===// // RenameTableInfo //===--------------------------------------------------------------------===// @@ -99,6 +144,19 @@ unique_ptr RenameTableInfo::Copy() const { return make_uniq_base(GetAlterEntryData(), new_table_name); } +string RenameTableInfo::ToString() const { + string result = ""; + result += "ALTER TABLE "; + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += QualifierToString(catalog, schema, name); + result += " RENAME TO "; + result += KeywordHelper::WriteOptionallyQuoted(new_table_name); + result += ";"; + return result; +} + //===--------------------------------------------------------------------===// // AddColumnInfo //===--------------------------------------------------------------------===// @@ -118,6 +176,22 @@ unique_ptr AddColumnInfo::Copy() const { return make_uniq_base(GetAlterEntryData(), new_column.Copy(), if_column_not_exists); } +string AddColumnInfo::ToString() const { + string result = ""; + result += "ALTER TABLE "; + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += QualifierToString(catalog, schema, name); + result += " ADD COLUMN"; + if (if_column_not_exists) { + result += " IF NOT EXISTS"; + } + throw NotImplementedException("COLUMN SERIALIZATION"); + result += ";"; + return result; +} + //===--------------------------------------------------------------------===// // RemoveColumnInfo //===--------------------------------------------------------------------===// @@ -135,6 +209,25 @@ unique_ptr RemoveColumnInfo::Copy() const { return make_uniq_base(GetAlterEntryData(), removed_column, if_column_exists, cascade); } +string RemoveColumnInfo::ToString() const { + string result = ""; + result += "ALTER TABLE "; + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += QualifierToString(catalog, schema, name); + result += " DROP COLUMN "; + if (if_column_exists) { + result += "IF EXISTS "; + } + result += KeywordHelper::WriteOptionallyQuoted(removed_column); + if (cascade) { + result += " CASCADE"; + } + result += ";"; + return result; +} + //===--------------------------------------------------------------------===// // ChangeColumnTypeInfo //===--------------------------------------------------------------------===// @@ -154,6 +247,32 @@ unique_ptr ChangeColumnTypeInfo::Copy() const { expression->Copy()); } +string ChangeColumnTypeInfo::ToString() const { + string result = ""; + result += "ALTER TABLE "; + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += QualifierToString(catalog, schema, name); + result += " ALTER COLUMN "; + result += KeywordHelper::WriteOptionallyQuoted(column_name); + result += " TYPE "; + result += target_type.ToString(); // FIXME: ToSQLString ? + auto extra_type_info = target_type.AuxInfo(); + if (extra_type_info && extra_type_info->type == ExtraTypeInfoType::STRING_TYPE_INFO) { + auto &string_info = extra_type_info->Cast(); + if (!string_info.collation.empty()) { + result += " COLLATE " + string_info.collation; + } + } + if (expression) { + result += " USING "; + result += expression->ToString(); + } + result += ";"; + return result; +} + //===--------------------------------------------------------------------===// // SetDefaultInfo //===--------------------------------------------------------------------===// @@ -172,6 +291,25 @@ unique_ptr SetDefaultInfo::Copy() const { expression ? expression->Copy() : nullptr); } +string SetDefaultInfo::ToString() const { + string result = ""; + result += "ALTER TABLE "; + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += QualifierToString(catalog, schema, name); + result += " ALTER COLUMN "; + result += KeywordHelper::WriteOptionallyQuoted(column_name); + if (expression) { + result += " SET DEFAULT "; + result += expression->ToString(); + } else { + result += " DROP DEFAULT"; + } + result += ";"; + return result; +} + //===--------------------------------------------------------------------===// // SetNotNullInfo //===--------------------------------------------------------------------===// @@ -188,6 +326,20 @@ unique_ptr SetNotNullInfo::Copy() const { return make_uniq_base(GetAlterEntryData(), column_name); } +string SetNotNullInfo::ToString() const { + string result = ""; + result += "ALTER TABLE "; + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += QualifierToString(catalog, schema, name); + result += " ALTER COLUMN "; + result += KeywordHelper::WriteOptionallyQuoted(column_name); + result += " SET NOT NULL"; + result += ";"; + return result; +} + //===--------------------------------------------------------------------===// // DropNotNullInfo //===--------------------------------------------------------------------===// @@ -204,6 +356,20 @@ unique_ptr DropNotNullInfo::Copy() const { return make_uniq_base(GetAlterEntryData(), column_name); } +string DropNotNullInfo::ToString() const { + string result = ""; + result += "ALTER TABLE "; + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += QualifierToString(catalog, schema, name); + result += " ALTER COLUMN "; + result += KeywordHelper::WriteOptionallyQuoted(column_name); + result += " DROP NOT NULL"; + result += ";"; + return result; +} + //===--------------------------------------------------------------------===// // AlterForeignKeyInfo //===--------------------------------------------------------------------===// @@ -225,6 +391,10 @@ unique_ptr AlterForeignKeyInfo::Copy() const { pk_keys, fk_keys, type); } +string AlterForeignKeyInfo::ToString() const { + throw NotImplementedException("NOT PARSABLE CURRENTLY"); +} + //===--------------------------------------------------------------------===// // Alter View //===--------------------------------------------------------------------===// @@ -258,4 +428,17 @@ unique_ptr RenameViewInfo::Copy() const { return make_uniq_base(GetAlterEntryData(), new_view_name); } +string RenameViewInfo::ToString() const { + string result = ""; + result += "ALTER VIEW "; + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += QualifierToString(catalog, schema, name); + result += " RENAME TO "; + result += KeywordHelper::WriteOptionallyQuoted(new_view_name); + result += ";"; + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/attach_info.cpp b/src/duckdb/src/parser/parsed_data/attach_info.cpp index dea165bc..4f5352cf 100644 --- a/src/duckdb/src/parser/parsed_data/attach_info.cpp +++ b/src/duckdb/src/parser/parsed_data/attach_info.cpp @@ -1,4 +1,5 @@ #include "duckdb/parser/parsed_data/attach_info.hpp" +#include "duckdb/parser/keyword_helper.hpp" namespace duckdb { @@ -11,4 +12,26 @@ unique_ptr AttachInfo::Copy() const { return result; } +string AttachInfo::ToString() const { + string result = ""; + result += "ATTACH"; + if (on_conflict == OnCreateConflict::IGNORE_ON_CONFLICT) { + result += " IF NOT EXISTS"; + } + result += " DATABASE"; + result += StringUtil::Format(" '%s'", path); + if (!name.empty()) { + result += " AS " + KeywordHelper::WriteOptionallyQuoted(name); + } + if (!options.empty()) { + vector stringified; + for (auto &opt : options) { + stringified.push_back(StringUtil::Format("%s %s", opt.first, opt.second.ToSQLString())); + } + result += " (" + StringUtil::Join(stringified, ", ") + ")"; + } + result += ";"; + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/comment_on_column_info.cpp b/src/duckdb/src/parser/parsed_data/comment_on_column_info.cpp index 909990d6..4bc33248 100644 --- a/src/duckdb/src/parser/parsed_data/comment_on_column_info.cpp +++ b/src/duckdb/src/parser/parsed_data/comment_on_column_info.cpp @@ -1,5 +1,6 @@ #include "duckdb/parser/parsed_data/comment_on_column_info.hpp" #include "duckdb/catalog/catalog.hpp" +#include "duckdb/catalog/catalog_entry_retriever.hpp" namespace duckdb { @@ -21,8 +22,20 @@ unique_ptr SetColumnCommentInfo::Copy() const { return std::move(result); } -optional_ptr SetColumnCommentInfo::TryResolveCatalogEntry(ClientContext &context) { - auto entry = Catalog::GetEntry(context, CatalogType::TABLE_ENTRY, catalog, schema, name, if_not_found); +string SetColumnCommentInfo::ToString() const { + string result = ""; + + D_ASSERT(catalog_entry_type == CatalogType::INVALID); + result += "COMMENT ON COLUMN "; + result += QualifierToString(catalog, schema, name); + result += " IS "; + result += comment_value.ToSQLString(); + result += ";"; + return result; +} + +optional_ptr SetColumnCommentInfo::TryResolveCatalogEntry(CatalogEntryRetriever &retriever) { + auto entry = retriever.GetEntry(CatalogType::TABLE_ENTRY, catalog, schema, name, if_not_found); if (entry) { catalog_entry_type = entry->type; diff --git a/src/duckdb/src/parser/parsed_data/copy_info.cpp b/src/duckdb/src/parser/parsed_data/copy_info.cpp new file mode 100644 index 00000000..c46263a7 --- /dev/null +++ b/src/duckdb/src/parser/parsed_data/copy_info.cpp @@ -0,0 +1,100 @@ +#include "duckdb/parser/parsed_data/copy_info.hpp" +#include "duckdb/parser/query_node.hpp" + +namespace duckdb { + +unique_ptr CopyInfo::Copy() const { + auto result = make_uniq(); + result->catalog = catalog; + result->schema = schema; + result->table = table; + result->select_list = select_list; + result->file_path = file_path; + result->is_from = is_from; + result->format = format; + result->options = options; + if (select_statement) { + result->select_statement = select_statement->Copy(); + } + return result; +} + +string CopyInfo::CopyOptionsToString(const string &format, const case_insensitive_map_t> &options) { + if (format.empty() && options.empty()) { + return string(); + } + string result; + + result += " ("; + vector stringified; + if (!format.empty()) { + stringified.push_back(StringUtil::Format(" FORMAT %s", format)); + } + for (auto &opt : options) { + auto &name = opt.first; + auto &values = opt.second; + + auto option = name + " "; + if (values.empty()) { + // Options like HEADER don't need an explicit value + // just providing the name already sets it to true + stringified.push_back(option); + } else if (values.size() == 1) { + stringified.push_back(option + values[0].ToSQLString()); + } else { + vector sub_values; + for (auto &val : values) { + sub_values.push_back(val.ToSQLString()); + } + stringified.push_back(option + "( " + StringUtil::Join(sub_values, ", ") + " )"); + } + } + result += StringUtil::Join(stringified, ", "); + result += " )"; + return result; +} + +string CopyInfo::TablePartToString() const { + string result; + + D_ASSERT(!table.empty()); + result += QualifierToString(catalog, schema, table); + + // (c1, c2, ..) + if (!select_list.empty()) { + vector options; + for (auto &option : select_list) { + options.push_back(KeywordHelper::WriteOptionallyQuoted(option)); + } + result += " ("; + result += StringUtil::Join(options, ", "); + result += " )"; + } + return result; +} + +string CopyInfo::ToString() const { + string result = ""; + result += "COPY "; + if (is_from) { + D_ASSERT(!select_statement); + result += TablePartToString(); + result += " FROM"; + result += StringUtil::Format(" %s", SQLString(file_path)); + result += CopyOptionsToString(format, options); + } else { + if (select_statement) { + // COPY (select-node) TO ... + result += "(" + select_statement->ToString() + ")"; + } else { + result += TablePartToString(); + } + result += " TO "; + result += StringUtil::Format("%s", SQLString(file_path)); + result += CopyOptionsToString(format, options); + } + result += ";"; + return result; +} + +} // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/create_index_info.cpp b/src/duckdb/src/parser/parsed_data/create_index_info.cpp index 739d0362..4f2ff610 100644 --- a/src/duckdb/src/parser/parsed_data/create_index_info.cpp +++ b/src/duckdb/src/parser/parsed_data/create_index_info.cpp @@ -41,7 +41,7 @@ string CreateIndexInfo::ToString() const { } result += KeywordHelper::WriteOptionallyQuoted(index_name); result += " ON "; - result += KeywordHelper::WriteOptionallyQuoted(table); + result += QualifierToString(temporary ? "" : catalog, schema, table); if (index_type != "ART") { result += " USING "; result += KeywordHelper::WriteOptionallyQuoted(index_type); @@ -57,7 +57,20 @@ string CreateIndexInfo::ToString() const { // column ref expressions are qualified with the table name // we need to remove them to reproduce the original query RemoveTableQualificationRecursive(copy, table); - result += copy->ToString(); + bool add_parenthesis = true; + if (copy->type == ExpressionType::COLUMN_REF) { + auto &column_ref = copy->Cast(); + if (!column_ref.IsQualified()) { + // Only when column references are not qualified, i.e (col1, col2) + // then these expressions do not need to be wrapped in parenthesis + add_parenthesis = false; + } + } + if (add_parenthesis) { + result += StringUtil::Format("(%s)", copy->ToString()); + } else { + result += StringUtil::Format("%s", copy->ToString()); + } } result += ")"; if (!options.empty()) { @@ -72,6 +85,7 @@ string CreateIndexInfo::ToString() const { } result += " )"; } + result += ";"; return result; } diff --git a/src/duckdb/src/parser/parsed_data/create_info.cpp b/src/duckdb/src/parser/parsed_data/create_info.cpp index a548955b..92777cd7 100644 --- a/src/duckdb/src/parser/parsed_data/create_info.cpp +++ b/src/duckdb/src/parser/parsed_data/create_info.cpp @@ -19,7 +19,9 @@ void CreateInfo::CopyProperties(CreateInfo &other) const { other.temporary = temporary; other.internal = internal; other.sql = sql; + other.dependencies = dependencies; other.comment = comment; + other.tags = tags; } unique_ptr CreateInfo::GetAlterInfo() const { diff --git a/src/duckdb/src/parser/parsed_data/create_schema_info.cpp b/src/duckdb/src/parser/parsed_data/create_schema_info.cpp new file mode 100644 index 00000000..36796b95 --- /dev/null +++ b/src/duckdb/src/parser/parsed_data/create_schema_info.cpp @@ -0,0 +1,40 @@ +#include "duckdb/parser/parsed_data/create_schema_info.hpp" +#include "duckdb/parser/keyword_helper.hpp" + +namespace duckdb { + +CreateSchemaInfo::CreateSchemaInfo() : CreateInfo(CatalogType::SCHEMA_ENTRY) { +} + +unique_ptr CreateSchemaInfo::Copy() const { + auto result = make_uniq(); + CopyProperties(*result); + return std::move(result); +} + +string CreateSchemaInfo::ToString() const { + string ret = ""; + string qualified = QualifierToString(temporary ? "" : catalog, "", schema); + + switch (on_conflict) { + case OnCreateConflict::ALTER_ON_CONFLICT: { + ret += "CREATE SCHEMA " + qualified + " ON CONFLICT INSERT OR REPLACE;"; + break; + } + case OnCreateConflict::IGNORE_ON_CONFLICT: { + ret += "CREATE SCHEMA " + qualified + " IF NOT EXISTS;"; + break; + } + case OnCreateConflict::REPLACE_ON_CONFLICT: { + ret += "CREATE OR REPLACE SCHEMA " + qualified + ";"; + break; + } + case OnCreateConflict::ERROR_ON_CONFLICT: { + ret += "CREATE SCHEMA " + qualified + ";"; + break; + } + } + return ret; +} + +} // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp b/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp index d7caac02..ba5d83b3 100644 --- a/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +++ b/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp @@ -24,4 +24,26 @@ unique_ptr CreateSequenceInfo::Copy() const { return std::move(result); } +string CreateSequenceInfo::ToString() const { + std::stringstream ss; + ss << "CREATE"; + if (on_conflict == OnCreateConflict::REPLACE_ON_CONFLICT) { + ss << " OR REPLACE"; + } + if (temporary) { + ss << " TEMPORARY"; + } + ss << " SEQUENCE "; + if (on_conflict == OnCreateConflict::IGNORE_ON_CONFLICT) { + ss << " IF NOT EXISTS "; + } + ss << QualifierToString(temporary ? "" : catalog, schema, name); + ss << " INCREMENT BY " << increment; + ss << " MINVALUE " << min_value; + ss << " MAXVALUE " << max_value; + ss << " START " << start_value; + ss << " " << (cycle ? "CYCLE" : "NO CYCLE") << ";"; + return ss.str(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/create_table_info.cpp b/src/duckdb/src/parser/parsed_data/create_table_info.cpp index 69d1f8da..c9df2578 100644 --- a/src/duckdb/src/parser/parsed_data/create_table_info.cpp +++ b/src/duckdb/src/parser/parsed_data/create_table_info.cpp @@ -32,12 +32,20 @@ unique_ptr CreateTableInfo::Copy() const { string CreateTableInfo::ToString() const { string ret = ""; - string table_name = KeywordHelper::WriteOptionallyQuoted(table); - if (schema != DEFAULT_SCHEMA) { - table_name = KeywordHelper::WriteOptionallyQuoted(schema) + "." + table_name; + ret += "CREATE"; + if (on_conflict == OnCreateConflict::REPLACE_ON_CONFLICT) { + ret += " OR REPLACE"; } + if (temporary) { + ret += " TEMP"; + } + ret += " TABLE "; + + if (on_conflict == OnCreateConflict::IGNORE_ON_CONFLICT) { + ret += " IF NOT EXISTS "; + } + ret += QualifierToString(temporary ? "" : catalog, schema, table); - ret += "CREATE TABLE " + table_name; if (query != nullptr) { ret += " AS " + query->ToString(); } else { diff --git a/src/duckdb/src/parser/parsed_data/create_type_info.cpp b/src/duckdb/src/parser/parsed_data/create_type_info.cpp index 17603891..3c0472c9 100644 --- a/src/duckdb/src/parser/parsed_data/create_type_info.cpp +++ b/src/duckdb/src/parser/parsed_data/create_type_info.cpp @@ -2,13 +2,15 @@ #include "duckdb/catalog/catalog_entry/schema_catalog_entry.hpp" #include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp" #include "duckdb/catalog/catalog.hpp" +#include "duckdb/common/extra_type_info.hpp" namespace duckdb { -CreateTypeInfo::CreateTypeInfo() : CreateInfo(CatalogType::TYPE_ENTRY) { +CreateTypeInfo::CreateTypeInfo() : CreateInfo(CatalogType::TYPE_ENTRY), bind_modifiers(nullptr) { } -CreateTypeInfo::CreateTypeInfo(string name_p, LogicalType type_p) - : CreateInfo(CatalogType::TYPE_ENTRY), name(std::move(name_p)), type(std::move(type_p)) { +CreateTypeInfo::CreateTypeInfo(string name_p, LogicalType type_p, bind_type_modifiers_function_t bind_modifiers_p) + : CreateInfo(CatalogType::TYPE_ENTRY), name(std::move(name_p)), type(std::move(type_p)), + bind_modifiers(bind_modifiers_p) { } unique_ptr CreateTypeInfo::Copy() const { @@ -19,25 +21,46 @@ unique_ptr CreateTypeInfo::Copy() const { if (query) { result->query = query->Copy(); } + result->bind_modifiers = bind_modifiers; return std::move(result); } string CreateTypeInfo::ToString() const { string result = ""; - D_ASSERT(type.id() == LogicalTypeId::ENUM); - auto &values_insert_order = EnumType::GetValuesInsertOrder(type); - idx_t size = EnumType::GetSize(type); - result += "CREATE TYPE "; - result += KeywordHelper::WriteOptionallyQuoted(name); - result += " AS ENUM ( "; + result += "CREATE"; + if (temporary) { + // These are created by PIVOT + throw NotImplementedException("CREATE TEMPORARY TYPE can't be parsed currently"); + } + result += " TYPE "; + result += QualifierToString(temporary ? "" : catalog, schema, name); + if (type.id() == LogicalTypeId::ENUM) { + auto &values_insert_order = EnumType::GetValuesInsertOrder(type); + idx_t size = EnumType::GetSize(type); - for (idx_t i = 0; i < size; i++) { - result += "'" + values_insert_order.GetValue(i).ToString() + "'"; - if (i != size - 1) { - result += ", "; + result += " AS ENUM ( "; + for (idx_t i = 0; i < size; i++) { + result += "'" + values_insert_order.GetValue(i).ToString() + "'"; + if (i != size - 1) { + result += ", "; + } } + result += " );"; + } else if (type.id() == LogicalTypeId::INVALID) { + // CREATE TYPE mood AS ENUM (SELECT 'happy') + D_ASSERT(query); + result += " AS ENUM (" + query->ToString() + ")"; + } else if (type.id() == LogicalTypeId::USER) { + result += " AS "; + auto extra_info = type.AuxInfo(); + D_ASSERT(extra_info); + D_ASSERT(extra_info->type == ExtraTypeInfoType::USER_TYPE_INFO); + auto &user_info = extra_info->Cast(); + result += QualifierToString(user_info.catalog, user_info.schema, user_info.user_type_name); + } else { + result += " AS "; + result += type.ToString(); } - result += " );"; return result; } diff --git a/src/duckdb/src/parser/parsed_data/create_view_info.cpp b/src/duckdb/src/parser/parsed_data/create_view_info.cpp index 78d14969..ee8a71c5 100644 --- a/src/duckdb/src/parser/parsed_data/create_view_info.cpp +++ b/src/duckdb/src/parser/parsed_data/create_view_info.cpp @@ -30,11 +30,10 @@ string CreateViewInfo::ToString() const { result += " TEMPORARY"; } result += " VIEW "; - if (schema != DEFAULT_SCHEMA) { - result += KeywordHelper::WriteOptionallyQuoted(schema); - result += "."; + if (on_conflict == OnCreateConflict::IGNORE_ON_CONFLICT) { + result += " IF NOT EXISTS "; } - result += KeywordHelper::WriteOptionallyQuoted(view_name); + result += QualifierToString(temporary ? "" : catalog, schema, view_name); if (!aliases.empty()) { result += " ("; result += StringUtil::Join(aliases, aliases.size(), ", ", @@ -43,6 +42,7 @@ string CreateViewInfo::ToString() const { } result += " AS "; result += query->ToString(); + result += ";"; return result; } diff --git a/src/duckdb/src/parser/parsed_data/detach_info.cpp b/src/duckdb/src/parser/parsed_data/detach_info.cpp index 04a8a71a..62302315 100644 --- a/src/duckdb/src/parser/parsed_data/detach_info.cpp +++ b/src/duckdb/src/parser/parsed_data/detach_info.cpp @@ -1,4 +1,5 @@ #include "duckdb/parser/parsed_data/detach_info.hpp" +#include "duckdb/parser/keyword_helper.hpp" namespace duckdb { @@ -12,4 +13,15 @@ unique_ptr DetachInfo::Copy() const { return result; } +string DetachInfo::ToString() const { + string result = ""; + result += "DETACH DATABASE"; + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += " " + KeywordHelper::WriteOptionallyQuoted(name); + result += ";"; + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/drop_info.cpp b/src/duckdb/src/parser/parsed_data/drop_info.cpp index ce856750..c5db57dd 100644 --- a/src/duckdb/src/parser/parsed_data/drop_info.cpp +++ b/src/duckdb/src/parser/parsed_data/drop_info.cpp @@ -16,4 +16,25 @@ unique_ptr DropInfo::Copy() const { return make_uniq(*this); } +string DropInfo::ToString() const { + string result = ""; + if (type == CatalogType::PREPARED_STATEMENT) { + result += "DEALLOCATE PREPARE "; + result += KeywordHelper::WriteOptionallyQuoted(name); + } else { + result += "DROP"; + result += " " + ParseInfo::TypeToString(type); + if (if_not_found == OnEntryNotFound::RETURN_NULL) { + result += " IF EXISTS"; + } + result += " "; + result += QualifierToString(catalog, schema, name); + if (cascade) { + result += " CASCADE"; + } + } + result += ";"; + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/load_info.cpp b/src/duckdb/src/parser/parsed_data/load_info.cpp new file mode 100644 index 00000000..30142961 --- /dev/null +++ b/src/duckdb/src/parser/parsed_data/load_info.cpp @@ -0,0 +1,46 @@ +#include "duckdb/parser/parsed_data/load_info.hpp" +#include "duckdb/common/enum_util.hpp" +#include "duckdb/common/string_util.hpp" +#include "duckdb/parser/keyword_helper.hpp" + +namespace duckdb { + +unique_ptr LoadInfo::Copy() const { + auto result = make_uniq(); + result->filename = filename; + result->repository = repository; + result->load_type = load_type; + result->repo_is_alias = repo_is_alias; + return result; +} + +static string LoadInfoToString(LoadType load_type) { + switch (load_type) { + case LoadType::LOAD: + return "LOAD"; + case LoadType::INSTALL: + return "INSTALL"; + case LoadType::FORCE_INSTALL: + return "FORCE INSTALL"; + default: + throw InternalException("ToString for LoadType with type: %s not implemented", EnumUtil::ToString(load_type)); + } +} + +string LoadInfo::ToString() const { + string result = ""; + result += LoadInfoToString(load_type); + result += StringUtil::Format(" '%s'", filename); + if (!repository.empty()) { + if (repo_is_alias) { + result += " FROM " + KeywordHelper::WriteOptionallyQuoted(repository); + } else { + result += " FROM " + KeywordHelper::WriteQuoted(repository); + } + } + + result += ";"; + return result; +} + +} // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/parse_info.cpp b/src/duckdb/src/parser/parsed_data/parse_info.cpp new file mode 100644 index 00000000..63f7c67c --- /dev/null +++ b/src/duckdb/src/parser/parsed_data/parse_info.cpp @@ -0,0 +1,50 @@ +#include "duckdb/parser/parsed_data/parse_info.hpp" +#include "duckdb/common/enums/catalog_type.hpp" +#include "duckdb/common/enum_util.hpp" +#include "duckdb/parser/keyword_helper.hpp" + +namespace duckdb { + +string ParseInfo::TypeToString(CatalogType type) { + switch (type) { + case CatalogType::TABLE_ENTRY: + return "TABLE"; + case CatalogType::SCALAR_FUNCTION_ENTRY: + return "FUNCTION"; + case CatalogType::INDEX_ENTRY: + return "INDEX"; + case CatalogType::SCHEMA_ENTRY: + return "SCHEMA"; + case CatalogType::TYPE_ENTRY: + return "TYPE"; + case CatalogType::VIEW_ENTRY: + return "VIEW"; + case CatalogType::SEQUENCE_ENTRY: + return "SEQUENCE"; + case CatalogType::MACRO_ENTRY: + return "MACRO"; + case CatalogType::TABLE_MACRO_ENTRY: + return "MACRO TABLE"; + case CatalogType::SECRET_ENTRY: + return "SECRET"; + default: + throw InternalException("ParseInfo::TypeToString for CatalogType with type: %s not implemented", + EnumUtil::ToString(type)); + } +} + +string ParseInfo::QualifierToString(const string &catalog, const string &schema, const string &name) { + string result; + if (!catalog.empty()) { + result += KeywordHelper::WriteOptionallyQuoted(catalog) + "."; + if (!schema.empty()) { + result += KeywordHelper::WriteOptionallyQuoted(schema) + "."; + } + } else if (!schema.empty() && schema != DEFAULT_SCHEMA) { + result += KeywordHelper::WriteOptionallyQuoted(schema) + "."; + } + result += KeywordHelper::WriteOptionallyQuoted(name); + return result; +} + +} // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/pragma_info.cpp b/src/duckdb/src/parser/parsed_data/pragma_info.cpp new file mode 100644 index 00000000..3052c441 --- /dev/null +++ b/src/duckdb/src/parser/parsed_data/pragma_info.cpp @@ -0,0 +1,33 @@ +#include "duckdb/parser/parsed_data/pragma_info.hpp" + +namespace duckdb { + +unique_ptr PragmaInfo::Copy() const { + auto result = make_uniq(); + result->name = name; + for (auto ¶m : parameters) { + result->parameters.push_back(param->Copy()); + } + for (auto &entry : named_parameters) { + result->named_parameters.insert(make_pair(entry.first, entry.second->Copy())); + } + return result; +} + +string PragmaInfo::ToString() const { + string result = ""; + result += "PRAGMA"; + // FIXME: Can pragma's live in different catalog/schemas ? + result += " " + KeywordHelper::WriteOptionallyQuoted(name); + if (!parameters.empty()) { + vector stringified; + for (auto ¶m : parameters) { + stringified.push_back(param->ToString()); + } + result += "(" + StringUtil::Join(stringified, ", ") + ")"; + } + result += ";"; + return result; +} + +} // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/transaction_info.cpp b/src/duckdb/src/parser/parsed_data/transaction_info.cpp index d0cc8112..8e1aeb67 100644 --- a/src/duckdb/src/parser/parsed_data/transaction_info.cpp +++ b/src/duckdb/src/parser/parsed_data/transaction_info.cpp @@ -1,4 +1,5 @@ #include "duckdb/parser/parsed_data/transaction_info.hpp" +#include "duckdb/common/enum_util.hpp" namespace duckdb { @@ -8,4 +9,25 @@ TransactionInfo::TransactionInfo() : ParseInfo(TYPE) { TransactionInfo::TransactionInfo(TransactionType type) : ParseInfo(TYPE), type(type) { } +string TransactionInfo::ToString() const { + string result = ""; + switch (type) { + case TransactionType::BEGIN_TRANSACTION: + result += "BEGIN"; + break; + case TransactionType::COMMIT: + result += "COMMIT"; + break; + case TransactionType::ROLLBACK: + result += "ROLLBACK"; + break; + default: { + throw InternalException("ToString for TransactionStatement with type: %s not implemented", + EnumUtil::ToString(type)); + } + } + result += ";"; + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_data/vacuum_info.cpp b/src/duckdb/src/parser/parsed_data/vacuum_info.cpp index cf832693..7fff15e8 100644 --- a/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +++ b/src/duckdb/src/parser/parsed_data/vacuum_info.cpp @@ -15,4 +15,24 @@ unique_ptr VacuumInfo::Copy() { return result; } +string VacuumInfo::ToString() const { + string result = ""; + result += "VACUUM"; + if (options.analyze) { + result += " ANALYZE"; + } + if (ref) { + result += " " + ref->ToString(); + if (!columns.empty()) { + vector names; + for (auto &column : columns) { + names.push_back(KeywordHelper::WriteOptionallyQuoted(column)); + } + result += "(" + StringUtil::Join(names, ", ") + ")"; + } + } + result += ";"; + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/parsed_expression_iterator.cpp b/src/duckdb/src/parser/parsed_expression_iterator.cpp index 50a46691..cb2516c7 100644 --- a/src/duckdb/src/parser/parsed_expression_iterator.cpp +++ b/src/duckdb/src/parser/parsed_expression_iterator.cpp @@ -242,6 +242,7 @@ void ParsedExpressionIterator::EnumerateTableRefChildren( case TableReferenceType::BASE_TABLE: case TableReferenceType::EMPTY_FROM: case TableReferenceType::SHOW_REF: + case TableReferenceType::COLUMN_DATA: // these TableRefs do not need to be unfolded break; case TableReferenceType::INVALID: diff --git a/src/duckdb/src/parser/parser.cpp b/src/duckdb/src/parser/parser.cpp index 8274c521..7dd7a43d 100644 --- a/src/duckdb/src/parser/parser.cpp +++ b/src/duckdb/src/parser/parser.cpp @@ -181,7 +181,7 @@ void Parser::ParseQuery(const string &query) { } else { parser_error = parser.error_message; if (parser.error_location > 0) { - parser_error_location = parser.error_location - 1; + parser_error_location = NumericCast(parser.error_location - 1); } } } @@ -196,7 +196,7 @@ void Parser::ParseQuery(const string &query) { } else { // split sql string into statements and re-parse using extension auto query_statements = SplitQueryStringIntoStatements(query); - auto stmt_loc = 0; + idx_t stmt_loc = 0; for (auto const &query_statement : query_statements) { ErrorData another_parser_error; // Creating a new scope to allow extensions to use PostgresParser, which is not reentrant @@ -219,7 +219,8 @@ void Parser::ParseQuery(const string &query) { } else { another_parser_error = ErrorData(another_parser.error_message); if (another_parser.error_location > 0) { - another_parser_error.AddQueryLocation(another_parser.error_location - 1); + another_parser_error.AddQueryLocation( + NumericCast(another_parser.error_location - 1)); } } } // LCOV_EXCL_STOP @@ -292,7 +293,7 @@ vector Parser::Tokenize(const string &query) { default: throw InternalException("Unrecognized token category"); } // LCOV_EXCL_STOP - token.start = pg_token.start; + token.start = NumericCast(pg_token.start); result.push_back(token); } return result; diff --git a/src/duckdb/src/parser/query_node.cpp b/src/duckdb/src/parser/query_node.cpp index dab1375f..7b084c5c 100644 --- a/src/duckdb/src/parser/query_node.cpp +++ b/src/duckdb/src/parser/query_node.cpp @@ -24,6 +24,7 @@ CommonTableExpressionMap CommonTableExpressionMap::Copy() const { kv_info->materialized = kv.second->materialized; res.map[kv.first] = std::move(kv_info); } + return res; } @@ -44,6 +45,7 @@ string CommonTableExpressionMap::ToString() const { result += "RECURSIVE "; } bool first_cte = true; + for (auto &kv : map) { if (!first_cte) { result += ", "; @@ -131,15 +133,17 @@ bool QueryNode::Equals(const QueryNode *other) const { if (cte_map.map.size() != other->cte_map.map.size()) { return false; } + for (auto &entry : cte_map.map) { auto other_entry = other->cte_map.map.find(entry.first); if (other_entry == other->cte_map.map.end()) { return false; } - if (entry.second->aliases != other_entry->second->aliases) { + + if (entry.second->aliases != other->cte_map.map.at(entry.first)->aliases) { return false; } - if (!entry.second->query->Equals(*other_entry->second->query)) { + if (!entry.second->query->Equals(*other->cte_map.map.at(entry.first)->query)) { return false; } } diff --git a/src/duckdb/src/parser/statement/alter_statement.cpp b/src/duckdb/src/parser/statement/alter_statement.cpp index f9a05f08..e964783c 100644 --- a/src/duckdb/src/parser/statement/alter_statement.cpp +++ b/src/duckdb/src/parser/statement/alter_statement.cpp @@ -12,4 +12,8 @@ unique_ptr AlterStatement::Copy() const { return unique_ptr(new AlterStatement(*this)); } +string AlterStatement::ToString() const { + return info->ToString(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/attach_statement.cpp b/src/duckdb/src/parser/statement/attach_statement.cpp index 0bae08cd..12958a22 100644 --- a/src/duckdb/src/parser/statement/attach_statement.cpp +++ b/src/duckdb/src/parser/statement/attach_statement.cpp @@ -12,4 +12,8 @@ unique_ptr AttachStatement::Copy() const { return unique_ptr(new AttachStatement(*this)); } +string AttachStatement::ToString() const { + return info->ToString(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/call_statement.cpp b/src/duckdb/src/parser/statement/call_statement.cpp index cd7a2218..646765af 100644 --- a/src/duckdb/src/parser/statement/call_statement.cpp +++ b/src/duckdb/src/parser/statement/call_statement.cpp @@ -12,4 +12,12 @@ unique_ptr CallStatement::Copy() const { return unique_ptr(new CallStatement(*this)); } +string CallStatement::ToString() const { + string result = ""; + result += "CALL"; + result += " " + function->ToString(); + result += ";"; + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/copy_statement.cpp b/src/duckdb/src/parser/statement/copy_statement.cpp index 9031de28..5a77447b 100644 --- a/src/duckdb/src/parser/statement/copy_statement.cpp +++ b/src/duckdb/src/parser/statement/copy_statement.cpp @@ -6,100 +6,10 @@ CopyStatement::CopyStatement() : SQLStatement(StatementType::COPY_STATEMENT), in } CopyStatement::CopyStatement(const CopyStatement &other) : SQLStatement(other), info(other.info->Copy()) { - if (other.select_statement) { - select_statement = other.select_statement->Copy(); - } -} - -string CopyStatement::CopyOptionsToString(const string &format, - const case_insensitive_map_t> &options) const { - if (format.empty() && options.empty()) { - return string(); - } - string result; - - result += " ("; - if (!format.empty()) { - result += " FORMAT "; - result += format; - } - for (auto it = options.begin(); it != options.end(); it++) { - if (!format.empty() || it != options.begin()) { - result += ", "; - } - auto &name = it->first; - auto &values = it->second; - - result += name + " "; - if (values.empty()) { - // Options like HEADER don't need an explicit value - // just providing the name already sets it to true - } else if (values.size() == 1) { - result += values[0].ToSQLString(); - } else { - result += "( "; - for (idx_t i = 0; i < values.size(); i++) { - if (i) { - result += ", "; - } - result += values[i].ToSQLString(); - } - result += " )"; - } - } - result += " )"; - return result; -} - -// COPY table-name (c1, c2, ..) -string TablePart(const CopyInfo &info) { - string result; - - if (!info.catalog.empty()) { - result += KeywordHelper::WriteOptionallyQuoted(info.catalog) + "."; - } - if (!info.schema.empty()) { - result += KeywordHelper::WriteOptionallyQuoted(info.schema) + "."; - } - D_ASSERT(!info.table.empty()); - result += KeywordHelper::WriteOptionallyQuoted(info.table); - - // (c1, c2, ..) - if (!info.select_list.empty()) { - result += " ("; - for (idx_t i = 0; i < info.select_list.size(); i++) { - if (i > 0) { - result += ", "; - } - result += KeywordHelper::WriteOptionallyQuoted(info.select_list[i]); - } - result += " )"; - } - return result; } string CopyStatement::ToString() const { - string result; - - result += "COPY "; - if (info->is_from) { - D_ASSERT(!select_statement); - result += TablePart(*info); - result += " FROM"; - result += StringUtil::Format(" %s", SQLString(info->file_path)); - result += CopyOptionsToString(info->format, info->options); - } else { - if (select_statement) { - // COPY (select-node) TO ... - result += "(" + select_statement->ToString() + ")"; - } else { - result += TablePart(*info); - } - result += " TO "; - result += StringUtil::Format("%s", SQLString(info->file_path)); - result += CopyOptionsToString(info->format, info->options); - } - return result; + return info->ToString(); } unique_ptr CopyStatement::Copy() const { diff --git a/src/duckdb/src/parser/statement/detach_statement.cpp b/src/duckdb/src/parser/statement/detach_statement.cpp index 1ca52f71..0239e940 100644 --- a/src/duckdb/src/parser/statement/detach_statement.cpp +++ b/src/duckdb/src/parser/statement/detach_statement.cpp @@ -12,4 +12,8 @@ unique_ptr DetachStatement::Copy() const { return unique_ptr(new DetachStatement(*this)); } +string DetachStatement::ToString() const { + return info->ToString(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/drop_statement.cpp b/src/duckdb/src/parser/statement/drop_statement.cpp index 7bf363f3..b1ad8fd6 100644 --- a/src/duckdb/src/parser/statement/drop_statement.cpp +++ b/src/duckdb/src/parser/statement/drop_statement.cpp @@ -12,4 +12,8 @@ unique_ptr DropStatement::Copy() const { return unique_ptr(new DropStatement(*this)); } +string DropStatement::ToString() const { + return info->ToString(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/execute_statement.cpp b/src/duckdb/src/parser/statement/execute_statement.cpp index 2a2fa131..b052b71b 100644 --- a/src/duckdb/src/parser/statement/execute_statement.cpp +++ b/src/duckdb/src/parser/statement/execute_statement.cpp @@ -15,4 +15,19 @@ unique_ptr ExecuteStatement::Copy() const { return unique_ptr(new ExecuteStatement(*this)); } +string ExecuteStatement::ToString() const { + string result = ""; + result += "EXECUTE"; + result += " " + name; + if (!named_values.empty()) { + vector stringified; + for (auto &val : named_values) { + stringified.push_back(StringUtil::Format("\"%s\" := %s", val.first, val.second->ToString())); + } + result += "(" + StringUtil::Join(stringified, ", ") + ")"; + } + result += ";"; + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/explain_statement.cpp b/src/duckdb/src/parser/statement/explain_statement.cpp index 2ad08fec..8ab2b94e 100644 --- a/src/duckdb/src/parser/statement/explain_statement.cpp +++ b/src/duckdb/src/parser/statement/explain_statement.cpp @@ -1,4 +1,5 @@ #include "duckdb/parser/statement/explain_statement.hpp" +#include "duckdb/common/enum_util.hpp" namespace duckdb { @@ -14,4 +15,22 @@ unique_ptr ExplainStatement::Copy() const { return unique_ptr(new ExplainStatement(*this)); } +static string ExplainTypeToString(ExplainType type) { + switch (type) { + case ExplainType::EXPLAIN_STANDARD: + return "EXPLAIN"; + case ExplainType::EXPLAIN_ANALYZE: + return "EXPLAIN ANALYZE"; + default: + throw InternalException("ToString for ExplainType with type: %s not implemented", EnumUtil::ToString(type)); + } +} + +string ExplainStatement::ToString() const { + string result = ""; + result += ExplainTypeToString(explain_type); + result += " " + stmt->ToString(); + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/export_statement.cpp b/src/duckdb/src/parser/statement/export_statement.cpp index e4b7f07b..2b2e0c83 100644 --- a/src/duckdb/src/parser/statement/export_statement.cpp +++ b/src/duckdb/src/parser/statement/export_statement.cpp @@ -1,4 +1,6 @@ #include "duckdb/parser/statement/export_statement.hpp" +#include "duckdb/parser/parsed_data/copy_info.hpp" +#include "duckdb/parser/query_node.hpp" namespace duckdb { @@ -14,4 +16,20 @@ unique_ptr ExportStatement::Copy() const { return unique_ptr(new ExportStatement(*this)); } +string ExportStatement::ToString() const { + string result = ""; + result += "EXPORT DATABASE"; + if (!database.empty()) { + result += " " + database + " TO"; + } + auto &path = info->file_path; + D_ASSERT(info->is_from == false); + auto &options = info->options; + auto &format = info->format; + result += StringUtil::Format(" '%s'", path); + result += CopyInfo::CopyOptionsToString(format, options); + result += ";"; + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/extension_statement.cpp b/src/duckdb/src/parser/statement/extension_statement.cpp index 22d6dec1..ac0e66f5 100644 --- a/src/duckdb/src/parser/statement/extension_statement.cpp +++ b/src/duckdb/src/parser/statement/extension_statement.cpp @@ -11,4 +11,8 @@ unique_ptr ExtensionStatement::Copy() const { return make_uniq(extension, parse_data->Copy()); } +string ExtensionStatement::ToString() const { + return parse_data->ToString(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/load_statement.cpp b/src/duckdb/src/parser/statement/load_statement.cpp index da59355c..8ab6e37a 100644 --- a/src/duckdb/src/parser/statement/load_statement.cpp +++ b/src/duckdb/src/parser/statement/load_statement.cpp @@ -12,4 +12,8 @@ unique_ptr LoadStatement::Copy() const { return unique_ptr(new LoadStatement(*this)); } +string LoadStatement::ToString() const { + return info->ToString(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/multi_statement.cpp b/src/duckdb/src/parser/statement/multi_statement.cpp index 3daea30f..2821084c 100644 --- a/src/duckdb/src/parser/statement/multi_statement.cpp +++ b/src/duckdb/src/parser/statement/multi_statement.cpp @@ -15,4 +15,12 @@ unique_ptr MultiStatement::Copy() const { return unique_ptr(new MultiStatement(*this)); } +string MultiStatement::ToString() const { + vector stringified; + for (auto &stmt : statements) { + stringified.push_back(stmt->ToString()); + } + return StringUtil::Join(stringified, ";") + ";"; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/pragma_statement.cpp b/src/duckdb/src/parser/statement/pragma_statement.cpp index 7c083b29..b1503456 100644 --- a/src/duckdb/src/parser/statement/pragma_statement.cpp +++ b/src/duckdb/src/parser/statement/pragma_statement.cpp @@ -12,4 +12,8 @@ unique_ptr PragmaStatement::Copy() const { return unique_ptr(new PragmaStatement(*this)); } +string PragmaStatement::ToString() const { + return info->ToString(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/prepare_statement.cpp b/src/duckdb/src/parser/statement/prepare_statement.cpp index 5e50dfc3..69c8ba9e 100644 --- a/src/duckdb/src/parser/statement/prepare_statement.cpp +++ b/src/duckdb/src/parser/statement/prepare_statement.cpp @@ -13,4 +13,17 @@ unique_ptr PrepareStatement::Copy() const { return unique_ptr(new PrepareStatement(*this)); } +string PrepareStatement::ToString() const { + string result = ""; + result += "PREPARE"; + result += " "; + result += name; + result += " "; + result += "AS"; + result += " "; + result += statement->ToString(); + // NOTE: We expect SQLStatement->ToString() to always end in a ';' ^ + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/relation_statement.cpp b/src/duckdb/src/parser/statement/relation_statement.cpp index 50721ee3..3fd5ade1 100644 --- a/src/duckdb/src/parser/statement/relation_statement.cpp +++ b/src/duckdb/src/parser/statement/relation_statement.cpp @@ -10,4 +10,8 @@ unique_ptr RelationStatement::Copy() const { return unique_ptr(new RelationStatement(*this)); } +string RelationStatement::ToString() const { + return relation->ToString(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/set_statement.cpp b/src/duckdb/src/parser/statement/set_statement.cpp index fd98ab6a..a487421d 100644 --- a/src/duckdb/src/parser/statement/set_statement.cpp +++ b/src/duckdb/src/parser/statement/set_statement.cpp @@ -1,4 +1,5 @@ #include "duckdb/parser/statement/set_statement.hpp" +#include "duckdb/common/enum_util.hpp" namespace duckdb { @@ -6,10 +7,6 @@ SetStatement::SetStatement(std::string name_p, SetScope scope_p, SetType type_p) : SQLStatement(StatementType::SET_STATEMENT), name(std::move(name_p)), scope(scope_p), set_type(type_p) { } -unique_ptr SetStatement::Copy() const { - return unique_ptr(new SetStatement(*this)); -} - // Set Variable SetVariableStatement::SetVariableStatement(std::string name_p, unique_ptr value_p, SetScope scope_p) @@ -24,10 +21,42 @@ unique_ptr SetVariableStatement::Copy() const { return unique_ptr(new SetVariableStatement(*this)); } +static string ScopeToString(SetScope scope) { + switch (scope) { + case SetScope::AUTOMATIC: + return ""; + case SetScope::LOCAL: + return "LOCAL"; + case SetScope::SESSION: + return "SESSION"; + case SetScope::GLOBAL: + return "GLOBAL"; + default: + throw InternalException("ToString not implemented for SetScope of type: %s", EnumUtil::ToString(scope)); + } +} + +string SetVariableStatement::ToString() const { + return StringUtil::Format("SET %s %s TO %s;", ScopeToString(scope), name, value->ToString()); +} + // Reset Variable ResetVariableStatement::ResetVariableStatement(std::string name_p, SetScope scope_p) : SetStatement(std::move(name_p), scope_p, SetType::RESET) { } +unique_ptr ResetVariableStatement::Copy() const { + return unique_ptr(new ResetVariableStatement(*this)); +} + +string ResetVariableStatement::ToString() const { + string result = ""; + result += "RESET"; + result += " " + ScopeToString(scope); + result += " " + name; + result += ";"; + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/transaction_statement.cpp b/src/duckdb/src/parser/statement/transaction_statement.cpp index 6903ab84..9ff14825 100644 --- a/src/duckdb/src/parser/statement/transaction_statement.cpp +++ b/src/duckdb/src/parser/statement/transaction_statement.cpp @@ -14,4 +14,8 @@ unique_ptr TransactionStatement::Copy() const { return unique_ptr(new TransactionStatement(*this)); } +string TransactionStatement::ToString() const { + return info->ToString(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/statement/update_extensions_statement.cpp b/src/duckdb/src/parser/statement/update_extensions_statement.cpp new file mode 100644 index 00000000..73fea01d --- /dev/null +++ b/src/duckdb/src/parser/statement/update_extensions_statement.cpp @@ -0,0 +1,34 @@ +#include "duckdb/parser/statement/update_extensions_statement.hpp" + +namespace duckdb { + +UpdateExtensionsStatement::UpdateExtensionsStatement() : SQLStatement(StatementType::UPDATE_EXTENSIONS_STATEMENT) { +} + +UpdateExtensionsStatement::UpdateExtensionsStatement(const UpdateExtensionsStatement &other) + : SQLStatement(other), info(other.info->Copy()) { +} + +string UpdateExtensionsStatement::ToString() const { + string result; + result += "UPDATE EXTENSIONS"; + + if (!info->extensions_to_update.empty()) { + result += "("; + for (idx_t i = 0; i < info->extensions_to_update.size(); i++) { + if (i > 0) { + result += ", "; + } + result += info->extensions_to_update[i]; + } + result += ")"; + } + + return result; +} + +unique_ptr UpdateExtensionsStatement::Copy() const { + return unique_ptr(new UpdateExtensionsStatement(*this)); +} + +} // namespace duckdb diff --git a/src/duckdb/src/parser/statement/vacuum_statement.cpp b/src/duckdb/src/parser/statement/vacuum_statement.cpp index 5596acf8..e78f422b 100644 --- a/src/duckdb/src/parser/statement/vacuum_statement.cpp +++ b/src/duckdb/src/parser/statement/vacuum_statement.cpp @@ -13,4 +13,8 @@ unique_ptr VacuumStatement::Copy() const { return unique_ptr(new VacuumStatement(*this)); } +string VacuumStatement::ToString() const { + return info->ToString(); +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/tableref.cpp b/src/duckdb/src/parser/tableref.cpp index 3d72020f..f8b8db70 100644 --- a/src/duckdb/src/parser/tableref.cpp +++ b/src/duckdb/src/parser/tableref.cpp @@ -48,6 +48,7 @@ void TableRef::CopyProperties(TableRef &target) const { target.alias = alias; target.query_location = query_location; target.sample = sample ? sample->Copy() : nullptr; + target.external_dependency = external_dependency; } void TableRef::Print() { diff --git a/src/duckdb/src/parser/tableref/column_data_ref.cpp b/src/duckdb/src/parser/tableref/column_data_ref.cpp new file mode 100644 index 00000000..e815451d --- /dev/null +++ b/src/duckdb/src/parser/tableref/column_data_ref.cpp @@ -0,0 +1,81 @@ +#include "duckdb/parser/tableref/column_data_ref.hpp" +#include "duckdb/common/string_util.hpp" + +#include "duckdb/common/serializer/serializer.hpp" +#include "duckdb/common/serializer/deserializer.hpp" + +namespace duckdb { + +string ColumnDataRef::ToString() const { + auto result = collection->ToString(); + return BaseToString(result, expected_names); +} + +bool ColumnDataRef::Equals(const TableRef &other_p) const { + if (!TableRef::Equals(other_p)) { + return false; + } + auto &other = other_p.Cast(); + auto expected_types = collection->Types(); + auto other_expected_types = other.collection->Types(); + if (expected_types.size() != other_expected_types.size()) { + return false; + } + if (expected_names.size() != other.expected_names.size()) { + return false; + } + D_ASSERT(expected_types.size() == expected_names.size()); + for (idx_t i = 0; i < expected_types.size(); i++) { + auto &this_type = expected_types[i]; + auto &other_type = other_expected_types[i]; + + auto &this_name = expected_names[i]; + auto &other_name = other.expected_names[i]; + + if (this_type != other_type) { + return false; + } + if (!StringUtil::CIEquals(this_name, other_name)) { + return false; + } + } + string unused; + if (!ColumnDataCollection::ResultEquals(*collection, *other.collection, unused, true)) { + return false; + } + return true; +} + +unique_ptr ColumnDataRef::Copy() { + unique_ptr result; + if (collection.is_owned()) { + // This collection is owned, the copy should be self sufficient so it needs a copy + auto new_collection = make_uniq(*collection); + + DataChunk chunk; + collection->InitializeScanChunk(chunk); + + ColumnDataScanState scan_state; + collection->InitializeScan(scan_state); + + ColumnDataAppendState append_state; + new_collection->InitializeAppend(append_state); + while (collection->Scan(scan_state, chunk)) { + new_collection->Append(append_state, chunk); + } +#ifdef DEBUG + string error_message; + if (!ColumnDataCollection::ResultEquals(*collection, *new_collection, error_message, true)) { + throw InternalException("Copied ColumnDataCollection was not equal: %s", error_message); + } +#endif + result = make_uniq(expected_names, std::move(new_collection)); + } else { + result = make_uniq(*collection); + } + result->expected_names = expected_names; + CopyProperties(*result); + return std::move(result); +} + +} // namespace duckdb diff --git a/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp b/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp index ec9dffb7..3c96f4da 100644 --- a/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp +++ b/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp @@ -20,9 +20,9 @@ static unique_ptr TransformBooleanTestInternal(unique_ptr TransformBooleanTestIsNull(unique_ptr argument, - ExpressionType operator_type, idx_t query_location) { + ExpressionType operator_type, int query_location) { auto result = make_uniq(operator_type, std::move(argument)); - Transformer::SetQueryLocation(*result, UnsafeNumericCast(query_location)); + Transformer::SetQueryLocation(*result, query_location); return std::move(result); } diff --git a/src/duckdb/src/parser/transform/expression/transform_cast.cpp b/src/duckdb/src/parser/transform/expression/transform_cast.cpp index c10c81d7..a4b1dde5 100644 --- a/src/duckdb/src/parser/transform/expression/transform_cast.cpp +++ b/src/duckdb/src/parser/transform/expression/transform_cast.cpp @@ -18,7 +18,7 @@ unique_ptr Transformer::TransformTypeCast(duckdb_libpgquery::P if (c->val.type == duckdb_libpgquery::T_PGString) { CastParameters parameters; if (root.location >= 0) { - parameters.query_location = root.location; + parameters.query_location = NumericCast(root.location); } auto blob_data = Blob::ToBlob(string(c->val.val.str), parameters); return make_uniq(Value::BLOB_RAW(blob_data)); diff --git a/src/duckdb/src/parser/transform/expression/transform_interval.cpp b/src/duckdb/src/parser/transform/expression/transform_interval.cpp index 50450f5f..421ebde9 100644 --- a/src/duckdb/src/parser/transform/expression/transform_interval.cpp +++ b/src/duckdb/src/parser/transform/expression/transform_interval.cpp @@ -34,7 +34,7 @@ unique_ptr Transformer::TransformInterval(duckdb_libpgquery::P int32_t mask = NumericCast( PGPointerCast(node.typmods->head->data.ptr_value)->val.val.ival); - // these seemingly random constants are from datetime.hpp + // these seemingly random constants are from libpg_query/include/utils/datetime.hpp // they are copied here to avoid having to include this header // the bitshift is from the function INTERVAL_MASK in the parser constexpr int32_t MONTH_MASK = 1 << 1; @@ -49,6 +49,7 @@ unique_ptr Transformer::TransformInterval(duckdb_libpgquery::P constexpr int32_t DECADE_MASK = 1 << 25; constexpr int32_t CENTURY_MASK = 1 << 26; constexpr int32_t MILLENNIUM_MASK = 1 << 27; + constexpr int32_t QUARTER_MASK = 1 << 29; // we need to check certain combinations // because certain interval masks (e.g. INTERVAL '10' HOURS TO DAYS) set multiple bits @@ -115,6 +116,10 @@ unique_ptr Transformer::TransformInterval(duckdb_libpgquery::P // WEEK fname = "to_weeks"; target_type = LogicalType::INTEGER; + } else if (mask & QUARTER_MASK) { + // QUARTER + fname = "to_quarters"; + target_type = LogicalType::INTEGER; } else if (mask & DECADE_MASK) { // DECADE fname = "to_decades"; diff --git a/src/duckdb/src/parser/transform/expression/transform_param_ref.cpp b/src/duckdb/src/parser/transform/expression/transform_param_ref.cpp index d5d7931f..2d4ba515 100644 --- a/src/duckdb/src/parser/transform/expression/transform_param_ref.cpp +++ b/src/duckdb/src/parser/transform/expression/transform_param_ref.cpp @@ -40,7 +40,7 @@ unique_ptr Transformer::TransformParamRef(duckdb_libpgquery::P // We have not seen this parameter before if (node.number != 0) { // Preserve the parameter number - known_param_index = node.number; + known_param_index = NumericCast(node.number); } else { known_param_index = ParamCount() + 1; if (!node.name) { diff --git a/src/duckdb/src/parser/transform/expression/transform_positional_reference.cpp b/src/duckdb/src/parser/transform/expression/transform_positional_reference.cpp index efe7d3da..8d672948 100644 --- a/src/duckdb/src/parser/transform/expression/transform_positional_reference.cpp +++ b/src/duckdb/src/parser/transform/expression/transform_positional_reference.cpp @@ -8,7 +8,7 @@ unique_ptr Transformer::TransformPositionalReference(duckdb_li if (node.position <= 0) { throw ParserException("Positional reference node needs to be >= 1"); } - auto result = make_uniq(node.position); + auto result = make_uniq(NumericCast(node.position)); SetQueryLocation(*result, node.location); return std::move(result); } diff --git a/src/duckdb/src/parser/transform/expression/transform_subquery.cpp b/src/duckdb/src/parser/transform/expression/transform_subquery.cpp index c8dbe23a..2a06d590 100644 --- a/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +++ b/src/duckdb/src/parser/transform/expression/transform_subquery.cpp @@ -4,9 +4,23 @@ #include "duckdb/parser/tableref/subqueryref.hpp" #include "duckdb/parser/expression/constant_expression.hpp" #include "duckdb/parser/expression/positional_reference_expression.hpp" +#include "duckdb/parser/parsed_expression_iterator.hpp" namespace duckdb { +void RemoveOrderQualificationRecursive(unique_ptr &expr) { + if (expr->GetExpressionType() == ExpressionType::COLUMN_REF) { + auto &col_ref = expr->Cast(); + auto &col_names = col_ref.column_names; + if (col_names.size() > 1) { + col_names = vector {col_names.back()}; + } + } else { + ParsedExpressionIterator::EnumerateChildren( + *expr, [](unique_ptr &child) { RemoveOrderQualificationRecursive(child); }); + } +} + unique_ptr Transformer::TransformSubquery(duckdb_libpgquery::PGSubLink &root) { auto subquery_expr = make_uniq(); @@ -90,6 +104,8 @@ unique_ptr Transformer::TransformSubquery(duckdb_libpgquery::P idx_t positional_index = order_index < 0 ? NumericLimits::Maximum() : idx_t(order_index); order.expression = make_uniq(positional_index); } + } else { + RemoveOrderQualificationRecursive(order.expression); } } } diff --git a/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp b/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp index 14563286..ed9e2e37 100644 --- a/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp +++ b/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp @@ -458,6 +458,8 @@ std::string Transformer::NodetypeToString(duckdb_libpgquery::PGNodeTag type) { / return "T_DeleteStmt"; case duckdb_libpgquery::T_PGUpdateStmt: return "T_UpdateStmt"; + case duckdb_libpgquery::T_PGUpdateExtensionsStmt: + return "T_UpdateExtensionsStmt"; case duckdb_libpgquery::T_PGSelectStmt: return "T_SelectStmt"; case duckdb_libpgquery::T_PGAlterTableStmt: diff --git a/src/duckdb/src/parser/transform/helpers/transform_typename.cpp b/src/duckdb/src/parser/transform/helpers/transform_typename.cpp index ff40554f..e3cab920 100644 --- a/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +++ b/src/duckdb/src/parser/transform/helpers/transform_typename.cpp @@ -5,9 +5,72 @@ #include "duckdb/parser/transformer.hpp" #include "duckdb/common/types/decimal.hpp" #include "duckdb/common/types/vector.hpp" +#include "duckdb/parser/expression/constant_expression.hpp" namespace duckdb { +struct SizeModifiers { + int64_t width = 0; + int64_t scale = 0; + // How many modifiers were found + idx_t count = 0; +}; + +static SizeModifiers GetSizeModifiers(duckdb_libpgquery::PGTypeName &type_name, LogicalTypeId base_type) { + + SizeModifiers result; + + if (base_type == LogicalTypeId::DECIMAL) { + // Defaults for DECIMAL + result.width = 18; + result.scale = 3; + } + + if (type_name.typmods) { + for (auto node = type_name.typmods->head; node; node = node->next) { + auto &const_val = *Transformer::PGPointerCast(node->data.ptr_value); + if (const_val.type != duckdb_libpgquery::T_PGAConst || + const_val.val.type != duckdb_libpgquery::T_PGInteger) { + throw ParserException("Expected an integer constant as type modifier"); + } + if (const_val.val.val.ival < 0) { + throw ParserException("Negative modifier not supported"); + } + if (result.count == 0) { + result.width = const_val.val.val.ival; + if (base_type == LogicalTypeId::BIT && const_val.location != -1) { + result.width = 0; + } + } else if (result.count == 1) { + result.scale = const_val.val.val.ival; + } else { + throw ParserException("A maximum of two modifiers is supported"); + } + result.count++; + } + } + return result; +} + +vector Transformer::TransformTypeModifiers(duckdb_libpgquery::PGTypeName &type_name) { + vector type_mods; + if (type_name.typmods) { + for (auto node = type_name.typmods->head; node; node = node->next) { + if (type_mods.size() > 9) { + auto name = PGPointerCast(type_name.names->tail->data.ptr_value)->val.str; + throw ParserException("'%s': a maximum of 9 type modifiers is allowed", name); + } + auto &const_val = *PGPointerCast(node->data.ptr_value); + if (const_val.type != duckdb_libpgquery::T_PGAConst) { + throw ParserException("Expected a constant as type modifier"); + } + auto const_expr = TransformValue(const_val.val); + type_mods.push_back(std::move(const_expr->value)); + } + } + return type_mods; +} + LogicalType Transformer::TransformTypeName(duckdb_libpgquery::PGTypeName &type_name) { if (type_name.type != duckdb_libpgquery::T_PGTypeName) { throw ParserException("Expected a type"); @@ -20,11 +83,13 @@ LogicalType Transformer::TransformTypeName(duckdb_libpgquery::PGTypeName &type_n for (auto cell = type_name.names->head; cell; cell = cell->next) { names.push_back(PGPointerCast(cell->data.ptr_value)->val.str); } + vector type_mods = TransformTypeModifiers(type_name); switch (type_name.names->length) { case 2: - return LogicalType::USER(INVALID_CATALOG, std::move(names[0]), std::move(names[1])); + return LogicalType::USER(INVALID_CATALOG, std::move(names[0]), std::move(names[1]), std::move(type_mods)); case 3: - return LogicalType::USER(std::move(names[0]), std::move(names[1]), std::move(names[2])); + return LogicalType::USER(std::move(names[0]), std::move(names[1]), std::move(names[2]), + std::move(type_mods)); default: throw ParserException( "Too many qualifications for type name - expected [catalog.schema.name] or [schema.name]"); @@ -41,7 +106,7 @@ LogicalType Transformer::TransformTypeName(duckdb_libpgquery::PGTypeName &type_n if (!type_name.typmods || type_name.typmods->length == 0) { throw ParserException("Enum needs a set of entries"); } - Vector enum_vector(LogicalType::VARCHAR, type_name.typmods->length); + Vector enum_vector(LogicalType::VARCHAR, NumericCast(type_name.typmods->length)); auto string_data = FlatVector::GetData(enum_vector); idx_t pos = 0; for (auto node = type_name.typmods->head; node; node = node->next) { @@ -52,7 +117,7 @@ LogicalType Transformer::TransformTypeName(duckdb_libpgquery::PGTypeName &type_n } string_data[pos++] = StringVector::AddString(enum_vector, constant_value->val.val.str); } - return LogicalType::ENUM(enum_vector, type_name.typmods->length); + return LogicalType::ENUM(enum_vector, NumericCast(type_name.typmods->length)); } else if (base_type == LogicalTypeId::STRUCT) { if (!type_name.typmods || type_name.typmods->length == 0) { throw ParserException("Struct needs a name and entries"); @@ -131,97 +196,66 @@ LogicalType Transformer::TransformTypeName(duckdb_libpgquery::PGTypeName &type_n } D_ASSERT(!children.empty()); result_type = LogicalType::UNION(std::move(children)); + } else if (base_type == LogicalTypeId::USER) { + string user_type_name {name}; + vector type_mods = TransformTypeModifiers(type_name); + result_type = LogicalType::USER(user_type_name, type_mods); } else { - idx_t width, scale; - if (base_type == LogicalTypeId::DECIMAL) { - // default decimal width/scale - width = 18; - scale = 3; - } else { - width = 0; - scale = 0; - } - // check any modifiers - int modifier_idx = 0; - if (type_name.typmods) { - for (auto node = type_name.typmods->head; node; node = node->next) { - auto &const_val = *PGPointerCast(node->data.ptr_value); - if (const_val.type != duckdb_libpgquery::T_PGAConst || - const_val.val.type != duckdb_libpgquery::T_PGInteger) { - throw ParserException("Expected an integer constant as type modifier"); - } - if (const_val.val.val.ival < 0) { - throw ParserException("Negative modifier not supported"); - } - if (modifier_idx == 0) { - width = const_val.val.val.ival; - if (base_type == LogicalTypeId::BIT && const_val.location != -1) { - width = 0; - } - } else if (modifier_idx == 1) { - scale = const_val.val.val.ival; - } else { - throw ParserException("A maximum of two modifiers is supported"); - } - modifier_idx++; - } - } + SizeModifiers modifiers = GetSizeModifiers(type_name, base_type); switch (base_type) { case LogicalTypeId::VARCHAR: - if (modifier_idx > 1) { + if (modifiers.count > 1) { throw ParserException("VARCHAR only supports a single modifier"); } // FIXME: create CHECK constraint based on varchar width - width = 0; + modifiers.width = 0; result_type = LogicalType::VARCHAR; break; case LogicalTypeId::DECIMAL: - if (modifier_idx == 1) { + if (modifiers.count > 2) { + throw ParserException("DECIMAL only supports a maximum of two modifiers"); + } + if (modifiers.count == 1) { // only width is provided: set scale to 0 - scale = 0; + modifiers.scale = 0; } - if (width <= 0 || width > Decimal::MAX_WIDTH_DECIMAL) { + if (modifiers.width <= 0 || modifiers.width > Decimal::MAX_WIDTH_DECIMAL) { throw ParserException("Width must be between 1 and %d!", (int)Decimal::MAX_WIDTH_DECIMAL); } - if (scale > width) { + if (modifiers.scale > modifiers.width) { throw ParserException("Scale cannot be bigger than width"); } - result_type = LogicalType::DECIMAL(NumericCast(width), NumericCast(scale)); + result_type = + LogicalType::DECIMAL(NumericCast(modifiers.width), NumericCast(modifiers.scale)); break; case LogicalTypeId::INTERVAL: - if (modifier_idx > 1) { + if (modifiers.count > 1) { throw ParserException("INTERVAL only supports a single modifier"); } - width = 0; + modifiers.width = 0; result_type = LogicalType::INTERVAL; break; - case LogicalTypeId::USER: { - string user_type_name {name}; - result_type = LogicalType::USER(user_type_name); - break; - } - case LogicalTypeId::BIT: { - if (!width && type_name.typmods) { + case LogicalTypeId::BIT: + if (!modifiers.width && type_name.typmods) { throw ParserException("Type %s does not support any modifiers!", LogicalType(base_type).ToString()); } result_type = LogicalType(base_type); break; - } case LogicalTypeId::TIMESTAMP: - if (modifier_idx == 0) { + if (modifiers.count == 0) { result_type = LogicalType::TIMESTAMP; } else { - if (modifier_idx > 1) { + if (modifiers.count > 1) { throw ParserException("TIMESTAMP only supports a single modifier"); } - if (width > 10) { + if (modifiers.width > 10) { throw ParserException("TIMESTAMP only supports until nano-second precision (9)"); } - if (width == 0) { + if (modifiers.width == 0) { result_type = LogicalType::TIMESTAMP_S; - } else if (width <= 3) { + } else if (modifiers.width <= 3) { result_type = LogicalType::TIMESTAMP_MS; - } else if (width <= 6) { + } else if (modifiers.width <= 6) { result_type = LogicalType::TIMESTAMP; } else { result_type = LogicalType::TIMESTAMP_NS; @@ -229,7 +263,7 @@ LogicalType Transformer::TransformTypeName(duckdb_libpgquery::PGTypeName &type_n } break; default: - if (modifier_idx > 0) { + if (modifiers.count > 0) { throw ParserException("Type %s does not support any modifiers!", LogicalType(base_type).ToString()); } result_type = LogicalType(base_type); @@ -255,7 +289,7 @@ LogicalType Transformer::TransformTypeName(duckdb_libpgquery::PGTypeName &type_n } else if (array_size > static_cast(ArrayType::MAX_ARRAY_SIZE)) { throw ParserException("Arrays must have a size of at most %d", ArrayType::MAX_ARRAY_SIZE); } else { - result_type = LogicalType::ARRAY(result_type, array_size); + result_type = LogicalType::ARRAY(result_type, NumericCast(array_size)); } } } diff --git a/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp b/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp index e52d1df2..6f8fded6 100644 --- a/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp +++ b/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp @@ -11,6 +11,8 @@ unique_ptr Transformer::TransformCheckpoint(duckdb_libpgquery::PGC auto checkpoint_name = stmt.force ? "force_checkpoint" : "checkpoint"; auto result = make_uniq(); auto function = make_uniq(checkpoint_name, std::move(children)); + function->catalog = SYSTEM_CATALOG; + function->schema = DEFAULT_SCHEMA; if (stmt.name) { function->children.push_back(make_uniq(Value(stmt.name))); } diff --git a/src/duckdb/src/parser/transform/statement/transform_copy.cpp b/src/duckdb/src/parser/transform/statement/transform_copy.cpp index 909ab168..5da207dd 100644 --- a/src/duckdb/src/parser/transform/statement/transform_copy.cpp +++ b/src/duckdb/src/parser/transform/statement/transform_copy.cpp @@ -117,7 +117,7 @@ unique_ptr Transformer::TransformCopy(duckdb_libpgquery::PGCopySt info.schema = table.schema_name; info.catalog = table.catalog_name; } else { - result->select_statement = TransformSelectNode(*PGPointerCast(stmt.query)); + info.select_statement = TransformSelectNode(*PGPointerCast(stmt.query)); } // handle the different options of the COPY statement diff --git a/src/duckdb/src/parser/transform/statement/transform_load.cpp b/src/duckdb/src/parser/transform/statement/transform_load.cpp index 4e8ec950..50ef3783 100644 --- a/src/duckdb/src/parser/transform/statement/transform_load.cpp +++ b/src/duckdb/src/parser/transform/statement/transform_load.cpp @@ -8,8 +8,10 @@ unique_ptr Transformer::TransformLoad(duckdb_libpgquery::PGLoadSt auto load_stmt = make_uniq(); auto load_info = make_uniq(); - load_info->filename = std::string(stmt.filename); - load_info->repository = std::string(stmt.repository); + load_info->filename = stmt.filename ? string(stmt.filename) : ""; + load_info->repository = stmt.repository ? string(stmt.repository) : ""; + load_info->repo_is_alias = stmt.repo_is_alias; + load_info->version = stmt.version ? string(stmt.version) : ""; switch (stmt.load_type) { case duckdb_libpgquery::PG_LOAD_TYPE_LOAD: load_info->load_type = LoadType::LOAD; diff --git a/src/duckdb/src/parser/transform/statement/transform_update.cpp b/src/duckdb/src/parser/transform/statement/transform_update.cpp index 6d704835..5de96657 100644 --- a/src/duckdb/src/parser/transform/statement/transform_update.cpp +++ b/src/duckdb/src/parser/transform/statement/transform_update.cpp @@ -1,4 +1,5 @@ #include "duckdb/parser/statement/update_statement.hpp" +#include "duckdb/parser/statement/update_extensions_statement.hpp" #include "duckdb/parser/transformer.hpp" namespace duckdb { @@ -38,4 +39,22 @@ unique_ptr Transformer::TransformUpdate(duckdb_libpgquery::PGUp return result; } +unique_ptr +Transformer::TransformUpdateExtensions(duckdb_libpgquery::PGUpdateExtensionsStmt &stmt) { + auto result = make_uniq(); + auto info = make_uniq(); + + if (stmt.extensions) { + auto column_list = PGPointerCast(stmt.extensions); + for (auto c = column_list->head; c != nullptr; c = lnext(c)) { + auto extension = reinterpret_cast(c->data.ptr_value)->val.str; + info->extensions_to_update.emplace_back(extension); + } + } + + result->info = std::move(info); + + return result; +} + } // namespace duckdb diff --git a/src/duckdb/src/parser/transformer.cpp b/src/duckdb/src/parser/transformer.cpp index 8c54c46a..b713f3c2 100644 --- a/src/duckdb/src/parser/transformer.cpp +++ b/src/duckdb/src/parser/transformer.cpp @@ -134,8 +134,8 @@ unique_ptr Transformer::TransformStatementInternal(duckdb_libpgque auto &raw_stmt = PGCast(stmt); auto result = TransformStatement(*raw_stmt.stmt); if (result) { - result->stmt_location = raw_stmt.stmt_location; - result->stmt_length = raw_stmt.stmt_len; + result->stmt_location = NumericCast(raw_stmt.stmt_location); + result->stmt_length = NumericCast(raw_stmt.stmt_len); } return result; } @@ -163,6 +163,8 @@ unique_ptr Transformer::TransformStatementInternal(duckdb_libpgque return TransformDelete(PGCast(stmt)); case duckdb_libpgquery::T_PGUpdateStmt: return TransformUpdate(PGCast(stmt)); + case duckdb_libpgquery::T_PGUpdateExtensionsStmt: + return TransformUpdateExtensions(PGCast(stmt)); case duckdb_libpgquery::T_PGIndexStmt: return TransformCreateIndex(PGCast(stmt)); case duckdb_libpgquery::T_PGAlterTableStmt: @@ -225,6 +227,7 @@ unique_ptr Transformer::TransformStatementInternal(duckdb_libpgque unique_ptr Transformer::TransformMaterializedCTE(unique_ptr root) { // Extract materialized CTEs from cte_map vector> materialized_ctes; + for (auto &cte : root->cte_map.map) { auto &cte_entry = cte.second; if (cte_entry->materialized == CTEMaterialize::CTE_MATERIALIZE_ALWAYS) { diff --git a/src/duckdb/src/planner/bind_context.cpp b/src/duckdb/src/planner/bind_context.cpp index 6323ebad..9e7da9c7 100644 --- a/src/duckdb/src/planner/bind_context.cpp +++ b/src/duckdb/src/planner/bind_context.cpp @@ -514,13 +514,13 @@ void BindContext::AddGenericBinding(idx_t index, const string &alias, const vect void BindContext::AddCTEBinding(idx_t index, const string &alias, const vector &names, const vector &types) { - auto binding = make_shared(BindingType::BASE, alias, types, names, index); + auto binding = make_shared_ptr(BindingType::BASE, alias, types, names, index); if (cte_bindings.find(alias) != cte_bindings.end()) { throw BinderException("Duplicate alias \"%s\" in query!", alias); } cte_bindings[alias] = std::move(binding); - cte_references[alias] = std::make_shared(0); + cte_references[alias] = make_shared_ptr(0); } void BindContext::AddContext(BindContext other) { diff --git a/src/duckdb/src/planner/binder.cpp b/src/duckdb/src/planner/binder.cpp index 8239fd29..e59a3310 100644 --- a/src/duckdb/src/planner/binder.cpp +++ b/src/duckdb/src/planner/binder.cpp @@ -16,6 +16,8 @@ #include "duckdb/planner/operator/logical_projection.hpp" #include "duckdb/planner/operator/logical_sample.hpp" #include "duckdb/parser/query_node/list.hpp" +#include "duckdb/common/helper.hpp" +#include "duckdb/common/enum_util.hpp" #include @@ -39,26 +41,27 @@ idx_t Binder::GetBinderDepth() const { return depth; } -shared_ptr Binder::CreateBinder(ClientContext &context, optional_ptr parent, bool inherit_ctes) { +shared_ptr Binder::CreateBinder(ClientContext &context, optional_ptr parent, BinderType binder_type) { auto depth = parent ? parent->GetBinderDepth() : 0; if (depth > context.config.max_expression_depth) { throw BinderException("Max expression depth limit of %lld exceeded. Use \"SET max_expression_depth TO x\" to " "increase the maximum expression depth.", context.config.max_expression_depth); } - return make_shared(true, context, parent ? parent->shared_from_this() : nullptr, inherit_ctes); + return make_shared_ptr(true, context, parent ? parent->shared_from_this() : nullptr, binder_type); } -Binder::Binder(bool, ClientContext &context, shared_ptr parent_p, bool inherit_ctes_p) - : context(context), bind_context(*this), parent(std::move(parent_p)), bound_tables(0), - inherit_ctes(inherit_ctes_p) { +Binder::Binder(bool, ClientContext &context, shared_ptr parent_p, BinderType binder_type) + : context(context), bind_context(*this), parent(std::move(parent_p)), bound_tables(0), binder_type(binder_type), + entry_retriever(context) { if (parent) { + entry_retriever.SetCallback(parent->entry_retriever.GetCallback()); // We have to inherit macro and lambda parameter bindings and from the parent binder, if there is a parent. macro_binding = parent->macro_binding; lambda_bindings = parent->lambda_bindings; - if (inherit_ctes) { + if (binder_type == BinderType::REGULAR_BINDER) { // We have to inherit CTE bindings from the parent bind_context, if there is a parent. bind_context.SetCTEBindings(parent->bind_context.GetCTEBindings()); bind_context.cte_references = parent->bind_context.cte_references; @@ -110,22 +113,22 @@ BoundStatement Binder::BindWithCTE(T &statement) { BoundStatement bound_statement; auto bound_cte = BindMaterializedCTE(statement.template Cast().cte_map); if (bound_cte) { - BoundCTENode *tail = bound_cte.get(); + reference tail_ref = *bound_cte; - while (tail->child && tail->child->type == QueryNodeType::CTE_NODE) { - tail = &tail->child->Cast(); + while (tail_ref.get().child && tail_ref.get().child->type == QueryNodeType::CTE_NODE) { + tail_ref = tail_ref.get().child->Cast(); } - bound_statement = tail->child_binder->Bind(statement.template Cast()); + auto &tail = tail_ref.get(); + bound_statement = tail.child_binder->Bind(statement.template Cast()); - tail->types = bound_statement.types; - tail->names = bound_statement.names; + tail.types = bound_statement.types; + tail.names = bound_statement.names; - for (auto &c : tail->query_binder->correlated_columns) { - tail->child_binder->AddCorrelatedColumn(c); + for (auto &c : tail.query_binder->correlated_columns) { + tail.child_binder->AddCorrelatedColumn(c); } - - MoveCorrelatedExpressions(*tail->child_binder); + MoveCorrelatedExpressions(*tail.child_binder); // extract operator below root operation auto plan = std::move(bound_statement.plan->children[0]); @@ -188,6 +191,8 @@ BoundStatement Binder::Bind(SQLStatement &statement) { return Bind(statement.Cast()); case StatementType::COPY_DATABASE_STATEMENT: return Bind(statement.Cast()); + case StatementType::UPDATE_EXTENSIONS_STATEMENT: + return Bind(statement.Cast()); default: // LCOV_EXCL_START throw NotImplementedException("Unimplemented statement type \"%s\" for Bind", StatementTypeToString(statement.type)); @@ -271,6 +276,9 @@ unique_ptr Binder::Bind(TableRef &ref) { case TableReferenceType::EXPRESSION_LIST: result = Bind(ref.Cast()); break; + case TableReferenceType::COLUMN_DATA: + result = Bind(ref.Cast()); + break; case TableReferenceType::PIVOT: result = Bind(ref.Cast()); break; @@ -280,7 +288,7 @@ unique_ptr Binder::Bind(TableRef &ref) { case TableReferenceType::CTE: case TableReferenceType::INVALID: default: - throw InternalException("Unknown table ref type"); + throw InternalException("Unknown table ref type (%s)", EnumUtil::ToString(ref.type)); } result->sample = std::move(ref.sample); return result; @@ -307,6 +315,9 @@ unique_ptr Binder::CreatePlan(BoundTableRef &ref) { case TableReferenceType::EXPRESSION_LIST: root = CreatePlan(ref.Cast()); break; + case TableReferenceType::COLUMN_DATA: + root = CreatePlan(ref.Cast()); + break; case TableReferenceType::CTE: root = CreatePlan(ref.Cast()); break; @@ -315,7 +326,7 @@ unique_ptr Binder::CreatePlan(BoundTableRef &ref) { break; case TableReferenceType::INVALID: default: - throw InternalException("Unsupported bound table ref type"); + throw InternalException("Unsupported bound table ref type (%s)", EnumUtil::ToString(ref.type)); } // plan the sample clause if (ref.sample) { @@ -341,7 +352,7 @@ vector> Binder::FindCTE(const string &name, ctes.push_back(entry->second); } } - if (parent && inherit_ctes) { + if (parent && binder_type == BinderType::REGULAR_BINDER) { auto parent_ctes = parent->FindCTE(name, name == alias); ctes.insert(ctes.end(), parent_ctes.begin(), parent_ctes.end()); } @@ -352,7 +363,7 @@ bool Binder::CTEIsAlreadyBound(CommonTableExpressionInfo &cte) { if (bound_ctes.find(cte) != bound_ctes.end()) { return true; } - if (parent && inherit_ctes) { + if (parent && binder_type == BinderType::REGULAR_BINDER) { return parent->CTEIsAlreadyBound(cte); } return false; @@ -375,6 +386,11 @@ idx_t Binder::GenerateTableIndex() { return root_binder.bound_tables++; } +StatementProperties &Binder::GetStatementProperties() { + auto &root_binder = GetRootBinder(); + return root_binder.prop; +} + void Binder::PushExpressionBinder(ExpressionBinder &binder) { GetActiveBinders().push_back(binder); } @@ -398,7 +414,11 @@ bool Binder::HasActiveBinder() { } vector> &Binder::GetActiveBinders() { - auto &root_binder = GetRootBinder(); + reference root = *this; + while (root.get().parent && root.get().binder_type == BinderType::REGULAR_BINDER) { + root = *root.get().parent; + } + auto &root_binder = root.get(); return root_binder.active_binders; } @@ -487,15 +507,8 @@ void Binder::SetCanContainNulls(bool can_contain_nulls_p) { } void Binder::SetAlwaysRequireRebind() { - reference current_binder = *this; - while (true) { - auto ¤t = current_binder.get(); - current.properties.always_require_rebind = true; - if (!current.parent) { - break; - } - current_binder = *current.parent; - } + auto &properties = GetStatementProperties(); + properties.always_require_rebind = true; } void Binder::AddTableName(string table_name) { @@ -571,9 +584,16 @@ BoundStatement Binder::BindReturning(vector> return // where the data modification doesn't take place until the streamed result is exhausted. Once a row is // returned, it should be guaranteed that the row has been inserted. // see https://github.com/duckdb/duckdb/issues/8310 + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; properties.return_type = StatementReturnType::QUERY_RESULT; return result; } +optional_ptr Binder::GetCatalogEntry(CatalogType type, const string &catalog, const string &schema, + const string &name, OnEntryNotFound on_entry_not_found, + QueryErrorContext &error_context) { + return entry_retriever.GetEntry(type, catalog, schema, name, on_entry_not_found, error_context); +} + } // namespace duckdb diff --git a/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp b/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp index eecd07ea..5caf89a6 100644 --- a/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +++ b/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp @@ -6,6 +6,8 @@ #include "duckdb/planner/expression/bound_cast_expression.hpp" #include "duckdb/planner/expression/bound_columnref_expression.hpp" #include "duckdb/planner/expression/bound_constant_expression.hpp" +#include "duckdb/planner/expression/bound_function_expression.hpp" +#include "duckdb/planner/expression_iterator.hpp" #include "duckdb/planner/expression_binder/aggregate_binder.hpp" #include "duckdb/planner/expression_binder/base_select_binder.hpp" #include "duckdb/planner/query_node/bound_select_node.hpp" @@ -17,6 +19,18 @@ namespace duckdb { +static bool ExtractFunctionalDependencies(column_binding_set_t &deps, const unique_ptr &expr) { + if (expr->type == ExpressionType::BOUND_COLUMN_REF) { + auto &colref = expr->Cast(); + deps.insert(colref.binding); + } + + bool is_volatile = expr->IsVolatile(); + ExpressionIterator::EnumerateChildren( + *expr, [&](unique_ptr &child) { is_volatile |= ExtractFunctionalDependencies(deps, child); }); + return is_volatile; +} + static Value NegatePercentileValue(const Value &v, const bool desc) { if (v.IsNull()) { return v; @@ -233,19 +247,32 @@ BindResult BaseSelectBinder::BindAggregate(FunctionExpression &aggr, AggregateFu } } - // If the aggregate is DISTINCT then the ORDER BYs need to be arguments. + // If the aggregate is DISTINCT then the ORDER BYs need to be functional dependencies of the arguments. if (aggr.distinct && order_bys) { + column_binding_set_t child_dependencies; + bool children_volatile = false; + for (const auto &child : children) { + children_volatile |= ExtractFunctionalDependencies(child_dependencies, child); + } + + column_binding_set_t order_dependencies; + bool order_volatile = false; for (const auto &order_by : order_bys->orders) { - bool is_arg = false; - for (const auto &child : children) { - if (order_by.expression->Equals(*child)) { - is_arg = true; + order_volatile |= ExtractFunctionalDependencies(order_dependencies, order_by.expression); + } + + bool in_args = !children_volatile && !order_volatile; + if (in_args) { + for (const auto &binding : order_dependencies) { + if (!child_dependencies.count(binding)) { + in_args = false; break; } } - if (!is_arg) { - throw BinderException("In a DISTINCT aggregate, ORDER BY expressions must appear in the argument list"); - } + } + + if (!in_args) { + throw BinderException("In a DISTINCT aggregate, ORDER BY expressions must appear in the argument list"); } } diff --git a/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp b/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp index 68272d0a..79d9047e 100644 --- a/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +++ b/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp @@ -14,7 +14,7 @@ BindResult ExpressionBinder::BindExpression(CastExpression &expr, idx_t depth) { } // FIXME: We can also implement 'hello'::schema.custom_type; and pass by the schema down here. // Right now just considering its DEFAULT_SCHEMA always - Binder::BindLogicalType(context, expr.cast_type); + binder.BindLogicalType(expr.cast_type); // the children have been successfully resolved auto &child = BoundExpression::GetExpression(*expr.child); if (expr.try_cast) { diff --git a/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp b/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp index 0d888e37..8eb9a890 100644 --- a/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +++ b/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp @@ -39,13 +39,12 @@ BindResult ExpressionBinder::BindExpression(FunctionExpression &function, idx_t // lookup the function in the catalog QueryErrorContext error_context(function.query_location); binder.BindSchemaOrCatalog(function.catalog, function.schema); - auto func = Catalog::GetEntry(context, CatalogType::SCALAR_FUNCTION_ENTRY, function.catalog, function.schema, - function.function_name, OnEntryNotFound::RETURN_NULL, error_context); + auto func = GetCatalogEntry(CatalogType::SCALAR_FUNCTION_ENTRY, function.catalog, function.schema, + function.function_name, OnEntryNotFound::RETURN_NULL, error_context); if (!func) { // function was not found - check if we this is a table function - auto table_func = - Catalog::GetEntry(context, CatalogType::TABLE_FUNCTION_ENTRY, function.catalog, function.schema, - function.function_name, OnEntryNotFound::RETURN_NULL, error_context); + auto table_func = GetCatalogEntry(CatalogType::TABLE_FUNCTION_ENTRY, function.catalog, function.schema, + function.function_name, OnEntryNotFound::RETURN_NULL, error_context); if (table_func) { throw BinderException(function, "Function \"%s\" is a table function but it was used as a scalar function. This " @@ -75,8 +74,8 @@ BindResult ExpressionBinder::BindExpression(FunctionExpression &function, idx_t } } // rebind the function - func = Catalog::GetEntry(context, CatalogType::SCALAR_FUNCTION_ENTRY, function.catalog, function.schema, - function.function_name, OnEntryNotFound::THROW_EXCEPTION, error_context); + func = GetCatalogEntry(CatalogType::SCALAR_FUNCTION_ENTRY, function.catalog, function.schema, + function.function_name, OnEntryNotFound::THROW_EXCEPTION, error_context); } if (func->type != CatalogType::AGGREGATE_FUNCTION_ENTRY && @@ -281,4 +280,11 @@ string ExpressionBinder::UnsupportedUnnestMessage() { return "UNNEST not supported here"; } +optional_ptr ExpressionBinder::GetCatalogEntry(CatalogType type, const string &catalog, + const string &schema, const string &name, + OnEntryNotFound on_entry_not_found, + QueryErrorContext &error_context) { + return binder.GetCatalogEntry(type, catalog, schema, name, on_entry_not_found, error_context); +} + } // namespace duckdb diff --git a/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp b/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp index 8c557a45..b434cb81 100644 --- a/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +++ b/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp @@ -45,7 +45,7 @@ unique_ptr Binder::BindOrderExpression(OrderBinder &order_binder, un BoundLimitNode Binder::BindLimitValue(OrderBinder &order_binder, unique_ptr limit_val, bool is_percentage, bool is_offset) { - auto new_binder = Binder::CreateBinder(context, this, true); + auto new_binder = Binder::CreateBinder(context, this); ExpressionBinder expr_binder(*new_binder, context); auto target_type = is_percentage ? LogicalType::DOUBLE : LogicalType::BIGINT; expr_binder.target_type = target_type; diff --git a/src/duckdb/src/planner/binder/query_node/plan_setop.cpp b/src/duckdb/src/planner/binder/query_node/plan_setop.cpp index caccbc45..c7ddf17b 100644 --- a/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +++ b/src/duckdb/src/planner/binder/query_node/plan_setop.cpp @@ -4,6 +4,8 @@ #include "duckdb/planner/operator/logical_projection.hpp" #include "duckdb/planner/operator/logical_set_operation.hpp" #include "duckdb/planner/query_node/bound_set_operation_node.hpp" +#include "duckdb/function/table/read_csv.hpp" +#include "duckdb/planner/operator/logical_get.hpp" namespace duckdb { @@ -23,14 +25,45 @@ unique_ptr Binder::CastLogicalOperatorToTypes(vectortype == LogicalOperatorType::LOGICAL_PROJECTION) { // "node" is a projection; we can just do the casts in there D_ASSERT(node->expressions.size() == source_types.size()); + if (node->children.size() == 1 && node->children[0]->type == LogicalOperatorType::LOGICAL_GET) { + // If this projection only has one child and that child is a logical get we can try to pushdown types + auto &logical_get = node->children[0]->Cast(); + if (logical_get.function.type_pushdown) { + unordered_map new_column_types; + bool do_pushdown = true; + for (idx_t i = 0; i < op->expressions.size(); i++) { + if (op->expressions[i]->type == ExpressionType::BOUND_COLUMN_REF) { + auto &col_ref = op->expressions[i]->Cast(); + if (new_column_types.find(logical_get.column_ids[col_ref.binding.column_index]) != + new_column_types.end()) { + // Only one reference per column is accepted + do_pushdown = false; + break; + } + new_column_types[logical_get.column_ids[col_ref.binding.column_index]] = target_types[i]; + } else { + do_pushdown = false; + break; + } + } + if (do_pushdown) { + logical_get.function.type_pushdown(context, logical_get.bind_data, new_column_types); + // We also have to modify the types to the logical_get.returned_types + for (auto &type : new_column_types) { + logical_get.returned_types[type.first] = type.second; + } + return op; + } + } + } // add the casts to the selection list for (idx_t i = 0; i < target_types.size(); i++) { if (source_types[i] != target_types[i]) { // differing types, have to add a cast - string alias = node->expressions[i]->alias; + string cur_alias = node->expressions[i]->alias; node->expressions[i] = BoundCastExpression::AddCastToType(context, std::move(node->expressions[i]), target_types[i]); - node->expressions[i]->alias = alias; + node->expressions[i]->alias = cur_alias; } } return op; diff --git a/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp b/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp index 3f3aaa92..471c6296 100644 --- a/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +++ b/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp @@ -6,7 +6,6 @@ #include "duckdb/planner/expression/bound_columnref_expression.hpp" #include "duckdb/planner/expression/bound_comparison_expression.hpp" #include "duckdb/planner/expression/bound_constant_expression.hpp" -#include "duckdb/planner/expression/bound_reference_expression.hpp" #include "duckdb/planner/expression/bound_subquery_expression.hpp" #include "duckdb/planner/expression/bound_window_expression.hpp" #include "duckdb/planner/expression_iterator.hpp" @@ -16,7 +15,6 @@ #include "duckdb/planner/subquery/flatten_dependent_join.hpp" #include "duckdb/common/enums/logical_operator_type.hpp" #include "duckdb/planner/operator/logical_dependent_join.hpp" -#include "duckdb/planner/expression_binder/lateral_binder.hpp" #include "duckdb/planner/subquery/recursive_dependent_join_planner.hpp" namespace duckdb { diff --git a/src/duckdb/src/planner/binder/statement/bind_attach.cpp b/src/duckdb/src/planner/binder/statement/bind_attach.cpp index 63921911..48032416 100644 --- a/src/duckdb/src/planner/binder/statement/bind_attach.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_attach.cpp @@ -12,6 +12,8 @@ BoundStatement Binder::Bind(AttachStatement &stmt) { result.names = {"Success"}; result.plan = make_uniq(LogicalOperatorType::LOGICAL_ATTACH, std::move(stmt.info)); + + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; properties.return_type = StatementReturnType::NOTHING; return result; diff --git a/src/duckdb/src/planner/binder/statement/bind_call.cpp b/src/duckdb/src/planner/binder/statement/bind_call.cpp index 8f910bb9..2767ba2d 100644 --- a/src/duckdb/src/planner/binder/statement/bind_call.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_call.cpp @@ -24,6 +24,8 @@ BoundStatement Binder::Bind(CallStatement &stmt) { result.types = get.returned_types; result.names = get.names; result.plan = CreatePlan(*bound_func); + + auto &properties = GetStatementProperties(); properties.return_type = StatementReturnType::QUERY_RESULT; return result; } diff --git a/src/duckdb/src/planner/binder/statement/bind_copy.cpp b/src/duckdb/src/planner/binder/statement/bind_copy.cpp index 80cdc002..1e3928f0 100644 --- a/src/duckdb/src/planner/binder/statement/bind_copy.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_copy.cpp @@ -45,8 +45,10 @@ BoundStatement Binder::BindCopyTo(CopyStatement &stmt) { return copy_function.function.plan(*this, stmt); } + auto ©_info = *stmt.info; // bind the select statement - auto select_node = Bind(*stmt.select_statement); + auto node_copy = copy_info.select_statement->Copy(); + auto select_node = Bind(*node_copy); if (!copy_function.function.copy_to_bind) { throw NotImplementedException("COPY TO is not supported for FORMAT \"%s\"", stmt.info->format); @@ -229,7 +231,7 @@ BoundStatement Binder::BindCopyFrom(CopyStatement &stmt) { } BoundStatement Binder::Bind(CopyStatement &stmt) { - if (!stmt.info->is_from && !stmt.select_statement) { + if (!stmt.info->is_from && !stmt.info->select_statement) { // copy table into file without a query // generate SELECT * FROM table; auto ref = make_uniq(); @@ -246,8 +248,10 @@ BoundStatement Binder::Bind(CopyStatement &stmt) { } else { statement->select_list.push_back(make_uniq()); } - stmt.select_statement = std::move(statement); + stmt.info->select_statement = std::move(statement); } + + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; properties.return_type = StatementReturnType::CHANGED_ROWS; if (stmt.info->is_from) { diff --git a/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp b/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp index 9ab4cc44..c6cf8c00 100644 --- a/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp @@ -15,81 +15,31 @@ #include "duckdb/planner/expression/bound_constant_expression.hpp" #include "duckdb/planner/operator/logical_dummy_scan.hpp" #include "duckdb/planner/operator/logical_expression_get.hpp" +#include "duckdb/catalog/duck_catalog.hpp" +#include "duckdb/catalog/dependency_manager.hpp" namespace duckdb { -unique_ptr Binder::BindCopyDatabaseSchema(Catalog &source_catalog, - const string &target_database_name) { - auto source_schemas = source_catalog.GetSchemas(context); +unique_ptr Binder::BindCopyDatabaseSchema(Catalog &from_database, const string &target_database_name) { - ExportEntries entries; - PhysicalExport::ExtractEntries(context, source_schemas, entries); + catalog_entry_vector_t catalog_entries; + catalog_entries = PhysicalExport::GetNaiveExportOrder(context, from_database); auto info = make_uniq(target_database_name); - - // get a list of all schemas to copy over - for (auto &schema_ref : source_schemas) { - auto &schema = schema_ref.get().Cast(); - if (schema.internal) { - continue; - } - auto create_info = schema.GetInfo(); - create_info->catalog = target_database_name; - create_info->on_conflict = OnCreateConflict::IGNORE_ON_CONFLICT; - info->entries.push_back(std::move(create_info)); - } - // get a list of all types to copy over - for (auto &seq_ref : entries.sequences) { - auto &seq_entry = seq_ref.get().Cast(); - if (seq_entry.internal) { - continue; - } - auto create_info = seq_entry.GetInfo(); - create_info->catalog = target_database_name; - create_info->on_conflict = OnCreateConflict::ERROR_ON_CONFLICT; - info->entries.push_back(std::move(create_info)); - } - // get a list of all types to copy over - for (auto &type_ref : entries.custom_types) { - auto &type_entry = type_ref.get().Cast(); - if (type_entry.internal) { - continue; - } - auto create_info = type_entry.GetInfo(); + for (auto &entry : catalog_entries) { + auto create_info = entry.get().GetInfo(); create_info->catalog = target_database_name; - create_info->on_conflict = OnCreateConflict::ERROR_ON_CONFLICT; - info->entries.push_back(std::move(create_info)); - } - // get a list of all tables to copy over - for (auto &table_ref : entries.tables) { - auto &table = table_ref.get().Cast(); - if (table.internal) { - continue; + auto on_conflict = create_info->type == CatalogType::SCHEMA_ENTRY ? OnCreateConflict::IGNORE_ON_CONFLICT + : OnCreateConflict::ERROR_ON_CONFLICT; + // Update all the dependencies of the entry to point to the newly created entries on the target database + LogicalDependencyList altered_dependencies; + for (auto &dep : create_info->dependencies.Set()) { + auto altered_dep = dep; + altered_dep.catalog = target_database_name; + altered_dependencies.AddDependency(altered_dep); } - auto create_info = table.GetInfo(); - create_info->catalog = target_database_name; - create_info->on_conflict = OnCreateConflict::ERROR_ON_CONFLICT; - info->entries.push_back(std::move(create_info)); - } - for (auto ¯o_ref : entries.macros) { - auto ¯o = macro_ref.get().Cast(); - if (macro.internal) { - continue; - } - auto create_info = macro.GetInfo(); - create_info->catalog = target_database_name; - create_info->on_conflict = OnCreateConflict::ERROR_ON_CONFLICT; - info->entries.push_back(std::move(create_info)); - } - // get a list of all views to copy over - for (auto &view_ref : entries.views) { - auto &view = view_ref.get().Cast(); - if (view.internal) { - continue; - } - auto create_info = view.GetInfo(); - create_info->catalog = target_database_name; - create_info->on_conflict = OnCreateConflict::ERROR_ON_CONFLICT; + create_info->dependencies = altered_dependencies; + create_info->on_conflict = on_conflict; info->entries.push_back(std::move(create_info)); } @@ -100,6 +50,7 @@ unique_ptr Binder::BindCopyDatabaseSchema(Catalog &source_catal unique_ptr Binder::BindCopyDatabaseData(Catalog &source_catalog, const string &target_database_name) { auto source_schemas = source_catalog.GetSchemas(context); + // We can just use ExtractEntries here because the order doesn't matter ExportEntries entries; PhysicalExport::ExtractEntries(context, source_schemas, entries); @@ -130,7 +81,7 @@ unique_ptr Binder::BindCopyDatabaseData(Catalog &source_catalog if (result) { // use UNION ALL to combine the individual copy statements into a single node auto copy_union = - make_uniq(GenerateTableIndex(), 1, std::move(insert_plan), std::move(result), + make_uniq(GenerateTableIndex(), 1U, std::move(insert_plan), std::move(result), LogicalOperatorType::LOGICAL_UNION, true, false); result = std::move(copy_union); } else { @@ -173,6 +124,8 @@ BoundStatement Binder::Bind(CopyDatabaseStatement &stmt) { } result.plan = std::move(plan); + + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; properties.return_type = StatementReturnType::NOTHING; properties.modified_databases.insert(target_catalog.GetName()); diff --git a/src/duckdb/src/planner/binder/statement/bind_create.cpp b/src/duckdb/src/planner/binder/statement/bind_create.cpp index 8f66ea03..eb31c952 100644 --- a/src/duckdb/src/planner/binder/statement/bind_create.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_create.cpp @@ -121,6 +121,7 @@ SchemaCatalogEntry &Binder::BindSchema(CreateInfo &info) { D_ASSERT(schema_obj.type == CatalogType::SCHEMA_ENTRY); info.schema = schema_obj.name; if (!info.temporary) { + auto &properties = GetStatementProperties(); properties.modified_databases.insert(schema_obj.catalog.GetName()); } return schema_obj; @@ -134,10 +135,23 @@ SchemaCatalogEntry &Binder::BindCreateSchema(CreateInfo &info) { return schema; } +void Binder::SetCatalogLookupCallback(catalog_entry_callback_t callback) { + entry_retriever.SetCallback(std::move(callback)); +} + void Binder::BindCreateViewInfo(CreateViewInfo &base) { // bind the view as if it were a query so we can catch errors // note that we bind the original, and replace the original with a copy auto view_binder = Binder::CreateBinder(context); + auto &dependencies = base.dependencies; + auto &catalog = Catalog::GetCatalog(context, base.catalog); + view_binder->SetCatalogLookupCallback([&dependencies, &catalog](CatalogEntry &entry) { + if (&catalog != &entry.ParentCatalog()) { + // Don't register dependencies between catalogs + return; + } + dependencies.AddDependency(entry); + }); view_binder->can_contain_nulls = true; auto copy = base.query->Copy(); @@ -188,6 +202,16 @@ SchemaCatalogEntry &Binder::BindCreateFunctionInfo(CreateInfo &info) { BoundSelectNode sel_node; BoundGroupInformation group_info; SelectBinder binder(*this, context, sel_node, group_info); + auto &dependencies = base.dependencies; + auto &catalog = Catalog::GetCatalog(context, info.catalog); + binder.SetCatalogLookupCallback([&dependencies, &catalog](CatalogEntry &entry) { + if (&catalog != &entry.ParentCatalog()) { + // Don't register any cross-catalog dependencies + return; + } + // Register any catalog entry required to bind the macro function + dependencies.AddDependency(entry); + }); error = binder.Bind(expression, 0, false); if (error.HasError()) { error.Throw(); @@ -196,12 +220,12 @@ SchemaCatalogEntry &Binder::BindCreateFunctionInfo(CreateInfo &info) { return BindCreateSchema(info); } -void Binder::BindLogicalType(ClientContext &context, LogicalType &type, optional_ptr catalog, - const string &schema) { +void Binder::BindLogicalType(LogicalType &type, optional_ptr catalog, const string &schema) { if (type.id() == LogicalTypeId::LIST || type.id() == LogicalTypeId::MAP) { auto child_type = ListType::GetChildType(type); - BindLogicalType(context, child_type, catalog, schema); + BindLogicalType(child_type, catalog, schema); auto alias = type.GetAlias(); + auto modifiers = type.GetModifiersCopy(); if (type.id() == LogicalTypeId::LIST) { type = LogicalType::LIST(child_type); } else { @@ -210,54 +234,116 @@ void Binder::BindLogicalType(ClientContext &context, LogicalType &type, optional } type.SetAlias(alias); + type.SetModifiers(modifiers); } else if (type.id() == LogicalTypeId::STRUCT) { auto child_types = StructType::GetChildTypes(type); for (auto &child_type : child_types) { - BindLogicalType(context, child_type.second, catalog, schema); + BindLogicalType(child_type.second, catalog, schema); } // Generate new Struct Type auto alias = type.GetAlias(); + auto modifiers = type.GetModifiersCopy(); type = LogicalType::STRUCT(child_types); type.SetAlias(alias); + type.SetModifiers(modifiers); } else if (type.id() == LogicalTypeId::ARRAY) { auto child_type = ArrayType::GetChildType(type); auto array_size = ArrayType::GetSize(type); - BindLogicalType(context, child_type, catalog, schema); + BindLogicalType(child_type, catalog, schema); auto alias = type.GetAlias(); + auto modifiers = type.GetModifiersCopy(); type = LogicalType::ARRAY(child_type, array_size); type.SetAlias(alias); + type.SetModifiers(modifiers); } else if (type.id() == LogicalTypeId::UNION) { auto member_types = UnionType::CopyMemberTypes(type); for (auto &member_type : member_types) { - BindLogicalType(context, member_type.second, catalog, schema); + BindLogicalType(member_type.second, catalog, schema); } // Generate new Union Type auto alias = type.GetAlias(); + auto modifiers = type.GetModifiersCopy(); type = LogicalType::UNION(member_types); type.SetAlias(alias); + type.SetModifiers(modifiers); } else if (type.id() == LogicalTypeId::USER) { auto user_type_name = UserType::GetTypeName(type); + auto user_type_mods = UserType::GetTypeModifiers(type); + + bind_type_modifiers_function_t user_bind_modifiers_func = nullptr; + if (catalog) { // The search order is: // 1) In the same schema as the table // 2) In the same catalog // 3) System catalog - type = catalog->GetType(context, schema, user_type_name, OnEntryNotFound::RETURN_NULL); - - if (type.id() == LogicalTypeId::INVALID) { - type = catalog->GetType(context, INVALID_SCHEMA, user_type_name, OnEntryNotFound::RETURN_NULL); - } - - if (type.id() == LogicalTypeId::INVALID) { - type = Catalog::GetType(context, INVALID_CATALOG, INVALID_SCHEMA, user_type_name); + auto entry = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, *catalog, schema, user_type_name, + OnEntryNotFound::RETURN_NULL); + if (!entry || entry->Cast().user_type.id() == LogicalTypeId::INVALID) { + entry = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, *catalog, INVALID_SCHEMA, user_type_name, + OnEntryNotFound::RETURN_NULL); + if (!entry || entry->Cast().user_type.id() == LogicalTypeId::INVALID) { + entry = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, INVALID_CATALOG, INVALID_SCHEMA, + user_type_name, OnEntryNotFound::THROW_EXCEPTION); + } } + auto &type_entry = entry->Cast(); + type = type_entry.user_type; + user_bind_modifiers_func = type_entry.bind_modifiers; } else { string type_catalog = UserType::GetCatalog(type); string type_schema = UserType::GetSchema(type); + BindSchemaOrCatalog(context, type_catalog, type_schema); - type = Catalog::GetType(context, type_catalog, type_schema, user_type_name); + auto entry = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, type_catalog, type_schema, user_type_name); + auto &type_entry = entry->Cast(); + type = type_entry.user_type; + user_bind_modifiers_func = type_entry.bind_modifiers; + } + + BindLogicalType(type, catalog, schema); + + // Apply the type modifiers (if any) + if (user_bind_modifiers_func) { + // If an explicit bind_modifiers function was provided, use that to set the type modifier + BindTypeModifiersInput input {context, type, user_type_mods}; + type = user_bind_modifiers_func(input); + } else if (type.HasModifiers()) { + // If the type already has modifiers, try to replace them with the user-provided ones if they are compatible + // This enables registering custom types with "default" type modifiers that can be overridden, without + // having to provide a custom bind_modifiers function + auto type_mods_size = type.GetModifiers()->size(); + + // Are we trying to pass more type modifiers than the type has? + if (user_type_mods.size() > type_mods_size) { + throw BinderException( + "Cannot apply '%d' type modifier(s) to type '%s' taking at most '%d' type modifier(s)", + user_type_mods.size(), user_type_name, type_mods_size); + } + + // Deep copy the type so that we can replace the type modifiers + type = type.DeepCopy(); + + // Re-fetch the type modifiers now that we've deduplicated the ExtraTypeInfo + auto &type_mods = *type.GetModifiers(); + + // Replace them in order, casting if necessary + for (idx_t i = 0; i < MinValue(type_mods.size(), user_type_mods.size()); i++) { + auto &type_mod = type_mods[i]; + auto user_type_mod = user_type_mods[i]; + if (type_mod.type() == user_type_mod.type()) { + type_mod = std::move(user_type_mod); + } else if (user_type_mod.DefaultTryCastAs(type_mod.type())) { + type_mod = std::move(user_type_mod); + } else { + throw BinderException("Cannot apply type modifier '%s' to type '%s', expected value of type '%s'", + user_type_mod.ToString(), user_type_name, type_mod.type().ToString()); + } + } + } else if (!user_type_mods.empty()) { + // We're trying to pass type modifiers to a type that doesnt have any + throw BinderException("Type '%s' does not take any type modifiers", user_type_name); } - BindLogicalType(context, type, catalog, schema); } } @@ -447,6 +533,15 @@ unique_ptr DuckCatalog::BindCreateIndex(Binder &binder, CreateS auto &get = plan->Cast(); // bind the index expressions IndexBinder index_binder(binder, binder.context); + auto &dependencies = base.dependencies; + auto &catalog = Catalog::GetCatalog(binder.context, base.catalog); + index_binder.SetCatalogLookupCallback([&dependencies, &catalog](CatalogEntry &entry) { + if (&catalog != &entry.ParentCatalog()) { + // Don't register any cross-catalog dependencies + return; + } + dependencies.AddDependency(entry); + }); vector> expressions; expressions.reserve(base.expressions.size()); for (auto &expr : base.expressions) { @@ -479,6 +574,7 @@ BoundStatement Binder::Bind(CreateStatement &stmt) { result.types = {LogicalType::BIGINT}; auto catalog_type = stmt.info->type; + auto &properties = GetStatementProperties(); switch (catalog_type) { case CatalogType::SCHEMA_ENTRY: { auto &base = stmt.info->Cast(); @@ -509,8 +605,9 @@ BoundStatement Binder::Bind(CreateStatement &stmt) { } case CatalogType::MACRO_ENTRY: { auto &schema = BindCreateFunctionInfo(*stmt.info); - result.plan = + auto logical_create = make_uniq(LogicalOperatorType::LOGICAL_CREATE_MACRO, std::move(stmt.info), &schema); + result.plan = std::move(logical_create); break; } case CatalogType::INDEX_ENTRY: { @@ -566,16 +663,16 @@ BoundStatement Binder::Bind(CreateStatement &stmt) { CheckForeignKeyTypes(create_info.columns, create_info.columns, fk); } else { // have to resolve referenced table - auto &pk_table_entry_ptr = - Catalog::GetEntry(context, INVALID_CATALOG, fk.info.schema, fk.info.table); + auto table_entry = + entry_retriever.GetEntry(CatalogType::TABLE_ENTRY, INVALID_CATALOG, fk.info.schema, fk.info.table); + auto &pk_table_entry_ptr = table_entry->Cast(); fk_schemas.insert(pk_table_entry_ptr.schema); FindMatchingPrimaryKeyColumns(pk_table_entry_ptr.GetColumns(), pk_table_entry_ptr.GetConstraints(), fk); FindForeignKeyIndexes(pk_table_entry_ptr.GetColumns(), fk.pk_columns, fk.info.pk_keys); CheckForeignKeyTypes(pk_table_entry_ptr.GetColumns(), create_info.columns, fk); auto &storage = pk_table_entry_ptr.GetStorage(); - auto index = storage.info->indexes.FindForeignKeyIndex(fk.info.pk_keys, - ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE); - if (!index) { + + if (!storage.HasForeignKeyIndex(fk.info.pk_keys, ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE)) { auto fk_column_names = StringUtil::Join(fk.pk_columns, ","); throw BinderException("Failed to create foreign key on %s(%s): no UNIQUE or PRIMARY KEY constraint " "present on these columns", @@ -612,6 +709,16 @@ BoundStatement Binder::Bind(CreateStatement &stmt) { auto &schema = BindCreateSchema(*stmt.info); auto &create_type_info = stmt.info->Cast(); result.plan = make_uniq(LogicalOperatorType::LOGICAL_CREATE_TYPE, std::move(stmt.info), &schema); + + auto &catalog = Catalog::GetCatalog(context, create_type_info.catalog); + auto &dependencies = create_type_info.dependencies; + auto dependency_callback = [&dependencies, &catalog](CatalogEntry &entry) { + if (&catalog != &entry.ParentCatalog()) { + // Don't register any cross-catalog dependencies + return; + } + dependencies.AddDependency(entry); + }; if (create_type_info.query) { // CREATE TYPE mood AS ENUM (SELECT 'happy') auto query_obj = Bind(*create_type_info.query); @@ -636,16 +743,23 @@ BoundStatement Binder::Bind(CreateStatement &stmt) { result.plan->AddChild(std::move(query)); } else if (create_type_info.type.id() == LogicalTypeId::USER) { + SetCatalogLookupCallback(dependency_callback); // two cases: // 1: create a type with a non-existent type as source, Binder::BindLogicalType(...) will throw exception. // 2: create a type alias with a custom type. // eg. CREATE TYPE a AS INT; CREATE TYPE b AS a; // We set b to be an alias for the underlying type of a - create_type_info.type = Catalog::GetType(context, schema.catalog.GetName(), schema.name, - UserType::GetTypeName(create_type_info.type)); + auto type_entry_p = entry_retriever.GetEntry(CatalogType::TYPE_ENTRY, schema.catalog.GetName(), schema.name, + UserType::GetTypeName(create_type_info.type)); + D_ASSERT(type_entry_p); + auto &type_entry = type_entry_p->Cast(); + create_type_info.type = type_entry.user_type; } else { + SetCatalogLookupCallback(dependency_callback); + // This is done so that if the type contains a USER type, + // we register this dependency auto preserved_type = create_type_info.type; - BindLogicalType(context, create_type_info.type); + BindLogicalType(create_type_info.type); create_type_info.type = preserved_type; } break; diff --git a/src/duckdb/src/planner/binder/statement/bind_create_table.cpp b/src/duckdb/src/planner/binder/statement/bind_create_table.cpp index 4564cb0f..ec39dae9 100644 --- a/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_create_table.cpp @@ -35,61 +35,64 @@ static void CreateColumnDependencyManager(BoundCreateTableInfo &info) { } } -static void BindCheckConstraint(Binder &binder, BoundCreateTableInfo &info, const unique_ptr &cond) { - auto &base = info.base->Cast(); - +static unique_ptr BindCheckConstraint(Binder &binder, const string &table_name, + const ColumnList &columns, const unique_ptr &cond) { auto bound_constraint = make_uniq(); // check constraint: bind the expression - CheckBinder check_binder(binder, binder.context, base.table, base.columns, bound_constraint->bound_columns); + CheckBinder check_binder(binder, binder.context, table_name, columns, bound_constraint->bound_columns); auto &check = cond->Cast(); // create a copy of the unbound expression because the binding destroys the constraint auto unbound_expression = check.expression->Copy(); // now bind the constraint and create a new BoundCheckConstraint - bound_constraint->expression = check_binder.Bind(check.expression); - info.bound_constraints.push_back(std::move(bound_constraint)); - // move the unbound constraint back into the original check expression - check.expression = std::move(unbound_expression); + bound_constraint->expression = check_binder.Bind(unbound_expression); + return std::move(bound_constraint); } -static void BindConstraints(Binder &binder, BoundCreateTableInfo &info) { - auto &base = info.base->Cast(); +vector> Binder::BindConstraints(ClientContext &context, + const vector> &constraints, + const string &table_name, const ColumnList &columns) { + auto binder = Binder::CreateBinder(context); + return binder->BindConstraints(constraints, table_name, columns); +} - bool has_primary_key = false; - logical_index_set_t not_null_columns; - vector primary_keys; - for (idx_t i = 0; i < base.constraints.size(); i++) { - auto &cond = base.constraints[i]; - switch (cond->type) { +vector> Binder::BindConstraints(const TableCatalogEntry &table) { + return BindConstraints(table.GetConstraints(), table.name, table.GetColumns()); +} + +vector> Binder::BindConstraints(const vector> &constraints, + const string &table_name, const ColumnList &columns) { + vector> bound_constraints; + for (auto &constr : constraints) { + switch (constr->type) { case ConstraintType::CHECK: { - BindCheckConstraint(binder, info, cond); + bound_constraints.push_back(BindCheckConstraint(*this, table_name, columns, constr)); break; } case ConstraintType::NOT_NULL: { - auto ¬_null = cond->Cast(); - auto &col = base.columns.GetColumn(LogicalIndex(not_null.index)); - info.bound_constraints.push_back(make_uniq(PhysicalIndex(col.StorageOid()))); - not_null_columns.insert(not_null.index); + auto ¬_null = constr->Cast(); + auto &col = columns.GetColumn(LogicalIndex(not_null.index)); + bound_constraints.push_back(make_uniq(PhysicalIndex(col.StorageOid()))); break; } case ConstraintType::UNIQUE: { - auto &unique = cond->Cast(); + auto &unique = constr->Cast(); // have to resolve columns of the unique constraint vector keys; logical_index_set_t key_set; if (unique.HasIndex()) { - D_ASSERT(unique.GetIndex().index < base.columns.LogicalColumnCount()); + D_ASSERT(unique.GetIndex().index < columns.LogicalColumnCount()); // unique constraint is given by single index - unique.SetColumnName(base.columns.GetColumn(unique.GetIndex()).Name()); + unique.SetColumnName(columns.GetColumn(unique.GetIndex()).Name()); keys.push_back(unique.GetIndex()); key_set.insert(unique.GetIndex()); } else { // unique constraint is given by list of names // have to resolve names for (auto &keyname : unique.GetColumnNames()) { - if (!base.columns.ColumnExists(keyname)) { + if (!columns.ColumnExists(keyname)) { throw ParserException("column \"%s\" named in key does not exist", keyname); } - auto &column = base.columns.GetColumn(keyname); + auto &column = columns.GetColumn(keyname); auto column_index = column.Logical(); if (key_set.find(column_index) != key_set.end()) { throw ParserException("column \"%s\" appears twice in " @@ -100,38 +103,29 @@ static void BindConstraints(Binder &binder, BoundCreateTableInfo &info) { key_set.insert(column_index); } } - - if (unique.IsPrimaryKey()) { - // we can only have one primary key per table - if (has_primary_key) { - throw ParserException("table \"%s\" has more than one primary key", base.table); - } - has_primary_key = true; - primary_keys = keys; - } - info.bound_constraints.push_back( + bound_constraints.push_back( make_uniq(std::move(keys), std::move(key_set), unique.IsPrimaryKey())); break; } case ConstraintType::FOREIGN_KEY: { - auto &fk = cond->Cast(); + auto &fk = constr->Cast(); D_ASSERT((fk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE && !fk.info.pk_keys.empty()) || (fk.info.type == ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE && !fk.info.pk_keys.empty()) || fk.info.type == ForeignKeyType::FK_TYPE_SELF_REFERENCE_TABLE); physical_index_set_t fk_key_set, pk_key_set; - for (idx_t i = 0; i < fk.info.pk_keys.size(); i++) { - if (pk_key_set.find(fk.info.pk_keys[i]) != pk_key_set.end()) { + for (auto &pk_key : fk.info.pk_keys) { + if (pk_key_set.find(pk_key) != pk_key_set.end()) { throw BinderException("Duplicate primary key referenced in FOREIGN KEY constraint"); } - pk_key_set.insert(fk.info.pk_keys[i]); + pk_key_set.insert(pk_key); } - for (idx_t i = 0; i < fk.info.fk_keys.size(); i++) { - if (fk_key_set.find(fk.info.fk_keys[i]) != fk_key_set.end()) { + for (auto &fk_key : fk.info.fk_keys) { + if (fk_key_set.find(fk_key) != fk_key_set.end()) { throw BinderException("Duplicate key specified in FOREIGN KEY constraint"); } - fk_key_set.insert(fk.info.fk_keys[i]); + fk_key_set.insert(fk_key); } - info.bound_constraints.push_back( + bound_constraints.push_back( make_uniq(fk.info, std::move(pk_key_set), std::move(fk_key_set))); break; } @@ -139,6 +133,44 @@ static void BindConstraints(Binder &binder, BoundCreateTableInfo &info) { throw NotImplementedException("unrecognized constraint type in bind"); } } + return bound_constraints; +} + +vector> Binder::BindNewConstraints(vector> &constraints, + const string &table_name, const ColumnList &columns) { + auto bound_constraints = BindConstraints(constraints, table_name, columns); + + // handle primary keys/not null constraints + bool has_primary_key = false; + logical_index_set_t not_null_columns; + vector primary_keys; + for (idx_t c = 0; c < constraints.size(); c++) { + auto &constr = constraints[c]; + switch (constr->type) { + case ConstraintType::NOT_NULL: { + auto ¬_null = constr->Cast(); + auto &col = columns.GetColumn(LogicalIndex(not_null.index)); + bound_constraints.push_back(make_uniq(PhysicalIndex(col.StorageOid()))); + not_null_columns.insert(not_null.index); + break; + } + case ConstraintType::UNIQUE: { + auto &unique = constr->Cast(); + auto &bound_unique = bound_constraints[c]->Cast(); + if (unique.IsPrimaryKey()) { + // we can only have one primary key per table + if (has_primary_key) { + throw ParserException("table \"%s\" has more than one primary key", table_name); + } + has_primary_key = true; + primary_keys = bound_unique.keys; + } + break; + } + default: + break; + } + } if (has_primary_key) { // if there is a primary key index, also create a NOT NULL constraint for each of the columns for (auto &column_index : primary_keys) { @@ -146,11 +178,12 @@ static void BindConstraints(Binder &binder, BoundCreateTableInfo &info) { //! No need to create a NotNullConstraint, it's already present continue; } - auto physical_index = base.columns.LogicalToPhysical(column_index); - base.constraints.push_back(make_uniq(column_index)); - info.bound_constraints.push_back(make_uniq(physical_index)); + auto physical_index = columns.LogicalToPhysical(column_index); + constraints.push_back(make_uniq(column_index)); + bound_constraints.push_back(make_uniq(physical_index)); } } + return bound_constraints; } void Binder::BindGeneratedColumns(BoundCreateTableInfo &info) { @@ -168,6 +201,7 @@ void Binder::BindGeneratedColumns(BoundCreateTableInfo &info) { // Create a new binder because we dont need (or want) these bindings in this scope auto binder = Binder::CreateBinder(context); + binder->SetCatalogLookupCallback(entry_retriever.GetCallback()); binder->bind_context.AddGenericBinding(table_index, base.table, names, types); auto expr_binder = ExpressionBinder(*binder, context); ErrorData ignore; @@ -239,22 +273,40 @@ static void ExtractExpressionDependencies(Expression &expr, LogicalDependencyLis expr, [&](Expression &child) { ExtractExpressionDependencies(child, dependencies); }); } -static void ExtractDependencies(BoundCreateTableInfo &info) { - for (auto &default_value : info.bound_defaults) { +static void ExtractDependencies(BoundCreateTableInfo &info, vector> &defaults, + vector> &constraints) { + for (auto &default_value : defaults) { if (default_value) { ExtractExpressionDependencies(*default_value, info.dependencies); } } - for (auto &constraint : info.bound_constraints) { + for (auto &constraint : constraints) { if (constraint->type == ConstraintType::CHECK) { auto &bound_check = constraint->Cast(); ExtractExpressionDependencies(*bound_check.expression, info.dependencies); } } } + unique_ptr Binder::BindCreateTableInfo(unique_ptr info, SchemaCatalogEntry &schema) { + vector> bound_defaults; + return BindCreateTableInfo(std::move(info), schema, bound_defaults); +} + +unique_ptr Binder::BindCreateTableCheckpoint(unique_ptr info, + SchemaCatalogEntry &schema) { + auto result = make_uniq(schema, std::move(info)); + CreateColumnDependencyManager(*result); + return result; +} + +unique_ptr Binder::BindCreateTableInfo(unique_ptr info, SchemaCatalogEntry &schema, + vector> &bound_defaults) { auto &base = info->Cast(); auto result = make_uniq(schema, std::move(info)); + auto &dependencies = result->dependencies; + + vector> bound_constraints; if (base.query) { // construct the result object auto query_obj = Bind(*base.query); @@ -269,20 +321,24 @@ unique_ptr Binder::BindCreateTableInfo(unique_ptrbound_defaults); + BindDefaultValues(base.columns, bound_defaults); } // extract dependencies from any default values or CHECK constraints - ExtractDependencies(*result); + ExtractDependencies(*result, bound_defaults, bound_constraints); if (base.columns.PhysicalColumnCount() == 0) { throw BinderException("Creating a table without physical (non-generated) columns is not supported"); @@ -293,9 +349,11 @@ unique_ptr Binder::BindCreateTableInfo(unique_ptrschema.catalog); + BindLogicalType(column.TypeMutable(), &result->schema.catalog); } result->dependencies.VerifyDependencies(schema.catalog, result->Base().table); + + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; return result; } diff --git a/src/duckdb/src/planner/binder/statement/bind_delete.cpp b/src/duckdb/src/planner/binder/statement/bind_delete.cpp index 7ae86228..c32b4b58 100644 --- a/src/duckdb/src/planner/binder/statement/bind_delete.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_delete.cpp @@ -29,6 +29,7 @@ BoundStatement Binder::Bind(DeleteStatement &stmt) { if (!table.temporary) { // delete from persistent table: not read only! + auto &properties = GetStatementProperties(); properties.modified_databases.insert(table.catalog.GetName()); } @@ -69,6 +70,7 @@ BoundStatement Binder::Bind(DeleteStatement &stmt) { } // create the delete node auto del = make_uniq(table, GenerateTableIndex()); + del->bound_constraints = BindConstraints(table); del->AddChild(std::move(root)); // set up the delete expression @@ -89,6 +91,8 @@ BoundStatement Binder::Bind(DeleteStatement &stmt) { result.plan = std::move(del); result.names = {"Count"}; result.types = {LogicalType::BIGINT}; + + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; properties.return_type = StatementReturnType::CHANGED_ROWS; diff --git a/src/duckdb/src/planner/binder/statement/bind_detach.cpp b/src/duckdb/src/planner/binder/statement/bind_detach.cpp index 14c99e9e..98db5805 100644 --- a/src/duckdb/src/planner/binder/statement/bind_detach.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_detach.cpp @@ -11,6 +11,8 @@ BoundStatement Binder::Bind(DetachStatement &stmt) { result.plan = make_uniq(LogicalOperatorType::LOGICAL_DETACH, std::move(stmt.info)); result.names = {"Success"}; result.types = {LogicalType::BOOLEAN}; + + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; properties.return_type = StatementReturnType::NOTHING; return result; diff --git a/src/duckdb/src/planner/binder/statement/bind_drop.cpp b/src/duckdb/src/planner/binder/statement/bind_drop.cpp index 9c5f43df..61973047 100644 --- a/src/duckdb/src/planner/binder/statement/bind_drop.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_drop.cpp @@ -14,6 +14,7 @@ namespace duckdb { BoundStatement Binder::Bind(DropStatement &stmt) { BoundStatement result; + auto &properties = GetStatementProperties(); switch (stmt.info->type) { case CatalogType::PREPARED_STATEMENT: // dropping prepared statements is always possible @@ -61,6 +62,7 @@ BoundStatement Binder::Bind(DropStatement &stmt) { result.plan = make_uniq(LogicalOperatorType::LOGICAL_DROP, std::move(stmt.info)); result.names = {"Success"}; result.types = {LogicalType::BOOLEAN}; + properties.allow_stream_result = false; properties.return_type = StatementReturnType::NOTHING; return result; diff --git a/src/duckdb/src/planner/binder/statement/bind_execute.cpp b/src/duckdb/src/planner/binder/statement/bind_execute.cpp index f235c144..b8c43c71 100644 --- a/src/duckdb/src/planner/binder/statement/bind_execute.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_execute.cpp @@ -54,8 +54,10 @@ BoundStatement Binder::Bind(ExecuteStatement &stmt) { this->bound_tables = prepared_planner.binder->bound_tables; } // copy the properties of the prepared statement into the planner - this->properties = prepared->properties; - this->properties.parameter_count = parameter_count; + auto &properties = GetStatementProperties(); + properties = prepared->properties; + properties.parameter_count = parameter_count; + BoundStatement result; result.names = prepared->names; result.types = prepared->types; diff --git a/src/duckdb/src/planner/binder/statement/bind_explain.cpp b/src/duckdb/src/planner/binder/statement/bind_explain.cpp index 2e1fd3ac..ab186356 100644 --- a/src/duckdb/src/planner/binder/statement/bind_explain.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_explain.cpp @@ -17,6 +17,8 @@ BoundStatement Binder::Bind(ExplainStatement &stmt) { result.plan = std::move(explain); result.names = {"explain_key", "explain_value"}; result.types = {LogicalType::VARCHAR, LogicalType::VARCHAR}; + + auto &properties = GetStatementProperties(); properties.return_type = StatementReturnType::QUERY_RESULT; return result; } diff --git a/src/duckdb/src/planner/binder/statement/bind_export.cpp b/src/duckdb/src/planner/binder/statement/bind_export.cpp index f5370a20..4119d582 100644 --- a/src/duckdb/src/planner/binder/statement/bind_export.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_export.cpp @@ -16,6 +16,7 @@ #include "duckdb/parser/query_node/select_node.hpp" #include "duckdb/common/numeric_utils.hpp" #include "duckdb/common/string_util.hpp" +#include "duckdb/parser/constraints/not_null_constraint.hpp" #include @@ -303,7 +304,14 @@ BoundStatement Binder::Bind(ExportStatement &stmt) { // We can not export generated columns child_list_t select_list; - + // Let's verify if any on these columns have not null constraints + vector not_null_columns; + for (auto &constaint : table.GetConstraints()) { + if (constaint->type == ConstraintType::NOT_NULL) { + auto ¬_null_constraint = constaint->Cast(); + not_null_columns.push_back(table.GetColumn(not_null_constraint.index).GetName()); + } + } for (auto &col : table.GetColumns().Physical()) { select_list.push_back(std::make_pair(col.Name(), col.Type())); } @@ -315,14 +323,14 @@ BoundStatement Binder::Bind(ExportStatement &stmt) { exported_data.file_path = info->file_path; - ExportedTableInfo table_info(table, std::move(exported_data)); + ExportedTableInfo table_info(table, std::move(exported_data), not_null_columns); exported_tables.data.push_back(table_info); id++; // generate the copy statement and bind it CopyStatement copy_stmt; copy_stmt.info = std::move(info); - copy_stmt.select_statement = + copy_stmt.info->select_statement = CreateSelectStatement(copy_stmt, select_list, copy_function.function.supports_type); auto copy_binder = Binder::CreateBinder(context, this); @@ -331,7 +339,7 @@ BoundStatement Binder::Bind(ExportStatement &stmt) { if (child_operator) { // use UNION ALL to combine the individual copy statements into a single node - auto copy_union = make_uniq(GenerateTableIndex(), 1, std::move(child_operator), + auto copy_union = make_uniq(GenerateTableIndex(), 1U, std::move(child_operator), std::move(plan), LogicalOperatorType::LOGICAL_UNION, true); child_operator = std::move(copy_union); } else { @@ -345,6 +353,7 @@ BoundStatement Binder::Bind(ExportStatement &stmt) { fs.CreateDirectory(stmt.info->file_path); } + stmt.info->catalog = catalog; // create the export node auto export_node = make_uniq(copy_function.function, std::move(stmt.info), exported_tables); @@ -353,6 +362,8 @@ BoundStatement Binder::Bind(ExportStatement &stmt) { } result.plan = std::move(export_node); + + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; properties.return_type = StatementReturnType::NOTHING; return result; diff --git a/src/duckdb/src/planner/binder/statement/bind_extension.cpp b/src/duckdb/src/planner/binder/statement/bind_extension.cpp index f0884cdc..c2585309 100644 --- a/src/duckdb/src/planner/binder/statement/bind_extension.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_extension.cpp @@ -12,6 +12,7 @@ BoundStatement Binder::Bind(ExtensionStatement &stmt) { auto parse_result = stmt.extension.plan_function(stmt.extension.parser_info.get(), context, std::move(stmt.parse_data)); + auto &properties = GetStatementProperties(); properties.modified_databases = parse_result.modified_databases; properties.requires_valid_transaction = parse_result.requires_valid_transaction; properties.return_type = parse_result.return_type; diff --git a/src/duckdb/src/planner/binder/statement/bind_insert.cpp b/src/duckdb/src/planner/binder/statement/bind_insert.cpp index 1829d776..a979da57 100644 --- a/src/duckdb/src/planner/binder/statement/bind_insert.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_insert.cpp @@ -30,7 +30,7 @@ namespace duckdb { -static void CheckInsertColumnCountMismatch(int64_t expected_columns, int64_t result_columns, bool columns_provided, +static void CheckInsertColumnCountMismatch(idx_t expected_columns, idx_t result_columns, bool columns_provided, const char *tname) { if (result_columns != expected_columns) { string msg = StringUtil::Format(!columns_provided ? "table %s has %lld columns but %lld values were supplied" @@ -402,6 +402,7 @@ BoundStatement Binder::Bind(InsertStatement &stmt) { auto &table = Catalog::GetEntry(context, stmt.catalog, stmt.schema, stmt.table); if (!table.temporary) { // inserting into a non-temporary table: alters underlying database + auto &properties = GetStatementProperties(); properties.modified_databases.insert(table.catalog.GetName()); } @@ -472,6 +473,7 @@ BoundStatement Binder::Bind(InsertStatement &stmt) { // bind the default values BindDefaultValues(table.GetColumns(), insert->bound_defaults); + insert->bound_constraints = BindConstraints(table); if (!stmt.select_statement && !stmt.default_values) { result.plan = std::move(insert); return result; @@ -543,6 +545,8 @@ BoundStatement Binder::Bind(InsertStatement &stmt) { D_ASSERT(result.types.size() == result.names.size()); result.plan = std::move(insert); + + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; properties.return_type = StatementReturnType::CHANGED_ROWS; return result; diff --git a/src/duckdb/src/planner/binder/statement/bind_load.cpp b/src/duckdb/src/planner/binder/statement/bind_load.cpp index a179ba2b..53d8f579 100644 --- a/src/duckdb/src/planner/binder/statement/bind_load.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_load.cpp @@ -1,6 +1,7 @@ #include "duckdb/parser/statement/load_statement.hpp" #include "duckdb/planner/binder.hpp" #include "duckdb/planner/operator/logical_simple.hpp" +#include "duckdb/main/extension_install_info.hpp" #include namespace duckdb { @@ -10,7 +11,19 @@ BoundStatement Binder::Bind(LoadStatement &stmt) { result.types = {LogicalType::BOOLEAN}; result.names = {"Success"}; + // Ensure the repository exists if it's an alias + if (!stmt.info->repository.empty() && stmt.info->repo_is_alias) { + auto repository_url = ExtensionRepository::TryGetRepositoryUrl(stmt.info->repository); + if (repository_url.empty()) { + throw BinderException("'%s' is not a known repository name. Are you trying to query from a repository by " + "path? Use single quotes: `FROM '%s'`", + stmt.info->repository, stmt.info->repository); + } + } + result.plan = make_uniq(LogicalOperatorType::LOGICAL_LOAD, std::move(stmt.info)); + + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; properties.return_type = StatementReturnType::NOTHING; return result; diff --git a/src/duckdb/src/planner/binder/statement/bind_logical_plan.cpp b/src/duckdb/src/planner/binder/statement/bind_logical_plan.cpp index 9a7ae93a..5b187c8e 100644 --- a/src/duckdb/src/planner/binder/statement/bind_logical_plan.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_logical_plan.cpp @@ -24,6 +24,8 @@ BoundStatement Binder::Bind(LogicalPlanStatement &stmt) { result.names.push_back(StringUtil::Format("col%d", i)); } result.plan = std::move(stmt.plan); + + auto &properties = GetStatementProperties(); properties.allow_stream_result = true; properties.return_type = StatementReturnType::QUERY_RESULT; // TODO could also be something else diff --git a/src/duckdb/src/planner/binder/statement/bind_pragma.cpp b/src/duckdb/src/planner/binder/statement/bind_pragma.cpp index 61bf0672..8f89dec5 100644 --- a/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_pragma.cpp @@ -55,6 +55,8 @@ BoundStatement Binder::Bind(PragmaStatement &stmt) { result.names = {"Success"}; result.types = {LogicalType::BOOLEAN}; result.plan = make_uniq(std::move(bound_info)); + + auto &properties = GetStatementProperties(); properties.return_type = StatementReturnType::QUERY_RESULT; return result; } diff --git a/src/duckdb/src/planner/binder/statement/bind_prepare.cpp b/src/duckdb/src/planner/binder/statement/bind_prepare.cpp index 700e9175..74062e41 100644 --- a/src/duckdb/src/planner/binder/statement/bind_prepare.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_prepare.cpp @@ -13,6 +13,7 @@ BoundStatement Binder::Bind(PrepareStatement &stmt) { auto prepare = make_uniq(stmt.name, std::move(prepared_data), std::move(prepared_planner.plan)); // we can always prepare, even if the transaction has been invalidated // this is required because most clients ALWAYS invoke prepared statements + auto &properties = GetStatementProperties(); properties.requires_valid_transaction = false; properties.allow_stream_result = false; properties.bound_all_parameters = true; diff --git a/src/duckdb/src/planner/binder/statement/bind_select.cpp b/src/duckdb/src/planner/binder/statement/bind_select.cpp index 711a07c5..ee68d0e2 100644 --- a/src/duckdb/src/planner/binder/statement/bind_select.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_select.cpp @@ -5,6 +5,7 @@ namespace duckdb { BoundStatement Binder::Bind(SelectStatement &stmt) { + auto &properties = GetStatementProperties(); properties.allow_stream_result = true; properties.return_type = StatementReturnType::QUERY_RESULT; return Bind(*stmt.node); diff --git a/src/duckdb/src/planner/binder/statement/bind_set.cpp b/src/duckdb/src/planner/binder/statement/bind_set.cpp index 77c23e22..35c8484f 100644 --- a/src/duckdb/src/planner/binder/statement/bind_set.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_set.cpp @@ -21,6 +21,8 @@ BoundStatement Binder::Bind(SetVariableStatement &stmt) { auto value = ExpressionExecutor::EvaluateScalar(context, *bound_value, true); result.plan = make_uniq(stmt.name, std::move(value), stmt.scope); + + auto &properties = GetStatementProperties(); properties.return_type = StatementReturnType::NOTHING; return result; } @@ -31,6 +33,8 @@ BoundStatement Binder::Bind(ResetVariableStatement &stmt) { result.names = {"Success"}; result.plan = make_uniq(stmt.name, stmt.scope); + + auto &properties = GetStatementProperties(); properties.return_type = StatementReturnType::NOTHING; return result; } diff --git a/src/duckdb/src/planner/binder/statement/bind_simple.cpp b/src/duckdb/src/planner/binder/statement/bind_simple.cpp index 08c73ef8..c9ca1f57 100644 --- a/src/duckdb/src/planner/binder/statement/bind_simple.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_simple.cpp @@ -17,20 +17,21 @@ BoundStatement Binder::Bind(AlterStatement &stmt) { BoundStatement result; result.names = {"Success"}; result.types = {LogicalType::BOOLEAN}; + BindSchemaOrCatalog(stmt.info->catalog, stmt.info->schema); optional_ptr entry; - if (stmt.info->type == AlterType::SET_COLUMN_COMMENT) { // for column comments we need to an extra step: they can alter a table or a view, we resolve that here. auto &info = stmt.info->Cast(); - entry = info.TryResolveCatalogEntry(context); + entry = info.TryResolveCatalogEntry(entry_retriever); } else { // All other AlterTypes - entry = Catalog::GetEntry(context, stmt.info->GetCatalogType(), stmt.info->catalog, stmt.info->schema, - stmt.info->name, stmt.info->if_not_found); + entry = entry_retriever.GetEntry(stmt.info->GetCatalogType(), stmt.info->catalog, stmt.info->schema, + stmt.info->name, stmt.info->if_not_found); } + auto &properties = GetStatementProperties(); if (entry) { D_ASSERT(!entry->deleted); auto &catalog = entry->ParentCatalog(); @@ -47,6 +48,7 @@ BoundStatement Binder::Bind(AlterStatement &stmt) { } BoundStatement Binder::Bind(TransactionStatement &stmt) { + auto &properties = GetStatementProperties(); // transaction statements do not require a valid transaction properties.requires_valid_transaction = stmt.info->type == TransactionType::BEGIN_TRANSACTION; diff --git a/src/duckdb/src/planner/binder/statement/bind_update.cpp b/src/duckdb/src/planner/binder/statement/bind_update.cpp index ce7c6c5f..5bfcfca4 100644 --- a/src/duckdb/src/planner/binder/statement/bind_update.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_update.cpp @@ -96,6 +96,7 @@ BoundStatement Binder::Bind(UpdateStatement &stmt) { if (!table.temporary) { // update of persistent table: not read only! + auto &properties = GetStatementProperties(); properties.modified_databases.insert(table.catalog.GetName()); } auto update = make_uniq(table); @@ -106,6 +107,7 @@ BoundStatement Binder::Bind(UpdateStatement &stmt) { } // bind the default values BindDefaultValues(table.GetColumns(), update->bound_defaults); + update->bound_constraints = BindConstraints(table); // project any additional columns required for the condition/expressions if (stmt.set_info->condition) { @@ -126,7 +128,7 @@ BoundStatement Binder::Bind(UpdateStatement &stmt) { auto proj = unique_ptr_cast(std::move(proj_tmp)); // bind any extra columns necessary for CHECK constraints or indexes - table.BindUpdateConstraints(*get, *proj, *update, context); + table.BindUpdateConstraints(*this, *get, *proj, *update, context); // finally add the row id column to the projection list proj->expressions.push_back(make_uniq( @@ -148,6 +150,8 @@ BoundStatement Binder::Bind(UpdateStatement &stmt) { result.names = {"Count"}; result.types = {LogicalType::BIGINT}; result.plan = std::move(update); + + auto &properties = GetStatementProperties(); properties.allow_stream_result = false; properties.return_type = StatementReturnType::CHANGED_ROWS; return result; diff --git a/src/duckdb/src/planner/binder/statement/bind_update_extensions.cpp b/src/duckdb/src/planner/binder/statement/bind_update_extensions.cpp new file mode 100644 index 00000000..e355adc7 --- /dev/null +++ b/src/duckdb/src/planner/binder/statement/bind_update_extensions.cpp @@ -0,0 +1,28 @@ +#include "duckdb/parser/statement/load_statement.hpp" +#include "duckdb/planner/binder.hpp" +#include "duckdb/parser/statement/update_extensions_statement.hpp" +#include "duckdb/planner/operator/logical_simple.hpp" +#include + +namespace duckdb { + +BoundStatement Binder::Bind(UpdateExtensionsStatement &stmt) { + BoundStatement result; + + result.names.emplace_back("extension_name"); + result.types.emplace_back(LogicalType::VARCHAR); + result.names.emplace_back("repository"); + result.types.emplace_back(LogicalType::VARCHAR); + result.names.emplace_back("update_result"); + result.types.emplace_back(LogicalType::VARCHAR); + result.names.emplace_back("previous_version"); + result.types.emplace_back(LogicalType::VARCHAR); + result.names.emplace_back("current_version"); + result.types.emplace_back(LogicalType::VARCHAR); + + result.plan = make_uniq(LogicalOperatorType::LOGICAL_UPDATE_EXTENSIONS, std::move(stmt.info)); + + return result; +} + +} // namespace duckdb diff --git a/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp b/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp index 5d48772e..8ad43552 100644 --- a/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp @@ -89,6 +89,8 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) { result.names = {"Success"}; result.types = {LogicalType::BOOLEAN}; result.plan = std::move(vacuum); + + auto &properties = GetStatementProperties(); properties.return_type = StatementReturnType::NOTHING; return result; } diff --git a/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp b/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp index 30b2b264..88739947 100644 --- a/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +++ b/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp @@ -46,31 +46,33 @@ static bool TryLoadExtensionForReplacementScan(ClientContext &context, const str unique_ptr Binder::BindWithReplacementScan(ClientContext &context, const string &table_name, BaseTableRef &ref) { auto &config = DBConfig::GetConfig(context); - if (context.config.use_replacement_scans) { - for (auto &scan : config.replacement_scans) { - auto replacement_function = scan.function(context, table_name, scan.data.get()); - if (replacement_function) { - if (!ref.alias.empty()) { - // user-provided alias overrides the default alias - replacement_function->alias = ref.alias; - } else if (replacement_function->alias.empty()) { - // if the replacement scan itself did not provide an alias we use the table name - replacement_function->alias = ref.table_name; - } - if (replacement_function->type == TableReferenceType::TABLE_FUNCTION) { - auto &table_function = replacement_function->Cast(); - table_function.column_name_alias = ref.column_name_alias; - } else if (replacement_function->type == TableReferenceType::SUBQUERY) { - auto &subquery = replacement_function->Cast(); - subquery.column_name_alias = ref.column_name_alias; - } else { - throw InternalException("Replacement scan should return either a table function or a subquery"); - } - return Bind(*replacement_function); - } + if (!context.config.use_replacement_scans) { + return nullptr; + } + for (auto &scan : config.replacement_scans) { + ReplacementScanInput input(ref.Cast(), table_name); + auto replacement_function = scan.function(context, input, scan.data.get()); + if (!replacement_function) { + continue; } + if (!ref.alias.empty()) { + // user-provided alias overrides the default alias + replacement_function->alias = ref.alias; + } else if (replacement_function->alias.empty()) { + // if the replacement scan itself did not provide an alias we use the table name + replacement_function->alias = ref.table_name; + } + if (replacement_function->type == TableReferenceType::TABLE_FUNCTION) { + auto &table_function = replacement_function->Cast(); + table_function.column_name_alias = ref.column_name_alias; + } else if (replacement_function->type == TableReferenceType::SUBQUERY) { + auto &subquery = replacement_function->Cast(); + subquery.column_name_alias = ref.column_name_alias; + } else { + throw InternalException("Replacement scan should return either a table function or a subquery"); + } + return Bind(*replacement_function); } - return nullptr; } @@ -149,8 +151,8 @@ unique_ptr Binder::Bind(BaseTableRef &ref) { // not a CTE // extract a table or view from the catalog BindSchemaOrCatalog(ref.catalog_name, ref.schema_name); - auto table_or_view = Catalog::GetEntry(context, CatalogType::TABLE_ENTRY, ref.catalog_name, ref.schema_name, - ref.table_name, OnEntryNotFound::RETURN_NULL, error_context); + auto table_or_view = entry_retriever.GetEntry(CatalogType::TABLE_ENTRY, ref.catalog_name, ref.schema_name, + ref.table_name, OnEntryNotFound::RETURN_NULL, error_context); // we still didn't find the table if (GetBindingMode() == BindingMode::EXTRACT_NAMES) { if (!table_or_view || table_or_view->type == CatalogType::TABLE_ENTRY) { @@ -189,8 +191,8 @@ unique_ptr Binder::Bind(BaseTableRef &ref) { } // could not find an alternative: bind again to get the error - Catalog::GetEntry(context, CatalogType::TABLE_ENTRY, ref.catalog_name, ref.schema_name, ref.table_name, - OnEntryNotFound::THROW_EXCEPTION, error_context); + (void)entry_retriever.GetEntry(CatalogType::TABLE_ENTRY, ref.catalog_name, ref.schema_name, ref.table_name, + OnEntryNotFound::THROW_EXCEPTION, error_context); throw InternalException("Catalog::GetEntry should have thrown an exception above"); } @@ -199,6 +201,8 @@ unique_ptr Binder::Bind(BaseTableRef &ref) { // base table: create the BoundBaseTableRef node auto table_index = GenerateTableIndex(); auto &table = table_or_view->Cast(); + + auto &properties = GetStatementProperties(); properties.read_databases.insert(table.ParentCatalog().GetName()); unique_ptr bind_data; @@ -231,8 +235,7 @@ unique_ptr Binder::Bind(BaseTableRef &ref) { // We need to use a new binder for the view that doesn't reference any CTEs // defined for this binder so there are no collisions between the CTEs defined // for the view and for the current query - bool inherit_ctes = false; - auto view_binder = Binder::CreateBinder(context, this, inherit_ctes); + auto view_binder = Binder::CreateBinder(context, this, BinderType::VIEW_BINDER); view_binder->can_contain_nulls = true; SubqueryRef subquery(unique_ptr_cast(view_catalog_entry.query->Copy())); subquery.alias = ref.alias.empty() ? ref.table_name : ref.alias; diff --git a/src/duckdb/src/planner/binder/tableref/bind_column_data_ref.cpp b/src/duckdb/src/planner/binder/tableref/bind_column_data_ref.cpp new file mode 100644 index 00000000..e6b2c45e --- /dev/null +++ b/src/duckdb/src/planner/binder/tableref/bind_column_data_ref.cpp @@ -0,0 +1,16 @@ +#include "duckdb/planner/binder.hpp" +#include "duckdb/parser/tableref/column_data_ref.hpp" +#include "duckdb/planner/tableref/bound_column_data_ref.hpp" +#include "duckdb/planner/operator/logical_column_data_get.hpp" + +namespace duckdb { + +unique_ptr Binder::Bind(ColumnDataRef &ref) { + auto types = ref.collection->Types(); + auto result = make_uniq(std::move(ref.collection)); + result->bind_index = GenerateTableIndex(); + bind_context.AddGenericBinding(result->bind_index, ref.alias, ref.expected_names, types); + return unique_ptr_cast(std::move(result)); +} + +} // namespace duckdb diff --git a/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp b/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp index 34a9ae6a..7b1f776a 100644 --- a/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +++ b/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp @@ -19,6 +19,7 @@ #include "duckdb/planner/expression/bound_aggregate_expression.hpp" #include "duckdb/main/client_config.hpp" #include "duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp" +#include "duckdb/catalog/catalog_entry/type_catalog_entry.hpp" #include "duckdb/main/query_result.hpp" namespace duckdb { @@ -90,7 +91,7 @@ static unique_ptr ConstructInitialGrouping(PivotRef &ref, vectorgroups.group_expressions.push_back(make_uniq( - Value::INTEGER(UnsafeNumericCast(subquery->select_list.size() + 1)))); + Value::INTEGER(UnsafeNumericCast(subquery->select_list.size() + 1)))); subquery->select_list.push_back(make_uniq(row)); } } @@ -167,7 +168,7 @@ static unique_ptr PivotInitialAggregate(PivotBindState &bind_state, } auto pivot_alias = pivot_expr->alias; subquery_stage1->groups.group_expressions.push_back(make_uniq( - Value::INTEGER(UnsafeNumericCast(subquery_stage1->select_list.size() + 1)))); + Value::INTEGER(UnsafeNumericCast(subquery_stage1->select_list.size() + 1)))); subquery_stage1->select_list.push_back(std::move(pivot_expr)); pivot_expr = make_uniq(std::move(pivot_alias)); } @@ -204,7 +205,7 @@ static unique_ptr PivotListAggregate(PivotBindState &bind_state, Piv // add all of the groups for (idx_t gr = 0; gr < bind_state.internal_group_names.size(); gr++) { subquery_stage2->groups.group_expressions.push_back(make_uniq( - Value::INTEGER(UnsafeNumericCast(subquery_stage2->select_list.size() + 1)))); + Value::INTEGER(UnsafeNumericCast(subquery_stage2->select_list.size() + 1)))); auto group_reference = make_uniq(bind_state.internal_group_names[gr]); group_reference->alias = bind_state.internal_group_names[gr]; subquery_stage2->select_list.push_back(std::move(group_reference)); @@ -378,7 +379,9 @@ unique_ptr Binder::BindPivot(PivotRef &ref, vector(context, INVALID_CATALOG, INVALID_SCHEMA, pivot.pivot_enum); + auto type = type_entry.user_type; if (type.id() != LogicalTypeId::ENUM) { throw BinderException(ref, "Pivot must reference an ENUM type: \"%s\" is of type \"%s\"", pivot.pivot_enum, type.ToString()); diff --git a/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp b/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp index be984868..97445227 100644 --- a/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +++ b/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp @@ -31,7 +31,7 @@ static bool IsTableInTableOutFunction(TableFunctionCatalogEntry &table_function) bool Binder::BindTableInTableOutFunction(vector> &expressions, unique_ptr &subquery, ErrorData &error) { - auto binder = Binder::CreateBinder(this->context, this, true); + auto binder = Binder::CreateBinder(this->context, this); unique_ptr subquery_node; if (expressions.size() == 1 && expressions[0]->type == ExpressionType::SUBQUERY) { // general case: argument is a subquery, bind it as part of the node @@ -91,7 +91,7 @@ bool Binder::BindTableFunctionParameters(TableFunctionCatalogEntry &table_functi error = ErrorData("Table function can have at most one subquery parameter"); return false; } - auto binder = Binder::CreateBinder(this->context, this, true); + auto binder = Binder::CreateBinder(this->context, this); auto &se = child->Cast(); auto node = binder->BindNode(*se.subquery->node); subquery = make_uniq(std::move(binder), std::move(node)); @@ -128,11 +128,25 @@ bool Binder::BindTableFunctionParameters(TableFunctionCatalogEntry &table_functi return true; } -unique_ptr -Binder::BindTableFunctionInternal(TableFunction &table_function, const string &function_name, vector parameters, - named_parameter_map_t named_parameters, vector input_table_types, - vector input_table_names, const vector &column_name_alias, - unique_ptr external_dependency) { +static string GetAlias(const TableFunctionRef &ref) { + if (!ref.alias.empty()) { + return ref.alias; + } + if (ref.function && ref.function->type == ExpressionType::FUNCTION) { + auto &function_expr = ref.function->Cast(); + return function_expr.function_name; + } + return string(); +} + +unique_ptr Binder::BindTableFunctionInternal(TableFunction &table_function, + const TableFunctionRef &ref, vector parameters, + named_parameter_map_t named_parameters, + vector input_table_types, + vector input_table_names) { + auto function_name = GetAlias(ref); + auto &column_name_alias = ref.column_name_alias; + auto bind_index = GenerateTableIndex(); // perform the binding unique_ptr bind_data; @@ -140,7 +154,7 @@ Binder::BindTableFunctionInternal(TableFunction &table_function, const string &f vector return_names; if (table_function.bind || table_function.bind_replace) { TableFunctionBindInput bind_input(parameters, named_parameters, input_table_types, input_table_names, - table_function.function_info.get(), this); + table_function.function_info.get(), this, table_function, ref); if (table_function.bind_replace) { auto new_plan = table_function.bind_replace(context, bind_input); if (new_plan != nullptr) { @@ -151,10 +165,6 @@ Binder::BindTableFunctionInternal(TableFunction &table_function, const string &f } } bind_data = table_function.bind(context, bind_input, return_types, return_names); - if (table_function.name == "pandas_scan" || table_function.name == "arrow_scan") { - auto &arrow_bind = bind_data->Cast(); - arrow_bind.external_dependency = std::move(external_dependency); - } } else { throw InvalidInputException("Cannot call function \"%s\" directly - it has no bind function", table_function.name); @@ -197,10 +207,12 @@ unique_ptr Binder::BindTableFunction(TableFunction &function, v named_parameter_map_t named_parameters; vector input_table_types; vector input_table_names; - vector column_name_aliases; - return BindTableFunctionInternal(function, function.name, std::move(parameters), std::move(named_parameters), - std::move(input_table_types), std::move(input_table_names), column_name_aliases, - nullptr); + + TableFunctionRef ref; + ref.alias = function.name; + D_ASSERT(!ref.alias.empty()); + return BindTableFunctionInternal(function, ref, std::move(parameters), std::move(named_parameters), + std::move(input_table_types), std::move(input_table_names)); } unique_ptr Binder::Bind(TableFunctionRef &ref) { @@ -210,8 +222,8 @@ unique_ptr Binder::Bind(TableFunctionRef &ref) { auto &fexpr = ref.function->Cast(); // fetch the function from the catalog - auto &func_catalog = Catalog::GetEntry(context, CatalogType::TABLE_FUNCTION_ENTRY, fexpr.catalog, fexpr.schema, - fexpr.function_name, error_context); + auto &func_catalog = *GetCatalogEntry(CatalogType::TABLE_FUNCTION_ENTRY, fexpr.catalog, fexpr.schema, + fexpr.function_name, OnEntryNotFound::THROW_EXCEPTION, error_context); if (func_catalog.type == CatalogType::TABLE_MACRO_ENTRY) { auto ¯o_func = func_catalog.Cast(); @@ -278,10 +290,8 @@ unique_ptr Binder::Bind(TableFunctionRef &ref) { input_table_types = subquery->subquery->types; input_table_names = subquery->subquery->names; } - auto get = BindTableFunctionInternal(table_function, ref.alias.empty() ? fexpr.function_name : ref.alias, - std::move(parameters), std::move(named_parameters), - std::move(input_table_types), std::move(input_table_names), - ref.column_name_alias, std::move(ref.external_dependency)); + auto get = BindTableFunctionInternal(table_function, ref, std::move(parameters), std::move(named_parameters), + std::move(input_table_types), std::move(input_table_names)); if (subquery) { get->children.push_back(Binder::CreatePlan(*subquery)); } diff --git a/src/duckdb/src/planner/binder/tableref/plan_column_data_ref.cpp b/src/duckdb/src/planner/binder/tableref/plan_column_data_ref.cpp new file mode 100644 index 00000000..83e965b5 --- /dev/null +++ b/src/duckdb/src/planner/binder/tableref/plan_column_data_ref.cpp @@ -0,0 +1,15 @@ +#include "duckdb/planner/binder.hpp" +#include "duckdb/planner/tableref/bound_column_data_ref.hpp" +#include "duckdb/planner/operator/logical_column_data_get.hpp" + +namespace duckdb { + +unique_ptr Binder::CreatePlan(BoundColumnDataRef &ref) { + auto types = ref.collection->Types(); + // Create a (potentially owning) LogicalColumnDataGet + auto root = make_uniq_base(ref.bind_index, std::move(types), + std::move(ref.collection)); + return root; +} + +} // namespace duckdb diff --git a/src/duckdb/src/planner/bound_parameter_map.cpp b/src/duckdb/src/planner/bound_parameter_map.cpp index 420fa393..aac75230 100644 --- a/src/duckdb/src/planner/bound_parameter_map.cpp +++ b/src/duckdb/src/planner/bound_parameter_map.cpp @@ -33,7 +33,7 @@ shared_ptr BoundParameterMap::CreateOrGetData(const string & auto entry = parameters.find(identifier); if (entry == parameters.end()) { // no entry yet: create a new one - auto data = make_shared(); + auto data = make_shared_ptr(); data->return_type = GetReturnType(identifier); CreateNewParameter(identifier, data); diff --git a/src/duckdb/src/planner/bound_result_modifier.cpp b/src/duckdb/src/planner/bound_result_modifier.cpp index 9a1728ed..a4cb6ed4 100644 --- a/src/duckdb/src/planner/bound_result_modifier.cpp +++ b/src/duckdb/src/planner/bound_result_modifier.cpp @@ -126,7 +126,7 @@ BoundLimitNode::BoundLimitNode() : type(LimitNodeType::UNSET) { } BoundLimitNode::BoundLimitNode(int64_t constant_value) - : type(LimitNodeType::CONSTANT_VALUE), constant_integer(constant_value) { + : type(LimitNodeType::CONSTANT_VALUE), constant_integer(NumericCast(constant_value)) { } BoundLimitNode::BoundLimitNode(double percentage_value) diff --git a/src/duckdb/src/planner/expression/bound_expression.cpp b/src/duckdb/src/planner/expression/bound_expression.cpp index e5cdfb1c..864357ff 100644 --- a/src/duckdb/src/planner/expression/bound_expression.cpp +++ b/src/duckdb/src/planner/expression/bound_expression.cpp @@ -1,4 +1,5 @@ #include "duckdb/parser/expression/bound_expression.hpp" +#include "duckdb/common/enum_util.hpp" namespace duckdb { @@ -30,11 +31,11 @@ hash_t BoundExpression::Hash() const { } unique_ptr BoundExpression::Copy() const { - throw SerializationException("Cannot copy or serialize bound expression"); + throw SerializationException("Cannot copy bound expression"); } void BoundExpression::Serialize(Serializer &serializer) const { - throw SerializationException("Cannot copy or serialize bound expression"); + throw SerializationException("Cannot serialize bound expression"); } } // namespace duckdb diff --git a/src/duckdb/src/planner/expression_binder.cpp b/src/duckdb/src/planner/expression_binder.cpp index fa03fabd..649ab82a 100644 --- a/src/duckdb/src/planner/expression_binder.cpp +++ b/src/duckdb/src/planner/expression_binder.cpp @@ -9,6 +9,10 @@ namespace duckdb { +void ExpressionBinder::SetCatalogLookupCallback(catalog_entry_callback_t callback) { + binder.SetCatalogLookupCallback(std::move(callback)); +} + ExpressionBinder::ExpressionBinder(Binder &binder, ClientContext &context, bool replace_binder) : binder(binder), context(context) { InitializeStackCheck(); diff --git a/src/duckdb/src/planner/expression_binder/alter_binder.cpp b/src/duckdb/src/planner/expression_binder/alter_binder.cpp index 597ef0ca..e8c4d547 100644 --- a/src/duckdb/src/planner/expression_binder/alter_binder.cpp +++ b/src/duckdb/src/planner/expression_binder/alter_binder.cpp @@ -1,8 +1,9 @@ #include "duckdb/planner/expression_binder/alter_binder.hpp" +#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp" #include "duckdb/parser/expression/columnref_expression.hpp" #include "duckdb/planner/expression/bound_reference_expression.hpp" -#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp" +#include "duckdb/planner/table_binding.hpp" namespace duckdb { @@ -12,6 +13,12 @@ AlterBinder::AlterBinder(Binder &binder, ClientContext &context, TableCatalogEnt this->target_type = std::move(target_type); } +BindResult AlterBinder::BindLambdaReference(LambdaRefExpression &expr, idx_t depth) { + D_ASSERT(lambda_bindings && expr.lambda_idx < lambda_bindings->size()); + auto &lambda_ref = expr.Cast(); + return (*lambda_bindings)[expr.lambda_idx].Bind(lambda_ref, depth); +} + BindResult AlterBinder::BindExpression(unique_ptr &expr_ptr, idx_t depth, bool root_expression) { auto &expr = *expr_ptr; switch (expr.GetExpressionClass()) { @@ -20,7 +27,7 @@ BindResult AlterBinder::BindExpression(unique_ptr &expr_ptr, i case ExpressionClass::SUBQUERY: return BindResult("cannot use subquery in alter statement"); case ExpressionClass::COLUMN_REF: - return BindColumn(expr.Cast()); + return BindColumnReference(expr.Cast(), depth); default: return ExpressionBinder::BindExpression(expr_ptr, depth); } @@ -30,14 +37,24 @@ string AlterBinder::UnsupportedAggregateMessage() { return "aggregate functions are not allowed in alter statement"; } -BindResult AlterBinder::BindColumn(ColumnRefExpression &colref) { - if (colref.column_names.size() > 1) { - return BindQualifiedColumnName(colref, table.name); +BindResult AlterBinder::BindColumnReference(ColumnRefExpression &col_ref, idx_t depth) { + + // try binding as a lambda parameter + if (!col_ref.IsQualified()) { + auto lambda_ref = LambdaRefExpression::FindMatchingBinding(lambda_bindings, col_ref.GetName()); + if (lambda_ref) { + return BindLambdaReference(lambda_ref->Cast(), depth); + } + } + + if (col_ref.column_names.size() > 1) { + return BindQualifiedColumnName(col_ref, table.name); } - auto idx = table.GetColumnIndex(colref.column_names[0], true); + + auto idx = table.GetColumnIndex(col_ref.column_names[0], true); if (!idx.IsValid()) { throw BinderException("Table does not contain column %s referenced in alter statement!", - colref.column_names[0]); + col_ref.column_names[0]); } if (table.GetColumn(idx).Generated()) { throw BinderException("Using generated columns in alter statement not supported"); diff --git a/src/duckdb/src/planner/expression_binder/base_select_binder.cpp b/src/duckdb/src/planner/expression_binder/base_select_binder.cpp index cadc3ac6..30a1eeaa 100644 --- a/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +++ b/src/duckdb/src/planner/expression_binder/base_select_binder.cpp @@ -3,9 +3,12 @@ #include "duckdb/common/string_util.hpp" #include "duckdb/parser/expression/columnref_expression.hpp" #include "duckdb/parser/expression/operator_expression.hpp" +#include "duckdb/planner/expression/bound_operator_expression.hpp" +#include "duckdb/planner/expression/bound_constant_expression.hpp" #include "duckdb/parser/expression/window_expression.hpp" #include "duckdb/planner/binder.hpp" #include "duckdb/planner/expression/bound_columnref_expression.hpp" +#include "duckdb/planner/expression/bound_case_expression.hpp" #include "duckdb/planner/expression_binder/aggregate_binder.hpp" #include "duckdb/planner/query_node/bound_select_node.hpp" #include "duckdb/planner/expression_binder/select_bind_state.hpp" @@ -98,8 +101,30 @@ BindResult BaseSelectBinder::BindGroup(ParsedExpression &expr, idx_t depth, idx_ if (it != info.collated_groups.end()) { // This is an implicitly collated group, so we need to refer to the first() aggregate const auto &aggr_index = it->second; - return BindResult(make_uniq(expr.GetName(), node.aggregates[aggr_index]->return_type, - ColumnBinding(node.aggregate_index, aggr_index), depth)); + auto uncollated_first_expression = + make_uniq(expr.GetName(), node.aggregates[aggr_index]->return_type, + ColumnBinding(node.aggregate_index, aggr_index), depth); + + if (node.groups.grouping_sets.size() <= 1) { + // if there are no more than two grouping sets, you can return the uncollated first expression. + // "first" meaning the aggreagte function. + return BindResult(std::move(uncollated_first_expression)); + } + + // otherwise we insert a case statement to return NULL when the collated group expression is NULL + // otherwise you can return the "first" of the uncollated expression. + auto &group = node.groups.group_expressions[group_index]; + auto collated_group_expression = make_uniq( + expr.GetName(), group->return_type, ColumnBinding(node.group_index, group_index), depth); + + auto sql_null = make_uniq(Value(LogicalType::VARCHAR)); + auto when_expr = make_uniq(ExpressionType::OPERATOR_IS_NULL, LogicalType::BOOLEAN); + when_expr->children.push_back(std::move(collated_group_expression)); + auto then_expr = make_uniq(Value(LogicalType::VARCHAR)); + auto else_expr = std::move(uncollated_first_expression); + auto case_expr = + make_uniq(std::move(when_expr), std::move(then_expr), std::move(else_expr)); + return BindResult(std::move(case_expr)); } else { auto &group = node.groups.group_expressions[group_index]; return BindResult(make_uniq(expr.GetName(), group->return_type, diff --git a/src/duckdb/src/planner/expression_binder/having_binder.cpp b/src/duckdb/src/planner/expression_binder/having_binder.cpp index 5a987ef7..1a2bd35a 100644 --- a/src/duckdb/src/planner/expression_binder/having_binder.cpp +++ b/src/duckdb/src/planner/expression_binder/having_binder.cpp @@ -15,14 +15,29 @@ HavingBinder::HavingBinder(Binder &binder, ClientContext &context, BoundSelectNo target_type = LogicalType(LogicalTypeId::BOOLEAN); } +BindResult HavingBinder::BindLambdaReference(LambdaRefExpression &expr, idx_t depth) { + D_ASSERT(lambda_bindings && expr.lambda_idx < lambda_bindings->size()); + auto &lambda_ref = expr.Cast(); + return (*lambda_bindings)[expr.lambda_idx].Bind(lambda_ref, depth); +} + BindResult HavingBinder::BindColumnRef(unique_ptr &expr_ptr, idx_t depth, bool root_expression) { + // Keep the original column name to return a meaningful error message. - auto column_name = expr_ptr->Cast().GetColumnName(); + auto col_ref = expr_ptr->Cast(); + const auto &column_name = col_ref.GetColumnName(); + + // Try binding as a lambda parameter + if (!col_ref.IsQualified()) { + auto lambda_ref = LambdaRefExpression::FindMatchingBinding(lambda_bindings, col_ref.GetName()); + if (lambda_ref) { + return BindLambdaReference(lambda_ref->Cast(), depth); + } + } // Bind the alias. BindResult alias_result; auto found_alias = column_alias_binder.BindAlias(*this, expr_ptr, depth, root_expression, alias_result); - if (found_alias) { if (depth > 0) { throw BinderException("Having clause cannot reference alias \"%s\" in correlated subquery", column_name); @@ -30,27 +45,27 @@ BindResult HavingBinder::BindColumnRef(unique_ptr &expr_ptr, i return alias_result; } - if (aggregate_handling == AggregateHandling::FORCE_AGGREGATES) { - if (depth > 0) { - throw BinderException( - "Having clause cannot reference column \"%s\" in correlated subquery and group by all", column_name); - } + if (aggregate_handling != AggregateHandling::FORCE_AGGREGATES) { + return BindResult(StringUtil::Format( + "column %s must appear in the GROUP BY clause or be used in an aggregate function", column_name)); + } - auto expr = duckdb::BaseSelectBinder::BindColumnRef(expr_ptr, depth, root_expression); - if (expr.HasError()) { - return expr; - } + if (depth > 0) { + throw BinderException("Having clause cannot reference column \"%s\" in correlated subquery and group by all", + column_name); + } - // Return a GROUP BY column reference expression. - auto return_type = expr.expression->return_type; - auto column_binding = ColumnBinding(node.group_index, node.groups.group_expressions.size()); - auto group_ref = make_uniq(return_type, column_binding); - node.groups.group_expressions.push_back(std::move(expr.expression)); - return BindResult(std::move(group_ref)); + auto expr = duckdb::BaseSelectBinder::BindColumnRef(expr_ptr, depth, root_expression); + if (expr.HasError()) { + return expr; } - return BindResult(StringUtil::Format( - "column %s must appear in the GROUP BY clause or be used in an aggregate function", column_name)); + // Return a GROUP BY column reference expression. + auto return_type = expr.expression->return_type; + auto column_binding = ColumnBinding(node.group_index, node.groups.group_expressions.size()); + auto group_ref = make_uniq(return_type, column_binding); + node.groups.group_expressions.push_back(std::move(expr.expression)); + return BindResult(std::move(group_ref)); } BindResult HavingBinder::BindWindow(WindowExpression &expr, idx_t depth) { diff --git a/src/duckdb/src/planner/expression_binder/index_binder.cpp b/src/duckdb/src/planner/expression_binder/index_binder.cpp index 5bdf1f04..988948ae 100644 --- a/src/duckdb/src/planner/expression_binder/index_binder.cpp +++ b/src/duckdb/src/planner/expression_binder/index_binder.cpp @@ -4,6 +4,10 @@ #include "duckdb/parser/expression/columnref_expression.hpp" #include "duckdb/planner/expression/bound_columnref_expression.hpp" #include "duckdb/planner/column_binding.hpp" +#include "duckdb/execution/index/bound_index.hpp" +#include "duckdb/execution/index/unbound_index.hpp" +#include "duckdb/main/config.hpp" +#include "duckdb/main/database.hpp" namespace duckdb { @@ -12,6 +16,35 @@ IndexBinder::IndexBinder(Binder &binder, ClientContext &context, optional_ptr IndexBinder::BindIndex(const UnboundIndex &unbound_index) { + auto &index_type_name = unbound_index.GetIndexType(); + // Do we know the type of this index now? + auto index_type = context.db->config.GetIndexTypes().FindByName(index_type_name); + if (!index_type) { + throw MissingExtensionException("Cannot bind index '%s', unknown index type '%s'. You need to load the " + "extension that provides this index type before table '%s' can be modified.", + unbound_index.GetTableName(), index_type_name, unbound_index.GetTableName()); + } + + auto &create_info = unbound_index.GetCreateInfo(); + auto &storage_info = unbound_index.GetStorageInfo(); + auto &parsed_expressions = unbound_index.GetParsedExpressions(); + + // bind the parsed expressions to create unbound expressions + vector> unbound_expressions; + unbound_expressions.reserve(parsed_expressions.size()); + for (auto &expr : parsed_expressions) { + auto copy = expr->Copy(); + unbound_expressions.push_back(Bind(copy)); + } + + CreateIndexInput input(unbound_index.table_io_manager, unbound_index.db, create_info.constraint_type, + create_info.index_name, create_info.column_ids, unbound_expressions, storage_info, + create_info.options); + + return index_type->create_instance(input); +} + BindResult IndexBinder::BindExpression(unique_ptr &expr_ptr, idx_t depth, bool root_expression) { auto &expr = *expr_ptr; switch (expr.expression_class) { diff --git a/src/duckdb/src/planner/expression_binder/order_binder.cpp b/src/duckdb/src/planner/expression_binder/order_binder.cpp index c5a63de8..4a277b3a 100644 --- a/src/duckdb/src/planner/expression_binder/order_binder.cpp +++ b/src/duckdb/src/planner/expression_binder/order_binder.cpp @@ -108,7 +108,16 @@ unique_ptr OrderBinder::Bind(unique_ptr expr) { auto &collation = expr->Cast(); if (collation.child->expression_class == ExpressionClass::CONSTANT) { auto &constant = collation.child->Cast(); - auto index = NumericCast(constant.value.GetValue()) - 1; + + // non-integral expression, we just leave the constant here. + // ORDER BY has no effect + // CONTROVERSIAL: maybe we should throw an error + if (!constant.value.type().IsIntegral()) { + return nullptr; + } + + D_ASSERT(constant.value.GetValue() > 0); + auto index = constant.value.GetValue() - 1; child_list_t values; values.push_back(make_pair("index", Value::UBIGINT(index))); values.push_back(make_pair("collation", Value(std::move(collation.collation)))); diff --git a/src/duckdb/src/planner/expression_iterator.cpp b/src/duckdb/src/planner/expression_iterator.cpp index 8bf16220..47feaeb1 100644 --- a/src/duckdb/src/planner/expression_iterator.cpp +++ b/src/duckdb/src/planner/expression_iterator.cpp @@ -7,6 +7,7 @@ #include "duckdb/planner/query_node/bound_recursive_cte_node.hpp" #include "duckdb/planner/query_node/bound_cte_node.hpp" #include "duckdb/planner/tableref/list.hpp" +#include "duckdb/common/enum_util.hpp" namespace duckdb { @@ -269,7 +270,8 @@ void BoundNodeVisitor::VisitBoundTableRef(BoundTableRef &ref) { case TableReferenceType::CTE: break; default: - throw NotImplementedException("Unimplemented table reference type in ExpressionIterator"); + throw NotImplementedException("Unimplemented table reference type (%s) in ExpressionIterator", + EnumUtil::ToString(ref.type)); } } diff --git a/src/duckdb/src/planner/filter/constant_filter.cpp b/src/duckdb/src/planner/filter/constant_filter.cpp index 1388aa42..1243e9b7 100644 --- a/src/duckdb/src/planner/filter/constant_filter.cpp +++ b/src/duckdb/src/planner/filter/constant_filter.cpp @@ -32,7 +32,7 @@ FilterPropagateResult ConstantFilter::CheckStatistics(BaseStatistics &stats) { } string ConstantFilter::ToString(const string &column_name) { - return column_name + ExpressionTypeToOperator(comparison_type) + constant.ToString(); + return column_name + ExpressionTypeToOperator(comparison_type) + constant.ToSQLString(); } bool ConstantFilter::Equals(const TableFilter &other_p) const { diff --git a/src/duckdb/src/planner/operator/logical_column_data_get.cpp b/src/duckdb/src/planner/operator/logical_column_data_get.cpp index b99c9121..28b0e76b 100644 --- a/src/duckdb/src/planner/operator/logical_column_data_get.cpp +++ b/src/duckdb/src/planner/operator/logical_column_data_get.cpp @@ -6,9 +6,23 @@ namespace duckdb { LogicalColumnDataGet::LogicalColumnDataGet(idx_t table_index, vector types, - unique_ptr collection) + unique_ptr collection_p) : LogicalOperator(LogicalOperatorType::LOGICAL_CHUNK_GET), table_index(table_index), - collection(std::move(collection)) { + collection(std::move(collection_p)) { + D_ASSERT(types.size() > 0); + chunk_types = std::move(types); +} + +LogicalColumnDataGet::LogicalColumnDataGet(idx_t table_index, vector types, ColumnDataCollection &to_scan) + : LogicalOperator(LogicalOperatorType::LOGICAL_CHUNK_GET), table_index(table_index), collection(to_scan) { + D_ASSERT(types.size() > 0); + chunk_types = std::move(types); +} + +LogicalColumnDataGet::LogicalColumnDataGet(idx_t table_index, vector types, + optionally_owned_ptr collection_p) + : LogicalOperator(LogicalOperatorType::LOGICAL_CHUNK_GET), table_index(table_index), + collection(std::move(collection_p)) { D_ASSERT(types.size() > 0); chunk_types = std::move(types); } diff --git a/src/duckdb/src/planner/operator/logical_delete.cpp b/src/duckdb/src/planner/operator/logical_delete.cpp index 950f2eaa..d82c3bfd 100644 --- a/src/duckdb/src/planner/operator/logical_delete.cpp +++ b/src/duckdb/src/planner/operator/logical_delete.cpp @@ -15,6 +15,8 @@ LogicalDelete::LogicalDelete(ClientContext &context, const unique_ptr(context, table_info->catalog, table_info->schema, table_info->Cast().table)) { + auto binder = Binder::CreateBinder(context); + bound_constraints = binder->BindConstraints(table); } idx_t LogicalDelete::EstimateCardinality(ClientContext &context) { diff --git a/src/duckdb/src/planner/operator/logical_get.cpp b/src/duckdb/src/planner/operator/logical_get.cpp index 077eb6cb..188b0520 100644 --- a/src/duckdb/src/planner/operator/logical_get.cpp +++ b/src/duckdb/src/planner/operator/logical_get.cpp @@ -9,6 +9,7 @@ #include "duckdb/storage/data_table.hpp" #include "duckdb/common/serializer/serializer.hpp" #include "duckdb/common/serializer/deserializer.hpp" +#include "duckdb/parser/tableref/table_function_ref.hpp" namespace duckdb { @@ -164,8 +165,10 @@ unique_ptr LogicalGet::Deserialize(Deserializer &deserializer) deserializer.ReadProperty(207, "named_parameters", result->named_parameters); deserializer.ReadProperty(208, "input_table_types", result->input_table_types); deserializer.ReadProperty(209, "input_table_names", result->input_table_names); + TableFunctionRef empty_ref; TableFunctionBindInput input(result->parameters, result->named_parameters, result->input_table_types, - result->input_table_names, function.function_info.get(), nullptr); + result->input_table_names, function.function_info.get(), nullptr, result->function, + empty_ref); vector bind_return_types; vector bind_names; diff --git a/src/duckdb/src/planner/operator/logical_insert.cpp b/src/duckdb/src/planner/operator/logical_insert.cpp index 51866161..dd5bf92a 100644 --- a/src/duckdb/src/planner/operator/logical_insert.cpp +++ b/src/duckdb/src/planner/operator/logical_insert.cpp @@ -15,6 +15,8 @@ LogicalInsert::LogicalInsert(ClientContext &context, const unique_ptr(context, table_info->catalog, table_info->schema, table_info->Cast().table)) { + auto binder = Binder::CreateBinder(context); + bound_constraints = binder->BindConstraints(table); } idx_t LogicalInsert::EstimateCardinality(ClientContext &context) { diff --git a/src/duckdb/src/planner/operator/logical_top_n.cpp b/src/duckdb/src/planner/operator/logical_top_n.cpp index da1fa493..e60adc0e 100644 --- a/src/duckdb/src/planner/operator/logical_top_n.cpp +++ b/src/duckdb/src/planner/operator/logical_top_n.cpp @@ -4,7 +4,7 @@ namespace duckdb { idx_t LogicalTopN::EstimateCardinality(ClientContext &context) { auto child_cardinality = LogicalOperator::EstimateCardinality(context); - if (limit >= 0 && child_cardinality < idx_t(limit)) { + if (child_cardinality < limit) { return limit; } return child_cardinality; diff --git a/src/duckdb/src/planner/operator/logical_update.cpp b/src/duckdb/src/planner/operator/logical_update.cpp index edcfd5d8..38626447 100644 --- a/src/duckdb/src/planner/operator/logical_update.cpp +++ b/src/duckdb/src/planner/operator/logical_update.cpp @@ -13,6 +13,8 @@ LogicalUpdate::LogicalUpdate(ClientContext &context, const unique_ptr(context, table_info->catalog, table_info->schema, table_info->Cast().table)) { + auto binder = Binder::CreateBinder(context); + bound_constraints = binder->BindConstraints(table); } idx_t LogicalUpdate::EstimateCardinality(ClientContext &context) { diff --git a/src/duckdb/src/planner/planner.cpp b/src/duckdb/src/planner/planner.cpp index 2df3a698..6449872f 100644 --- a/src/duckdb/src/planner/planner.cpp +++ b/src/duckdb/src/planner/planner.cpp @@ -13,6 +13,7 @@ #include "duckdb/planner/expression/bound_parameter_expression.hpp" #include "duckdb/transaction/meta_transaction.hpp" #include "duckdb/execution/column_binding_resolver.hpp" +#include "duckdb/main/attached_database.hpp" namespace duckdb { @@ -76,7 +77,7 @@ void Planner::CreatePlan(SQLStatement &statement) { throw; } } - this->properties = binder->properties; + this->properties = binder->GetStatementProperties(); this->properties.parameter_count = parameter_count; properties.bound_all_parameters = !bound_parameters.rebind && parameters_resolved; @@ -101,7 +102,7 @@ shared_ptr Planner::PrepareSQLStatement(unique_ptr(copied_statement->type); + auto prepared_data = make_shared_ptr(copied_statement->type); prepared_data->unbound_statement = std::move(copied_statement); prepared_data->names = names; prepared_data->types = types; @@ -138,6 +139,7 @@ void Planner::CreatePlan(unique_ptr statement) { case StatementType::ATTACH_STATEMENT: case StatementType::DETACH_STATEMENT: case StatementType::COPY_DATABASE_STATEMENT: + case StatementType::UPDATE_EXTENSIONS_STATEMENT: CreatePlan(*statement); break; default: @@ -156,9 +158,20 @@ static bool OperatorSupportsSerialization(LogicalOperator &op) { void Planner::VerifyPlan(ClientContext &context, unique_ptr &op, optional_ptr map) { + auto &config = DBConfig::GetConfig(context); #ifdef DUCKDB_ALTERNATIVE_VERIFY - // if alternate verification is enabled we run the original operator - return; + { + auto &serialize_comp = config.options.serialization_compatibility; + auto latest_version = SerializationCompatibility::Latest(); + if (serialize_comp.manually_set && + serialize_comp.serialization_version != latest_version.serialization_version) { + // Serialization should not be skipped, this test relies on the serialization to remove certain fields for + // compatibility with older versions. This might change behavior, not doing this might make this test fail. + } else { + // if alternate verification is enabled we run the original operator + return; + } + } #endif if (!op || !ClientConfig::GetConfig(context).verify_serializer) { return; @@ -173,7 +186,16 @@ void Planner::VerifyPlan(ClientContext &context, unique_ptr &op // format (de)serialization of this operator try { MemoryStream stream; - BinarySerializer::Serialize(*op, stream, true); + + SerializationOptions options; + if (config.options.serialization_compatibility.manually_set) { + // Override the default of 'latest' if this was manually set (for testing, mostly) + options.serialization_compatibility = config.options.serialization_compatibility; + } else { + options.serialization_compatibility = SerializationCompatibility::Latest(); + } + + BinarySerializer::Serialize(*op, stream, options); stream.Rewind(); bound_parameter_map_t parameters; auto new_plan = BinaryDeserializer::Deserialize(stream, context, parameters); @@ -182,10 +204,14 @@ void Planner::VerifyPlan(ClientContext &context, unique_ptr &op *map = std::move(parameters); } op = std::move(new_plan); - } catch (SerializationException &ex) { // NOLINT: explicitly allowing these errors (for now) - // pass - } catch (NotImplementedException &ex) { // NOLINT: explicitly allowing these errors (for now) - // pass + } catch (std::exception &ex) { + ErrorData error(ex); + switch (error.Type()) { + case ExceptionType::NOT_IMPLEMENTED: // NOLINT: explicitly allowing these errors (for now) + break; // pass + default: + throw; + } } } diff --git a/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp b/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp index 7e863703..55cb4396 100644 --- a/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +++ b/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp @@ -119,6 +119,8 @@ unique_ptr FlattenDependentJoins::PushDownDependentJoinInternal idx_t lateral_depth) { // first check if the logical operator has correlated expressions auto entry = has_correlated_expressions.find(*plan); + bool exit_projection = false; + unique_ptr delim_scan; D_ASSERT(entry != has_correlated_expressions.end()); if (!entry->second) { // we reached a node without correlated expressions @@ -136,13 +138,21 @@ unique_ptr FlattenDependentJoins::PushDownDependentJoinInternal } } - auto left_columns = plan->GetColumnBindings().size(); + // create cross product with Delim Join auto delim_index = binder.GenerateTableIndex(); - this->base_binding = ColumnBinding(delim_index, 0); - this->delim_offset = left_columns; - this->data_offset = 0; - auto delim_scan = make_uniq(delim_index, delim_types); - return LogicalCrossProduct::Create(std::move(plan), std::move(delim_scan)); + base_binding = ColumnBinding(delim_index, 0); + + auto left_columns = plan->GetColumnBindings().size(); + delim_offset = left_columns; + data_offset = 0; + delim_scan = make_uniq(delim_index, delim_types); + if (plan->type == LogicalOperatorType::LOGICAL_PROJECTION) { + // we want to keep the logical projection for positionality. + exit_projection = true; + } else { + auto cross_product = LogicalCrossProduct::Create(std::move(plan), std::move(delim_scan)); + return cross_product; + } } switch (plan->type) { case LogicalOperatorType::LOGICAL_UNNEST: @@ -166,8 +176,18 @@ unique_ptr FlattenDependentJoins::PushDownDependentJoinInternal for (auto &expr : plan->expressions) { parent_propagate_null_values &= expr->PropagatesNullValues(); } - plan->children[0] = - PushDownDependentJoinInternal(std::move(plan->children[0]), parent_propagate_null_values, lateral_depth); + + // if the node has no correlated expressions, + // push the cross product with the delim get only below the projection. + // This will preserve positionality of the columns and prevent errors when reordering of + // delim gets is enabled. + if (exit_projection) { + auto cross_product = LogicalCrossProduct::Create(std::move(plan->children[0]), std::move(delim_scan)); + plan->children[0] = std::move(cross_product); + } else { + plan->children[0] = PushDownDependentJoinInternal(std::move(plan->children[0]), + parent_propagate_null_values, lateral_depth); + } // then we replace any correlated expressions with the corresponding entry in the correlated_map RewriteCorrelatedExpressions rewriter(base_binding, correlated_map, lateral_depth); @@ -248,7 +268,7 @@ unique_ptr FlattenDependentJoins::PushDownDependentJoinInternal } } auto left_index = binder.GenerateTableIndex(); - auto delim_scan = make_uniq(left_index, delim_types); + delim_scan = make_uniq(left_index, delim_types); join->children.push_back(std::move(delim_scan)); join->children.push_back(std::move(plan)); for (idx_t i = 0; i < new_group_count; i++) { @@ -555,6 +575,11 @@ unique_ptr FlattenDependentJoins::PushDownDependentJoinInternal // push into children plan->children[0] = PushDownDependentJoinInternal(std::move(plan->children[0]), parent_propagate_null_values, lateral_depth); + + // we replace any correlated expressions with the corresponding entry in the correlated_map + RewriteCorrelatedExpressions rewriter(base_binding, correlated_map, lateral_depth); + rewriter.VisitOperator(*plan); + // add the correlated columns to the PARTITION BY clauses in the Window for (auto &expr : window.expressions) { D_ASSERT(expr->GetExpressionClass() == ExpressionClass::BOUND_WINDOW); diff --git a/src/duckdb/src/planner/table_binding.cpp b/src/duckdb/src/planner/table_binding.cpp index 1709a452..dff3de59 100644 --- a/src/duckdb/src/planner/table_binding.cpp +++ b/src/duckdb/src/planner/table_binding.cpp @@ -171,7 +171,7 @@ ColumnBinding TableBinding::GetColumnBinding(column_t column_index) { auto it = std::find_if(column_ids.begin(), column_ids.end(), [&](const column_t &id) -> bool { return id == column_index; }); // Get the index of it - binding.column_index = std::distance(column_ids.begin(), it); + binding.column_index = NumericCast(std::distance(column_ids.begin(), it)); // If it wasn't found, add it if (it == column_ids.end()) { column_ids.push_back(column_index); diff --git a/src/duckdb/src/storage/arena_allocator.cpp b/src/duckdb/src/storage/arena_allocator.cpp index c659b2c1..d7198c06 100644 --- a/src/duckdb/src/storage/arena_allocator.cpp +++ b/src/duckdb/src/storage/arena_allocator.cpp @@ -1,6 +1,7 @@ #include "duckdb/storage/arena_allocator.hpp" #include "duckdb/common/assert.hpp" +#include "duckdb/common/numeric_utils.hpp" namespace duckdb { @@ -88,10 +89,11 @@ data_ptr_t ArenaAllocator::Reallocate(data_ptr_t pointer, idx_t old_size, idx_t } auto head_ptr = head->data.get() + head->current_position; - int64_t diff = size - old_size; - if (pointer == head_ptr && (size < old_size || head->current_position + diff <= head->maximum_size)) { + int64_t diff = NumericCast(size) - NumericCast(old_size); + if (pointer == head_ptr && (size < old_size || NumericCast(head->current_position) + diff <= + NumericCast(head->maximum_size))) { // passed pointer is the head pointer, and the diff fits on the current chunk - head->current_position += diff; + head->current_position += NumericCast(diff); return pointer; } else { // allocate new memory diff --git a/src/duckdb/src/storage/buffer/block_handle.cpp b/src/duckdb/src/storage/buffer/block_handle.cpp index 6e7a96c0..706e3e7d 100644 --- a/src/duckdb/src/storage/buffer/block_handle.cpp +++ b/src/duckdb/src/storage/buffer/block_handle.cpp @@ -9,9 +9,9 @@ namespace duckdb { BlockHandle::BlockHandle(BlockManager &block_manager, block_id_t block_id_p, MemoryTag tag) - : block_manager(block_manager), readers(0), block_id(block_id_p), tag(tag), buffer(nullptr), eviction_timestamp(0), + : block_manager(block_manager), readers(0), block_id(block_id_p), tag(tag), buffer(nullptr), eviction_seq_num(0), can_destroy(false), memory_charge(tag, block_manager.buffer_manager.GetBufferPool()), unswizzled(nullptr) { - eviction_timestamp = 0; + eviction_seq_num = 0; state = BlockState::BLOCK_UNLOADED; memory_usage = Storage::BLOCK_ALLOC_SIZE; } @@ -19,7 +19,7 @@ BlockHandle::BlockHandle(BlockManager &block_manager, block_id_t block_id_p, Mem BlockHandle::BlockHandle(BlockManager &block_manager, block_id_t block_id_p, MemoryTag tag, unique_ptr buffer_p, bool can_destroy_p, idx_t block_size, BufferPoolReservation &&reservation) - : block_manager(block_manager), readers(0), block_id(block_id_p), tag(tag), eviction_timestamp(0), + : block_manager(block_manager), readers(0), block_id(block_id_p), tag(tag), eviction_seq_num(0), can_destroy(can_destroy_p), memory_charge(tag, block_manager.buffer_manager.GetBufferPool()), unswizzled(nullptr) { buffer = std::move(buffer_p); diff --git a/src/duckdb/src/storage/buffer/block_manager.cpp b/src/duckdb/src/storage/buffer/block_manager.cpp index 36c2b559..e5e21b0e 100644 --- a/src/duckdb/src/storage/buffer/block_manager.cpp +++ b/src/duckdb/src/storage/buffer/block_manager.cpp @@ -23,7 +23,7 @@ shared_ptr BlockManager::RegisterBlock(block_id_t block_id) { } } // create a new block pointer for this block - auto result = make_shared(*this, block_id, MemoryTag::BASE_TABLE); + auto result = make_shared_ptr(*this, block_id, MemoryTag::BASE_TABLE); // register the block pointer in the set of blocks as a weak pointer blocks[block_id] = weak_ptr(result); return result; diff --git a/src/duckdb/src/storage/buffer/buffer_pool.cpp b/src/duckdb/src/storage/buffer/buffer_pool.cpp index 0b427b22..528bfe00 100644 --- a/src/duckdb/src/storage/buffer/buffer_pool.cpp +++ b/src/duckdb/src/storage/buffer/buffer_pool.cpp @@ -1,5 +1,6 @@ #include "duckdb/storage/buffer/buffer_pool.hpp" +#include "duckdb/common/chrono.hpp" #include "duckdb/common/exception.hpp" #include "duckdb/parallel/concurrentqueue.hpp" #include "duckdb/storage/temporary_memory_manager.hpp" @@ -12,8 +13,13 @@ struct EvictionQueue { eviction_queue_t q; }; +BufferEvictionNode::BufferEvictionNode(weak_ptr handle_p, idx_t eviction_seq_num) + : handle(std::move(handle_p)), handle_sequence_number(eviction_seq_num) { + D_ASSERT(!handle.expired()); +} + bool BufferEvictionNode::CanUnload(BlockHandle &handle_p) { - if (timestamp != handle_p.eviction_timestamp) { + if (handle_sequence_number != handle_p.eviction_seq_num) { // handle was used in between return false; } @@ -34,9 +40,10 @@ shared_ptr BufferEvictionNode::TryGetBlockHandle() { return handle_p; } -BufferPool::BufferPool(idx_t maximum_memory) - : current_memory(0), maximum_memory(maximum_memory), queue(make_uniq()), - temporary_memory_manager(make_uniq()), evict_queue_insertions(0), total_dead_nodes(0) { +BufferPool::BufferPool(idx_t maximum_memory, bool track_eviction_timestamps) + : current_memory(0), maximum_memory(maximum_memory), track_eviction_timestamps(track_eviction_timestamps), + queue(make_uniq()), temporary_memory_manager(make_uniq()), + evict_queue_insertions(0), total_dead_nodes(0) { for (idx_t i = 0; i < MEMORY_TAG_COUNT; i++) { memory_usage_per_tag[i] = 0; } @@ -50,7 +57,13 @@ bool BufferPool::AddToEvictionQueue(shared_ptr &handle) { // or the block handle is still a local variable (ConvertToPersistent) D_ASSERT(handle->readers == 0); - auto ts = ++handle->eviction_timestamp; + auto ts = ++handle->eviction_seq_num; + if (track_eviction_timestamps) { + handle->lru_timestamp_msec = + std::chrono::time_point_cast(std::chrono::steady_clock::now()) + .time_since_epoch() + .count(); + } BufferEvictionNode evict_node(weak_ptr(handle), ts); queue->q.enqueue(evict_node); @@ -66,9 +79,14 @@ bool BufferPool::AddToEvictionQueue(shared_ptr &handle) { return false; } -void BufferPool::IncreaseUsedMemory(MemoryTag tag, idx_t size) { - current_memory += size; - memory_usage_per_tag[uint8_t(tag)] += size; +void BufferPool::UpdateUsedMemory(MemoryTag tag, int64_t size) { + if (size < 0) { + current_memory -= UnsafeNumericCast(-size); + memory_usage_per_tag[uint8_t(tag)] -= UnsafeNumericCast(-size); + } else { + current_memory += UnsafeNumericCast(size); + memory_usage_per_tag[uint8_t(tag)] += UnsafeNumericCast(size); + } } idx_t BufferPool::GetUsedMemory() const { @@ -89,18 +107,68 @@ TemporaryMemoryManager &BufferPool::GetTemporaryMemoryManager() { BufferPool::EvictionResult BufferPool::EvictBlocks(MemoryTag tag, idx_t extra_memory, idx_t memory_limit, unique_ptr *buffer) { - BufferEvictionNode node; TempBufferPoolReservation r(tag, *this, extra_memory); + bool found = false; + + if (current_memory <= memory_limit) { + return {true, std::move(r)}; + } + + IterateUnloadableBlocks([&](BufferEvictionNode &, const shared_ptr &handle) { + // hooray, we can unload the block + if (buffer && handle->buffer->AllocSize() == extra_memory) { + // we can re-use the memory directly + *buffer = handle->UnloadAndTakeBlock(); + found = true; + return false; + } + + // release the memory and mark the block as unloaded + handle->Unload(); + + if (current_memory <= memory_limit) { + found = true; + return false; + } - while (current_memory > memory_limit) { + // Continue iteration + return true; + }); + + if (!found) { + r.Resize(0); + } + + return {found, std::move(r)}; +} + +idx_t BufferPool::PurgeAgedBlocks(uint32_t max_age_sec) { + int64_t now = std::chrono::time_point_cast(std::chrono::steady_clock::now()) + .time_since_epoch() + .count(); + int64_t limit = now - (static_cast(max_age_sec) * 1000); + idx_t purged_bytes = 0; + IterateUnloadableBlocks([&](BufferEvictionNode &node, const shared_ptr &handle) { + // We will unload this block regardless. But stop the iteration immediately afterward if this + // block is younger than the age threshold. + bool is_fresh = handle->lru_timestamp_msec >= limit && handle->lru_timestamp_msec <= now; + purged_bytes += handle->GetMemoryUsage(); + handle->Unload(); + return is_fresh; + }); + return purged_bytes; +} + +template +void BufferPool::IterateUnloadableBlocks(FN fn) { + for (;;) { // get a block to unpin from the queue + BufferEvictionNode node; if (!queue->q.try_dequeue(node)) { // we could not dequeue any eviction node, so we try one more time, // but more aggressively if (!TryDequeueWithLock(node)) { - // still no success, we return - r.Resize(0); - return {false, std::move(r)}; + return; } } @@ -119,17 +187,10 @@ BufferPool::EvictionResult BufferPool::EvictBlocks(MemoryTag tag, idx_t extra_me continue; } - // hooray, we can unload the block - if (buffer && handle->buffer->AllocSize() == extra_memory) { - // we can re-use the memory directly - *buffer = handle->UnloadAndTakeBlock(); - return {true, std::move(r)}; + if (!fn(node, handle)) { + break; } - - // release the memory and mark the block as unloaded - handle->Unload(); } - return {true, std::move(r)}; } bool BufferPool::TryDequeueWithLock(BufferEvictionNode &node) { diff --git a/src/duckdb/src/storage/buffer/buffer_pool_reservation.cpp b/src/duckdb/src/storage/buffer/buffer_pool_reservation.cpp index f22a96ff..783a9807 100644 --- a/src/duckdb/src/storage/buffer/buffer_pool_reservation.cpp +++ b/src/duckdb/src/storage/buffer/buffer_pool_reservation.cpp @@ -23,8 +23,8 @@ BufferPoolReservation::~BufferPoolReservation() { } void BufferPoolReservation::Resize(idx_t new_size) { - int64_t delta = (int64_t)new_size - size; - pool.IncreaseUsedMemory(tag, delta); + auto delta = UnsafeNumericCast(new_size) - UnsafeNumericCast(size); + pool.UpdateUsedMemory(tag, delta); size = new_size; } diff --git a/src/duckdb/src/storage/buffer_manager.cpp b/src/duckdb/src/storage/buffer_manager.cpp index cf49535d..f234a391 100644 --- a/src/duckdb/src/storage/buffer_manager.cpp +++ b/src/duckdb/src/storage/buffer_manager.cpp @@ -23,8 +23,12 @@ void BufferManager::FreeReservedMemory(idx_t size) { throw NotImplementedException("This type of BufferManager can not free reserved memory"); } -void BufferManager::SetLimit(idx_t limit) { - throw NotImplementedException("This type of BufferManager can not set a limit"); +void BufferManager::SetMemoryLimit(idx_t limit) { + throw NotImplementedException("This type of BufferManager can not set a memory limit"); +} + +void BufferManager::SetSwapLimit(optional_idx limit) { + throw NotImplementedException("This type of BufferManager can not set a swap limit"); } vector BufferManager::GetTemporaryFiles() { diff --git a/src/duckdb/src/storage/checkpoint/row_group_writer.cpp b/src/duckdb/src/storage/checkpoint/row_group_writer.cpp index 3845782c..90f7ba42 100644 --- a/src/duckdb/src/storage/checkpoint/row_group_writer.cpp +++ b/src/duckdb/src/storage/checkpoint/row_group_writer.cpp @@ -9,12 +9,21 @@ CompressionType RowGroupWriter::GetColumnCompressionType(idx_t i) { return table.GetColumn(LogicalIndex(i)).CompressionType(); } +SingleFileRowGroupWriter::SingleFileRowGroupWriter(TableCatalogEntry &table, PartialBlockManager &partial_block_manager, + TableDataWriter &writer, MetadataWriter &table_data_writer) + : RowGroupWriter(table, partial_block_manager), writer(writer), table_data_writer(table_data_writer) { +} + void SingleFileRowGroupWriter::WriteColumnDataPointers(ColumnCheckpointState &column_checkpoint_state, Serializer &serializer) { const auto &data_pointers = column_checkpoint_state.data_pointers; serializer.WriteProperty(100, "data_pointers", data_pointers); } +CheckpointType SingleFileRowGroupWriter::GetCheckpointType() const { + return writer.GetCheckpointType(); +} + MetadataWriter &SingleFileRowGroupWriter::GetPayloadWriter() { return table_data_writer; } diff --git a/src/duckdb/src/storage/checkpoint/table_data_writer.cpp b/src/duckdb/src/storage/checkpoint/table_data_writer.cpp index b90cae89..dad7e96a 100644 --- a/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +++ b/src/duckdb/src/storage/checkpoint/table_data_writer.cpp @@ -39,7 +39,12 @@ SingleFileTableDataWriter::SingleFileTableDataWriter(SingleFileCheckpointWriter } unique_ptr SingleFileTableDataWriter::GetRowGroupWriter(RowGroup &row_group) { - return make_uniq(table, checkpoint_manager.partial_block_manager, table_data_writer); + return make_uniq(table, checkpoint_manager.partial_block_manager, *this, + table_data_writer); +} + +CheckpointType SingleFileTableDataWriter::GetCheckpointType() const { + return checkpoint_manager.GetCheckpointType(); } void SingleFileTableDataWriter::FinalizeTable(const TableStatistics &global_stats, DataTableInfo *info, @@ -75,7 +80,7 @@ void SingleFileTableDataWriter::FinalizeTable(const TableStatistics &global_stat serializer.WriteProperty(101, "table_pointer", pointer); serializer.WriteProperty(102, "total_rows", total_rows); - auto index_storage_infos = info->indexes.GetStorageInfos(); + auto index_storage_infos = info->GetIndexes().GetStorageInfos(); // write empty block pointers for forwards compatibility vector compat_block_pointers; serializer.WriteProperty(103, "index_pointers", compat_block_pointers); diff --git a/src/duckdb/src/storage/checkpoint_manager.cpp b/src/duckdb/src/storage/checkpoint_manager.cpp index 574fc066..c31e86f9 100644 --- a/src/duckdb/src/storage/checkpoint_manager.cpp +++ b/src/duckdb/src/storage/checkpoint_manager.cpp @@ -2,15 +2,17 @@ #include "duckdb/catalog/catalog_entry/duck_index_entry.hpp" #include "duckdb/catalog/catalog_entry/duck_table_entry.hpp" +#include "duckdb/catalog/catalog_entry/index_catalog_entry.hpp" #include "duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp" #include "duckdb/catalog/catalog_entry/schema_catalog_entry.hpp" #include "duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp" #include "duckdb/catalog/catalog_entry/type_catalog_entry.hpp" #include "duckdb/catalog/catalog_entry/view_catalog_entry.hpp" -#include "duckdb/catalog/catalog_entry/index_catalog_entry.hpp" #include "duckdb/catalog/duck_catalog.hpp" #include "duckdb/common/serializer/binary_deserializer.hpp" #include "duckdb/common/serializer/binary_serializer.hpp" +#include "duckdb/execution/index/art/art.hpp" +#include "duckdb/execution/index/unbound_index.hpp" #include "duckdb/main/attached_database.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/main/config.hpp" @@ -20,7 +22,6 @@ #include "duckdb/parser/parsed_data/create_view_info.hpp" #include "duckdb/planner/binder.hpp" #include "duckdb/planner/bound_tableref.hpp" -#include "duckdb/planner/expression_binder/index_binder.hpp" #include "duckdb/planner/parsed_data/bound_create_table_info.hpp" #include "duckdb/storage/block_manager.hpp" #include "duckdb/storage/checkpoint/table_data_reader.hpp" @@ -28,15 +29,16 @@ #include "duckdb/storage/metadata/metadata_reader.hpp" #include "duckdb/storage/table/column_checkpoint_state.hpp" #include "duckdb/transaction/transaction_manager.hpp" -#include "duckdb/execution/index/art/art.hpp" -#include "duckdb/execution/index/unknown_index.hpp" +#include "duckdb/transaction/meta_transaction.hpp" namespace duckdb { void ReorderTableEntries(catalog_entry_vector_t &tables); -SingleFileCheckpointWriter::SingleFileCheckpointWriter(AttachedDatabase &db, BlockManager &block_manager) - : CheckpointWriter(db), partial_block_manager(block_manager, CheckpointType::FULL_CHECKPOINT) { +SingleFileCheckpointWriter::SingleFileCheckpointWriter(AttachedDatabase &db, BlockManager &block_manager, + CheckpointType checkpoint_type) + : CheckpointWriter(db), partial_block_manager(block_manager, PartialBlockType::FULL_CHECKPOINT), + checkpoint_type(checkpoint_type) { } BlockManager &SingleFileCheckpointWriter::GetBlockManager() { @@ -168,7 +170,11 @@ void SingleFileCheckpointWriter::CreateCheckpoint() { } */ auto catalog_entries = GetCatalogEntries(schemas); - BinarySerializer serializer(*metadata_writer); + SerializationOptions serialization_options; + + serialization_options.serialization_compatibility = config.options.serialization_compatibility; + + BinarySerializer serializer(*metadata_writer, serialization_options); serializer.Begin(); serializer.WriteList(100, "catalog_entries", catalog_entries.size(), [&](Serializer::List &list, idx_t i) { auto &entry = catalog_entries[i]; @@ -176,7 +182,6 @@ void SingleFileCheckpointWriter::CreateCheckpoint() { }); serializer.End(); - partial_block_manager.FlushPartialBlocks(); metadata_writer->Flush(); table_metadata_writer->Flush(); @@ -185,9 +190,9 @@ void SingleFileCheckpointWriter::CreateCheckpoint() { // WAL we write an entry CHECKPOINT "meta_block_id" into the WAL upon loading, if we see there is an entry // CHECKPOINT "meta_block_id", and the id MATCHES the head idin the file we know that the database was successfully // checkpointed, so we know that we should avoid replaying the WAL to avoid duplicating data - auto wal = storage_manager.GetWriteAheadLog(); - bool wal_is_empty = wal->GetWALSize() == 0; + bool wal_is_empty = storage_manager.GetWALSize() == 0; if (!wal_is_empty) { + auto wal = storage_manager.GetWAL(); wal->WriteCheckpoint(meta_block); wal->Flush(); } @@ -212,15 +217,15 @@ void SingleFileCheckpointWriter::CreateCheckpoint() { // truncate the WAL if (!wal_is_empty) { - wal->Truncate(0); + storage_manager.ResetWAL(); } } -void CheckpointReader::LoadCheckpoint(ClientContext &context, MetadataReader &reader) { +void CheckpointReader::LoadCheckpoint(CatalogTransaction transaction, MetadataReader &reader) { BinaryDeserializer deserializer(reader); deserializer.Begin(); deserializer.ReadList(100, "catalog_entries", [&](Deserializer::List &list, idx_t i) { - return list.ReadObject([&](Deserializer &obj) { ReadEntry(context, obj); }); + return list.ReadObject([&](Deserializer &obj) { ReadEntry(transaction, obj); }); }); deserializer.End(); } @@ -229,7 +234,7 @@ MetadataManager &SingleFileCheckpointReader::GetMetadataManager() { return storage.block_manager->GetMetadataManager(); } -void SingleFileCheckpointReader::LoadFromStorage(optional_ptr context) { +void SingleFileCheckpointReader::LoadFromStorage() { auto &block_manager = *storage.block_manager; auto &metadata_manager = GetMetadataManager(); MetaBlockPointer meta_block(block_manager.GetMetaBlock(), 0); @@ -238,20 +243,10 @@ void SingleFileCheckpointReader::LoadFromStorage(optional_ptr con return; } - if (context) { - // create the MetadataReader to read from the storage - MetadataReader reader(metadata_manager, meta_block); - // reader.SetContext(*con.context); - LoadCheckpoint(*context, reader); - } else { - Connection con(storage.GetDatabase()); - con.BeginTransaction(); - // create the MetadataReader to read from the storage - MetadataReader reader(metadata_manager, meta_block); - // reader.SetContext(*con.context); - LoadCheckpoint(*con.context, reader); - con.Commit(); - } + // create the MetadataReader to read from the storage + MetadataReader reader(metadata_manager, meta_block); + auto transaction = CatalogTransaction::GetSystemTransaction(catalog.GetDatabase()); + LoadCheckpoint(transaction, reader); } void CheckpointWriter::WriteEntry(CatalogEntry &entry, Serializer &serializer) { @@ -311,40 +306,40 @@ void CheckpointWriter::WriteSchema(SchemaCatalogEntry &schema, Serializer &seria serializer.WriteProperty(100, "schema", &schema); } -void CheckpointReader::ReadEntry(ClientContext &context, Deserializer &deserializer) { +void CheckpointReader::ReadEntry(CatalogTransaction transaction, Deserializer &deserializer) { auto type = deserializer.ReadProperty(99, "type"); switch (type) { case CatalogType::SCHEMA_ENTRY: { - ReadSchema(context, deserializer); + ReadSchema(transaction, deserializer); break; } case CatalogType::TYPE_ENTRY: { - ReadType(context, deserializer); + ReadType(transaction, deserializer); break; } case CatalogType::SEQUENCE_ENTRY: { - ReadSequence(context, deserializer); + ReadSequence(transaction, deserializer); break; } case CatalogType::TABLE_ENTRY: { - ReadTable(context, deserializer); + ReadTable(transaction, deserializer); break; } case CatalogType::VIEW_ENTRY: { - ReadView(context, deserializer); + ReadView(transaction, deserializer); break; } case CatalogType::MACRO_ENTRY: { - ReadMacro(context, deserializer); + ReadMacro(transaction, deserializer); break; } case CatalogType::TABLE_MACRO_ENTRY: { - ReadTableMacro(context, deserializer); + ReadTableMacro(transaction, deserializer); break; } case CatalogType::INDEX_ENTRY: { - ReadIndex(context, deserializer); + ReadIndex(transaction, deserializer); break; } default: @@ -352,14 +347,14 @@ void CheckpointReader::ReadEntry(ClientContext &context, Deserializer &deseriali } } -void CheckpointReader::ReadSchema(ClientContext &context, Deserializer &deserializer) { +void CheckpointReader::ReadSchema(CatalogTransaction transaction, Deserializer &deserializer) { // Read the schema and create it in the catalog auto info = deserializer.ReadProperty>(100, "schema"); auto &schema_info = info->Cast(); // we set create conflict to IGNORE_ON_CONFLICT, so that we can ignore a failure when recreating the main schema schema_info.on_conflict = OnCreateConflict::IGNORE_ON_CONFLICT; - catalog.CreateSchema(context, schema_info); + catalog.CreateSchema(transaction, schema_info); } //===--------------------------------------------------------------------===// @@ -369,10 +364,10 @@ void CheckpointWriter::WriteView(ViewCatalogEntry &view, Serializer &serializer) serializer.WriteProperty(100, "view", &view); } -void CheckpointReader::ReadView(ClientContext &context, Deserializer &deserializer) { +void CheckpointReader::ReadView(CatalogTransaction transaction, Deserializer &deserializer) { auto info = deserializer.ReadProperty>(100, "view"); auto &view_info = info->Cast(); - catalog.CreateView(context, view_info); + catalog.CreateView(transaction, view_info); } //===--------------------------------------------------------------------===// @@ -382,10 +377,10 @@ void CheckpointWriter::WriteSequence(SequenceCatalogEntry &seq, Serializer &seri serializer.WriteProperty(100, "sequence", &seq); } -void CheckpointReader::ReadSequence(ClientContext &context, Deserializer &deserializer) { +void CheckpointReader::ReadSequence(CatalogTransaction transaction, Deserializer &deserializer) { auto info = deserializer.ReadProperty>(100, "sequence"); auto &sequence_info = info->Cast(); - catalog.CreateSequence(context, sequence_info); + catalog.CreateSequence(transaction, sequence_info); } //===--------------------------------------------------------------------===// @@ -399,7 +394,7 @@ void CheckpointWriter::WriteIndex(IndexCatalogEntry &index_catalog_entry, Serial serializer.WriteProperty(100, "index", &index_catalog_entry); } -void CheckpointReader::ReadIndex(ClientContext &context, Deserializer &deserializer) { +void CheckpointReader::ReadIndex(CatalogTransaction transaction, Deserializer &deserializer) { // we need to keep the tag "index", even though it is slightly misleading. auto create_info = deserializer.ReadProperty>(100, "index"); @@ -413,8 +408,8 @@ void CheckpointReader::ReadIndex(ClientContext &context, Deserializer &deseriali // create the index in the catalog // look for the table in the catalog - auto &table = - catalog.GetEntry(context, CatalogType::TABLE_ENTRY, create_info->schema, info.table).Cast(); + auto &schema = catalog.GetSchema(transaction, create_info->schema); + auto &table = schema.GetEntry(transaction, CatalogType::TABLE_ENTRY, info.table)->Cast(); // we also need to make sure the index type is loaded // backwards compatability: @@ -424,43 +419,17 @@ void CheckpointReader::ReadIndex(ClientContext &context, Deserializer &deseriali } // now we can look for the index in the catalog and assign the table info - auto &index = catalog.CreateIndex(context, info)->Cast(); - index.info = make_shared(table.GetStorage().info, info.index_name); + auto &index = catalog.CreateIndex(transaction, info)->Cast(); + auto data_table_info = table.GetStorage().GetDataTableInfo(); + index.info = make_shared_ptr(data_table_info, info.index_name); // insert the parsed expressions into the index so that we can (de)serialize them during consecutive checkpoints for (auto &parsed_expr : info.parsed_expressions) { index.parsed_expressions.push_back(parsed_expr->Copy()); } - - // obtain the parsed expressions of the ART from the index metadata - vector> parsed_expressions; - for (auto &parsed_expr : info.parsed_expressions) { - parsed_expressions.push_back(parsed_expr->Copy()); - } - D_ASSERT(!parsed_expressions.empty()); - - // add the table to the bind context to bind the parsed expressions - auto binder = Binder::CreateBinder(context); - vector column_types; - vector column_names; - for (auto &col : table.GetColumns().Logical()) { - column_types.push_back(col.Type()); - column_names.push_back(col.Name()); - } - - // create a binder to bind the parsed expressions - vector column_ids; - binder->bind_context.AddBaseTable(0, info.table, column_names, column_types, column_ids, &table); - IndexBinder idx_binder(*binder, context); - - // bind the parsed expressions to create unbound expressions - vector> unbound_expressions; - unbound_expressions.reserve(parsed_expressions.size()); - for (auto &expr : parsed_expressions) { - unbound_expressions.push_back(idx_binder.Bind(expr)); - } - + D_ASSERT(!info.parsed_expressions.empty()); auto &data_table = table.GetStorage(); + IndexStorageInfo index_storage_info; if (root_block_pointer.IsValid()) { // this code path is necessary to read older duckdb files @@ -469,7 +438,7 @@ void CheckpointReader::ReadIndex(ClientContext &context, Deserializer &deseriali } else { // get the matching index storage info - for (auto const &elem : data_table.info->index_storage_infos) { + for (auto const &elem : data_table.GetDataTableInfo()->GetIndexStorageInfo()) { if (elem.name == info.index_name) { index_storage_info = elem; break; @@ -479,19 +448,11 @@ void CheckpointReader::ReadIndex(ClientContext &context, Deserializer &deseriali D_ASSERT(index_storage_info.IsValid() && !index_storage_info.name.empty()); - // This is executed before any extensions can be loaded, which is why we must treat any index type that is not - // built-in (ART) as unknown - if (info.index_type == ART::TYPE_NAME) { - data_table.info->indexes.AddIndex(make_uniq(info.index_name, info.constraint_type, info.column_ids, - TableIOManager::Get(data_table), unbound_expressions, - data_table.db, nullptr, index_storage_info)); - } else { - auto unknown_index = make_uniq(info.index_name, info.index_type, info.constraint_type, - info.column_ids, TableIOManager::Get(data_table), - unbound_expressions, data_table.db, info, index_storage_info); + // Create an unbound index and add it to the table + auto unbound_index = make_uniq(std::move(create_info), index_storage_info, + TableIOManager::Get(data_table), data_table.db); - data_table.info->indexes.AddIndex(std::move(unknown_index)); - } + data_table.GetDataTableInfo()->GetIndexes().AddIndex(std::move(unbound_index)); } //===--------------------------------------------------------------------===// @@ -501,10 +462,10 @@ void CheckpointWriter::WriteType(TypeCatalogEntry &type, Serializer &serializer) serializer.WriteProperty(100, "type", &type); } -void CheckpointReader::ReadType(ClientContext &context, Deserializer &deserializer) { +void CheckpointReader::ReadType(CatalogTransaction transaction, Deserializer &deserializer) { auto info = deserializer.ReadProperty>(100, "type"); auto &type_info = info->Cast(); - catalog.CreateType(context, type_info); + catalog.CreateType(transaction, type_info); } //===--------------------------------------------------------------------===// @@ -514,50 +475,53 @@ void CheckpointWriter::WriteMacro(ScalarMacroCatalogEntry ¯o, Serializer &se serializer.WriteProperty(100, "macro", ¯o); } -void CheckpointReader::ReadMacro(ClientContext &context, Deserializer &deserializer) { +void CheckpointReader::ReadMacro(CatalogTransaction transaction, Deserializer &deserializer) { auto info = deserializer.ReadProperty>(100, "macro"); auto ¯o_info = info->Cast(); - catalog.CreateFunction(context, macro_info); + catalog.CreateFunction(transaction, macro_info); } void CheckpointWriter::WriteTableMacro(TableMacroCatalogEntry ¯o, Serializer &serializer) { serializer.WriteProperty(100, "table_macro", ¯o); } -void CheckpointReader::ReadTableMacro(ClientContext &context, Deserializer &deserializer) { +void CheckpointReader::ReadTableMacro(CatalogTransaction transaction, Deserializer &deserializer) { auto info = deserializer.ReadProperty>(100, "table_macro"); auto ¯o_info = info->Cast(); - catalog.CreateFunction(context, macro_info); + catalog.CreateFunction(transaction, macro_info); } //===--------------------------------------------------------------------===// // Table Metadata //===--------------------------------------------------------------------===// -void CheckpointWriter::WriteTable(TableCatalogEntry &table, Serializer &serializer) { +void SingleFileCheckpointWriter::WriteTable(TableCatalogEntry &table, Serializer &serializer) { // Write the table metadata serializer.WriteProperty(100, "table", &table); // Write the table data + auto table_lock = table.GetStorage().GetCheckpointLock(); if (auto writer = GetTableDataWriter(table)) { writer->WriteTableData(serializer); } + // flush any partial blocks BEFORE releasing the table lock + // flushing partial blocks updates where data lives and is not thread-safe + partial_block_manager.FlushPartialBlocks(); } -void CheckpointReader::ReadTable(ClientContext &context, Deserializer &deserializer) { +void CheckpointReader::ReadTable(CatalogTransaction transaction, Deserializer &deserializer) { // deserialize the table meta data auto info = deserializer.ReadProperty>(100, "table"); - auto binder = Binder::CreateBinder(context); - auto &schema = catalog.GetSchema(context, info->schema); - auto bound_info = binder->BindCreateTableInfo(std::move(info), schema); + auto &schema = catalog.GetSchema(transaction, info->schema); + auto bound_info = Binder::BindCreateTableCheckpoint(std::move(info), schema); // now read the actual table data and place it into the CreateTableInfo - ReadTableData(context, deserializer, *bound_info); + ReadTableData(transaction, deserializer, *bound_info); // finally create the table in the catalog - catalog.CreateTable(context, *bound_info); + catalog.CreateTable(transaction, *bound_info); } -void CheckpointReader::ReadTableData(ClientContext &context, Deserializer &deserializer, +void CheckpointReader::ReadTableData(CatalogTransaction transaction, Deserializer &deserializer, BoundCreateTableInfo &bound_info) { // written in "SingleFileTableDataWriter::FinalizeTable" diff --git a/src/duckdb/src/storage/compression/bitpacking.cpp b/src/duckdb/src/storage/compression/bitpacking.cpp index 5a82482e..4dc33f8c 100644 --- a/src/duckdb/src/storage/compression/bitpacking.cpp +++ b/src/duckdb/src/storage/compression/bitpacking.cpp @@ -5,6 +5,7 @@ #include "duckdb/common/operator/add.hpp" #include "duckdb/common/operator/multiply.hpp" #include "duckdb/common/operator/subtract.hpp" +#include "duckdb/common/operator/cast_operators.hpp" #include "duckdb/function/compression/compression.hpp" #include "duckdb/function/compression_function.hpp" #include "duckdb/main/config.hpp" @@ -64,7 +65,7 @@ typedef uint32_t bitpacking_metadata_encoded_t; static bitpacking_metadata_encoded_t EncodeMeta(bitpacking_metadata_t metadata) { D_ASSERT(metadata.offset <= 0x00FFFFFF); // max uint24_t bitpacking_metadata_encoded_t encoded_value = metadata.offset; - encoded_value |= (uint8_t)metadata.mode << 24; + encoded_value |= UnsafeNumericCast((uint8_t)metadata.mode << 24); return encoded_value; } static bitpacking_metadata_t DecodeMeta(bitpacking_metadata_encoded_t *metadata_encoded) { @@ -471,8 +472,8 @@ struct BitpackingCompressState : public CompressionState { }; bool CanStore(idx_t data_bytes, idx_t meta_bytes) { - auto required_data_bytes = AlignValue((data_ptr + data_bytes) - data_ptr); - auto required_meta_bytes = Storage::BLOCK_SIZE - (metadata_ptr - data_ptr) + meta_bytes; + auto required_data_bytes = AlignValue(UnsafeNumericCast((data_ptr + data_bytes) - data_ptr)); + auto required_meta_bytes = Storage::BLOCK_SIZE - UnsafeNumericCast(metadata_ptr - data_ptr) + meta_bytes; return required_data_bytes + required_meta_bytes <= Storage::BLOCK_SIZE - BitpackingPrimitives::BITPACKING_HEADER_SIZE; @@ -514,9 +515,10 @@ struct BitpackingCompressState : public CompressionState { auto base_ptr = handle.Ptr(); // Compact the segment by moving the metadata next to the data. - idx_t unaligned_offset = data_ptr - base_ptr; + + idx_t unaligned_offset = NumericCast(data_ptr - base_ptr); idx_t metadata_offset = AlignValue(unaligned_offset); - idx_t metadata_size = base_ptr + Storage::BLOCK_SIZE - metadata_ptr; + idx_t metadata_size = NumericCast(base_ptr + Storage::BLOCK_SIZE - metadata_ptr); idx_t total_segment_size = metadata_offset + metadata_size; // Asserting things are still sane here @@ -770,7 +772,7 @@ unique_ptr BitpackingInitScan(ColumnSegment &segment) { //===--------------------------------------------------------------------===// // Scan base data //===--------------------------------------------------------------------===// -template ::type> +template ::type, class T_U = typename MakeUnsigned::type> void BitpackingScanPartial(ColumnSegment &segment, ColumnScanState &state, idx_t scan_count, Vector &result, idx_t result_offset) { auto &scan_state = state.scan_state->Cast>(); @@ -809,8 +811,10 @@ void BitpackingScanPartial(ColumnSegment &segment, ColumnScanState &state, idx_t T *target_ptr = result_data + result_offset + scanned; for (idx_t i = 0; i < to_scan; i++) { - target_ptr[i] = (static_cast(scan_state.current_group_offset + i) * scan_state.current_constant) + - scan_state.current_frame_of_reference; + idx_t multiplier = scan_state.current_group_offset + i; + // intended static casts to unsigned and back for defined wrapping of integers + target_ptr[i] = static_cast((static_cast(scan_state.current_constant) * multiplier) + + static_cast(scan_state.current_frame_of_reference)); } scanned += to_scan; @@ -871,7 +875,7 @@ template void BitpackingFetchRow(ColumnSegment &segment, ColumnFetchState &state, row_t row_id, Vector &result, idx_t result_idx) { BitpackingScanState scan_state(segment); - scan_state.Skip(segment, row_id); + scan_state.Skip(segment, NumericCast(row_id)); D_ASSERT(scan_state.current_group_offset < BITPACKING_METADATA_GROUP_SIZE); @@ -895,16 +899,18 @@ void BitpackingFetchRow(ColumnSegment &segment, ColumnFetchState &state, row_t r } if (scan_state.current_group.mode == BitpackingMode::CONSTANT_DELTA) { + T multiplier; + auto cast = TryCast::Operation(scan_state.current_group_offset, multiplier); + (void)cast; + D_ASSERT(cast); #ifdef DEBUG // overflow check T result; - bool multiply = TryMultiplyOperator::Operation(static_cast(scan_state.current_group_offset), - scan_state.current_constant, result); + bool multiply = TryMultiplyOperator::Operation(multiplier, scan_state.current_constant, result); bool add = TryAddOperator::Operation(result, scan_state.current_frame_of_reference, result); D_ASSERT(multiply && add); #endif - *current_result_ptr = (static_cast(scan_state.current_group_offset) * scan_state.current_constant) + - scan_state.current_frame_of_reference; + *current_result_ptr = (multiplier * scan_state.current_constant) + scan_state.current_frame_of_reference; return; } diff --git a/src/duckdb/src/storage/compression/dictionary_compression.cpp b/src/duckdb/src/storage/compression/dictionary_compression.cpp index 4f2bce49..58529e72 100644 --- a/src/duckdb/src/storage/compression/dictionary_compression.cpp +++ b/src/duckdb/src/storage/compression/dictionary_compression.cpp @@ -86,7 +86,7 @@ typedef struct { } dictionary_compression_header_t; struct DictionaryCompressionStorage { - static constexpr float MINIMUM_COMPRESSION_RATIO = 1.2; + static constexpr float MINIMUM_COMPRESSION_RATIO = 1.2F; static constexpr uint16_t DICTIONARY_HEADER_SIZE = sizeof(dictionary_compression_header_t); static constexpr size_t COMPACTION_FLUSH_LIMIT = (size_t)Storage::BLOCK_SIZE / 5 * 4; @@ -402,7 +402,7 @@ idx_t DictionaryCompressionStorage::StringFinalAnalyze(AnalyzeState &state_p) { auto req_space = RequiredSpace(state.current_tuple_count, state.current_unique_count, state.current_dict_size, width); - return MINIMUM_COMPRESSION_RATIO * (state.segment_count * Storage::BLOCK_SIZE + req_space); + return NumericCast(MINIMUM_COMPRESSION_RATIO * (state.segment_count * Storage::BLOCK_SIZE + req_space)); } //===--------------------------------------------------------------------===// @@ -456,7 +456,8 @@ unique_ptr DictionaryCompressionStorage::StringInitScan(Column for (uint32_t i = 0; i < index_buffer_count; i++) { // NOTE: the passing of dict_child_vector, will not be used, its for big strings uint16_t str_len = GetStringLength(index_buffer_ptr, i); - dict_child_data[i] = FetchStringFromDict(segment, dict, baseptr, index_buffer_ptr[i], str_len); + dict_child_data[i] = + FetchStringFromDict(segment, dict, baseptr, UnsafeNumericCast(index_buffer_ptr[i]), str_len); } return std::move(state); @@ -509,7 +510,8 @@ void DictionaryCompressionStorage::StringScanPartial(ColumnSegment &segment, Col auto string_number = scan_state.sel_vec->get_index(i + start_offset); auto dict_offset = index_buffer_ptr[string_number]; auto str_len = GetStringLength(index_buffer_ptr, UnsafeNumericCast(string_number)); - result_data[result_offset + i] = FetchStringFromDict(segment, dict, baseptr, dict_offset, str_len); + result_data[result_offset + i] = + FetchStringFromDict(segment, dict, baseptr, UnsafeNumericCast(dict_offset), str_len); } } else { @@ -559,11 +561,11 @@ void DictionaryCompressionStorage::StringFetchRow(ColumnSegment &segment, Column auto result_data = FlatVector::GetData(result); // Handling non-bitpacking-group-aligned start values; - idx_t start_offset = row_id % BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE; + idx_t start_offset = NumericCast(row_id) % BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE; // Decompress part of selection buffer we need for this value. sel_t decompression_buffer[BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE]; - data_ptr_t src = data_ptr_cast(&base_data[((row_id - start_offset) * width) / 8]); + data_ptr_t src = data_ptr_cast(&base_data[((NumericCast(row_id) - start_offset) * width) / 8]); BitpackingPrimitives::UnPackBuffer(data_ptr_cast(decompression_buffer), src, BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE, width); @@ -571,7 +573,7 @@ void DictionaryCompressionStorage::StringFetchRow(ColumnSegment &segment, Column auto dict_offset = index_buffer_ptr[selection_value]; uint16_t str_len = GetStringLength(index_buffer_ptr, selection_value); - result_data[result_idx] = FetchStringFromDict(segment, dict, baseptr, dict_offset, str_len); + result_data[result_idx] = FetchStringFromDict(segment, dict, baseptr, NumericCast(dict_offset), str_len); } //===--------------------------------------------------------------------===// diff --git a/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp b/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp index c1b210d7..bbccd3f0 100644 --- a/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +++ b/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp @@ -172,7 +172,7 @@ void FixedSizeFetchRow(ColumnSegment &segment, ColumnFetchState &state, row_t ro auto handle = buffer_manager.Pin(segment.block); // first fetch the data from the base table - auto data_ptr = handle.Ptr() + segment.GetBlockOffset() + row_id * sizeof(T); + auto data_ptr = handle.Ptr() + segment.GetBlockOffset() + NumericCast(row_id) * sizeof(T); memcpy(FlatVector::GetData(result) + result_idx * sizeof(T), data_ptr, sizeof(T)); } diff --git a/src/duckdb/src/storage/compression/fsst.cpp b/src/duckdb/src/storage/compression/fsst.cpp index 6c956236..fcccab4a 100644 --- a/src/duckdb/src/storage/compression/fsst.cpp +++ b/src/duckdb/src/storage/compression/fsst.cpp @@ -178,7 +178,8 @@ idx_t FSSTStorage::StringFinalAnalyze(AnalyzeState &state_p) { compressed_dict_size += size; max_compressed_string_length = MaxValue(max_compressed_string_length, size); } - D_ASSERT(compressed_dict_size == (compressed_ptrs[res - 1] - compressed_ptrs[0]) + compressed_sizes[res - 1]); + D_ASSERT(compressed_dict_size == + (uint64_t)(compressed_ptrs[res - 1] - compressed_ptrs[0]) + compressed_sizes[res - 1]); auto minimum_width = BitpackingPrimitives::MinimumBitWidth(max_compressed_string_length); auto bitpacked_offsets_size = @@ -190,7 +191,7 @@ idx_t FSSTStorage::StringFinalAnalyze(AnalyzeState &state_p) { auto estimated_size = estimated_base_size + symtable_size; - return estimated_size * MINIMUM_COMPRESSION_RATIO; + return NumericCast(estimated_size * MINIMUM_COMPRESSION_RATIO); } //===--------------------------------------------------------------------===// @@ -606,7 +607,8 @@ void FSSTStorage::StringScanPartial(ColumnSegment &segment, ColumnScanState &sta for (idx_t i = 0; i < scan_count; i++) { uint32_t string_length = bitunpack_buffer[i + offsets.scan_offset]; result_data[i] = UncompressedStringStorage::FetchStringFromDict( - segment, dict, result, baseptr, delta_decode_buffer[i + offsets.unused_delta_decoded_values], + segment, dict, result, baseptr, + UnsafeNumericCast(delta_decode_buffer[i + offsets.unused_delta_decoded_values]), string_length); FSSTVector::SetCount(result, scan_count); } @@ -615,7 +617,8 @@ void FSSTStorage::StringScanPartial(ColumnSegment &segment, ColumnScanState &sta for (idx_t i = 0; i < scan_count; i++) { uint32_t str_len = bitunpack_buffer[i + offsets.scan_offset]; auto str_ptr = FSSTStorage::FetchStringPointer( - dict, baseptr, delta_decode_buffer[i + offsets.unused_delta_decoded_values]); + dict, baseptr, + UnsafeNumericCast(delta_decode_buffer[i + offsets.unused_delta_decoded_values])); if (str_len > 0) { result_data[i + result_offset] = @@ -627,7 +630,7 @@ void FSSTStorage::StringScanPartial(ColumnSegment &segment, ColumnScanState &sta } scan_state.StoreLastDelta(delta_decode_buffer[scan_count + offsets.unused_delta_decoded_values - 1], - start + scan_count - 1); + UnsafeNumericCast(start + scan_count - 1)); } void FSSTStorage::StringScan(ColumnSegment &segment, ColumnScanState &state, idx_t scan_count, Vector &result) { @@ -655,7 +658,7 @@ void FSSTStorage::StringFetchRow(ColumnSegment &segment, ColumnFetchState &state if (have_symbol_table) { // We basically just do a scan of 1 which is kinda expensive as we need to repeatedly delta decode until we // reach the row we want, we could consider a more clever caching trick if this is slow - auto offsets = CalculateBpDeltaOffsets(-1, row_id, 1); + auto offsets = CalculateBpDeltaOffsets(-1, UnsafeNumericCast(row_id), 1); auto bitunpack_buffer = unique_ptr(new uint32_t[offsets.total_bitunpack_count]); BitUnpackRange(base_data, data_ptr_cast(bitunpack_buffer.get()), offsets.total_bitunpack_count, @@ -667,7 +670,8 @@ void FSSTStorage::StringFetchRow(ColumnSegment &segment, ColumnFetchState &state uint32_t string_length = bitunpack_buffer[offsets.scan_offset]; string_t compressed_string = UncompressedStringStorage::FetchStringFromDict( - segment, dict, result, base_ptr, delta_decode_buffer[offsets.unused_delta_decoded_values], string_length); + segment, dict, result, base_ptr, + UnsafeNumericCast(delta_decode_buffer[offsets.unused_delta_decoded_values]), string_length); result_data[result_idx] = FSSTPrimitives::DecompressValue((void *)&decoder, result, compressed_string.GetData(), compressed_string.GetSize()); diff --git a/src/duckdb/src/storage/compression/rle.cpp b/src/duckdb/src/storage/compression/rle.cpp index edc111dd..e518b146 100644 --- a/src/duckdb/src/storage/compression/rle.cpp +++ b/src/duckdb/src/storage/compression/rle.cpp @@ -378,7 +378,7 @@ void RLEScan(ColumnSegment &segment, ColumnScanState &state, idx_t scan_count, V template void RLEFetchRow(ColumnSegment &segment, ColumnFetchState &state, row_t row_id, Vector &result, idx_t result_idx) { RLEScanState scan_state(segment); - scan_state.Skip(segment, row_id); + scan_state.Skip(segment, NumericCast(row_id)); auto data = scan_state.handle.Ptr() + segment.GetBlockOffset(); auto data_pointer = reinterpret_cast(data + RLEConstants::RLE_HEADER_SIZE); diff --git a/src/duckdb/src/storage/compression/string_uncompressed.cpp b/src/duckdb/src/storage/compression/string_uncompressed.cpp index bfdebbe3..dea2ef6f 100644 --- a/src/duckdb/src/storage/compression/string_uncompressed.cpp +++ b/src/duckdb/src/storage/compression/string_uncompressed.cpp @@ -87,7 +87,7 @@ void UncompressedStringStorage::StringScanPartial(ColumnSegment &segment, Column for (idx_t i = 0; i < scan_count; i++) { // std::abs used since offsets can be negative to indicate big strings - uint32_t string_length = std::abs(base_data[start + i]) - std::abs(previous_offset); + auto string_length = UnsafeNumericCast(std::abs(base_data[start + i]) - std::abs(previous_offset)); result_data[result_offset + i] = FetchStringFromDict(segment, dict, result, baseptr, base_data[start + i], string_length); previous_offset = base_data[start + i]; @@ -133,9 +133,9 @@ void UncompressedStringStorage::StringFetchRow(ColumnSegment &segment, ColumnFet uint32_t string_length; if ((idx_t)row_id == 0) { // edge case where this is the first string in the dict - string_length = std::abs(dict_offset); + string_length = NumericCast(std::abs(dict_offset)); } else { - string_length = std::abs(dict_offset) - std::abs(base_data[row_id - 1]); + string_length = NumericCast(std::abs(dict_offset) - std::abs(base_data[row_id - 1])); } result_data[result_idx] = FetchStringFromDict(segment, dict, result, baseptr, dict_offset, string_length); } @@ -347,7 +347,8 @@ string_t UncompressedStringStorage::ReadOverflowString(ColumnSegment &segment, V // now append the string to the single buffer while (remaining > 0) { - idx_t to_write = MinValue(remaining, Storage::BLOCK_SIZE - sizeof(block_id_t) - offset); + idx_t to_write = + MinValue(remaining, Storage::BLOCK_SIZE - sizeof(block_id_t) - UnsafeNumericCast(offset)); memcpy(target_ptr, handle.Ptr() + offset, to_write); remaining -= to_write; offset += to_write; diff --git a/src/duckdb/src/storage/compression/validity_uncompressed.cpp b/src/duckdb/src/storage/compression/validity_uncompressed.cpp index 3df0cae8..f2f01533 100644 --- a/src/duckdb/src/storage/compression/validity_uncompressed.cpp +++ b/src/duckdb/src/storage/compression/validity_uncompressed.cpp @@ -384,7 +384,7 @@ void ValidityFetchRow(ColumnSegment &segment, ColumnFetchState &state, row_t row auto dataptr = handle.Ptr() + segment.GetBlockOffset(); ValidityMask mask(reinterpret_cast(dataptr)); auto &result_mask = FlatVector::Validity(result); - if (!mask.RowIsValidUnsafe(row_id)) { + if (!mask.RowIsValidUnsafe(NumericCast(row_id))) { result_mask.SetInvalid(result_idx); } } diff --git a/src/duckdb/src/storage/data_table.cpp b/src/duckdb/src/storage/data_table.cpp index 2b09cfa6..b1b01f37 100644 --- a/src/duckdb/src/storage/data_table.cpp +++ b/src/duckdb/src/storage/data_table.cpp @@ -23,19 +23,20 @@ #include "duckdb/common/types/conflict_manager.hpp" #include "duckdb/common/types/constraint_conflict_info.hpp" #include "duckdb/storage/table/append_state.hpp" +#include "duckdb/storage/table/delete_state.hpp" #include "duckdb/storage/table/scan_state.hpp" +#include "duckdb/storage/table/update_state.hpp" #include "duckdb/common/exception/transaction_exception.hpp" namespace duckdb { DataTableInfo::DataTableInfo(AttachedDatabase &db, shared_ptr table_io_manager_p, string schema, string table) - : db(db), table_io_manager(std::move(table_io_manager_p)), cardinality(0), schema(std::move(schema)), - table(std::move(table)) { + : db(db), table_io_manager(std::move(table_io_manager_p)), schema(std::move(schema)), table(std::move(table)) { } -void DataTableInfo::InitializeIndexes(ClientContext &context, bool throw_on_failure) { - indexes.InitializeIndexes(context, *this, throw_on_failure); +void DataTableInfo::InitializeIndexes(ClientContext &context, const char *index_type) { + indexes.InitializeIndexes(context, *this, index_type); } bool DataTableInfo::IsTemporary() const { @@ -45,12 +46,12 @@ bool DataTableInfo::IsTemporary() const { DataTable::DataTable(AttachedDatabase &db, shared_ptr table_io_manager_p, const string &schema, const string &table, vector column_definitions_p, unique_ptr data) - : info(make_shared(db, std::move(table_io_manager_p), schema, table)), - column_definitions(std::move(column_definitions_p)), db(db), is_root(true) { + : db(db), info(make_shared_ptr(db, std::move(table_io_manager_p), schema, table)), + column_definitions(std::move(column_definitions_p)), is_root(true) { // initialize the table with the existing data from disk, if any auto types = GetTypes(); this->row_groups = - make_shared(info, TableIOManager::Get(*this).GetBlockManagerForRowData(), types, 0); + make_shared_ptr(info, TableIOManager::Get(*this).GetBlockManagerForRowData(), types, 0); if (data && data->row_group_count > 0) { this->row_groups->Initialize(*data); } else { @@ -61,28 +62,34 @@ DataTable::DataTable(AttachedDatabase &db, shared_ptr table_io_m } DataTable::DataTable(ClientContext &context, DataTable &parent, ColumnDefinition &new_column, Expression &default_value) - : info(parent.info), db(parent.db), is_root(true) { + : db(parent.db), info(parent.info), is_root(true) { // add the column definitions from this DataTable for (auto &column_def : parent.column_definitions) { column_definitions.emplace_back(column_def.Copy()); } column_definitions.emplace_back(new_column.Copy()); + + auto &local_storage = LocalStorage::Get(context, db); + + ExpressionExecutor default_executor(context); + default_executor.AddExpression(default_value); + // prevent any new tuples from being added to the parent lock_guard parent_lock(parent.append_lock); - this->row_groups = parent.row_groups->AddColumn(context, new_column, default_value); + this->row_groups = parent.row_groups->AddColumn(context, new_column, default_executor); // also add this column to client local storage - auto &local_storage = LocalStorage::Get(context, db); - local_storage.AddColumn(parent, *this, new_column, default_value); + local_storage.AddColumn(parent, *this, new_column, default_executor); // this table replaces the previous table, hence the parent is no longer the root DataTable parent.is_root = false; } DataTable::DataTable(ClientContext &context, DataTable &parent, idx_t removed_column) - : info(parent.info), db(parent.db), is_root(true) { + : db(parent.db), info(parent.info), is_root(true) { // prevent any new tuples from being added to the parent + auto &local_storage = LocalStorage::Get(context, db); lock_guard parent_lock(parent.append_lock); for (auto &column_def : parent.column_definitions) { @@ -93,7 +100,7 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, idx_t removed_co // first check if there are any indexes that exist that point to the removed column info->indexes.Scan([&](Index &index) { - for (auto &column_id : index.column_ids) { + for (auto &column_id : index.GetColumnIds()) { if (column_id == removed_column) { throw CatalogException("Cannot drop this column: an index depends on it!"); } else if (column_id > removed_column) { @@ -105,7 +112,7 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, idx_t removed_co // erase the column definitions from this DataTable D_ASSERT(removed_column < column_definitions.size()); - column_definitions.erase(column_definitions.begin() + removed_column); + column_definitions.erase_at(removed_column); storage_t storage_idx = 0; for (idx_t i = 0; i < column_definitions.size(); i++) { @@ -121,7 +128,6 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, idx_t removed_co this->row_groups = parent.row_groups->RemoveColumn(removed_column); // scan the original table, and fill the new column with the transformed value - auto &local_storage = LocalStorage::Get(context, db); local_storage.DropColumn(parent, *this, removed_column); // this table replaces the previous table, hence the parent is no longer the root DataTable @@ -130,8 +136,9 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, idx_t removed_co // Alter column to add new constraint DataTable::DataTable(ClientContext &context, DataTable &parent, unique_ptr constraint) - : info(parent.info), db(parent.db), row_groups(parent.row_groups), is_root(true) { + : db(parent.db), info(parent.info), row_groups(parent.row_groups), is_root(true) { + auto &local_storage = LocalStorage::Get(context, db); lock_guard parent_lock(parent.append_lock); for (auto &column_def : parent.column_definitions) { column_definitions.emplace_back(column_def.Copy()); @@ -140,10 +147,9 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, unique_ptrInitializeIndexes(context); // Verify the new constraint against current persistent/local data - VerifyNewConstraint(context, parent, constraint.get()); + VerifyNewConstraint(local_storage, parent, *constraint); // Get the local data ownership from old dt - auto &local_storage = LocalStorage::Get(context, db); local_storage.MoveStorage(parent, *this); // this table replaces the previous table, hence the parent is no longer the root DataTable parent.is_root = false; @@ -151,7 +157,8 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, unique_ptr &bound_columns, Expression &cast_expr) - : info(parent.info), db(parent.db), is_root(true) { + : db(parent.db), info(parent.info), is_root(true) { + auto &local_storage = LocalStorage::Get(context, db); // prevent any tuples from being added to the parent lock_guard lock(append_lock); for (auto &column_def : parent.column_definitions) { @@ -162,7 +169,7 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, idx_t changed_id // first check if there are any indexes that exist that point to the changed column info->indexes.Scan([&](Index &index) { - for (auto &column_id : index.column_ids) { + for (auto &column_id : index.GetColumnIds()) { if (column_id == changed_idx) { throw CatalogException("Cannot change the type of this column: an index depends on it!"); } @@ -178,7 +185,6 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, idx_t changed_id this->row_groups = parent.row_groups->AlterType(context, changed_idx, target_type, bound_columns, cast_expr); // scan the original table, and fill the new column with the transformed value - auto &local_storage = LocalStorage::Get(context, db); local_storage.ChangeType(parent, *this, changed_idx, target_type, bound_columns, cast_expr); // this table replaces the previous table, hence the parent is no longer the root DataTable @@ -193,8 +199,25 @@ vector DataTable::GetTypes() { return types; } +bool DataTable::IsTemporary() const { + return info->IsTemporary(); +} + +AttachedDatabase &DataTable::GetAttached() { + D_ASSERT(RefersToSameObject(db, info->db)); + return db; +} + +const vector &DataTable::Columns() const { + return column_definitions; +} + +TableIOManager &DataTable::GetTableIOManager() { + return *info->table_io_manager; +} + TableIOManager &TableIOManager::Get(DataTable &table) { - return *table.info->table_io_manager; + return table.GetTableIOManager(); } //===--------------------------------------------------------------------===// @@ -202,19 +225,21 @@ TableIOManager &TableIOManager::Get(DataTable &table) { //===--------------------------------------------------------------------===// void DataTable::InitializeScan(TableScanState &state, const vector &column_ids, TableFilterSet *table_filters) { + state.checkpoint_lock = info->checkpoint_lock.GetSharedLock(); state.Initialize(column_ids, table_filters); row_groups->InitializeScan(state.table_state, column_ids, table_filters); } void DataTable::InitializeScan(DuckTransaction &transaction, TableScanState &state, const vector &column_ids, TableFilterSet *table_filters) { - InitializeScan(state, column_ids, table_filters); auto &local_storage = LocalStorage::Get(transaction); + InitializeScan(state, column_ids, table_filters); local_storage.InitializeScan(*this, state.local_state, table_filters); } void DataTable::InitializeScanWithOffset(TableScanState &state, const vector &column_ids, idx_t start_row, idx_t end_row) { + state.checkpoint_lock = info->checkpoint_lock.GetSharedLock(); state.Initialize(column_ids); row_groups->InitializeScanWithOffset(state.table_state, column_ids, start_row, end_row); } @@ -229,9 +254,10 @@ idx_t DataTable::MaxThreads(ClientContext &context) { } void DataTable::InitializeParallelScan(ClientContext &context, ParallelTableScanState &state) { + auto &local_storage = LocalStorage::Get(context, db); + state.checkpoint_lock = info->checkpoint_lock.GetSharedLock(); row_groups->InitializeParallelScan(state.scan_state); - auto &local_storage = LocalStorage::Get(context, db); local_storage.InitializeParallelScan(*this, state.local_state); } @@ -264,15 +290,89 @@ bool DataTable::CreateIndexScan(TableScanState &state, DataChunk &result, TableS return state.table_state.ScanCommitted(result, type); } +//===--------------------------------------------------------------------===// +// Index Methods +//===--------------------------------------------------------------------===// +shared_ptr &DataTable::GetDataTableInfo() { + return info; +} + +void DataTable::InitializeIndexes(ClientContext &context) { + info->InitializeIndexes(context); +} + +bool DataTable::HasIndexes() const { + return !info->indexes.Empty(); +} + +void DataTable::AddIndex(unique_ptr index) { + info->indexes.AddIndex(std::move(index)); +} + +bool DataTable::HasForeignKeyIndex(const vector &keys, ForeignKeyType type) { + return info->indexes.FindForeignKeyIndex(keys, type) != nullptr; +} + +void DataTable::SetIndexStorageInfo(vector index_storage_info) { + info->index_storage_infos = std::move(index_storage_info); +} + +void DataTable::VacuumIndexes() { + info->indexes.Scan([&](Index &index) { + if (index.IsBound()) { + index.Cast().Vacuum(); + } + return false; + }); +} + bool DataTable::IndexNameIsUnique(const string &name) { return info->indexes.NameIsUnique(name); } +string DataTableInfo::GetSchemaName() { + return schema; +} + +string DataTableInfo::GetTableName() { + lock_guard l(name_lock); + return table; +} + +void DataTableInfo::SetTableName(string name) { + lock_guard l(name_lock); + table = std::move(name); +} + +string DataTable::GetTableName() const { + return info->GetTableName(); +} + +void DataTable::SetTableName(string new_name) { + info->SetTableName(std::move(new_name)); +} + +TableStorageInfo DataTable::GetStorageInfo() { + TableStorageInfo result; + result.cardinality = GetTotalRows(); + info->indexes.Scan([&](Index &index) { + IndexInfo index_info; + index_info.is_primary = index.IsPrimary(); + index_info.is_unique = index.IsUnique() || index_info.is_primary; + index_info.is_foreign = index.IsForeign(); + index_info.column_set = index.GetColumnIdSet(); + result.index_info.push_back(std::move(index_info)); + return false; + }); + return result; +} + //===--------------------------------------------------------------------===// // Fetch //===--------------------------------------------------------------------===// void DataTable::Fetch(DuckTransaction &transaction, DataChunk &result, const vector &column_ids, const Vector &row_identifiers, idx_t fetch_count, ColumnFetchState &state) { + auto lock = info->checkpoint_lock.GetSharedLock(); row_groups->Fetch(transaction, result, column_ids, row_identifiers, fetch_count, state); } @@ -333,12 +433,12 @@ bool DataTable::IsForeignKeyIndex(const vector &fk_keys, Index &i if (fk_type == ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE ? !index.IsUnique() : !index.IsForeign()) { return false; } - if (fk_keys.size() != index.column_ids.size()) { + if (fk_keys.size() != index.GetColumnIds().size()) { return false; } for (auto &fk_key : fk_keys) { bool is_found = false; - for (auto &index_key : index.column_ids) { + for (auto &index_key : index.GetColumnIds()) { if (fk_key.index == index_key) { is_found = true; break; @@ -378,9 +478,11 @@ idx_t LocateErrorIndex(bool is_append, const ManagedSelection &matches) { return failed_index; } -[[noreturn]] static void ThrowForeignKeyConstraintError(idx_t failed_index, bool is_append, Index &index, +[[noreturn]] static void ThrowForeignKeyConstraintError(idx_t failed_index, bool is_append, Index &conflict_index, DataChunk &input) { - + // The index that caused the conflict has to be bound by this point (or we would not have gotten here) + D_ASSERT(conflict_index.IsBound()); + auto &index = conflict_index.Cast(); auto verify_type = is_append ? VerifyExistenceType::APPEND_FK : VerifyExistenceType::DELETE_FK; D_ASSERT(failed_index != DConstants::INVALID_INDEX); auto message = index.GetConstraintViolationMessage(verify_type, failed_index, input); @@ -509,7 +611,8 @@ void DataTable::VerifyForeignKeyConstraint(const BoundForeignKeyConstraint &bfk, } ThrowForeignKeyConstraintError(failed_index, true, *index, dst_chunk); } - if (!is_append && transaction_check) { + if (!is_append) { + D_ASSERT(transaction_check); auto &transaction_matches = transaction_conflicts.Conflicts(); if (error) { auto failed_index = LocateErrorIndex(false, regular_matches); @@ -535,21 +638,20 @@ void DataTable::VerifyDeleteForeignKeyConstraint(const BoundForeignKeyConstraint VerifyForeignKeyConstraint(bfk, context, chunk, VerifyExistenceType::DELETE_FK); } -void DataTable::VerifyNewConstraint(ClientContext &context, DataTable &parent, const BoundConstraint *constraint) { - if (constraint->type != ConstraintType::NOT_NULL) { +void DataTable::VerifyNewConstraint(LocalStorage &local_storage, DataTable &parent, const BoundConstraint &constraint) { + if (constraint.type != ConstraintType::NOT_NULL) { throw NotImplementedException("FIXME: ALTER COLUMN with such constraint is not supported yet"); } - parent.row_groups->VerifyNewConstraint(parent, *constraint); - auto &local_storage = LocalStorage::Get(context, db); - local_storage.VerifyNewConstraint(parent, *constraint); + parent.row_groups->VerifyNewConstraint(parent, constraint); + local_storage.VerifyNewConstraint(parent, constraint); } bool HasUniqueIndexes(TableIndexList &list) { bool has_unique_index = false; list.Scan([&](Index &index) { if (index.IsUnique()) { - return has_unique_index = true; + has_unique_index = true; return true; } return false; @@ -558,7 +660,7 @@ bool HasUniqueIndexes(TableIndexList &list) { } void DataTable::VerifyUniqueIndexes(TableIndexList &indexes, ClientContext &context, DataChunk &chunk, - ConflictManager *conflict_manager) { + optional_ptr conflict_manager) { //! check whether or not the chunk can be inserted into the indexes if (!conflict_manager) { // Only need to verify that no unique constraints are violated @@ -566,7 +668,8 @@ void DataTable::VerifyUniqueIndexes(TableIndexList &indexes, ClientContext &cont if (!index.IsUnique()) { return false; } - index.VerifyAppend(chunk); + D_ASSERT(index.IsBound()); + index.Cast().VerifyAppend(chunk); return false; }); return; @@ -592,7 +695,8 @@ void DataTable::VerifyUniqueIndexes(TableIndexList &indexes, ClientContext &cont return false; } if (conflict_info.ConflictTargetMatches(index)) { - index.VerifyAppend(chunk, *conflict_manager); + D_ASSERT(index.IsBound()); + index.Cast().VerifyAppend(chunk, *conflict_manager); checked_indexes.insert(&index); } return false; @@ -609,13 +713,15 @@ void DataTable::VerifyUniqueIndexes(TableIndexList &indexes, ClientContext &cont // Already checked this constraint return false; } - index.VerifyAppend(chunk, *conflict_manager); + D_ASSERT(index.IsBound()); + index.Cast().VerifyAppend(chunk, *conflict_manager); return false; }); } -void DataTable::VerifyAppendConstraints(TableCatalogEntry &table, ClientContext &context, DataChunk &chunk, - ConflictManager *conflict_manager) { +void DataTable::VerifyAppendConstraints(ConstraintState &state, ClientContext &context, DataChunk &chunk, + optional_ptr conflict_manager) { + auto &table = state.table; if (table.HasGeneratedColumns()) { // Verify that the generated columns expression work with the inserted values auto binder = Binder::CreateBinder(context); @@ -638,10 +744,9 @@ void DataTable::VerifyAppendConstraints(TableCatalogEntry &table, ClientContext } auto &constraints = table.GetConstraints(); - auto &bound_constraints = table.GetBoundConstraints(); - for (idx_t i = 0; i < bound_constraints.size(); i++) { + for (idx_t i = 0; i < state.bound_constraints.size(); i++) { auto &base_constraint = constraints[i]; - auto &constraint = bound_constraints[i]; + auto &constraint = state.bound_constraints[i]; switch (base_constraint->type) { case ConstraintType::NOT_NULL: { auto &bound_not_null = *reinterpret_cast(constraint.get()); @@ -673,12 +778,21 @@ void DataTable::VerifyAppendConstraints(TableCatalogEntry &table, ClientContext } } -void DataTable::InitializeLocalAppend(LocalAppendState &state, ClientContext &context) { +unique_ptr +DataTable::InitializeConstraintState(TableCatalogEntry &table, + const vector> &bound_constraints) { + return make_uniq(table, bound_constraints); +} + +void DataTable::InitializeLocalAppend(LocalAppendState &state, TableCatalogEntry &table, ClientContext &context, + const vector> &bound_constraints) { if (!is_root) { throw TransactionException("Transaction conflict: adding entries to a table that has been altered!"); } auto &local_storage = LocalStorage::Get(context, db); local_storage.InitializeAppend(state, *this); + + state.constraint_state = InitializeConstraintState(table, bound_constraints); } void DataTable::LocalAppend(LocalAppendState &state, TableCatalogEntry &table, ClientContext &context, DataChunk &chunk, @@ -695,7 +809,7 @@ void DataTable::LocalAppend(LocalAppendState &state, TableCatalogEntry &table, C // verify any constraints on the new chunk if (!unsafe) { - VerifyAppendConstraints(table, context, chunk); + VerifyAppendConstraints(*state.constraint_state, context, chunk); } // append to the transaction local data @@ -721,18 +835,20 @@ void DataTable::LocalMerge(ClientContext &context, RowGroupCollection &collectio local_storage.LocalMerge(*this, collection); } -void DataTable::LocalAppend(TableCatalogEntry &table, ClientContext &context, DataChunk &chunk) { +void DataTable::LocalAppend(TableCatalogEntry &table, ClientContext &context, DataChunk &chunk, + const vector> &bound_constraints) { LocalAppendState append_state; auto &storage = table.GetStorage(); - storage.InitializeLocalAppend(append_state, context); + storage.InitializeLocalAppend(append_state, table, context, bound_constraints); storage.LocalAppend(append_state, table, context, chunk); storage.FinalizeLocalAppend(append_state); } -void DataTable::LocalAppend(TableCatalogEntry &table, ClientContext &context, ColumnDataCollection &collection) { +void DataTable::LocalAppend(TableCatalogEntry &table, ClientContext &context, ColumnDataCollection &collection, + const vector> &bound_constraints) { LocalAppendState append_state; auto &storage = table.GetStorage(); - storage.InitializeLocalAppend(append_state, context); + storage.InitializeLocalAppend(append_state, table, context, bound_constraints); for (auto &chunk : collection.Chunks()) { storage.LocalAppend(append_state, table, context, chunk); } @@ -744,7 +860,7 @@ void DataTable::AppendLock(TableAppendState &state) { if (!is_root) { throw TransactionException("Transaction conflict: adding entries to a table that has been altered!"); } - state.row_start = row_groups->GetTotalRows(); + state.row_start = NumericCast(row_groups->GetTotalRows()); state.current_row = state.row_start; } @@ -835,12 +951,9 @@ void DataTable::WriteToLog(WriteAheadLog &log, idx_t row_start, idx_t count) { void DataTable::CommitAppend(transaction_t commit_id, idx_t row_start, idx_t count) { lock_guard lock(append_lock); row_groups->CommitAppend(commit_id, row_start, count); - info->cardinality += count; } void DataTable::RevertAppendInternal(idx_t start_row) { - // adjust the cardinality - info->cardinality = start_row; D_ASSERT(is_root); // revert appends made to row_groups row_groups->RevertAppendInternal(start_row); @@ -857,11 +970,12 @@ void DataTable::RevertAppend(idx_t start_row, idx_t count) { idx_t scan_count = MinValue(count, row_groups->GetTotalRows() - start_row); ScanTableSegment(start_row, scan_count, [&](DataChunk &chunk) { for (idx_t i = 0; i < chunk.size(); i++) { - row_data[i] = current_row_base + i; + row_data[i] = NumericCast(current_row_base + i); } info->indexes.Scan([&](Index &index) { - if (!index.IsUnknown()) { - index.Delete(chunk, row_identifiers); + // We cant add to unbound indexes anyways, so there is no need to revert them + if (index.IsBound()) { + index.Cast().Delete(chunk, row_identifiers); } return false; }); @@ -872,8 +986,9 @@ void DataTable::RevertAppend(idx_t start_row, idx_t count) { // we need to vacuum the indexes to remove any buffers that are now empty // due to reverting the appends info->indexes.Scan([&](Index &index) { - if (!index.IsUnknown()) { - index.Vacuum(); + // We cant add to unbound indexes anyway, so there is no need to vacuum them + if (index.IsBound()) { + index.Cast().Vacuum(); } return false; }); @@ -894,10 +1009,16 @@ ErrorData DataTable::AppendToIndexes(TableIndexList &indexes, DataChunk &chunk, Vector row_identifiers(LogicalType::ROW_TYPE); VectorOperations::GenerateSequence(row_identifiers, chunk.size(), row_start, 1); - vector already_appended; + vector already_appended; bool append_failed = false; // now append the entries to the indices - indexes.Scan([&](Index &index) { + indexes.Scan([&](Index &index_to_append) { + if (!index_to_append.IsBound()) { + error = ErrorData("Unbound index found in DataTable::AppendToIndexes"); + append_failed = true; + return true; + } + auto &index = index_to_append.Cast(); try { error = index.Append(chunk, row_identifiers); } catch (std::exception &ex) { @@ -942,7 +1063,10 @@ void DataTable::RemoveFromIndexes(TableAppendState &state, DataChunk &chunk, row void DataTable::RemoveFromIndexes(TableAppendState &state, DataChunk &chunk, Vector &row_identifiers) { D_ASSERT(is_root); info->indexes.Scan([&](Index &index) { - index.Delete(chunk, row_identifiers); + if (!index.IsBound()) { + throw InternalException("Unbound index found in DataTable::RemoveFromIndexes"); + } + index.Cast().Delete(chunk, row_identifiers); return false; }); } @@ -956,15 +1080,14 @@ void DataTable::RemoveFromIndexes(Vector &row_identifiers, idx_t count) { // Delete //===--------------------------------------------------------------------===// static bool TableHasDeleteConstraints(TableCatalogEntry &table) { - auto &bound_constraints = table.GetBoundConstraints(); - for (auto &constraint : bound_constraints) { + for (auto &constraint : table.GetConstraints()) { switch (constraint->type) { case ConstraintType::NOT_NULL: case ConstraintType::CHECK: case ConstraintType::UNIQUE: break; case ConstraintType::FOREIGN_KEY: { - auto &bfk = *reinterpret_cast(constraint.get()); + auto &bfk = constraint->Cast(); if (bfk.info.type == ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE || bfk.info.type == ForeignKeyType::FK_TYPE_SELF_REFERENCE_TABLE) { return true; @@ -978,9 +1101,8 @@ static bool TableHasDeleteConstraints(TableCatalogEntry &table) { return false; } -void DataTable::VerifyDeleteConstraints(TableCatalogEntry &table, ClientContext &context, DataChunk &chunk) { - auto &bound_constraints = table.GetBoundConstraints(); - for (auto &constraint : bound_constraints) { +void DataTable::VerifyDeleteConstraints(TableDeleteState &state, ClientContext &context, DataChunk &chunk) { + for (auto &constraint : state.constraint_state->bound_constraints) { switch (constraint->type) { case ConstraintType::NOT_NULL: case ConstraintType::CHECK: @@ -1000,33 +1122,39 @@ void DataTable::VerifyDeleteConstraints(TableCatalogEntry &table, ClientContext } } -idx_t DataTable::Delete(TableCatalogEntry &table, ClientContext &context, Vector &row_identifiers, idx_t count) { +unique_ptr DataTable::InitializeDelete(TableCatalogEntry &table, ClientContext &context, + const vector> &bound_constraints) { + // initialize indexes (if any) + info->InitializeIndexes(context); + + auto binder = Binder::CreateBinder(context); + vector types; + auto result = make_uniq(); + result->has_delete_constraints = TableHasDeleteConstraints(table); + if (result->has_delete_constraints) { + // initialize the chunk if there are any constraints to verify + for (idx_t i = 0; i < column_definitions.size(); i++) { + result->col_ids.push_back(column_definitions[i].StorageOid()); + types.emplace_back(column_definitions[i].Type()); + } + result->verify_chunk.Initialize(Allocator::Get(context), types); + result->constraint_state = make_uniq(table, bound_constraints); + } + return result; +} + +idx_t DataTable::Delete(TableDeleteState &state, ClientContext &context, Vector &row_identifiers, idx_t count) { D_ASSERT(row_identifiers.GetType().InternalType() == ROW_TYPE); if (count == 0) { return 0; } - info->InitializeIndexes(context, true); - auto &transaction = DuckTransaction::Get(context, db); auto &local_storage = LocalStorage::Get(transaction); - bool has_delete_constraints = TableHasDeleteConstraints(table); row_identifiers.Flatten(count); auto ids = FlatVector::GetData(row_identifiers); - DataChunk verify_chunk; - vector col_ids; - vector types; - ColumnFetchState fetch_state; - if (has_delete_constraints) { - // initialize the chunk if there are any constraints to verify - for (idx_t i = 0; i < column_definitions.size(); i++) { - col_ids.push_back(column_definitions[i].StorageOid()); - types.emplace_back(column_definitions[i].Type()); - } - verify_chunk.Initialize(Allocator::Get(context), types); - } idx_t pos = 0; idx_t delete_count = 0; while (pos < count) { @@ -1045,18 +1173,21 @@ idx_t DataTable::Delete(TableCatalogEntry &table, ClientContext &context, Vector Vector offset_ids(row_identifiers, current_offset, pos); if (is_transaction_delete) { // transaction-local delete - if (has_delete_constraints) { + if (state.has_delete_constraints) { // perform the constraint verification - local_storage.FetchChunk(*this, offset_ids, current_count, col_ids, verify_chunk, fetch_state); - VerifyDeleteConstraints(table, context, verify_chunk); + ColumnFetchState fetch_state; + local_storage.FetchChunk(*this, offset_ids, current_count, state.col_ids, state.verify_chunk, + fetch_state); + VerifyDeleteConstraints(state, context, state.verify_chunk); } delete_count += local_storage.Delete(*this, offset_ids, current_count); } else { // regular table delete - if (has_delete_constraints) { + if (state.has_delete_constraints) { // perform the constraint verification - Fetch(transaction, verify_chunk, col_ids, offset_ids, current_count, fetch_state); - VerifyDeleteConstraints(table, context, verify_chunk); + ColumnFetchState fetch_state; + Fetch(transaction, state.verify_chunk, state.col_ids, offset_ids, current_count, fetch_state); + VerifyDeleteConstraints(state, context, state.verify_chunk); } delete_count += row_groups->Delete(transaction, *this, ids + current_offset, current_count); } @@ -1101,10 +1232,11 @@ static bool CreateMockChunk(TableCatalogEntry &table, const vector &column_ids) { + auto &table = state.table; auto &constraints = table.GetConstraints(); - auto &bound_constraints = table.GetBoundConstraints(); + auto &bound_constraints = state.bound_constraints; for (idx_t constr_idx = 0; constr_idx < bound_constraints.size(); constr_idx++) { auto &base_constraint = constraints[constr_idx]; auto &constraint = bound_constraints[constr_idx]; @@ -1143,14 +1275,25 @@ void DataTable::VerifyUpdateConstraints(ClientContext &context, TableCatalogEntr // instead update should have been rewritten to delete + update on higher layer #ifdef DEBUG info->indexes.Scan([&](Index &index) { - D_ASSERT(!index.IndexIsUpdated(column_ids)); + D_ASSERT(index.IsBound()); + D_ASSERT(!index.Cast().IndexIsUpdated(column_ids)); return false; }); #endif } -void DataTable::Update(TableCatalogEntry &table, ClientContext &context, Vector &row_ids, +unique_ptr DataTable::InitializeUpdate(TableCatalogEntry &table, ClientContext &context, + const vector> &bound_constraints) { + // check that there are no unknown indexes + info->InitializeIndexes(context); + + auto result = make_uniq(); + result->constraint_state = InitializeConstraintState(table, bound_constraints); + return result; +} + +void DataTable::Update(TableUpdateState &state, ClientContext &context, Vector &row_ids, const vector &column_ids, DataChunk &updates) { D_ASSERT(row_ids.GetType().InternalType() == ROW_TYPE); D_ASSERT(column_ids.size() == updates.ColumnCount()); @@ -1165,11 +1308,8 @@ void DataTable::Update(TableCatalogEntry &table, ClientContext &context, Vector throw TransactionException("Transaction conflict: cannot update a table that has been altered!"); } - // check that there are no unknown indexes - info->InitializeIndexes(context, true); - // first verify that no constraints are violated - VerifyUpdateConstraints(context, table, updates, column_ids); + VerifyUpdateConstraints(*state.constraint_state, context, updates, column_ids); // now perform the actual update Vector max_row_id_vec(Value::BIGINT(MAX_ROW_ID)); @@ -1243,8 +1383,15 @@ void DataTable::SetDistinct(column_t column_id, unique_ptr d //===--------------------------------------------------------------------===// // Checkpoint //===--------------------------------------------------------------------===// -void DataTable::Checkpoint(TableDataWriter &writer, Serializer &serializer) { +unique_ptr DataTable::GetSharedCheckpointLock() { + return info->checkpoint_lock.GetSharedLock(); +} + +unique_ptr DataTable::GetCheckpointLock() { + return info->checkpoint_lock.GetExclusiveLock(); +} +void DataTable::Checkpoint(TableDataWriter &writer, Serializer &serializer) { // checkpoint each individual row group TableStatistics global_stats; row_groups->CopyStats(global_stats); @@ -1262,7 +1409,11 @@ void DataTable::CommitDropColumn(idx_t index) { row_groups->CommitDropColumn(index); } -idx_t DataTable::GetTotalRows() { +idx_t DataTable::ColumnCount() const { + return column_definitions.size(); +} + +idx_t DataTable::GetTotalRows() const { return row_groups->GetTotalRows(); } @@ -1272,7 +1423,8 @@ void DataTable::CommitDropTable() { // propagate dropping this table to its indexes: frees all index memory info->indexes.Scan([&](Index &index) { - index.CommitDrop(); + D_ASSERT(index.IsBound()); + index.Cast().CommitDrop(); return false; }); } @@ -1281,6 +1433,7 @@ void DataTable::CommitDropTable() { // GetColumnSegmentInfo //===--------------------------------------------------------------------===// vector DataTable::GetColumnSegmentInfo() { + auto lock = GetSharedCheckpointLock(); return row_groups->GetColumnSegmentInfo(); } diff --git a/src/duckdb/src/storage/index.cpp b/src/duckdb/src/storage/index.cpp index 01b2b6c5..ca136d63 100644 --- a/src/duckdb/src/storage/index.cpp +++ b/src/duckdb/src/storage/index.cpp @@ -1,122 +1,18 @@ #include "duckdb/storage/index.hpp" - #include "duckdb/common/radix.hpp" #include "duckdb/common/serializer/serializer.hpp" -#include "duckdb/planner/expression/bound_columnref_expression.hpp" -#include "duckdb/planner/expression/bound_reference_expression.hpp" -#include "duckdb/planner/expression_iterator.hpp" -#include "duckdb/storage/table/append_state.hpp" namespace duckdb { -Index::Index(const string &name, const string &index_type, IndexConstraintType index_constraint_type, - const vector &column_ids, TableIOManager &table_io_manager, - const vector> &unbound_expressions, AttachedDatabase &db) +Index::Index(const vector &column_ids, TableIOManager &table_io_manager, AttachedDatabase &db) - : name(name), index_type(index_type), index_constraint_type(index_constraint_type), column_ids(column_ids), - table_io_manager(table_io_manager), db(db) { + : column_ids(column_ids), table_io_manager(table_io_manager), db(db) { if (!Radix::IsLittleEndian()) { throw NotImplementedException("indexes are not supported on big endian architectures"); } - - for (auto &expr : unbound_expressions) { - types.push_back(expr->return_type.InternalType()); - logical_types.push_back(expr->return_type); - auto unbound_expression = expr->Copy(); - bound_expressions.push_back(BindExpression(unbound_expression->Copy())); - this->unbound_expressions.emplace_back(std::move(unbound_expression)); - } - for (auto &bound_expr : bound_expressions) { - executor.AddExpression(*bound_expr); - } - // create the column id set column_id_set.insert(column_ids.begin(), column_ids.end()); } -void Index::InitializeLock(IndexLock &state) { - state.index_lock = unique_lock(lock); -} - -ErrorData Index::Append(DataChunk &entries, Vector &row_identifiers) { - IndexLock state; - InitializeLock(state); - return Append(state, entries, row_identifiers); -} - -void Index::CommitDrop() { - IndexLock index_lock; - InitializeLock(index_lock); - CommitDrop(index_lock); -} - -void Index::Delete(DataChunk &entries, Vector &row_identifiers) { - IndexLock state; - InitializeLock(state); - Delete(state, entries, row_identifiers); -} - -bool Index::MergeIndexes(Index &other_index) { - IndexLock state; - InitializeLock(state); - return MergeIndexes(state, other_index); -} - -string Index::VerifyAndToString(const bool only_verify) { - IndexLock state; - InitializeLock(state); - return VerifyAndToString(state, only_verify); -} - -void Index::Vacuum() { - IndexLock state; - InitializeLock(state); - Vacuum(state); -} - -idx_t Index::GetInMemorySize() { - IndexLock state; - InitializeLock(state); - return GetInMemorySize(state); -} - -void Index::ExecuteExpressions(DataChunk &input, DataChunk &result) { - executor.Execute(input, result); -} - -unique_ptr Index::BindExpression(unique_ptr expr) { - if (expr->type == ExpressionType::BOUND_COLUMN_REF) { - auto &bound_colref = expr->Cast(); - return make_uniq(expr->return_type, column_ids[bound_colref.binding.column_index]); - } - ExpressionIterator::EnumerateChildren( - *expr, [this](unique_ptr &expr) { expr = BindExpression(std::move(expr)); }); - return expr; -} - -bool Index::IndexIsUpdated(const vector &column_ids_p) const { - for (auto &column : column_ids_p) { - if (column_id_set.find(column.index) != column_id_set.end()) { - return true; - } - } - return false; -} - -IndexStorageInfo Index::GetStorageInfo(const bool get_buffers) { - throw NotImplementedException("The implementation of this index serialization does not exist."); -} - -string Index::AppendRowError(DataChunk &input, idx_t index) { - string error; - for (idx_t c = 0; c < input.ColumnCount(); c++) { - if (c > 0) { - error += ", "; - } - error += input.GetValue(c, index).ToString(); - } - return error; -} - } // namespace duckdb diff --git a/src/duckdb/src/storage/local_storage.cpp b/src/duckdb/src/storage/local_storage.cpp index b8482e2d..ec5275d0 100644 --- a/src/duckdb/src/storage/local_storage.cpp +++ b/src/duckdb/src/storage/local_storage.cpp @@ -14,30 +14,25 @@ namespace duckdb { -LocalTableStorage::LocalTableStorage(DataTable &table) +LocalTableStorage::LocalTableStorage(ClientContext &context, DataTable &table) : table_ref(table), allocator(Allocator::Get(table.db)), deleted_rows(0), optimistic_writer(table), merged_storage(false) { auto types = table.GetTypes(); - row_groups = make_shared(table.info, TableIOManager::Get(table).GetBlockManagerForRowData(), - types, MAX_ROW_ID, 0); + auto data_table_info = table.GetDataTableInfo(); + row_groups = make_shared_ptr( + data_table_info, TableIOManager::Get(table).GetBlockManagerForRowData(), types, MAX_ROW_ID, 0); row_groups->InitializeEmpty(); - table.info->indexes.Scan([&](Index &index) { - if (index.index_type != ART::TYPE_NAME) { - return false; - } - D_ASSERT(index.index_type == ART::TYPE_NAME); - - auto &art = index.Cast(); - if (art.index_constraint_type != IndexConstraintType::NONE) { + data_table_info->GetIndexes().BindAndScan(context, *data_table_info, [&](ART &art) { + if (art.GetConstraintType() != IndexConstraintType::NONE) { // unique index: create a local ART index that maintains the same unique constraint vector> unbound_expressions; unbound_expressions.reserve(art.unbound_expressions.size()); for (auto &expr : art.unbound_expressions) { unbound_expressions.push_back(expr->Copy()); } - indexes.AddIndex(make_uniq(art.name, art.index_constraint_type, art.column_ids, art.table_io_manager, - std::move(unbound_expressions), art.db)); + indexes.AddIndex(make_uniq(art.GetIndexName(), art.GetConstraintType(), art.GetColumnIds(), + art.table_io_manager, std::move(unbound_expressions), art.db)); } return false; }); @@ -64,11 +59,11 @@ LocalTableStorage::LocalTableStorage(DataTable &new_dt, LocalTableStorage &paren } LocalTableStorage::LocalTableStorage(ClientContext &context, DataTable &new_dt, LocalTableStorage &parent, - ColumnDefinition &new_column, Expression &default_value) + ColumnDefinition &new_column, ExpressionExecutor &default_executor) : table_ref(new_dt), allocator(Allocator::Get(new_dt.db)), deleted_rows(parent.deleted_rows), optimistic_writer(new_dt, parent.optimistic_writer), optimistic_writers(std::move(parent.optimistic_writers)), merged_storage(parent.merged_storage) { - row_groups = parent.row_groups->AddColumn(context, new_column, default_value); + row_groups = parent.row_groups->AddColumn(context, new_column, default_executor); parent.row_groups.reset(); indexes.Move(parent.indexes); } @@ -97,7 +92,8 @@ idx_t LocalTableStorage::EstimatedSize() { // get the index size idx_t index_sizes = 0; indexes.Scan([&](Index &index) { - index_sizes += index.GetInMemorySize(); + D_ASSERT(index.IsBound()); + index_sizes += index.Cast().GetInMemorySize(); return false; }); @@ -167,8 +163,9 @@ void LocalTableStorage::AppendToIndexes(DuckTransaction &transaction, TableAppen return true; }); } else { - error = - AppendToIndexes(transaction, *row_groups, table.info->indexes, table.GetTypes(), append_state.current_row); + auto data_table_info = table.GetDataTableInfo(); + auto &index_list = data_table_info->GetIndexes(); + error = AppendToIndexes(transaction, *row_groups, index_list, table.GetTypes(), append_state.current_row); } if (error.HasError()) { // need to revert all appended row ids @@ -191,19 +188,12 @@ void LocalTableStorage::AppendToIndexes(DuckTransaction &transaction, TableAppen return true; }); if (append_to_table) { - table.RevertAppendInternal(append_state.row_start); + table.RevertAppendInternal(NumericCast(append_state.row_start)); } // we need to vacuum the indexes to remove any buffers that are now empty // due to reverting the appends - table.info->indexes.Scan([&](Index &index) { - try { - index.Vacuum(); - } catch (std::exception &ex) { // LCOV_EXCL_START - error = ErrorData(ex); - } // LCOV_EXCL_STOP - return false; - }); + table.VacuumIndexes(); error.Throw(); } if (append_to_table) { @@ -223,7 +213,7 @@ void LocalTableStorage::FinalizeOptimisticWriter(OptimisticDataWriter &writer) { for (idx_t i = 0; i < optimistic_writers.size(); i++) { if (optimistic_writers[i].get() == &writer) { owned_writer = std::move(optimistic_writers[i]); - optimistic_writers.erase(optimistic_writers.begin() + i); + optimistic_writers.erase_at(i); break; } } @@ -250,11 +240,11 @@ optional_ptr LocalTableManager::GetStorage(DataTable &table) return entry == table_storage.end() ? nullptr : entry->second.get(); } -LocalTableStorage &LocalTableManager::GetOrCreateStorage(DataTable &table) { +LocalTableStorage &LocalTableManager::GetOrCreateStorage(ClientContext &context, DataTable &table) { lock_guard l(table_storage_lock); auto entry = table_storage.find(table); if (entry == table_storage.end()) { - auto new_storage = make_shared(table); + auto new_storage = make_shared_ptr(context, table); auto storage = new_storage.get(); table_storage.insert(make_pair(reference(table), std::move(new_storage))); return *storage; @@ -358,16 +348,17 @@ bool LocalStorage::NextParallelScan(ClientContext &context, DataTable &table, Pa } void LocalStorage::InitializeAppend(LocalAppendState &state, DataTable &table) { - table.info->InitializeIndexes(context); - state.storage = &table_manager.GetOrCreateStorage(table); + table.InitializeIndexes(context); + state.storage = &table_manager.GetOrCreateStorage(context, table); state.storage->row_groups->InitializeAppend(TransactionData(transaction), state.append_state); } void LocalStorage::Append(LocalAppendState &state, DataChunk &chunk) { // append to unique indices (if any) auto storage = state.storage; - idx_t base_id = MAX_ROW_ID + storage->row_groups->GetTotalRows() + state.append_state.total_append_count; - auto error = DataTable::AppendToIndexes(storage->indexes, chunk, base_id); + idx_t base_id = + NumericCast(MAX_ROW_ID) + storage->row_groups->GetTotalRows() + state.append_state.total_append_count; + auto error = DataTable::AppendToIndexes(storage->indexes, chunk, NumericCast(base_id)); if (error.HasError()) { error.Throw(); } @@ -385,10 +376,10 @@ void LocalStorage::FinalizeAppend(LocalAppendState &state) { } void LocalStorage::LocalMerge(DataTable &table, RowGroupCollection &collection) { - auto &storage = table_manager.GetOrCreateStorage(table); + auto &storage = table_manager.GetOrCreateStorage(context, table); if (!storage.indexes.Empty()) { // append data to indexes if required - row_t base_id = MAX_ROW_ID + storage.row_groups->GetTotalRows(); + row_t base_id = MAX_ROW_ID + NumericCast(storage.row_groups->GetTotalRows()); auto error = storage.AppendToIndexes(transaction, collection, storage.indexes, table.GetTypes(), base_id); if (error.HasError()) { error.Throw(); @@ -399,12 +390,12 @@ void LocalStorage::LocalMerge(DataTable &table, RowGroupCollection &collection) } OptimisticDataWriter &LocalStorage::CreateOptimisticWriter(DataTable &table) { - auto &storage = table_manager.GetOrCreateStorage(table); + auto &storage = table_manager.GetOrCreateStorage(context, table); return storage.CreateOptimisticWriter(); } void LocalStorage::FinalizeOptimisticWriter(DataTable &table, OptimisticDataWriter &writer) { - auto &storage = table_manager.GetOrCreateStorage(table); + auto &storage = table_manager.GetOrCreateStorage(context, table); storage.FinalizeOptimisticWriter(writer); } @@ -450,11 +441,11 @@ void LocalStorage::Flush(DataTable &table, LocalTableStorage &storage) { } idx_t append_count = storage.row_groups->GetTotalRows() - storage.deleted_rows; - table.info->InitializeIndexes(context); + table.InitializeIndexes(context); TableAppendState append_state; table.AppendLock(append_state); - transaction.PushAppend(table, append_state.row_start, append_count); + transaction.PushAppend(table, NumericCast(append_state.row_start), append_count); if ((append_state.row_start == 0 || storage.row_groups->GetTotalRows() >= MERGE_THRESHOLD) && storage.deleted_rows == 0) { // table is currently empty OR we are bulk appending: move over the storage directly @@ -463,7 +454,7 @@ void LocalStorage::Flush(DataTable &table, LocalTableStorage &storage) { // now append to the indexes (if there are any) // FIXME: we should be able to merge the transaction-local index directly into the main table index // as long we just rewrite some row-ids - if (!table.info->indexes.Empty()) { + if (table.HasIndexes()) { storage.AppendToIndexes(transaction, append_state, append_count, false); } // finally move over the row groups @@ -478,10 +469,7 @@ void LocalStorage::Flush(DataTable &table, LocalTableStorage &storage) { } // possibly vacuum any excess index data - table.info->indexes.Scan([&](Index &index) { - index.Vacuum(); - return false; - }); + table.VacuumIndexes(); } void LocalStorage::Commit(LocalStorage::CommitState &commit_state, DuckTransaction &transaction) { @@ -532,13 +520,13 @@ void LocalStorage::MoveStorage(DataTable &old_dt, DataTable &new_dt) { } void LocalStorage::AddColumn(DataTable &old_dt, DataTable &new_dt, ColumnDefinition &new_column, - Expression &default_value) { + ExpressionExecutor &default_executor) { // check if there are any pending appends for the old version of the table auto storage = table_manager.MoveEntry(old_dt); if (!storage) { return; } - auto new_storage = make_shared(context, new_dt, *storage, new_column, default_value); + auto new_storage = make_shared_ptr(context, new_dt, *storage, new_column, default_executor); table_manager.InsertEntry(new_dt, std::move(new_storage)); } @@ -548,7 +536,7 @@ void LocalStorage::DropColumn(DataTable &old_dt, DataTable &new_dt, idx_t remove if (!storage) { return; } - auto new_storage = make_shared(new_dt, *storage, removed_column); + auto new_storage = make_shared_ptr(new_dt, *storage, removed_column); table_manager.InsertEntry(new_dt, std::move(new_storage)); } @@ -559,8 +547,8 @@ void LocalStorage::ChangeType(DataTable &old_dt, DataTable &new_dt, idx_t change if (!storage) { return; } - auto new_storage = - make_shared(context, new_dt, *storage, changed_idx, target_type, bound_columns, cast_expr); + auto new_storage = make_shared_ptr(context, new_dt, *storage, changed_idx, target_type, + bound_columns, cast_expr); table_manager.InsertEntry(new_dt, std::move(new_storage)); } diff --git a/src/duckdb/src/storage/metadata/metadata_manager.cpp b/src/duckdb/src/storage/metadata/metadata_manager.cpp index 8d25e037..2fba4fc1 100644 --- a/src/duckdb/src/storage/metadata/metadata_manager.cpp +++ b/src/duckdb/src/storage/metadata/metadata_manager.cpp @@ -33,7 +33,7 @@ MetadataHandle MetadataManager::AllocateHandle() { // select the first free metadata block we can find MetadataPointer pointer; - pointer.block_index = free_block; + pointer.block_index = UnsafeNumericCast(free_block); auto &block = blocks[free_block]; if (block.block->BlockId() < MAXIMUM_BLOCK) { // this block is a disk-backed block, yet we are planning to write to it @@ -134,7 +134,7 @@ MetadataPointer MetadataManager::FromDiskPointer(MetaBlockPointer pointer) { pointer.block_pointer); } // LCOV_EXCL_STOP MetadataPointer result; - result.block_index = block_id; + result.block_index = UnsafeNumericCast(block_id); result.index = UnsafeNumericCast(index); return result; } diff --git a/src/duckdb/src/storage/metadata/metadata_writer.cpp b/src/duckdb/src/storage/metadata/metadata_writer.cpp index e47708c2..cc95b908 100644 --- a/src/duckdb/src/storage/metadata/metadata_writer.cpp +++ b/src/duckdb/src/storage/metadata/metadata_writer.cpp @@ -48,7 +48,7 @@ void MetadataWriter::NextBlock() { current_pointer = block.pointer; offset = sizeof(idx_t); capacity = MetadataManager::METADATA_BLOCK_SIZE; - Store(-1, BasePtr()); + Store(static_cast(-1), BasePtr()); if (written_pointers) { written_pointers->push_back(manager.GetDiskPointer(current_pointer)); } diff --git a/src/duckdb/src/storage/optimistic_data_writer.cpp b/src/duckdb/src/storage/optimistic_data_writer.cpp index df352698..0a1966c5 100644 --- a/src/duckdb/src/storage/optimistic_data_writer.cpp +++ b/src/duckdb/src/storage/optimistic_data_writer.cpp @@ -19,14 +19,14 @@ OptimisticDataWriter::~OptimisticDataWriter() { bool OptimisticDataWriter::PrepareWrite() { // check if we should pre-emptively write the table to disk - if (table.info->IsTemporary() || StorageManager::Get(table.info->db).InMemory()) { + if (table.IsTemporary() || StorageManager::Get(table.GetAttached()).InMemory()) { return false; } // we should! write the second-to-last row group to disk // allocate the partial block-manager if none is allocated yet if (!partial_manager) { - auto &block_manager = table.info->table_io_manager->GetBlockManagerForRowData(); - partial_manager = make_uniq(block_manager, CheckpointType::APPEND_TO_TABLE); + auto &block_manager = table.GetTableIOManager().GetBlockManagerForRowData(); + partial_manager = make_uniq(block_manager, PartialBlockType::APPEND_TO_TABLE); } return true; } @@ -38,7 +38,7 @@ void OptimisticDataWriter::WriteNewRowGroup(RowGroupCollection &row_groups) { } // flush second-to-last row group auto row_group = row_groups.GetRowGroup(-2); - FlushToDisk(row_group); + FlushToDisk(*row_group); } void OptimisticDataWriter::WriteLastRowGroup(RowGroupCollection &row_groups) { @@ -51,20 +51,18 @@ void OptimisticDataWriter::WriteLastRowGroup(RowGroupCollection &row_groups) { if (!row_group) { return; } - FlushToDisk(row_group); + FlushToDisk(*row_group); } -void OptimisticDataWriter::FlushToDisk(RowGroup *row_group) { - if (!row_group) { - throw InternalException("FlushToDisk called without a RowGroup"); - } +void OptimisticDataWriter::FlushToDisk(RowGroup &row_group) { //! The set of column compression types (if any) vector compression_types; D_ASSERT(compression_types.empty()); - for (auto &column : table.column_definitions) { + for (auto &column : table.Columns()) { compression_types.push_back(column.CompressionType()); } - row_group->WriteToDisk(*partial_manager, compression_types); + RowGroupWriteInfo info(*partial_manager, compression_types); + row_group.WriteToDisk(info); } void OptimisticDataWriter::Merge(OptimisticDataWriter &other) { diff --git a/src/duckdb/src/storage/partial_block_manager.cpp b/src/duckdb/src/storage/partial_block_manager.cpp index 7fd73d6f..0f29f235 100644 --- a/src/duckdb/src/storage/partial_block_manager.cpp +++ b/src/duckdb/src/storage/partial_block_manager.cpp @@ -34,10 +34,10 @@ void PartialBlock::FlushInternal(const idx_t free_space_left) { // PartialBlockManager //===--------------------------------------------------------------------===// -PartialBlockManager::PartialBlockManager(BlockManager &block_manager, CheckpointType checkpoint_type, +PartialBlockManager::PartialBlockManager(BlockManager &block_manager, PartialBlockType partial_block_type, uint32_t max_partial_block_size, uint32_t max_use_count) - : block_manager(block_manager), checkpoint_type(checkpoint_type), max_partial_block_size(max_partial_block_size), - max_use_count(max_use_count) { + : block_manager(block_manager), partial_block_type(partial_block_type), + max_partial_block_size(max_partial_block_size), max_use_count(max_use_count) { } PartialBlockManager::~PartialBlockManager() { } @@ -54,7 +54,7 @@ PartialBlockAllocation PartialBlockManager::GetBlockAllocation(uint32_t segment_ //! there is! increase the reference count of this block allocation.partial_block->state.block_use_count += 1; allocation.state = allocation.partial_block->state; - if (checkpoint_type == CheckpointType::FULL_CHECKPOINT) { + if (partial_block_type == PartialBlockType::FULL_CHECKPOINT) { block_manager.IncreaseBlockReferenceCount(allocation.state.block_id); } } else { @@ -71,7 +71,7 @@ bool PartialBlockManager::HasBlockAllocation(uint32_t segment_size) { void PartialBlockManager::AllocateBlock(PartialBlockState &state, uint32_t segment_size) { D_ASSERT(segment_size <= Storage::BLOCK_SIZE); - if (checkpoint_type == CheckpointType::FULL_CHECKPOINT) { + if (partial_block_type == PartialBlockType::FULL_CHECKPOINT) { state.block_id = block_manager.GetFreeBlockId(); } else { state.block_id = INVALID_BLOCK; @@ -97,7 +97,7 @@ bool PartialBlockManager::GetPartialBlock(idx_t segment_size, unique_ptrstate; - D_ASSERT(checkpoint_type != CheckpointType::FULL_CHECKPOINT || state.block_id >= 0); + D_ASSERT(partial_block_type != PartialBlockType::FULL_CHECKPOINT || state.block_id >= 0); if (state.block_use_count < max_use_count) { auto unaligned_size = allocation.allocation_size + state.offset; auto new_size = AlignValue(unaligned_size); diff --git a/src/duckdb/src/storage/serialization/serialize_create_info.cpp b/src/duckdb/src/storage/serialization/serialize_create_info.cpp index 3196a1d1..29d9c06d 100644 --- a/src/duckdb/src/storage/serialization/serialize_create_info.cpp +++ b/src/duckdb/src/storage/serialization/serialize_create_info.cpp @@ -25,6 +25,10 @@ void CreateInfo::Serialize(Serializer &serializer) const { serializer.WriteProperty(105, "on_conflict", on_conflict); serializer.WritePropertyWithDefault(106, "sql", sql); serializer.WritePropertyWithDefault(107, "comment", comment, Value()); + serializer.WritePropertyWithDefault>(108, "tags", tags, unordered_map()); + if (serializer.ShouldSerialize(2)) { + serializer.WritePropertyWithDefault(109, "dependencies", dependencies, LogicalDependencyList()); + } } unique_ptr CreateInfo::Deserialize(Deserializer &deserializer) { @@ -36,6 +40,8 @@ unique_ptr CreateInfo::Deserialize(Deserializer &deserializer) { auto on_conflict = deserializer.ReadProperty(105, "on_conflict"); auto sql = deserializer.ReadPropertyWithDefault(106, "sql"); auto comment = deserializer.ReadPropertyWithDefault(107, "comment", Value()); + auto tags = deserializer.ReadPropertyWithDefault>(108, "tags", unordered_map()); + auto dependencies = deserializer.ReadPropertyWithDefault(109, "dependencies", LogicalDependencyList()); deserializer.Set(type); unique_ptr result; switch (type) { @@ -74,6 +80,8 @@ unique_ptr CreateInfo::Deserialize(Deserializer &deserializer) { result->on_conflict = on_conflict; result->sql = std::move(sql); result->comment = comment; + result->tags = std::move(tags); + result->dependencies = dependencies; return result; } diff --git a/src/duckdb/src/storage/serialization/serialize_dependency.cpp b/src/duckdb/src/storage/serialization/serialize_dependency.cpp new file mode 100644 index 00000000..b2c22375 --- /dev/null +++ b/src/duckdb/src/storage/serialization/serialize_dependency.cpp @@ -0,0 +1,49 @@ +//===----------------------------------------------------------------------===// +// This file is automatically generated by scripts/generate_serialization.py +// Do not edit this file manually, your changes will be overwritten +//===----------------------------------------------------------------------===// + +#include "duckdb/common/serializer/serializer.hpp" +#include "duckdb/common/serializer/deserializer.hpp" +#include "duckdb/catalog/dependency.hpp" +#include "duckdb/catalog/dependency_list.hpp" + +namespace duckdb { + +void CatalogEntryInfo::Serialize(Serializer &serializer) const { + serializer.WriteProperty(100, "type", type); + serializer.WritePropertyWithDefault(101, "schema", schema); + serializer.WritePropertyWithDefault(102, "name", name); +} + +CatalogEntryInfo CatalogEntryInfo::Deserialize(Deserializer &deserializer) { + CatalogEntryInfo result; + deserializer.ReadProperty(100, "type", result.type); + deserializer.ReadPropertyWithDefault(101, "schema", result.schema); + deserializer.ReadPropertyWithDefault(102, "name", result.name); + return result; +} + +void LogicalDependency::Serialize(Serializer &serializer) const { + serializer.WriteProperty(100, "entry", entry); + serializer.WritePropertyWithDefault(101, "catalog", catalog); +} + +LogicalDependency LogicalDependency::Deserialize(Deserializer &deserializer) { + LogicalDependency result; + deserializer.ReadProperty(100, "entry", result.entry); + deserializer.ReadPropertyWithDefault(101, "catalog", result.catalog); + return result; +} + +void LogicalDependencyList::Serialize(Serializer &serializer) const { + serializer.WriteProperty(100, "set", set); +} + +LogicalDependencyList LogicalDependencyList::Deserialize(Deserializer &deserializer) { + LogicalDependencyList result; + deserializer.ReadProperty(100, "set", result.set); + return result; +} + +} // namespace duckdb diff --git a/src/duckdb/src/storage/serialization/serialize_extension_install_info.cpp b/src/duckdb/src/storage/serialization/serialize_extension_install_info.cpp new file mode 100644 index 00000000..cd665551 --- /dev/null +++ b/src/duckdb/src/storage/serialization/serialize_extension_install_info.cpp @@ -0,0 +1,28 @@ +//===----------------------------------------------------------------------===// +// This file is automatically generated by scripts/generate_serialization.py +// Do not edit this file manually, your changes will be overwritten +//===----------------------------------------------------------------------===// + +#include "duckdb/common/serializer/serializer.hpp" +#include "duckdb/common/serializer/deserializer.hpp" +#include "duckdb/main/extension_install_info.hpp" + +namespace duckdb { + +void ExtensionInstallInfo::Serialize(Serializer &serializer) const { + serializer.WriteProperty(100, "mode", mode); + serializer.WritePropertyWithDefault(101, "full_path", full_path); + serializer.WritePropertyWithDefault(102, "repository_url", repository_url); + serializer.WritePropertyWithDefault(103, "version", version); +} + +unique_ptr ExtensionInstallInfo::Deserialize(Deserializer &deserializer) { + auto result = duckdb::unique_ptr(new ExtensionInstallInfo()); + deserializer.ReadProperty(100, "mode", result->mode); + deserializer.ReadPropertyWithDefault(101, "full_path", result->full_path); + deserializer.ReadPropertyWithDefault(102, "repository_url", result->repository_url); + deserializer.ReadPropertyWithDefault(103, "version", result->version); + return result; +} + +} // namespace duckdb diff --git a/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp b/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp index 0fec4cbe..055c4e77 100644 --- a/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +++ b/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp @@ -172,6 +172,9 @@ unique_ptr LogicalOperator::Deserialize(Deserializer &deseriali case LogicalOperatorType::LOGICAL_UPDATE: result = LogicalUpdate::Deserialize(deserializer); break; + case LogicalOperatorType::LOGICAL_VACUUM: + result = LogicalVacuum::Deserialize(deserializer); + break; case LogicalOperatorType::LOGICAL_WINDOW: result = LogicalWindow::Deserialize(deserializer); break; @@ -262,13 +265,13 @@ void LogicalColumnDataGet::Serialize(Serializer &serializer) const { LogicalOperator::Serialize(serializer); serializer.WritePropertyWithDefault(200, "table_index", table_index); serializer.WritePropertyWithDefault>(201, "chunk_types", chunk_types); - serializer.WritePropertyWithDefault>(202, "collection", collection); + serializer.WritePropertyWithDefault>(202, "collection", collection); } unique_ptr LogicalColumnDataGet::Deserialize(Deserializer &deserializer) { auto table_index = deserializer.ReadPropertyWithDefault(200, "table_index"); auto chunk_types = deserializer.ReadPropertyWithDefault>(201, "chunk_types"); - auto collection = deserializer.ReadPropertyWithDefault>(202, "collection"); + auto collection = deserializer.ReadPropertyWithDefault>(202, "collection"); auto result = duckdb::unique_ptr(new LogicalColumnDataGet(table_index, std::move(chunk_types), std::move(collection))); return std::move(result); } diff --git a/src/duckdb/src/storage/serialization/serialize_nodes.cpp b/src/duckdb/src/storage/serialization/serialize_nodes.cpp index 03afa0d5..2be54ebe 100644 --- a/src/duckdb/src/storage/serialization/serialize_nodes.cpp +++ b/src/duckdb/src/storage/serialization/serialize_nodes.cpp @@ -14,6 +14,8 @@ #include "duckdb/parser/expression/case_expression.hpp" #include "duckdb/planner/expression/bound_case_expression.hpp" #include "duckdb/parser/parsed_data/sample_options.hpp" +#include "duckdb/execution/reservoir_sample.hpp" +#include "duckdb/common/queue.hpp" #include "duckdb/parser/tableref/pivotref.hpp" #include "duckdb/planner/tableref/bound_pivotref.hpp" #include "duckdb/parser/column_definition.hpp" @@ -33,6 +35,52 @@ namespace duckdb { +void BlockingSample::Serialize(Serializer &serializer) const { + serializer.WritePropertyWithDefault>(100, "base_reservoir_sample", base_reservoir_sample); + serializer.WriteProperty(101, "type", type); + serializer.WritePropertyWithDefault(102, "destroyed", destroyed); +} + +unique_ptr BlockingSample::Deserialize(Deserializer &deserializer) { + auto base_reservoir_sample = deserializer.ReadPropertyWithDefault>(100, "base_reservoir_sample"); + auto type = deserializer.ReadProperty(101, "type"); + auto destroyed = deserializer.ReadPropertyWithDefault(102, "destroyed"); + unique_ptr result; + switch (type) { + case SampleType::RESERVOIR_PERCENTAGE_SAMPLE: + result = ReservoirSamplePercentage::Deserialize(deserializer); + break; + case SampleType::RESERVOIR_SAMPLE: + result = ReservoirSample::Deserialize(deserializer); + break; + default: + throw SerializationException("Unsupported type for deserialization of BlockingSample!"); + } + result->base_reservoir_sample = std::move(base_reservoir_sample); + result->destroyed = destroyed; + return result; +} + +void BaseReservoirSampling::Serialize(Serializer &serializer) const { + serializer.WritePropertyWithDefault(100, "next_index_to_sample", next_index_to_sample); + serializer.WriteProperty(101, "min_weight_threshold", min_weight_threshold); + serializer.WritePropertyWithDefault(102, "min_weighted_entry_index", min_weighted_entry_index); + serializer.WritePropertyWithDefault(103, "num_entries_to_skip_b4_next_sample", num_entries_to_skip_b4_next_sample); + serializer.WritePropertyWithDefault(104, "num_entries_seen_total", num_entries_seen_total); + serializer.WritePropertyWithDefault>>(105, "reservoir_weights", reservoir_weights); +} + +unique_ptr BaseReservoirSampling::Deserialize(Deserializer &deserializer) { + auto result = duckdb::unique_ptr(new BaseReservoirSampling()); + deserializer.ReadPropertyWithDefault(100, "next_index_to_sample", result->next_index_to_sample); + deserializer.ReadProperty(101, "min_weight_threshold", result->min_weight_threshold); + deserializer.ReadPropertyWithDefault(102, "min_weighted_entry_index", result->min_weighted_entry_index); + deserializer.ReadPropertyWithDefault(103, "num_entries_to_skip_b4_next_sample", result->num_entries_to_skip_b4_next_sample); + deserializer.ReadPropertyWithDefault(104, "num_entries_seen_total", result->num_entries_seen_total); + deserializer.ReadPropertyWithDefault>>(105, "reservoir_weights", result->reservoir_weights); + return result; +} + void BoundCaseCheck::Serialize(Serializer &serializer) const { serializer.WritePropertyWithDefault>(100, "when_expr", when_expr); serializer.WritePropertyWithDefault>(101, "then_expr", then_expr); @@ -222,6 +270,7 @@ void ColumnDefinition::Serialize(Serializer &serializer) const { serializer.WriteProperty(103, "category", category); serializer.WriteProperty(104, "compression_type", compression_type); serializer.WritePropertyWithDefault(105, "comment", comment, Value()); + serializer.WritePropertyWithDefault>(106, "tags", tags, unordered_map()); } ColumnDefinition ColumnDefinition::Deserialize(Deserializer &deserializer) { @@ -232,6 +281,7 @@ ColumnDefinition ColumnDefinition::Deserialize(Deserializer &deserializer) { ColumnDefinition result(std::move(name), std::move(type), std::move(expression), category); deserializer.ReadProperty(104, "compression_type", result.compression_type); deserializer.ReadPropertyWithDefault(105, "comment", result.comment, Value()); + deserializer.ReadPropertyWithDefault>(106, "tags", result.tags, unordered_map()); return result; } @@ -272,12 +322,12 @@ unique_ptr CommonTableExpressionInfo::Deserialize(Des } void CommonTableExpressionMap::Serialize(Serializer &serializer) const { - serializer.WritePropertyWithDefault>>(100, "map", map); + serializer.WritePropertyWithDefault>>(100, "map", map); } CommonTableExpressionMap CommonTableExpressionMap::Deserialize(Deserializer &deserializer) { CommonTableExpressionMap result; - deserializer.ReadPropertyWithDefault>>(100, "map", result.map); + deserializer.ReadPropertyWithDefault>>(100, "map", result.map); return result; } @@ -421,6 +471,32 @@ unique_ptr ReadCSVData::Deserialize(Deserializer &deserializer) { return result; } +void ReservoirSample::Serialize(Serializer &serializer) const { + BlockingSample::Serialize(serializer); + serializer.WritePropertyWithDefault(200, "sample_count", sample_count); + serializer.WritePropertyWithDefault>(201, "reservoir_chunk", reservoir_chunk); +} + +unique_ptr ReservoirSample::Deserialize(Deserializer &deserializer) { + auto sample_count = deserializer.ReadPropertyWithDefault(200, "sample_count"); + auto result = duckdb::unique_ptr(new ReservoirSample(sample_count)); + deserializer.ReadPropertyWithDefault>(201, "reservoir_chunk", result->reservoir_chunk); + return std::move(result); +} + +void ReservoirSamplePercentage::Serialize(Serializer &serializer) const { + BlockingSample::Serialize(serializer); + serializer.WriteProperty(200, "sample_percentage", sample_percentage); + serializer.WritePropertyWithDefault(201, "reservoir_sample_size", reservoir_sample_size); +} + +unique_ptr ReservoirSamplePercentage::Deserialize(Deserializer &deserializer) { + auto sample_percentage = deserializer.ReadProperty(200, "sample_percentage"); + auto result = duckdb::unique_ptr(new ReservoirSamplePercentage(sample_percentage)); + deserializer.ReadPropertyWithDefault(201, "reservoir_sample_size", result->reservoir_sample_size); + return std::move(result); +} + void SampleOptions::Serialize(Serializer &serializer) const { serializer.WriteProperty(100, "sample_size", sample_size); serializer.WritePropertyWithDefault(101, "is_percentage", is_percentage); diff --git a/src/duckdb/src/storage/serialization/serialize_parse_info.cpp b/src/duckdb/src/storage/serialization/serialize_parse_info.cpp index fbd3d32c..329f623a 100644 --- a/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +++ b/src/duckdb/src/storage/serialization/serialize_parse_info.cpp @@ -15,6 +15,7 @@ #include "duckdb/parser/parsed_data/detach_info.hpp" #include "duckdb/parser/parsed_data/drop_info.hpp" #include "duckdb/parser/parsed_data/load_info.hpp" +#include "duckdb/parser/parsed_data/update_extensions_info.hpp" #include "duckdb/parser/parsed_data/pragma_info.hpp" #include "duckdb/parser/parsed_data/transaction_info.hpp" #include "duckdb/parser/parsed_data/vacuum_info.hpp" @@ -56,6 +57,9 @@ unique_ptr ParseInfo::Deserialize(Deserializer &deserializer) { case ParseInfoType::TRANSACTION_INFO: result = TransactionInfo::Deserialize(deserializer); break; + case ParseInfoType::UPDATE_EXTENSIONS_INFO: + result = UpdateExtensionsInfo::Deserialize(deserializer); + break; case ParseInfoType::VACUUM_INFO: result = VacuumInfo::Deserialize(deserializer); break; @@ -256,6 +260,7 @@ void CopyInfo::Serialize(Serializer &serializer) const { serializer.WritePropertyWithDefault(205, "format", format); serializer.WritePropertyWithDefault(206, "file_path", file_path); serializer.WritePropertyWithDefault>>(207, "options", options); + serializer.WritePropertyWithDefault>(208, "select_statement", select_statement); } unique_ptr CopyInfo::Deserialize(Deserializer &deserializer) { @@ -268,6 +273,7 @@ unique_ptr CopyInfo::Deserialize(Deserializer &deserializer) { deserializer.ReadPropertyWithDefault(205, "format", result->format); deserializer.ReadPropertyWithDefault(206, "file_path", result->file_path); deserializer.ReadPropertyWithDefault>>(207, "options", result->options); + deserializer.ReadPropertyWithDefault>(208, "select_statement", result->select_statement); return std::move(result); } @@ -325,6 +331,8 @@ void LoadInfo::Serialize(Serializer &serializer) const { serializer.WritePropertyWithDefault(200, "filename", filename); serializer.WriteProperty(201, "load_type", load_type); serializer.WritePropertyWithDefault(202, "repository", repository); + serializer.WritePropertyWithDefault(203, "version", version); + serializer.WritePropertyWithDefault(204, "repo_is_alias", repo_is_alias); } unique_ptr LoadInfo::Deserialize(Deserializer &deserializer) { @@ -332,6 +340,8 @@ unique_ptr LoadInfo::Deserialize(Deserializer &deserializer) { deserializer.ReadPropertyWithDefault(200, "filename", result->filename); deserializer.ReadProperty(201, "load_type", result->load_type); deserializer.ReadPropertyWithDefault(202, "repository", result->repository); + deserializer.ReadPropertyWithDefault(203, "version", result->version); + deserializer.ReadPropertyWithDefault(204, "repo_is_alias", result->repo_is_alias); return std::move(result); } @@ -463,6 +473,17 @@ unique_ptr TransactionInfo::Deserialize(Deserializer &deserializer) { return std::move(result); } +void UpdateExtensionsInfo::Serialize(Serializer &serializer) const { + ParseInfo::Serialize(serializer); + serializer.WritePropertyWithDefault>(200, "extensions_to_update", extensions_to_update); +} + +unique_ptr UpdateExtensionsInfo::Deserialize(Deserializer &deserializer) { + auto result = duckdb::unique_ptr(new UpdateExtensionsInfo()); + deserializer.ReadPropertyWithDefault>(200, "extensions_to_update", result->extensions_to_update); + return std::move(result); +} + void VacuumInfo::Serialize(Serializer &serializer) const { ParseInfo::Serialize(serializer); serializer.WriteProperty(200, "options", options); diff --git a/src/duckdb/src/storage/serialization/serialize_tableref.cpp b/src/duckdb/src/storage/serialization/serialize_tableref.cpp index e97e8232..e59594cc 100644 --- a/src/duckdb/src/storage/serialization/serialize_tableref.cpp +++ b/src/duckdb/src/storage/serialization/serialize_tableref.cpp @@ -26,6 +26,9 @@ unique_ptr TableRef::Deserialize(Deserializer &deserializer) { case TableReferenceType::BASE_TABLE: result = BaseTableRef::Deserialize(deserializer); break; + case TableReferenceType::COLUMN_DATA: + result = ColumnDataRef::Deserialize(deserializer); + break; case TableReferenceType::EMPTY_FROM: result = EmptyTableRef::Deserialize(deserializer); break; @@ -73,6 +76,19 @@ unique_ptr BaseTableRef::Deserialize(Deserializer &deserializer) { return std::move(result); } +void ColumnDataRef::Serialize(Serializer &serializer) const { + TableRef::Serialize(serializer); + serializer.WritePropertyWithDefault>(200, "expected_names", expected_names); + serializer.WritePropertyWithDefault>(202, "collection", collection); +} + +unique_ptr ColumnDataRef::Deserialize(Deserializer &deserializer) { + auto expected_names = deserializer.ReadPropertyWithDefault>(200, "expected_names"); + auto collection = deserializer.ReadPropertyWithDefault>(202, "collection"); + auto result = duckdb::unique_ptr(new ColumnDataRef(std::move(expected_names), std::move(collection))); + return std::move(result); +} + void EmptyTableRef::Serialize(Serializer &serializer) const { TableRef::Serialize(serializer); } diff --git a/src/duckdb/src/storage/serialization/serialize_types.cpp b/src/duckdb/src/storage/serialization/serialize_types.cpp index 0b75f518..bd7f619b 100644 --- a/src/duckdb/src/storage/serialization/serialize_types.cpp +++ b/src/duckdb/src/storage/serialization/serialize_types.cpp @@ -12,11 +12,13 @@ namespace duckdb { void ExtraTypeInfo::Serialize(Serializer &serializer) const { serializer.WriteProperty(100, "type", type); serializer.WritePropertyWithDefault(101, "alias", alias); + serializer.WritePropertyWithDefault>(102, "modifiers", modifiers, vector()); } shared_ptr ExtraTypeInfo::Deserialize(Deserializer &deserializer) { auto type = deserializer.ReadProperty(100, "type"); auto alias = deserializer.ReadPropertyWithDefault(101, "alias"); + auto modifiers = deserializer.ReadPropertyWithDefault>(102, "modifiers", vector()); shared_ptr result; switch (type) { case ExtraTypeInfoType::AGGREGATE_STATE_TYPE_INFO: @@ -35,7 +37,7 @@ shared_ptr ExtraTypeInfo::Deserialize(Deserializer &deserializer) result = EnumTypeInfo::Deserialize(deserializer); break; case ExtraTypeInfoType::GENERIC_TYPE_INFO: - result = make_shared(type); + result = make_shared_ptr(type); break; case ExtraTypeInfoType::INTEGER_LITERAL_TYPE_INFO: result = IntegerLiteralTypeInfo::Deserialize(deserializer); @@ -58,6 +60,7 @@ shared_ptr ExtraTypeInfo::Deserialize(Deserializer &deserializer) throw SerializationException("Unsupported type for deserialization of ExtraTypeInfo!"); } result->alias = std::move(alias); + result->modifiers = std::move(modifiers); return result; } @@ -164,6 +167,7 @@ void UserTypeInfo::Serialize(Serializer &serializer) const { serializer.WritePropertyWithDefault(200, "user_type_name", user_type_name); serializer.WritePropertyWithDefault(201, "catalog", catalog, string()); serializer.WritePropertyWithDefault(202, "schema", schema, string()); + serializer.WritePropertyWithDefault>(203, "user_type_modifiers", user_type_modifiers, vector()); } shared_ptr UserTypeInfo::Deserialize(Deserializer &deserializer) { @@ -171,6 +175,7 @@ shared_ptr UserTypeInfo::Deserialize(Deserializer &deserializer) deserializer.ReadPropertyWithDefault(200, "user_type_name", result->user_type_name); deserializer.ReadPropertyWithDefault(201, "catalog", result->catalog, string()); deserializer.ReadPropertyWithDefault(202, "schema", result->schema, string()); + deserializer.ReadPropertyWithDefault>(203, "user_type_modifiers", result->user_type_modifiers, vector()); return std::move(result); } diff --git a/src/duckdb/src/storage/single_file_block_manager.cpp b/src/duckdb/src/storage/single_file_block_manager.cpp index b46f4f92..82d7cece 100644 --- a/src/duckdb/src/storage/single_file_block_manager.cpp +++ b/src/duckdb/src/storage/single_file_block_manager.cpp @@ -62,7 +62,7 @@ MainHeader MainHeader::Read(ReadStream &source) { if (header.version_number != VERSION_NUMBER) { auto version = GetDuckDBVersion(header.version_number); string version_text; - if (version) { + if (!version.empty()) { // known version version_text = "DuckDB version " + string(version); } else { @@ -195,8 +195,8 @@ void SingleFileBlockManager::CreateNewDatabase() { DatabaseHeader h1; // header 1 h1.iteration = 0; - h1.meta_block = INVALID_BLOCK; - h1.free_list = INVALID_BLOCK; + h1.meta_block = idx_t(INVALID_BLOCK); + h1.free_list = idx_t(INVALID_BLOCK); h1.block_count = 0; h1.block_size = Storage::BLOCK_ALLOC_SIZE; h1.vector_size = STANDARD_VECTOR_SIZE; @@ -205,8 +205,8 @@ void SingleFileBlockManager::CreateNewDatabase() { // header 2 DatabaseHeader h2; h2.iteration = 0; - h2.meta_block = INVALID_BLOCK; - h2.free_list = INVALID_BLOCK; + h2.meta_block = idx_t(INVALID_BLOCK); + h2.free_list = idx_t(INVALID_BLOCK); h2.block_count = 0; h2.block_size = Storage::BLOCK_ALLOC_SIZE; h2.vector_size = STANDARD_VECTOR_SIZE; @@ -228,7 +228,7 @@ void SingleFileBlockManager::LoadExistingDatabase() { handle = fs.OpenFile(path, flags); if (!handle) { // this can only happen in read-only mode - as that is when we set FILE_FLAGS_NULL_IF_NOT_EXISTS - throw CatalogException("Cannot open database \"%s\" in read-only mode: database does not exist", path); + throw IOException("Cannot open database \"%s\" in read-only mode: database does not exist", path); } MainHeader::CheckMagicBytes(*handle); @@ -266,8 +266,9 @@ void SingleFileBlockManager::ReadAndChecksum(FileBuffer &block, uint64_t locatio // verify the checksum if (stored_checksum != computed_checksum) { - throw IOException("Corrupt database file: computed checksum %llu does not match stored checksum %llu in block", - computed_checksum, stored_checksum); + throw IOException("Corrupt database file: computed checksum %llu does not match stored checksum %llu in block " + "at location %llu", + computed_checksum, stored_checksum, location); } } @@ -283,7 +284,7 @@ void SingleFileBlockManager::Initialize(DatabaseHeader &header) { free_list_id = header.free_list; meta_block = header.meta_block; iteration_count = header.iteration; - max_block = header.block_count; + max_block = NumericCast(header.block_count); } void SingleFileBlockManager::LoadFreeList() { @@ -386,7 +387,7 @@ idx_t SingleFileBlockManager::GetMetaBlock() { idx_t SingleFileBlockManager::TotalBlocks() { lock_guard lock(block_lock); - return max_block; + return NumericCast(max_block); } idx_t SingleFileBlockManager::FreeBlocks() { @@ -413,12 +414,12 @@ unique_ptr SingleFileBlockManager::CreateBlock(block_id_t block_id, FileB void SingleFileBlockManager::Read(Block &block) { D_ASSERT(block.id >= 0); D_ASSERT(std::find(free_list.begin(), free_list.end(), block.id) == free_list.end()); - ReadAndChecksum(block, BLOCK_START + block.id * Storage::BLOCK_ALLOC_SIZE); + ReadAndChecksum(block, BLOCK_START + NumericCast(block.id) * Storage::BLOCK_ALLOC_SIZE); } void SingleFileBlockManager::Write(FileBuffer &buffer, block_id_t block_id) { D_ASSERT(block_id >= 0); - ChecksumAndWrite(buffer, BLOCK_START + block_id * Storage::BLOCK_ALLOC_SIZE); + ChecksumAndWrite(buffer, BLOCK_START + NumericCast(block_id) * Storage::BLOCK_ALLOC_SIZE); } void SingleFileBlockManager::Truncate() { @@ -440,7 +441,7 @@ void SingleFileBlockManager::Truncate() { // truncate the file free_list.erase(free_list.lower_bound(max_block), free_list.end()); newly_freed_list.erase(newly_freed_list.lower_bound(max_block), newly_freed_list.end()); - handle->Truncate(BLOCK_START + max_block * Storage::BLOCK_ALLOC_SIZE); + handle->Truncate(NumericCast(BLOCK_START + NumericCast(max_block) * Storage::BLOCK_ALLOC_SIZE)); } vector SingleFileBlockManager::GetFreeListBlocks() { @@ -488,15 +489,17 @@ class FreeListBlockWriter : public MetadataWriter { }; void SingleFileBlockManager::WriteHeader(DatabaseHeader header) { - // set the iteration count - header.iteration = ++iteration_count; - auto free_list_blocks = GetFreeListBlocks(); // now handle the free list auto &metadata_manager = GetMetadataManager(); // add all modified blocks to the free list: they can now be written to again metadata_manager.MarkBlocksAsModified(); + + lock_guard lock(block_lock); + // set the iteration count + header.iteration = ++iteration_count; + for (auto &block : modified_blocks) { free_list.insert(block); newly_freed_list.insert(block); @@ -529,7 +532,7 @@ void SingleFileBlockManager::WriteHeader(DatabaseHeader header) { header.free_list = DConstants::INVALID_INDEX; } metadata_manager.Flush(); - header.block_count = max_block; + header.block_count = NumericCast(max_block); auto &config = DBConfig::Get(db); if (config.options.checkpoint_abort == CheckpointAbort::DEBUG_ABORT_AFTER_FREE_LIST_WRITE) { @@ -569,8 +572,8 @@ void SingleFileBlockManager::TrimFreeBlocks() { // We are now one too far. --itr; // Trim the range. - handle->Trim(BLOCK_START + (first * Storage::BLOCK_ALLOC_SIZE), - (last + 1 - first) * Storage::BLOCK_ALLOC_SIZE); + handle->Trim(BLOCK_START + (NumericCast(first) * Storage::BLOCK_ALLOC_SIZE), + NumericCast(last + 1 - first) * Storage::BLOCK_ALLOC_SIZE); } } newly_freed_list.clear(); diff --git a/src/duckdb/src/storage/standard_buffer_manager.cpp b/src/duckdb/src/storage/standard_buffer_manager.cpp index 5b801134..43ee2cb0 100644 --- a/src/duckdb/src/storage/standard_buffer_manager.cpp +++ b/src/duckdb/src/storage/standard_buffer_manager.cpp @@ -42,16 +42,18 @@ unique_ptr StandardBufferManager::ConstructManagedBuffer(idx_t size, } void StandardBufferManager::SetTemporaryDirectory(const string &new_dir) { - if (temp_directory_handle) { + lock_guard guard(temporary_directory.lock); + if (temporary_directory.handle) { throw NotImplementedException("Cannot switch temporary directory after the current one has been used"); } - this->temp_directory = new_dir; + temporary_directory.path = new_dir; } StandardBufferManager::StandardBufferManager(DatabaseInstance &db, string tmp) - : BufferManager(), db(db), buffer_pool(db.GetBufferPool()), temp_directory(std::move(tmp)), - temporary_id(MAXIMUM_BLOCK), buffer_allocator(BufferAllocatorAllocate, BufferAllocatorFree, - BufferAllocatorRealloc, make_uniq(*this)) { + : BufferManager(), db(db), buffer_pool(db.GetBufferPool()), temporary_id(MAXIMUM_BLOCK), + buffer_allocator(BufferAllocatorAllocate, BufferAllocatorFree, BufferAllocatorRealloc, + make_uniq(*this)) { + temporary_directory.path = std::move(tmp); temp_block_manager = make_uniq(*this); for (idx_t i = 0; i < MEMORY_TAG_COUNT; i++) { evicted_data_per_tag[i] = 0; @@ -76,6 +78,22 @@ idx_t StandardBufferManager::GetMaxMemory() const { return buffer_pool.GetMaxMemory(); } +idx_t StandardBufferManager::GetUsedSwap() { + lock_guard guard(temporary_directory.lock); + if (!temporary_directory.handle) { + return 0; + } + return temporary_directory.handle->GetTempFile().GetTotalUsedSpaceInBytes(); +} + +optional_idx StandardBufferManager::GetMaxSwap() const { + lock_guard guard(temporary_directory.lock); + if (!temporary_directory.handle) { + return optional_idx(); + } + return temporary_directory.handle->GetTempFile().GetMaxSwapSpace(); +} + template TempBufferPoolReservation StandardBufferManager::EvictBlocksOrThrow(MemoryTag tag, idx_t memory_delta, unique_ptr *buffer, ARGS... args) { @@ -98,8 +116,8 @@ shared_ptr StandardBufferManager::RegisterSmallMemory(idx_t block_s auto buffer = ConstructManagedBuffer(block_size, nullptr, FileBufferType::TINY_BUFFER); // create a new block pointer for this block - auto result = make_shared(*temp_block_manager, ++temporary_id, MemoryTag::BASE_TABLE, - std::move(buffer), false, block_size, std::move(reservation)); + auto result = make_shared_ptr(*temp_block_manager, ++temporary_id, MemoryTag::BASE_TABLE, + std::move(buffer), false, block_size, std::move(reservation)); #ifdef DUCKDB_DEBUG_DESTROY_BLOCKS // Initialize the memory with garbage data WriteGarbageIntoBuffer(*result->buffer); @@ -118,8 +136,8 @@ shared_ptr StandardBufferManager::RegisterMemory(MemoryTag tag, idx auto buffer = ConstructManagedBuffer(block_size, std::move(reusable_buffer)); // create a new block pointer for this block - return make_shared(*temp_block_manager, ++temporary_id, tag, std::move(buffer), can_destroy, - alloc_size, std::move(res)); + return make_shared_ptr(*temp_block_manager, ++temporary_id, tag, std::move(buffer), can_destroy, + alloc_size, std::move(res)); } BufferHandle StandardBufferManager::Allocate(MemoryTag tag, idx_t block_size, bool can_destroy, @@ -142,7 +160,7 @@ void StandardBufferManager::ReAllocate(shared_ptr &handle, idx_t bl D_ASSERT(handle->memory_usage == handle->memory_charge.size); auto req = handle->buffer->CalculateMemory(block_size); - int64_t memory_delta = NumericCast(req.alloc_size) - handle->memory_usage; + int64_t memory_delta = NumericCast(req.alloc_size) - NumericCast(handle->memory_usage); if (memory_delta == 0) { return; @@ -150,10 +168,10 @@ void StandardBufferManager::ReAllocate(shared_ptr &handle, idx_t bl // evict blocks until we have space to resize this block // unlock the handle lock during the call to EvictBlocksOrThrow lock.unlock(); - auto reservation = - EvictBlocksOrThrow(handle->tag, memory_delta, nullptr, "failed to resize block from %s to %s%s", - StringUtil::BytesToHumanReadableString(handle->memory_usage), - StringUtil::BytesToHumanReadableString(req.alloc_size)); + auto reservation = EvictBlocksOrThrow(handle->tag, NumericCast(memory_delta), nullptr, + "failed to resize block from %s to %s%s", + StringUtil::BytesToHumanReadableString(handle->memory_usage), + StringUtil::BytesToHumanReadableString(req.alloc_size)); lock.lock(); // EvictBlocks decrements 'current_memory' for us. @@ -199,10 +217,10 @@ BufferHandle StandardBufferManager::Pin(shared_ptr &handle) { auto buf = handle->Load(handle, std::move(reusable_buffer)); handle->memory_charge = std::move(reservation); // In the case of a variable sized block, the buffer may be smaller than a full block. - int64_t delta = handle->buffer->AllocSize() - handle->memory_usage; + int64_t delta = NumericCast(handle->buffer->AllocSize()) - NumericCast(handle->memory_usage); if (delta) { D_ASSERT(delta < 0); - handle->memory_usage += delta; + handle->memory_usage += NumericCast(delta); handle->memory_charge.Resize(handle->memory_usage); } D_ASSERT(handle->memory_usage == handle->buffer->AllocSize()); @@ -248,10 +266,19 @@ void StandardBufferManager::Unpin(shared_ptr &handle) { } } -void StandardBufferManager::SetLimit(idx_t limit) { +void StandardBufferManager::SetMemoryLimit(idx_t limit) { buffer_pool.SetLimit(limit, InMemoryWarning()); } +void StandardBufferManager::SetSwapLimit(optional_idx limit) { + lock_guard guard(temporary_directory.lock); + if (temporary_directory.handle) { + temporary_directory.handle->GetTempFile().SetMaxSwapSpace(limit); + } else { + temporary_directory.maximum_swap_space = limit; + } +} + vector StandardBufferManager::GetMemoryUsageInfo() const { vector result; for (idx_t k = 0; k < MEMORY_TAG_COUNT; k++) { @@ -275,19 +302,20 @@ unique_ptr StandardBufferManager::ReadTemporaryBufferInternal(Buffer string StandardBufferManager::GetTemporaryPath(block_id_t id) { auto &fs = FileSystem::GetFileSystem(db); - return fs.JoinPath(temp_directory, "duckdb_temp_block-" + to_string(id) + ".block"); + return fs.JoinPath(temporary_directory.path, "duckdb_temp_block-" + to_string(id) + ".block"); } void StandardBufferManager::RequireTemporaryDirectory() { - if (temp_directory.empty()) { + if (temporary_directory.path.empty()) { throw InvalidInputException( "Out-of-memory: cannot write buffer because no temporary directory is specified!\nTo enable " "temporary buffer eviction set a temporary directory using PRAGMA temp_directory='/path/to/tmp.tmp'"); } - lock_guard temp_handle_guard(temp_handle_lock); - if (!temp_directory_handle) { + lock_guard guard(temporary_directory.lock); + if (!temporary_directory.handle) { // temp directory has not been created yet: initialize it - temp_directory_handle = make_uniq(db, temp_directory); + temporary_directory.handle = + make_uniq(db, temporary_directory.path, temporary_directory.maximum_swap_space); } } @@ -295,7 +323,7 @@ void StandardBufferManager::WriteTemporaryBuffer(MemoryTag tag, block_id_t block RequireTemporaryDirectory(); if (buffer.size == Storage::BLOCK_SIZE) { evicted_data_per_tag[uint8_t(tag)] += Storage::BLOCK_SIZE; - temp_directory_handle->GetTempFile().WriteTemporaryBuffer(block_id, buffer); + temporary_directory.handle->GetTempFile().WriteTemporaryBuffer(block_id, buffer); return; } evicted_data_per_tag[uint8_t(tag)] += buffer.size; @@ -311,11 +339,11 @@ void StandardBufferManager::WriteTemporaryBuffer(MemoryTag tag, block_id_t block unique_ptr StandardBufferManager::ReadTemporaryBuffer(MemoryTag tag, block_id_t id, unique_ptr reusable_buffer) { - D_ASSERT(!temp_directory.empty()); - D_ASSERT(temp_directory_handle.get()); - if (temp_directory_handle->GetTempFile().HasTemporaryBuffer(id)) { + D_ASSERT(!temporary_directory.path.empty()); + D_ASSERT(temporary_directory.handle.get()); + if (temporary_directory.handle->GetTempFile().HasTemporaryBuffer(id)) { evicted_data_per_tag[uint8_t(tag)] -= Storage::BLOCK_SIZE; - return temp_directory_handle->GetTempFile().ReadTemporaryBuffer(id, std::move(reusable_buffer)); + return temporary_directory.handle->GetTempFile().ReadTemporaryBuffer(id, std::move(reusable_buffer)); } idx_t block_size; // open the temporary file and read the size @@ -334,20 +362,20 @@ unique_ptr StandardBufferManager::ReadTemporaryBuffer(MemoryTag tag, } void StandardBufferManager::DeleteTemporaryFile(block_id_t id) { - if (temp_directory.empty()) { + if (temporary_directory.path.empty()) { // no temporary directory specified: nothing to delete return; } { - lock_guard temp_handle_guard(temp_handle_lock); - if (!temp_directory_handle) { + lock_guard guard(temporary_directory.lock); + if (!temporary_directory.handle) { // temporary directory was not initialized yet: nothing to delete return; } } // check if we should delete the file from the shared pool of files, or from the general file system - if (temp_directory_handle->GetTempFile().HasTemporaryBuffer(id)) { - temp_directory_handle->GetTempFile().DeleteTemporaryBuffer(id); + if (temporary_directory.handle->GetTempFile().HasTemporaryBuffer(id)) { + temporary_directory.handle->GetTempFile().DeleteTemporaryBuffer(id); return; } auto &fs = FileSystem::GetFileSystem(db); @@ -358,22 +386,22 @@ void StandardBufferManager::DeleteTemporaryFile(block_id_t id) { } bool StandardBufferManager::HasTemporaryDirectory() const { - return !temp_directory.empty(); + return !temporary_directory.path.empty(); } vector StandardBufferManager::GetTemporaryFiles() { vector result; - if (temp_directory.empty()) { + if (temporary_directory.path.empty()) { return result; } { - lock_guard temp_handle_guard(temp_handle_lock); - if (temp_directory_handle) { - result = temp_directory_handle->GetTempFile().GetTemporaryFiles(); + lock_guard temp_handle_guard(temporary_directory.lock); + if (temporary_directory.handle) { + result = temporary_directory.handle->GetTempFile().GetTemporaryFiles(); } } auto &fs = FileSystem::GetFileSystem(db); - fs.ListFiles(temp_directory, [&](const string &name, bool is_dir) { + fs.ListFiles(temporary_directory.path, [&](const string &name, bool is_dir) { if (is_dir) { return; } @@ -383,7 +411,7 @@ vector StandardBufferManager::GetTemporaryFiles() { TemporaryFileInformation info; info.path = name; auto handle = fs.OpenFile(name, FileFlags::FILE_FLAGS_READ); - info.size = fs.GetFileSize(*handle); + info.size = NumericCast(fs.GetFileSize(*handle)); handle.reset(); result.push_back(info); }); @@ -391,7 +419,7 @@ vector StandardBufferManager::GetTemporaryFiles() { } const char *StandardBufferManager::InMemoryWarning() { - if (!temp_directory.empty()) { + if (!temporary_directory.path.empty()) { return ""; } return "\nDatabase is launched in in-memory mode and no temporary directory is specified." diff --git a/src/duckdb/src/storage/statistics/column_statistics.cpp b/src/duckdb/src/storage/statistics/column_statistics.cpp index e2c2b45b..8b3ac243 100644 --- a/src/duckdb/src/storage/statistics/column_statistics.cpp +++ b/src/duckdb/src/storage/statistics/column_statistics.cpp @@ -14,7 +14,7 @@ ColumnStatistics::ColumnStatistics(BaseStatistics stats_p, unique_ptr ColumnStatistics::CreateEmptyStats(const LogicalType &type) { - return make_shared(BaseStatistics::CreateEmpty(type)); + return make_shared_ptr(BaseStatistics::CreateEmpty(type)); } void ColumnStatistics::Merge(ColumnStatistics &other) { @@ -53,7 +53,7 @@ void ColumnStatistics::UpdateDistinctStatistics(Vector &v, idx_t count) { } shared_ptr ColumnStatistics::Copy() const { - return make_shared(stats.Copy(), distinct_stats ? distinct_stats->Copy() : nullptr); + return make_shared_ptr(stats.Copy(), distinct_stats ? distinct_stats->Copy() : nullptr); } void ColumnStatistics::Serialize(Serializer &serializer) const { @@ -65,7 +65,7 @@ shared_ptr ColumnStatistics::Deserialize(Deserializer &deseria auto stats = deserializer.ReadProperty(100, "statistics"); auto distinct_stats = deserializer.ReadPropertyWithDefault>( 101, "distinct", unique_ptr()); - return make_shared(std::move(stats), std::move(distinct_stats)); + return make_shared_ptr(std::move(stats), std::move(distinct_stats)); } } // namespace duckdb diff --git a/src/duckdb/src/storage/statistics/distinct_statistics.cpp b/src/duckdb/src/storage/statistics/distinct_statistics.cpp index 7d4e6e92..69f53307 100644 --- a/src/duckdb/src/storage/statistics/distinct_statistics.cpp +++ b/src/duckdb/src/storage/statistics/distinct_statistics.cpp @@ -64,7 +64,7 @@ idx_t DistinctStatistics::GetCount() const { double u1 = pow(u / s, 2) * u; // Estimate total uniques using Good Turing Estimation - idx_t estimate = u + u1 / s * (n - s); + idx_t estimate = NumericCast(u + u1 / s * (n - s)); return MinValue(estimate, total_count); } diff --git a/src/duckdb/src/storage/storage_info.cpp b/src/duckdb/src/storage/storage_info.cpp index a8fd657b..1adf8e67 100644 --- a/src/duckdb/src/storage/storage_info.cpp +++ b/src/duckdb/src/storage/storage_info.cpp @@ -1,4 +1,5 @@ #include "duckdb/storage/storage_info.hpp" +#include "duckdb/common/optional_idx.hpp" namespace duckdb { @@ -9,33 +10,76 @@ struct StorageVersionInfo { idx_t storage_version; }; -static const StorageVersionInfo storage_version_info[] = {{"v0.9.0, v0.9.1, v0.9.2 or v0.10.0", 64}, - {"v0.8.0 or v0.8.1", 51}, - {"v0.7.0 or v0.7.1", 43}, - {"v0.6.0 or v0.6.1", 39}, - {"v0.5.0 or v0.5.1", 38}, - {"v0.3.3, v0.3.4 or v0.4.0", 33}, - {"v0.3.2", 31}, - {"v0.3.1", 27}, - {"v0.3.0", 25}, - {"v0.2.9", 21}, - {"v0.2.8", 18}, - {"v0.2.7", 17}, - {"v0.2.6", 15}, - {"v0.2.5", 13}, - {"v0.2.4", 11}, - {"v0.2.3", 6}, - {"v0.2.2", 4}, - {"v0.2.1 and prior", 1}, - {nullptr, 0}}; - -const char *GetDuckDBVersion(idx_t version_number) { +struct SerializationVersionInfo { + const char *version_name; + idx_t serialization_version; +}; + +// These sections are automatically generated by scripts/generate_storage_info.py +// Do not edit them manually, your changes will be overwritten + +// START OF STORAGE VERSION INFO +static const StorageVersionInfo storage_version_info[] = { + {"v0.0.4", 1}, {"v0.1.0", 1}, {"v0.1.1", 1}, {"v0.1.2", 1}, {"v0.1.3", 1}, {"v0.1.4", 1}, {"v0.1.5", 1}, + {"v0.1.6", 1}, {"v0.1.7", 1}, {"v0.1.8", 1}, {"v0.1.9", 1}, {"v0.2.0", 1}, {"v0.2.1", 1}, {"v0.2.2", 4}, + {"v0.2.3", 6}, {"v0.2.4", 11}, {"v0.2.5", 13}, {"v0.2.6", 15}, {"v0.2.7", 17}, {"v0.2.8", 18}, {"v0.2.9", 21}, + {"v0.3.0", 25}, {"v0.3.1", 27}, {"v0.3.2", 31}, {"v0.3.3", 33}, {"v0.3.4", 33}, {"v0.3.5", 33}, {"v0.4.0", 33}, + {"v0.5.0", 38}, {"v0.5.1", 38}, {"v0.6.0", 39}, {"v0.6.1", 39}, {"v0.7.0", 43}, {"v0.7.1", 43}, {"v0.8.0", 51}, + {"v0.8.1", 51}, {"v0.9.0", 64}, {"v0.9.1", 64}, {"v0.9.2", 64}, {"v0.10.0", 64}, {"v0.10.1", 64}, {"v0.10.2", 64}, + {nullptr, 0}}; +// END OF STORAGE VERSION INFO + +// START OF SERIALIZATION VERSION INFO +static const SerializationVersionInfo serialization_version_info[] = { + {"v0.10.0", 1}, {"v0.10.1", 1}, {"v0.10.2", 1}, {"latest", 2}, {nullptr, 0}}; +// END OF SERIALIZATION VERSION INFO + +optional_idx GetStorageVersion(const char *version_string) { + for (idx_t i = 0; storage_version_info[i].version_name; i++) { + if (!strcmp(storage_version_info[i].version_name, version_string)) { + return storage_version_info[i].storage_version; + } + } + return optional_idx(); +} + +optional_idx GetSerializationVersion(const char *version_string) { + for (idx_t i = 0; serialization_version_info[i].version_name; i++) { + if (!strcmp(serialization_version_info[i].version_name, version_string)) { + return serialization_version_info[i].serialization_version; + } + } + return optional_idx(); +} + +vector GetSerializationCandidates() { + vector candidates; + for (idx_t i = 0; serialization_version_info[i].version_name; i++) { + candidates.push_back(serialization_version_info[i].version_name); + } + return candidates; +} + +string GetDuckDBVersion(idx_t version_number) { + vector versions; for (idx_t i = 0; storage_version_info[i].version_name; i++) { if (version_number == storage_version_info[i].storage_version) { - return storage_version_info[i].version_name; + versions.push_back(string(storage_version_info[i].version_name)); + } + } + if (versions.empty()) { + return string(); + } + string result; + for (idx_t i = 0; i < versions.size(); i++) { + string sep = ""; + if (i) { + sep = i + 1 == versions.size() ? " or " : ", "; } + result += sep; + result += versions[i]; } - return nullptr; + return result; } } // namespace duckdb diff --git a/src/duckdb/src/storage/storage_lock.cpp b/src/duckdb/src/storage/storage_lock.cpp index 1b7b1577..9b7cafb8 100644 --- a/src/duckdb/src/storage/storage_lock.cpp +++ b/src/duckdb/src/storage/storage_lock.cpp @@ -4,41 +4,101 @@ namespace duckdb { -StorageLockKey::StorageLockKey(StorageLock &lock, StorageLockType type) : lock(lock), type(type) { +struct StorageLockInternals : enable_shared_from_this { +public: + StorageLockInternals() : read_count(0) { + } + + mutex exclusive_lock; + atomic read_count; + +public: + unique_ptr GetExclusiveLock() { + exclusive_lock.lock(); + while (read_count != 0) { + } + return make_uniq(shared_from_this(), StorageLockType::EXCLUSIVE); + } + + unique_ptr GetSharedLock() { + exclusive_lock.lock(); + read_count++; + exclusive_lock.unlock(); + return make_uniq(shared_from_this(), StorageLockType::SHARED); + } + + unique_ptr TryGetExclusiveLock() { + if (!exclusive_lock.try_lock()) { + // could not lock mutex + return nullptr; + } + if (read_count != 0) { + // there are active readers - cannot get exclusive lock + exclusive_lock.unlock(); + return nullptr; + } + // success! + return make_uniq(shared_from_this(), StorageLockType::EXCLUSIVE); + } + + unique_ptr TryUpgradeCheckpointLock(StorageLockKey &lock) { + if (lock.GetType() != StorageLockType::SHARED) { + throw InternalException("StorageLock::TryUpgradeLock called on an exclusive lock"); + } + if (!exclusive_lock.try_lock()) { + // could not lock mutex + return nullptr; + } + if (read_count != 1) { + // other shared locks are active: failed to upgrade + D_ASSERT(read_count != 0); + exclusive_lock.unlock(); + return nullptr; + } + // no other shared locks active: success! + return make_uniq(shared_from_this(), StorageLockType::EXCLUSIVE); + } + + void ReleaseExclusiveLock() { + exclusive_lock.unlock(); + } + void ReleaseSharedLock() { + read_count--; + } +}; + +StorageLockKey::StorageLockKey(shared_ptr internals_p, StorageLockType type) + : internals(std::move(internals_p)), type(type) { } StorageLockKey::~StorageLockKey() { if (type == StorageLockType::EXCLUSIVE) { - lock.ReleaseExclusiveLock(); + internals->ReleaseExclusiveLock(); } else { D_ASSERT(type == StorageLockType::SHARED); - lock.ReleaseSharedLock(); + internals->ReleaseSharedLock(); } } -StorageLock::StorageLock() : read_count(0) { +StorageLock::StorageLock() : internals(make_shared_ptr()) { +} +StorageLock::~StorageLock() { } unique_ptr StorageLock::GetExclusiveLock() { - exclusive_lock.lock(); - while (read_count != 0) { - } - return make_uniq(*this, StorageLockType::EXCLUSIVE); + return internals->GetExclusiveLock(); } -unique_ptr StorageLock::GetSharedLock() { - exclusive_lock.lock(); - read_count++; - exclusive_lock.unlock(); - return make_uniq(*this, StorageLockType::SHARED); +unique_ptr StorageLock::TryGetExclusiveLock() { + return internals->TryGetExclusiveLock(); } -void StorageLock::ReleaseExclusiveLock() { - exclusive_lock.unlock(); +unique_ptr StorageLock::GetSharedLock() { + return internals->GetSharedLock(); } -void StorageLock::ReleaseSharedLock() { - read_count--; +unique_ptr StorageLock::TryUpgradeCheckpointLock(StorageLockKey &lock) { + return internals->TryUpgradeCheckpointLock(lock); } } // namespace duckdb diff --git a/src/duckdb/src/storage/storage_manager.cpp b/src/duckdb/src/storage/storage_manager.cpp index 072584d7..903cc9fb 100644 --- a/src/duckdb/src/storage/storage_manager.cpp +++ b/src/duckdb/src/storage/storage_manager.cpp @@ -56,20 +56,42 @@ bool ObjectCache::ObjectCacheEnabled(ClientContext &context) { return context.db->config.options.object_cache_enable; } -optional_ptr StorageManager::GetWriteAheadLog() { +int64_t StorageManager::GetWALSize() { + if (!wal && !GetWAL()) { + return 0; + } + if (!wal->Initialized()) { + D_ASSERT(!FileSystem::Get(db).FileExists(GetWALPath())); + return 0; + } + return wal->GetWriter().GetFileSize(); +} + +optional_ptr StorageManager::GetWAL() { if (InMemory() || read_only || !load_complete) { return nullptr; } - if (wal) { - return wal.get(); - } + if (!wal) { + auto wal_path = GetWALPath(); + wal = make_uniq(db, wal_path); - // lazy WAL creation - wal = make_uniq(db, GetWALPath()); + // If the WAL file exists, then we initialize it. + if (FileSystem::Get(db).FileExists(wal_path)) { + wal->Initialize(); + } + } return wal.get(); } +void StorageManager::ResetWAL() { + auto wal_ptr = GetWAL(); + if (wal_ptr) { + wal_ptr->Delete(); + } + wal.reset(); +} + string StorageManager::GetWALPath() { std::size_t question_mark_pos = path.find('?'); @@ -87,14 +109,14 @@ bool StorageManager::InMemory() { return path == IN_MEMORY_PATH; } -void StorageManager::Initialize(optional_ptr context) { +void StorageManager::Initialize() { bool in_memory = InMemory(); if (in_memory && read_only) { throw CatalogException("Cannot launch in-memory database in read-only mode!"); } // create or load the database from disk, if not in-memory mode - LoadDatabase(context); + LoadDatabase(); } /////////////////////////////////////////////////////////////////////////// @@ -121,7 +143,7 @@ SingleFileStorageManager::SingleFileStorageManager(AttachedDatabase &db, string : StorageManager(db, std::move(path), read_only) { } -void SingleFileStorageManager::LoadDatabase(optional_ptr context) { +void SingleFileStorageManager::LoadDatabase() { if (InMemory()) { block_manager = make_uniq(BufferManager::GetBufferManager(db)); table_io_manager = make_uniq(*block_manager); @@ -171,7 +193,7 @@ void SingleFileStorageManager::LoadDatabase(optional_ptr context) // load the db from storage auto checkpoint_reader = SingleFileCheckpointReader(*this); - checkpoint_reader.LoadFromStorage(context); + checkpoint_reader.LoadFromStorage(); // check if the WAL file exists auto wal_path = GetWALPath(); @@ -204,7 +226,7 @@ class SingleFileStorageCommitState : public StorageCommitState { wal.skip_writing = false; if (wal.GetTotalWritten() > initial_written) { // remove any entries written into the WAL by truncating it - wal.Truncate(initial_wal_size); + wal.Truncate(NumericCast(initial_wal_size)); } } } @@ -215,20 +237,20 @@ class SingleFileStorageCommitState : public StorageCommitState { SingleFileStorageCommitState::SingleFileStorageCommitState(StorageManager &storage_manager, bool checkpoint) : checkpoint(checkpoint) { - log = storage_manager.GetWriteAheadLog(); - if (log) { - auto initial_size = log->GetWALSize(); - initial_written = log->GetTotalWritten(); - initial_wal_size = initial_size < 0 ? 0 : idx_t(initial_size); - - if (checkpoint) { - // check if we are checkpointing after this commit - // if we are checkpointing, we don't need to write anything to the WAL - // this saves us a lot of unnecessary writes to disk in the case of large commits - log->skip_writing = true; - } - } else { - D_ASSERT(!checkpoint); + + log = storage_manager.GetWAL(); + if (!log) { + return; + } + + auto initial_size = storage_manager.GetWALSize(); + initial_written = log->GetTotalWritten(); + initial_wal_size = initial_size < 0 ? 0 : idx_t(initial_size); + + if (checkpoint) { + // True, if we are checkpointing after the current commit. + // If true, we don't need to write to the WAL, saving unnecessary writes to disk. + log->skip_writing = true; } } @@ -257,24 +279,23 @@ bool SingleFileStorageManager::IsCheckpointClean(MetaBlockPointer checkpoint_id) return block_manager->IsRootBlock(checkpoint_id); } -void SingleFileStorageManager::CreateCheckpoint(bool delete_wal, bool force_checkpoint) { - if (InMemory() || read_only || !wal) { +void SingleFileStorageManager::CreateCheckpoint(CheckpointOptions options) { + if (InMemory() || read_only || !load_complete) { return; } auto &config = DBConfig::Get(db); - if (wal->GetWALSize() > 0 || config.options.force_checkpoint || force_checkpoint) { + if (GetWALSize() > 0 || config.options.force_checkpoint || options.action == CheckpointAction::FORCE_CHECKPOINT) { // we only need to checkpoint if there is anything in the WAL try { - SingleFileCheckpointWriter checkpointer(db, *block_manager); + SingleFileCheckpointWriter checkpointer(db, *block_manager, options.type); checkpointer.CreateCheckpoint(); } catch (std::exception &ex) { ErrorData error(ex); throw FatalException("Failed to create checkpoint because of error: %s", error.RawMessage()); } } - if (delete_wal) { - wal->Delete(); - wal.reset(); + if (options.wal_action == CheckpointWALAction::DELETE_WAL) { + ResetWAL(); } } @@ -287,9 +308,7 @@ DatabaseSize SingleFileStorageManager::GetDatabaseSize() { ds.free_blocks = block_manager->FreeBlocks(); ds.used_blocks = ds.total_blocks - ds.free_blocks; ds.bytes = (ds.total_blocks * ds.block_size); - if (auto wal = GetWriteAheadLog()) { - ds.wal_size = wal->GetWALSize(); - } + ds.wal_size = NumericCast(GetWALSize()); } return ds; } @@ -300,15 +319,9 @@ vector SingleFileStorageManager::GetMetadataInfo() { } bool SingleFileStorageManager::AutomaticCheckpoint(idx_t estimated_wal_bytes) { - auto log = GetWriteAheadLog(); - if (!log) { - return false; - } - - auto &config = DBConfig::Get(db); - auto initial_size = log->GetWALSize(); + auto initial_size = NumericCast(GetWALSize()); idx_t expected_wal_size = initial_size + estimated_wal_bytes; - return expected_wal_size > config.options.checkpoint_wal_size; + return expected_wal_size > DBConfig::Get(db).options.checkpoint_wal_size; } shared_ptr SingleFileStorageManager::GetTableIOManager(BoundCreateTableInfo *info /*info*/) { diff --git a/src/duckdb/src/storage/table/array_column_data.cpp b/src/duckdb/src/storage/table/array_column_data.cpp index 31cb93fa..44ae4db3 100644 --- a/src/duckdb/src/storage/table/array_column_data.cpp +++ b/src/duckdb/src/storage/table/array_column_data.cpp @@ -67,12 +67,14 @@ void ArrayColumnData::InitializeScanWithOffset(ColumnScanState &state, idx_t row } } -idx_t ArrayColumnData::Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result) { - return ScanCount(state, result, STANDARD_VECTOR_SIZE); +idx_t ArrayColumnData::Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t scan_count) { + return ScanCount(state, result, scan_count); } -idx_t ArrayColumnData::ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates) { - return ScanCount(state, result, STANDARD_VECTOR_SIZE); +idx_t ArrayColumnData::ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates, + idx_t scan_count) { + return ScanCount(state, result, scan_count); } idx_t ArrayColumnData::ScanCount(ColumnScanState &state, Vector &result, idx_t count) { @@ -120,9 +122,9 @@ void ArrayColumnData::RevertAppend(row_t start_row) { validity.RevertAppend(start_row); // Revert child column auto array_size = ArrayType::GetSize(type); - child_column->RevertAppend(start_row * array_size); + child_column->RevertAppend(start_row * UnsafeNumericCast(array_size)); - this->count = start_row - this->start; + this->count = UnsafeNumericCast(start_row) - this->start; } idx_t ArrayColumnData::Fetch(ColumnScanState &state, row_t row_id, Vector &result) { @@ -162,7 +164,7 @@ void ArrayColumnData::FetchRow(TransactionData transaction, ColumnFetchState &st // We need to fetch between [row_id * array_size, (row_id + 1) * array_size) auto child_state = make_uniq(); child_state->Initialize(child_type, nullptr); - child_column->InitializeScanWithOffset(*child_state, row_id * array_size); + child_column->InitializeScanWithOffset(*child_state, UnsafeNumericCast(row_id) * array_size); Vector child_scan(child_type, array_size); child_column->ScanCount(*child_state, child_scan, array_size); VectorOperations::Copy(child_scan, child_vec, array_size, 0, result_idx * array_size); @@ -203,12 +205,11 @@ unique_ptr ArrayColumnData::CreateCheckpointState(RowGrou } unique_ptr ArrayColumnData::Checkpoint(RowGroup &row_group, - PartialBlockManager &partial_block_manager, ColumnCheckpointInfo &checkpoint_info) { - auto checkpoint_state = make_uniq(row_group, *this, partial_block_manager); - checkpoint_state->validity_state = validity.Checkpoint(row_group, partial_block_manager, checkpoint_info); - checkpoint_state->child_state = child_column->Checkpoint(row_group, partial_block_manager, checkpoint_info); + auto checkpoint_state = make_uniq(row_group, *this, checkpoint_info.info.manager); + checkpoint_state->validity_state = validity.Checkpoint(row_group, checkpoint_info); + checkpoint_state->child_state = child_column->Checkpoint(row_group, checkpoint_info); return std::move(checkpoint_state); } @@ -219,7 +220,7 @@ void ArrayColumnData::DeserializeColumn(Deserializer &deserializer, BaseStatisti auto &child_stats = ArrayStats::GetChildStats(target_stats); deserializer.ReadObject(102, "child_column", [&](Deserializer &source) { child_column->DeserializeColumn(source, child_stats); }); - this->count = validity.count; + this->count = validity.count.load(); } void ArrayColumnData::GetColumnSegmentInfo(idx_t row_group_index, vector col_path, diff --git a/src/duckdb/src/storage/table/column_data.cpp b/src/duckdb/src/storage/table/column_data.cpp index 21924d03..cbb36c51 100644 --- a/src/duckdb/src/storage/table/column_data.cpp +++ b/src/duckdb/src/storage/table/column_data.cpp @@ -43,7 +43,7 @@ void ColumnData::SetStart(idx_t new_start) { } DatabaseInstance &ColumnData::GetDatabase() const { - return info.db.GetDatabase(); + return info.GetDB().GetDatabase(); } DataTableInfo &ColumnData::GetTableInfo() const { @@ -91,7 +91,26 @@ void ColumnData::InitializeScanWithOffset(ColumnScanState &state, idx_t row_idx) state.last_offset = 0; } -idx_t ColumnData::ScanVector(ColumnScanState &state, Vector &result, idx_t remaining, bool has_updates) { +ScanVectorType ColumnData::GetVectorScanType(ColumnScanState &state, idx_t scan_count) { + if (HasUpdates()) { + // if we have updates we need to merge in the updates + // always need to scan flat vectors + return ScanVectorType::SCAN_FLAT_VECTOR; + } + // check if the current segment has enough data remaining + idx_t remaining_in_segment = state.current->start + state.current->count - state.row_index; + if (remaining_in_segment < scan_count) { + // there is not enough data remaining in the current segment so we need to scan across segments + // we need flat vectors here + return ScanVectorType::SCAN_FLAT_VECTOR; + } + return ScanVectorType::SCAN_ENTIRE_VECTOR; +} + +idx_t ColumnData::ScanVector(ColumnScanState &state, Vector &result, idx_t remaining, ScanVectorType scan_type) { + if (scan_type == ScanVectorType::SCAN_FLAT_VECTOR && result.GetVectorType() != VectorType::FLAT_VECTOR) { + throw InternalException("ScanVector called with SCAN_FLAT_VECTOR but result is not a flat vector"); + } state.previous_states.clear(); if (!state.initialized) { D_ASSERT(state.current); @@ -115,11 +134,11 @@ idx_t ColumnData::ScanVector(ColumnScanState &state, Vector &result, idx_t remai if (state.scan_options && state.scan_options->force_fetch_row) { for (idx_t i = 0; i < scan_count; i++) { ColumnFetchState fetch_state; - state.current->FetchRow(fetch_state, state.row_index + i, result, result_offset + i); + state.current->FetchRow(fetch_state, UnsafeNumericCast(state.row_index + i), result, + result_offset + i); } } else { - state.current->Scan(state, scan_count, result, result_offset, - !has_updates && scan_count == initial_remaining); + state.current->Scan(state, scan_count, result, result_offset, scan_type); } state.row_index += scan_count; @@ -170,7 +189,7 @@ void ColumnData::FetchUpdateRow(TransactionData transaction, row_t row_id, Vecto if (!updates) { return; } - updates->FetchRow(transaction, row_id, result, result_idx); + updates->FetchRow(transaction, NumericCast(row_id), result, result_idx); } void ColumnData::UpdateInternal(TransactionData transaction, idx_t column_index, Vector &update_vector, row_t *row_ids, @@ -183,42 +202,58 @@ void ColumnData::UpdateInternal(TransactionData transaction, idx_t column_index, } template -idx_t ColumnData::ScanVector(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result) { - idx_t current_row = vector_index * STANDARD_VECTOR_SIZE; - auto vector_count = MinValue(STANDARD_VECTOR_SIZE, count - current_row); - - auto scan_count = ScanVector(state, result, vector_count, HasUpdates()); +idx_t ColumnData::ScanVector(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t target_scan) { + auto scan_count = ScanVector(state, result, target_scan, GetVectorScanType(state, target_scan)); FetchUpdates(transaction, vector_index, result, scan_count, ALLOW_UPDATES, SCAN_COMMITTED); return scan_count; } template idx_t ColumnData::ScanVector(TransactionData transaction, idx_t vector_index, - ColumnScanState &state, Vector &result); + ColumnScanState &state, Vector &result, idx_t target_scan); template idx_t ColumnData::ScanVector(TransactionData transaction, idx_t vector_index, - ColumnScanState &state, Vector &result); + ColumnScanState &state, Vector &result, idx_t target_scan); template idx_t ColumnData::ScanVector(TransactionData transaction, idx_t vector_index, - ColumnScanState &state, Vector &result); + ColumnScanState &state, Vector &result, idx_t target_scan); template idx_t ColumnData::ScanVector(TransactionData transaction, idx_t vector_index, - ColumnScanState &state, Vector &result); + ColumnScanState &state, Vector &result, idx_t target_scan); idx_t ColumnData::Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result) { - return ScanVector(transaction, vector_index, state, result); + auto target_count = GetVectorCount(vector_index); + return Scan(transaction, vector_index, state, result, target_count); } idx_t ColumnData::ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates) { + auto target_count = GetVectorCount(vector_index); + return ScanCommitted(vector_index, state, result, allow_updates, target_count); +} + +idx_t ColumnData::Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t scan_count) { + return ScanVector(transaction, vector_index, state, result, scan_count); +} + +idx_t ColumnData::ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates, + idx_t scan_count) { if (allow_updates) { - return ScanVector(TransactionData(0, 0), vector_index, state, result); + return ScanVector(TransactionData(0, 0), vector_index, state, result, scan_count); } else { - return ScanVector(TransactionData(0, 0), vector_index, state, result); + return ScanVector(TransactionData(0, 0), vector_index, state, result, scan_count); } } +idx_t ColumnData::GetVectorCount(idx_t vector_index) const { + idx_t current_row = vector_index * STANDARD_VECTOR_SIZE; + return MinValue(STANDARD_VECTOR_SIZE, count - current_row); +} + void ColumnData::ScanCommittedRange(idx_t row_group_start, idx_t offset_in_row_group, idx_t s_count, Vector &result) { ColumnScanState child_state; InitializeScanWithOffset(child_state, row_group_start + offset_in_row_group); bool has_updates = HasUpdates(); - auto scan_count = ScanVector(child_state, result, s_count, has_updates); + auto scan_count = ScanVector(child_state, result, s_count, ScanVectorType::SCAN_FLAT_VECTOR); if (has_updates) { + D_ASSERT(result.GetVectorType() == VectorType::FLAT_VECTOR); result.Flatten(scan_count); updates->FetchCommittedRange(offset_in_row_group, s_count, result); } @@ -230,7 +265,7 @@ idx_t ColumnData::ScanCount(ColumnScanState &state, Vector &result, idx_t scan_c } // ScanCount can only be used if there are no updates D_ASSERT(!HasUpdates()); - return ScanVector(state, result, scan_count, false); + return ScanVector(state, result, scan_count, ScanVectorType::SCAN_FLAT_VECTOR); } void ColumnData::Select(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, @@ -260,7 +295,7 @@ void ColumnData::Skip(ColumnScanState &state, idx_t s_count) { void ColumnData::Append(BaseStatistics &append_stats, ColumnAppendState &state, Vector &vector, idx_t append_count) { UnifiedVectorFormat vdata; - vector.ToUnifiedFormat(count, vdata); + vector.ToUnifiedFormat(append_count, vdata); AppendData(append_stats, state, vdata, append_count); } @@ -268,6 +303,7 @@ void ColumnData::Append(ColumnAppendState &state, Vector &vector, idx_t append_c if (parent || !stats) { throw InternalException("ColumnData::Append called on a column with a parent or without stats"); } + lock_guard l(stats_lock); Append(stats->statistics, state, vector, append_count); } @@ -275,6 +311,7 @@ bool ColumnData::CheckZonemap(TableFilter &filter) { if (!stats) { throw InternalException("ColumnData::CheckZonemap called on a column without stats"); } + lock_guard l(stats_lock); auto propagate_result = filter.CheckStatistics(stats->statistics); if (propagate_result == FilterPropagateResult::FILTER_ALWAYS_FALSE || propagate_result == FilterPropagateResult::FILTER_FALSE_OR_NULL) { @@ -287,6 +324,7 @@ unique_ptr ColumnData::GetStatistics() { if (!stats) { throw InternalException("ColumnData::GetStatistics called on a column without stats"); } + lock_guard l(stats_lock); return stats->statistics.ToUnique(); } @@ -294,6 +332,7 @@ void ColumnData::MergeStatistics(const BaseStatistics &other) { if (!stats) { throw InternalException("ColumnData::MergeStatistics called on a column without stats"); } + lock_guard l(stats_lock); return stats->statistics.Merge(other); } @@ -301,6 +340,7 @@ void ColumnData::MergeIntoStatistics(BaseStatistics &other) { if (!stats) { throw InternalException("ColumnData::MergeIntoStatistics called on a column without stats"); } + lock_guard l(stats_lock); return other.Merge(stats->statistics); } @@ -360,36 +400,38 @@ void ColumnData::RevertAppend(row_t start_row) { return; } // find the segment index that the current row belongs to - idx_t segment_index = data.GetSegmentIndex(l, start_row); - auto segment = data.GetSegmentByIndex(l, segment_index); + idx_t segment_index = data.GetSegmentIndex(l, UnsafeNumericCast(start_row)); + auto segment = data.GetSegmentByIndex(l, UnsafeNumericCast(segment_index)); auto &transient = *segment; D_ASSERT(transient.segment_type == ColumnSegmentType::TRANSIENT); // remove any segments AFTER this segment: they should be deleted entirely data.EraseSegments(l, segment_index); - this->count = start_row - this->start; + this->count = UnsafeNumericCast(start_row) - this->start; segment->next = nullptr; - transient.RevertAppend(start_row); + transient.RevertAppend(UnsafeNumericCast(start_row)); } idx_t ColumnData::Fetch(ColumnScanState &state, row_t row_id, Vector &result) { D_ASSERT(row_id >= 0); D_ASSERT(idx_t(row_id) >= start); // perform the fetch within the segment - state.row_index = start + ((row_id - start) / STANDARD_VECTOR_SIZE * STANDARD_VECTOR_SIZE); + state.row_index = + start + ((UnsafeNumericCast(row_id) - start) / STANDARD_VECTOR_SIZE * STANDARD_VECTOR_SIZE); state.current = data.GetSegment(state.row_index); state.internal_index = state.current->start; - return ScanVector(state, result, STANDARD_VECTOR_SIZE, false); + return ScanVector(state, result, STANDARD_VECTOR_SIZE, ScanVectorType::SCAN_FLAT_VECTOR); } void ColumnData::FetchRow(TransactionData transaction, ColumnFetchState &state, row_t row_id, Vector &result, idx_t result_idx) { - auto segment = data.GetSegment(row_id); + auto segment = data.GetSegment(UnsafeNumericCast(row_id)); // now perform the fetch within the segment segment->FetchRow(state, row_id, result, result_idx); // merge any updates made to this row + FetchUpdateRow(transaction, row_id, result, result_idx); } @@ -445,10 +487,10 @@ void ColumnData::CheckpointScan(ColumnSegment &segment, ColumnScanState &state, if (state.scan_options && state.scan_options->force_fetch_row) { for (idx_t i = 0; i < count; i++) { ColumnFetchState fetch_state; - segment.FetchRow(fetch_state, state.row_index + i, scan_vector, i); + segment.FetchRow(fetch_state, UnsafeNumericCast(state.row_index + i), scan_vector, i); } } else { - segment.Scan(state, count, scan_vector, 0, !HasUpdates()); + segment.Scan(state, count, scan_vector, 0, ScanVectorType::SCAN_FLAT_VECTOR); } if (updates) { @@ -457,12 +499,10 @@ void ColumnData::CheckpointScan(ColumnSegment &segment, ColumnScanState &state, } } -unique_ptr ColumnData::Checkpoint(RowGroup &row_group, - PartialBlockManager &partial_block_manager, - ColumnCheckpointInfo &checkpoint_info) { +unique_ptr ColumnData::Checkpoint(RowGroup &row_group, ColumnCheckpointInfo &checkpoint_info) { // scan the segments of the column data // set up the checkpoint state - auto checkpoint_state = CreateCheckpointState(row_group, partial_block_manager); + auto checkpoint_state = CreateCheckpointState(row_group, checkpoint_info.info.manager); checkpoint_state->global_stats = BaseStatistics::CreateEmpty(type).ToUnique(); auto l = data.Lock(); @@ -484,7 +524,7 @@ unique_ptr ColumnData::Checkpoint(RowGroup &row_group, void ColumnData::DeserializeColumn(Deserializer &deserializer, BaseStatistics &target_stats) { // load the data pointers for the column - deserializer.Set(info.db.GetDatabase()); + deserializer.Set(info.GetDB().GetDatabase()); deserializer.Set(type); vector data_pointers; @@ -540,7 +580,7 @@ void ColumnData::GetColumnSegmentInfo(idx_t row_group_index, vector col_p // iterate over the segments idx_t segment_idx = 0; - auto segment = (ColumnSegment *)data.GetRootSegment(); + auto segment = data.GetRootSegment(); while (segment) { ColumnSegmentInfo column_info; column_info.row_group_index = row_group_index; @@ -551,7 +591,10 @@ void ColumnData::GetColumnSegmentInfo(idx_t row_group_index, vector col_p column_info.segment_start = segment->start; column_info.segment_count = segment->count; column_info.compression_type = CompressionTypeToString(segment->function.get().type); - column_info.segment_stats = segment->stats.statistics.ToString(); + { + lock_guard l(stats_lock); + column_info.segment_stats = segment->stats.statistics.ToString(); + } column_info.has_updates = ColumnData::HasUpdates(); // persistent // block_id diff --git a/src/duckdb/src/storage/table/column_data_checkpointer.cpp b/src/duckdb/src/storage/table/column_data_checkpointer.cpp index 9ecfe43e..da007be8 100644 --- a/src/duckdb/src/storage/table/column_data_checkpointer.cpp +++ b/src/duckdb/src/storage/table/column_data_checkpointer.cpp @@ -100,7 +100,7 @@ unique_ptr ColumnDataCheckpointer::DetectBestCompressionMethod(idx auto &config = DBConfig::GetConfig(GetDatabase()); CompressionType forced_method = CompressionType::COMPRESSION_AUTO; - auto compression_type = checkpoint_info.compression_type; + auto compression_type = checkpoint_info.GetCompressionType(); if (compression_type != CompressionType::COMPRESSION_AUTO) { forced_method = ForceCompression(compression_functions, compression_type); } diff --git a/src/duckdb/src/storage/table/column_segment.cpp b/src/duckdb/src/storage/table/column_segment.cpp index 175791b6..446a15db 100644 --- a/src/duckdb/src/storage/table/column_segment.cpp +++ b/src/duckdb/src/storage/table/column_segment.cpp @@ -60,8 +60,8 @@ unique_ptr ColumnSegment::CreateTransientSegment(DatabaseInstance } else { buffer_manager.Allocate(MemoryTag::IN_MEMORY_TABLE, segment_size, false, &block); } - return make_uniq(db, std::move(block), type, ColumnSegmentType::TRANSIENT, start, 0, *function, - BaseStatistics::CreateEmpty(type), INVALID_BLOCK, 0, segment_size); + return make_uniq(db, std::move(block), type, ColumnSegmentType::TRANSIENT, start, 0U, *function, + BaseStatistics::CreateEmpty(type), INVALID_BLOCK, 0U, segment_size); } //===--------------------------------------------------------------------===// @@ -104,8 +104,8 @@ void ColumnSegment::InitializeScan(ColumnScanState &state) { } void ColumnSegment::Scan(ColumnScanState &state, idx_t scan_count, Vector &result, idx_t result_offset, - bool entire_vector) { - if (entire_vector) { + ScanVectorType scan_type) { + if (scan_type == ScanVectorType::SCAN_ENTIRE_VECTOR) { D_ASSERT(result_offset == 0); Scan(state, scan_count, result); } else { @@ -132,7 +132,8 @@ void ColumnSegment::ScanPartial(ColumnScanState &state, idx_t scan_count, Vector // Fetch //===--------------------------------------------------------------------===// void ColumnSegment::FetchRow(ColumnFetchState &state, row_t row_id, Vector &result, idx_t result_idx) { - function.get().fetch_row(*this, state, row_id - this->start, result, result_idx); + function.get().fetch_row(*this, state, UnsafeNumericCast(UnsafeNumericCast(row_id) - this->start), + result, result_idx); } //===--------------------------------------------------------------------===// diff --git a/src/duckdb/src/storage/table/list_column_data.cpp b/src/duckdb/src/storage/table/list_column_data.cpp index 418a4bd4..ce472ef4 100644 --- a/src/duckdb/src/storage/table/list_column_data.cpp +++ b/src/duckdb/src/storage/table/list_column_data.cpp @@ -44,7 +44,7 @@ uint64_t ListColumnData::FetchListOffset(idx_t row_idx) { auto segment = data.GetSegment(row_idx); ColumnFetchState fetch_state; Vector result(type, 1); - segment->FetchRow(fetch_state, row_idx, result, 0); + segment->FetchRow(fetch_state, UnsafeNumericCast(row_idx), result, 0U); // initialize the child scan with the required offset return FlatVector::GetData(result)[0]; @@ -70,12 +70,14 @@ void ListColumnData::InitializeScanWithOffset(ColumnScanState &state, idx_t row_ state.last_offset = child_offset; } -idx_t ListColumnData::Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result) { - return ScanCount(state, result, STANDARD_VECTOR_SIZE); +idx_t ListColumnData::Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t scan_count) { + return ScanCount(state, result, scan_count); } -idx_t ListColumnData::ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates) { - return ScanCount(state, result, STANDARD_VECTOR_SIZE); +idx_t ListColumnData::ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates, + idx_t scan_count) { + return ScanCount(state, result, scan_count); } idx_t ListColumnData::ScanCount(ColumnScanState &state, Vector &result, idx_t count) { @@ -86,7 +88,7 @@ idx_t ListColumnData::ScanCount(ColumnScanState &state, Vector &result, idx_t co D_ASSERT(!updates); Vector offset_vector(LogicalType::UBIGINT, count); - idx_t scan_count = ScanVector(state, offset_vector, count, false); + idx_t scan_count = ScanVector(state, offset_vector, count, ScanVectorType::SCAN_FLAT_VECTOR); D_ASSERT(scan_count > 0); validity.ScanCount(state.child_states[0], result, count); @@ -133,7 +135,7 @@ void ListColumnData::Skip(ColumnScanState &state, idx_t count) { // note that we only need to read the first and last entry // however, let's just read all "count" entries for now Vector offset_vector(LogicalType::UBIGINT, count); - idx_t scan_count = ScanVector(state, offset_vector, count, false); + idx_t scan_count = ScanVector(state, offset_vector, count, ScanVectorType::SCAN_FLAT_VECTOR); D_ASSERT(scan_count > 0); UnifiedVectorFormat offsets; @@ -235,7 +237,7 @@ void ListColumnData::RevertAppend(row_t start_row) { if (column_count > start) { // revert append in the child column auto list_offset = FetchListOffset(column_count - 1); - child_column->RevertAppend(list_offset); + child_column->RevertAppend(UnsafeNumericCast(list_offset)); } } @@ -269,8 +271,8 @@ void ListColumnData::FetchRow(TransactionData transaction, ColumnFetchState &sta } // now perform the fetch within the segment - auto start_offset = idx_t(row_id) == this->start ? 0 : FetchListOffset(row_id - 1); - auto end_offset = FetchListOffset(row_id); + auto start_offset = idx_t(row_id) == this->start ? 0 : FetchListOffset(UnsafeNumericCast(row_id - 1)); + auto end_offset = FetchListOffset(UnsafeNumericCast(row_id)); validity.FetchRow(transaction, *state.child_states[0], row_id, result, result_idx); auto &validity = FlatVector::Validity(result); @@ -339,11 +341,10 @@ unique_ptr ListColumnData::CreateCheckpointState(RowGroup } unique_ptr ListColumnData::Checkpoint(RowGroup &row_group, - PartialBlockManager &partial_block_manager, ColumnCheckpointInfo &checkpoint_info) { - auto base_state = ColumnData::Checkpoint(row_group, partial_block_manager, checkpoint_info); - auto validity_state = validity.Checkpoint(row_group, partial_block_manager, checkpoint_info); - auto child_state = child_column->Checkpoint(row_group, partial_block_manager, checkpoint_info); + auto base_state = ColumnData::Checkpoint(row_group, checkpoint_info); + auto validity_state = validity.Checkpoint(row_group, checkpoint_info); + auto child_state = child_column->Checkpoint(row_group, checkpoint_info); auto &checkpoint_state = base_state->Cast(); checkpoint_state.validity_state = std::move(validity_state); diff --git a/src/duckdb/src/storage/table/row_group.cpp b/src/duckdb/src/storage/table/row_group.cpp index 824827d7..4c1f1ead 100644 --- a/src/duckdb/src/storage/table/row_group.cpp +++ b/src/duckdb/src/storage/table/row_group.cpp @@ -106,7 +106,7 @@ ColumnData &RowGroup::GetColumn(storage_t c) { if (this->columns[c]->count != this->count) { throw InternalException("Corrupted database - loaded column with index %llu at row start %llu, count %llu did " "not match count of row group %llu", - c, start, this->columns[c]->count, this->count.load()); + c, start, this->columns[c]->count.load(), this->count.load()); } return *columns[c]; } @@ -273,6 +273,7 @@ unique_ptr RowGroup::AlterType(RowGroupCollection &new_collection, con if (i == changed_idx) { // this is the altered column: use the new column row_group->columns.push_back(std::move(column_data)); + column_data.reset(); } else { // this column was not altered: use the data directly row_group->columns.push_back(cols[i]); @@ -283,7 +284,7 @@ unique_ptr RowGroup::AlterType(RowGroupCollection &new_collection, con } unique_ptr RowGroup::AddColumn(RowGroupCollection &new_collection, ColumnDefinition &new_column, - ExpressionExecutor &executor, Expression &default_value, Vector &result) { + ExpressionExecutor &executor, Vector &result) { Verify(); // construct a new column data for the new column @@ -417,6 +418,9 @@ bool RowGroup::CheckZonemapSegments(CollectionScanState &state) { if (!read_segment) { idx_t target_row = GetFilterScanCount(state.column_scans[column_idx], *entry.second); + if (target_row >= state.max_row) { + target_row = state.max_row; + } D_ASSERT(target_row >= this->start); D_ASSERT(target_row <= this->start + this->count); @@ -487,7 +491,7 @@ void RowGroup::TemplatedScan(TransactionData transaction, CollectionScanState &s if (column == COLUMN_IDENTIFIER_ROW_ID) { // scan row id D_ASSERT(result.data[i].GetType().InternalType() == ROW_TYPE); - result.data[i].Sequence(this->start + current_row, 1, count); + result.data[i].Sequence(UnsafeNumericCast(this->start + current_row), 1, count); } else { auto &col_data = GetColumn(column); if (TYPE != TableScanType::TABLE_SCAN_REGULAR) { @@ -551,7 +555,8 @@ void RowGroup::TemplatedScan(TransactionData transaction, CollectionScanState &s result.data[i].SetVectorType(VectorType::FLAT_VECTOR); auto result_data = FlatVector::GetData(result.data[i]); for (size_t sel_idx = 0; sel_idx < approved_tuple_count; sel_idx++) { - result_data[sel_idx] = this->start + current_row + sel.get_index(sel_idx); + result_data[sel_idx] = + UnsafeNumericCast(this->start + current_row + sel.get_index(sel_idx)); } } else { auto &col_data = GetColumn(column); @@ -585,9 +590,16 @@ void RowGroup::Scan(TransactionData transaction, CollectionScanState &state, Dat void RowGroup::ScanCommitted(CollectionScanState &state, DataChunk &result, TableScanType type) { auto &transaction_manager = DuckTransactionManager::Get(GetCollection().GetAttached()); - auto lowest_active_start = transaction_manager.LowestActiveStart(); - auto lowest_active_id = transaction_manager.LowestActiveId(); - TransactionData data(lowest_active_id, lowest_active_start); + transaction_t start_ts; + transaction_t transaction_id; + if (type == TableScanType::TABLE_SCAN_LATEST_COMMITTED_ROWS) { + start_ts = transaction_manager.GetLastCommit() + 1; + transaction_id = MAX_TRANSACTION_ID; + } else { + start_ts = transaction_manager.LowestActiveStart(); + transaction_id = transaction_manager.LowestActiveId(); + } + TransactionData data(transaction_id, start_ts); switch (type) { case TableScanType::TABLE_SCAN_COMMITTED_ROWS: TemplatedScan(data, state, result); @@ -596,6 +608,7 @@ void RowGroup::ScanCommitted(CollectionScanState &state, DataChunk &result, Tabl TemplatedScan(data, state, result); break; case TableScanType::TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED: + case TableScanType::TABLE_SCAN_LATEST_COMMITTED_ROWS: TemplatedScan(data, state, result); break; default: @@ -624,7 +637,7 @@ shared_ptr &RowGroup::GetOrCreateVersionInfoPtr() { if (!vinfo) { lock_guard lock(row_group_lock); if (!version_info) { - version_info = make_shared(start); + version_info = make_shared_ptr(start); } } return version_info; @@ -703,7 +716,7 @@ void RowGroup::RevertAppend(idx_t row_group_start) { auto &vinfo = GetOrCreateVersionInfo(); vinfo.RevertAppend(row_group_start - this->start); for (auto &column : columns) { - column->RevertAppend(row_group_start); + column->RevertAppend(UnsafeNumericCast(row_group_start)); } this->count = MinValue(row_group_start - this->start, this->count); Verify(); @@ -770,24 +783,24 @@ void RowGroup::UpdateColumn(TransactionData transaction, DataChunk &updates, Vec unique_ptr RowGroup::GetStatistics(idx_t column_idx) { auto &col_data = GetColumn(column_idx); - lock_guard slock(stats_lock); return col_data.GetStatistics(); } void RowGroup::MergeStatistics(idx_t column_idx, const BaseStatistics &other) { auto &col_data = GetColumn(column_idx); - lock_guard slock(stats_lock); col_data.MergeStatistics(other); } void RowGroup::MergeIntoStatistics(idx_t column_idx, BaseStatistics &other) { auto &col_data = GetColumn(column_idx); - lock_guard slock(stats_lock); col_data.MergeIntoStatistics(other); } -RowGroupWriteData RowGroup::WriteToDisk(PartialBlockManager &manager, - const vector &compression_types) { +CompressionType ColumnCheckpointInfo::GetCompressionType() { + return info.compression_types[column_idx]; +} + +RowGroupWriteData RowGroup::WriteToDisk(RowGroupWriteInfo &info) { RowGroupWriteData result; result.states.reserve(columns.size()); result.statistics.reserve(columns.size()); @@ -802,8 +815,8 @@ RowGroupWriteData RowGroup::WriteToDisk(PartialBlockManager &manager, // pointers all end up densely packed, and thus more cache-friendly. for (idx_t column_idx = 0; column_idx < GetColumnCount(); column_idx++) { auto &column = GetColumn(column_idx); - ColumnCheckpointInfo checkpoint_info {compression_types[column_idx]}; - auto checkpoint_state = column.Checkpoint(*this, manager, checkpoint_info); + ColumnCheckpointInfo checkpoint_info(info, column_idx); + auto checkpoint_state = column.Checkpoint(*this, checkpoint_info); D_ASSERT(checkpoint_state); auto stats = checkpoint_state->GetStatistics(); @@ -841,20 +854,22 @@ RowGroupWriteData RowGroup::WriteToDisk(RowGroupWriter &writer) { if (column.count != this->count) { throw InternalException("Corrupted in-memory column - column with index %llu has misaligned count (row " "group has %llu rows, column has %llu)", - column_idx, this->count.load(), column.count); + column_idx, this->count.load(), column.count.load()); } compression_types.push_back(writer.GetColumnCompressionType(column_idx)); } - return WriteToDisk(writer.GetPartialBlockManager(), compression_types); + RowGroupWriteInfo info(writer.GetPartialBlockManager(), compression_types, writer.GetCheckpointType()); + return WriteToDisk(info); } RowGroupPointer RowGroup::Checkpoint(RowGroupWriteData write_data, RowGroupWriter &writer, TableStatistics &global_stats) { RowGroupPointer row_group_pointer; + auto lock = global_stats.GetLock(); for (idx_t column_idx = 0; column_idx < GetColumnCount(); column_idx++) { - global_stats.GetStats(column_idx).Statistics().Merge(write_data.statistics[column_idx]); + global_stats.GetStats(*lock, column_idx).Statistics().Merge(write_data.statistics[column_idx]); } // construct the row group pointer and write the column meta data to disk @@ -955,7 +970,7 @@ idx_t RowGroup::Delete(TransactionData transaction, DataTable &table, row_t *ids for (idx_t i = 0; i < count; i++) { D_ASSERT(ids[i] >= 0); D_ASSERT(idx_t(ids[i]) >= this->start && idx_t(ids[i]) < this->start + this->count); - del_state.Delete(ids[i] - this->start); + del_state.Delete(ids[i] - UnsafeNumericCast(this->start)); } del_state.Flush(); return del_state.delete_count; @@ -975,15 +990,15 @@ idx_t RowGroup::DeleteRows(idx_t vector_idx, transaction_t transaction_id, row_t void VersionDeleteState::Delete(row_t row_id) { D_ASSERT(row_id >= 0); - idx_t vector_idx = row_id / STANDARD_VECTOR_SIZE; - idx_t idx_in_vector = row_id - vector_idx * STANDARD_VECTOR_SIZE; + idx_t vector_idx = UnsafeNumericCast(row_id) / STANDARD_VECTOR_SIZE; + idx_t idx_in_vector = UnsafeNumericCast(row_id) - vector_idx * STANDARD_VECTOR_SIZE; if (current_chunk != vector_idx) { Flush(); current_chunk = vector_idx; chunk_row = vector_idx * STANDARD_VECTOR_SIZE; } - rows[count++] = idx_in_vector; + rows[count++] = UnsafeNumericCast(idx_in_vector); } void VersionDeleteState::Flush() { diff --git a/src/duckdb/src/storage/table/row_group_collection.cpp b/src/duckdb/src/storage/table/row_group_collection.cpp index 00e42d5b..a3029a60 100644 --- a/src/duckdb/src/storage/table/row_group_collection.cpp +++ b/src/duckdb/src/storage/table/row_group_collection.cpp @@ -14,6 +14,7 @@ #include "duckdb/parallel/task_scheduler.hpp" #include "duckdb/execution/task_error_manager.hpp" #include "duckdb/storage/table/column_checkpoint_state.hpp" +#include "duckdb/execution/index/bound_index.hpp" namespace duckdb { @@ -55,7 +56,7 @@ RowGroupCollection::RowGroupCollection(shared_ptr info_p, BlockMa vector types_p, idx_t row_start_p, idx_t total_rows_p) : block_manager(block_manager), total_rows(total_rows_p), info(std::move(info_p)), types(std::move(types_p)), row_start(row_start_p), allocation_size(0) { - row_groups = make_shared(*this); + row_groups = make_shared_ptr(*this); } idx_t RowGroupCollection::GetTotalRows() const { @@ -67,11 +68,11 @@ const vector &RowGroupCollection::GetTypes() const { } Allocator &RowGroupCollection::GetAllocator() const { - return Allocator::Get(info->db); + return Allocator::Get(info->GetDB()); } AttachedDatabase &RowGroupCollection::GetAttached() { - return GetTableInfo().db; + return GetTableInfo().GetDB(); } MetadataManager &RowGroupCollection::GetMetadataManager() { @@ -95,7 +96,7 @@ void RowGroupCollection::InitializeEmpty() { void RowGroupCollection::AppendRowGroup(SegmentLock &l, idx_t start_row) { D_ASSERT(start_row >= row_start); - auto new_row_group = make_uniq(*this, start_row, 0); + auto new_row_group = make_uniq(*this, start_row, 0U); new_row_group->InitializeEmpty(types); row_groups->AppendSegment(l, std::move(new_row_group)); } @@ -271,13 +272,13 @@ void RowGroupCollection::Fetch(TransactionData transaction, DataChunk &result, c { idx_t segment_index; auto l = row_groups->Lock(); - if (!row_groups->TryGetSegmentIndex(l, row_id, segment_index)) { + if (!row_groups->TryGetSegmentIndex(l, UnsafeNumericCast(row_id), segment_index)) { // in parallel append scenarios it is possible for the row_id continue; } - row_group = row_groups->GetSegmentByIndex(l, segment_index); + row_group = row_groups->GetSegmentByIndex(l, UnsafeNumericCast(segment_index)); } - if (!row_group->Fetch(transaction, row_id - row_group->start)) { + if (!row_group->Fetch(transaction, UnsafeNumericCast(row_id) - row_group->start)) { continue; } row_group->FetchRow(transaction, state, column_ids, row_id, result, count); @@ -306,7 +307,7 @@ bool RowGroupCollection::IsEmpty(SegmentLock &l) const { } void RowGroupCollection::InitializeAppend(TransactionData transaction, TableAppendState &state) { - state.row_start = total_rows; + state.row_start = UnsafeNumericCast(total_rows.load()); state.current_row = state.row_start; state.total_append_count = 0; @@ -347,7 +348,7 @@ bool RowGroupCollection::Append(DataChunk &chunk, TableAppendState &state) { // merge the stats auto stats_lock = stats.GetLock(); for (idx_t i = 0; i < types.size(); i++) { - current_row_group->MergeIntoStatistics(i, stats.GetStats(i).Statistics()); + current_row_group->MergeIntoStatistics(i, stats.GetStats(*stats_lock, i).Statistics()); } } remaining -= append_count; @@ -376,7 +377,7 @@ bool RowGroupCollection::Append(DataChunk &chunk, TableAppendState &state) { state.current_row += row_t(total_append_count); auto stats_lock = stats.GetLock(); for (idx_t col_idx = 0; col_idx < types.size(); col_idx++) { - stats.GetStats(col_idx).UpdateDistinctStatistics(chunk.data[col_idx], chunk.size()); + stats.GetStats(*stats_lock, col_idx).UpdateDistinctStatistics(chunk.data[col_idx], chunk.size()); } return new_row_group; } @@ -433,7 +434,7 @@ void RowGroupCollection::RevertAppendInternal(idx_t start_row) { // revert from the last segment segment_index = segment_count - 1; } - auto &segment = *row_groups->GetSegmentByIndex(l, segment_index); + auto &segment = *row_groups->GetSegmentByIndex(l, UnsafeNumericCast(segment_index)); // remove any segments AFTER this segment: they should be deleted entirely row_groups->EraseSegments(l, segment_index); @@ -468,7 +469,7 @@ idx_t RowGroupCollection::Delete(TransactionData transaction, DataTable &table, idx_t pos = 0; do { idx_t start = pos; - auto row_group = row_groups->GetSegment(ids[start]); + auto row_group = row_groups->GetSegment(UnsafeNumericCast(ids[start])); for (pos++; pos < count; pos++) { D_ASSERT(ids[pos] >= 0); // check if this id still belongs to this row group @@ -494,10 +495,12 @@ void RowGroupCollection::Update(TransactionData transaction, row_t *ids, const v idx_t pos = 0; do { idx_t start = pos; - auto row_group = row_groups->GetSegment(ids[pos]); + auto row_group = row_groups->GetSegment(UnsafeNumericCast(ids[pos])); row_t base_id = - row_group->start + ((ids[pos] - row_group->start) / STANDARD_VECTOR_SIZE * STANDARD_VECTOR_SIZE); - row_t max_id = MinValue(base_id + STANDARD_VECTOR_SIZE, row_group->start + row_group->count); + UnsafeNumericCast(row_group->start + ((UnsafeNumericCast(ids[pos]) - row_group->start) / + STANDARD_VECTOR_SIZE * STANDARD_VECTOR_SIZE)); + auto max_id = MinValue(base_id + STANDARD_VECTOR_SIZE, + UnsafeNumericCast(row_group->start + row_group->count)); for (pos++; pos < updates.size(); pos++) { D_ASSERT(ids[pos] >= 0); // check if this id still belongs to this vector in this row group @@ -544,8 +547,8 @@ void RowGroupCollection::RemoveFromIndexes(TableIndexList &indexes, Vector &row_ result.Reset(); // figure out which row_group to fetch from auto row_id = row_ids[r]; - auto row_group = row_groups->GetSegment(row_id); - auto row_group_vector_idx = (row_id - row_group->start) / STANDARD_VECTOR_SIZE; + auto row_group = row_groups->GetSegment(UnsafeNumericCast(row_id)); + auto row_group_vector_idx = (UnsafeNumericCast(row_id) - row_group->start) / STANDARD_VECTOR_SIZE; auto base_row_id = row_group_vector_idx * STANDARD_VECTOR_SIZE + row_group->start; // fetch the current vector @@ -572,7 +575,14 @@ void RowGroupCollection::RemoveFromIndexes(TableIndexList &indexes, Vector &row_ result.Slice(sel, sel_count); indexes.Scan([&](Index &index) { - index.Delete(result, row_identifiers); + if (index.IsBound()) { + index.Cast().Delete(result, row_identifiers); + } else { + throw MissingExtensionException( + "Cannot delete from index '%s', unknown index type '%s'. You need to load the " + "extension that provides this index type before table '%s' can be modified.", + index.GetIndexName(), index.GetIndexType(), info->GetTableName()); + } return false; }); } @@ -586,10 +596,11 @@ void RowGroupCollection::UpdateColumn(TransactionData transaction, Vector &row_i } // find the row_group this id belongs to auto primary_column_idx = column_path[0]; - auto row_group = row_groups->GetSegment(first_id); + auto row_group = row_groups->GetSegment(UnsafeNumericCast(first_id)); row_group->UpdateColumn(transaction, updates, row_ids, column_path); - row_group->MergeIntoStatistics(primary_column_idx, stats.GetStats(primary_column_idx).Statistics()); + auto lock = stats.GetLock(); + row_group->MergeIntoStatistics(primary_column_idx, stats.GetStats(*lock, primary_column_idx).Statistics()); } //===--------------------------------------------------------------------===// @@ -789,7 +800,7 @@ class VacuumTask : public BaseCheckpointTask { scan_chunk.Reset(); current_row_group.ScanCommitted(scan_state.table_state, scan_chunk, - TableScanType::TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED); + TableScanType::TABLE_SCAN_LATEST_COMMITTED_ROWS); if (scan_chunk.size() == 0) { break; } @@ -843,8 +854,11 @@ class VacuumTask : public BaseCheckpointTask { idx_t row_start; }; -void RowGroupCollection::InitializeVacuumState(VacuumState &state, vector> &segments) { - state.can_vacuum_deletes = info->indexes.Empty(); +void RowGroupCollection::InitializeVacuumState(CollectionCheckpointState &checkpoint_state, VacuumState &state, + vector> &segments) { + bool is_full_checkpoint = checkpoint_state.writer.GetCheckpointType() == CheckpointType::FULL_CHECKPOINT; + // currently we can only vacuum deletes if we are doing a full checkpoint and there are no indexes + state.can_vacuum_deletes = info->GetIndexes().Empty() && is_full_checkpoint; if (!state.can_vacuum_deletes) { return; } @@ -941,7 +955,7 @@ void RowGroupCollection::Checkpoint(TableDataWriter &writer, TableStatistics &gl CollectionCheckpointState checkpoint_state(*this, writer, segments, global_stats); VacuumState vacuum_state; - InitializeVacuumState(vacuum_state, segments); + InitializeVacuumState(checkpoint_state, vacuum_state, segments); // schedule tasks for (idx_t segment_idx = 0; segment_idx < segments.size(); segment_idx++) { auto &entry = segments[segment_idx]; @@ -1026,25 +1040,24 @@ vector RowGroupCollection::GetColumnSegmentInfo() { // Alter //===--------------------------------------------------------------------===// shared_ptr RowGroupCollection::AddColumn(ClientContext &context, ColumnDefinition &new_column, - Expression &default_value) { + ExpressionExecutor &default_executor) { idx_t new_column_idx = types.size(); auto new_types = types; new_types.push_back(new_column.GetType()); auto result = - make_shared(info, block_manager, std::move(new_types), row_start, total_rows.load()); + make_shared_ptr(info, block_manager, std::move(new_types), row_start, total_rows.load()); - ExpressionExecutor executor(context); DataChunk dummy_chunk; Vector default_vector(new_column.GetType()); - executor.AddExpression(default_value); result->stats.InitializeAddColumn(stats, new_column.GetType()); - auto &new_column_stats = result->stats.GetStats(new_column_idx); + auto lock = result->stats.GetLock(); + auto &new_column_stats = result->stats.GetStats(*lock, new_column_idx); // fill the column with its DEFAULT value, or NULL if none is specified auto new_stats = make_uniq(new_column.GetType()); for (auto ¤t_row_group : row_groups->Segments()) { - auto new_row_group = current_row_group.AddColumn(*result, new_column, executor, default_value, default_vector); + auto new_row_group = current_row_group.AddColumn(*result, new_column, default_executor, default_vector); // merge in the statistics new_row_group->MergeIntoStatistics(new_column_idx, new_column_stats.Statistics()); @@ -1056,10 +1069,10 @@ shared_ptr RowGroupCollection::AddColumn(ClientContext &cont shared_ptr RowGroupCollection::RemoveColumn(idx_t col_idx) { D_ASSERT(col_idx < types.size()); auto new_types = types; - new_types.erase(new_types.begin() + col_idx); + new_types.erase_at(col_idx); auto result = - make_shared(info, block_manager, std::move(new_types), row_start, total_rows.load()); + make_shared_ptr(info, block_manager, std::move(new_types), row_start, total_rows.load()); result->stats.InitializeRemoveColumn(stats, col_idx); for (auto ¤t_row_group : row_groups->Segments()) { @@ -1077,7 +1090,7 @@ shared_ptr RowGroupCollection::AlterType(ClientContext &cont new_types[changed_idx] = target_type; auto result = - make_shared(info, block_manager, std::move(new_types), row_start, total_rows.load()); + make_shared_ptr(info, block_manager, std::move(new_types), row_start, total_rows.load()); result->stats.InitializeAlterType(stats, changed_idx, target_type); vector scan_types; @@ -1099,7 +1112,8 @@ shared_ptr RowGroupCollection::AlterType(ClientContext &cont scan_state.table_state.max_row = row_start + total_rows; // now alter the type of the column within all of the row_groups individually - auto &changed_stats = result->stats.GetStats(changed_idx); + auto lock = result->stats.GetLock(); + auto &changed_stats = result->stats.GetStats(*lock, changed_idx); for (auto ¤t_row_group : row_groups->Segments()) { auto new_row_group = current_row_group.AlterType(*result, target_type, changed_idx, executor, scan_state.table_state, scan_chunk); @@ -1139,8 +1153,8 @@ void RowGroupCollection::VerifyNewConstraint(DataTable &parent, const BoundConst } // Check constraint if (VectorOperations::HasNull(scan_chunk.data[0], scan_chunk.size())) { - throw ConstraintException("NOT NULL constraint failed: %s.%s", info->table, - parent.column_definitions[physical_index].GetName()); + throw ConstraintException("NOT NULL constraint failed: %s.%s", info->GetTableName(), + parent.Columns()[physical_index].GetName()); } } } @@ -1158,8 +1172,8 @@ unique_ptr RowGroupCollection::CopyStats(column_t column_id) { void RowGroupCollection::SetDistinct(column_t column_id, unique_ptr distinct_stats) { D_ASSERT(column_id != COLUMN_IDENTIFIER_ROW_ID); - auto stats_guard = stats.GetLock(); - stats.GetStats(column_id).SetDistinct(std::move(distinct_stats)); + auto stats_lock = stats.GetLock(); + stats.GetStats(*stats_lock, column_id).SetDistinct(std::move(distinct_stats)); } } // namespace duckdb diff --git a/src/duckdb/src/storage/table/row_version_manager.cpp b/src/duckdb/src/storage/table/row_version_manager.cpp index ead21f89..05508908 100644 --- a/src/duckdb/src/storage/table/row_version_manager.cpp +++ b/src/duckdb/src/storage/table/row_version_manager.cpp @@ -69,7 +69,7 @@ bool RowVersionManager::Fetch(TransactionData transaction, idx_t row) { if (!info) { return true; } - return info->Fetch(transaction, row - vector_index * STANDARD_VECTOR_SIZE); + return info->Fetch(transaction, UnsafeNumericCast(row - vector_index * STANDARD_VECTOR_SIZE)); } void RowVersionManager::AppendVersionInfo(TransactionData transaction, idx_t count, idx_t row_group_start, @@ -212,7 +212,7 @@ shared_ptr RowVersionManager::Deserialize(MetaBlockPointer de if (!delete_pointer.IsValid()) { return nullptr; } - auto version_info = make_shared(start); + auto version_info = make_shared_ptr(start); MetadataReader source(manager, delete_pointer, &version_info->storage_pointers); auto chunk_count = source.Read(); D_ASSERT(chunk_count > 0); diff --git a/src/duckdb/src/storage/table/standard_column_data.cpp b/src/duckdb/src/storage/table/standard_column_data.cpp index ce851f00..7f6976c7 100644 --- a/src/duckdb/src/storage/table/standard_column_data.cpp +++ b/src/duckdb/src/storage/table/standard_column_data.cpp @@ -21,8 +21,16 @@ void StandardColumnData::SetStart(idx_t new_start) { validity.SetStart(new_start); } -bool StandardColumnData::HasUpdates() const { - return ColumnData::HasUpdates() || validity.HasUpdates(); +ScanVectorType StandardColumnData::GetVectorScanType(ColumnScanState &state, idx_t scan_count) { + // if either the current column data, or the validity column data requires flat vectors, we scan flat vectors + auto scan_type = ColumnData::GetVectorScanType(state, scan_count); + if (scan_type == ScanVectorType::SCAN_FLAT_VECTOR) { + return ScanVectorType::SCAN_FLAT_VECTOR; + } + if (state.child_states.empty()) { + return scan_type; + } + return validity.GetVectorScanType(state.child_states[0], scan_count); } bool StandardColumnData::CheckZonemap(ColumnScanState &state, TableFilter &filter) { @@ -31,10 +39,15 @@ bool StandardColumnData::CheckZonemap(ColumnScanState &state, TableFilter &filte return true; } state.segment_checked = true; - auto prune_result = filter.CheckStatistics(state.current->stats.statistics); - if (prune_result != FilterPropagateResult::FILTER_ALWAYS_FALSE) { - return true; + FilterPropagateResult prune_result; + { + lock_guard l(stats_lock); + prune_result = filter.CheckStatistics(state.current->stats.statistics); + if (prune_result != FilterPropagateResult::FILTER_ALWAYS_FALSE) { + return true; + } } + lock_guard l(update_lock); if (updates) { auto update_stats = updates->GetStatistics(); prune_result = filter.CheckStatistics(*update_stats); @@ -63,19 +76,19 @@ void StandardColumnData::InitializeScanWithOffset(ColumnScanState &state, idx_t validity.InitializeScanWithOffset(state.child_states[0], row_idx); } -idx_t StandardColumnData::Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, - Vector &result) { +idx_t StandardColumnData::Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t target_count) { D_ASSERT(state.row_index == state.child_states[0].row_index); - auto scan_count = ColumnData::Scan(transaction, vector_index, state, result); - validity.Scan(transaction, vector_index, state.child_states[0], result); + auto scan_count = ColumnData::Scan(transaction, vector_index, state, result, target_count); + validity.Scan(transaction, vector_index, state.child_states[0], result, target_count); return scan_count; } -idx_t StandardColumnData::ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, - bool allow_updates) { +idx_t StandardColumnData::ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates, + idx_t target_count) { D_ASSERT(state.row_index == state.child_states[0].row_index); - auto scan_count = ColumnData::ScanCommitted(vector_index, state, result, allow_updates); - validity.ScanCommitted(vector_index, state.child_states[0], result, allow_updates); + auto scan_count = ColumnData::ScanCommitted(vector_index, state, result, allow_updates, target_count); + validity.ScanCommitted(vector_index, state.child_states[0], result, allow_updates, target_count); return scan_count; } @@ -192,15 +205,14 @@ StandardColumnData::CreateCheckpointState(RowGroup &row_group, PartialBlockManag } unique_ptr StandardColumnData::Checkpoint(RowGroup &row_group, - PartialBlockManager &partial_block_manager, ColumnCheckpointInfo &checkpoint_info) { // we need to checkpoint the main column data first // that is because the checkpointing of the main column data ALSO scans the validity data // to prevent reading the validity data immediately after it is checkpointed we first checkpoint the main column // this is necessary for concurrent checkpointing as due to the partial block manager checkpointed data might be // flushed to disk by a different thread than the one that wrote it, causing a data race - auto base_state = ColumnData::Checkpoint(row_group, partial_block_manager, checkpoint_info); - auto validity_state = validity.Checkpoint(row_group, partial_block_manager, checkpoint_info); + auto base_state = ColumnData::Checkpoint(row_group, checkpoint_info); + auto validity_state = validity.Checkpoint(row_group, checkpoint_info); auto &checkpoint_state = base_state->Cast(); checkpoint_state.validity_state = std::move(validity_state); return base_state; diff --git a/src/duckdb/src/storage/table/struct_column_data.cpp b/src/duckdb/src/storage/table/struct_column_data.cpp index 5fca4dda..14d28e1b 100644 --- a/src/duckdb/src/storage/table/struct_column_data.cpp +++ b/src/duckdb/src/storage/table/struct_column_data.cpp @@ -42,10 +42,16 @@ bool StructColumnData::CheckZonemap(ColumnScanState &state, TableFilter &filter) return true; } state.segment_checked = true; - auto prune_result = filter.CheckStatistics(state.current->stats.statistics); - if (prune_result != FilterPropagateResult::FILTER_ALWAYS_FALSE) { - return true; + + FilterPropagateResult prune_result; + { + lock_guard l(stats_lock); + prune_result = filter.CheckStatistics(state.current->stats.statistics); + if (prune_result != FilterPropagateResult::FILTER_ALWAYS_FALSE) { + return true; + } } + lock_guard l(update_lock); if (updates) { auto update_stats = updates->GetStatistics(); prune_result = filter.CheckStatistics(*update_stats); @@ -90,20 +96,23 @@ void StructColumnData::InitializeScanWithOffset(ColumnScanState &state, idx_t ro } } -idx_t StructColumnData::Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result) { - auto scan_count = validity.Scan(transaction, vector_index, state.child_states[0], result); +idx_t StructColumnData::Scan(TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, + idx_t target_count) { + auto scan_count = validity.Scan(transaction, vector_index, state.child_states[0], result, target_count); auto &child_entries = StructVector::GetEntries(result); for (idx_t i = 0; i < sub_columns.size(); i++) { - sub_columns[i]->Scan(transaction, vector_index, state.child_states[i + 1], *child_entries[i]); + sub_columns[i]->Scan(transaction, vector_index, state.child_states[i + 1], *child_entries[i], target_count); } return scan_count; } -idx_t StructColumnData::ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates) { - auto scan_count = validity.ScanCommitted(vector_index, state.child_states[0], result, allow_updates); +idx_t StructColumnData::ScanCommitted(idx_t vector_index, ColumnScanState &state, Vector &result, bool allow_updates, + idx_t target_count) { + auto scan_count = validity.ScanCommitted(vector_index, state.child_states[0], result, allow_updates, target_count); auto &child_entries = StructVector::GetEntries(result); for (idx_t i = 0; i < sub_columns.size(); i++) { - sub_columns[i]->ScanCommitted(vector_index, state.child_states[i + 1], *child_entries[i], allow_updates); + sub_columns[i]->ScanCommitted(vector_index, state.child_states[i + 1], *child_entries[i], allow_updates, + target_count); } return scan_count; } @@ -157,7 +166,7 @@ void StructColumnData::RevertAppend(row_t start_row) { for (auto &sub_column : sub_columns) { sub_column->RevertAppend(start_row); } - this->count = start_row - this->start; + this->count = UnsafeNumericCast(start_row) - this->start; } idx_t StructColumnData::Fetch(ColumnScanState &state, row_t row_id, Vector &result) { @@ -281,13 +290,11 @@ unique_ptr StructColumnData::CreateCheckpointState(RowGro } unique_ptr StructColumnData::Checkpoint(RowGroup &row_group, - PartialBlockManager &partial_block_manager, ColumnCheckpointInfo &checkpoint_info) { - auto checkpoint_state = make_uniq(row_group, *this, partial_block_manager); - checkpoint_state->validity_state = validity.Checkpoint(row_group, partial_block_manager, checkpoint_info); + auto checkpoint_state = make_uniq(row_group, *this, checkpoint_info.info.manager); + checkpoint_state->validity_state = validity.Checkpoint(row_group, checkpoint_info); for (auto &sub_column : sub_columns) { - checkpoint_state->child_states.push_back( - sub_column->Checkpoint(row_group, partial_block_manager, checkpoint_info)); + checkpoint_state->child_states.push_back(sub_column->Checkpoint(row_group, checkpoint_info)); } return std::move(checkpoint_state); } @@ -301,7 +308,7 @@ void StructColumnData::DeserializeColumn(Deserializer &deserializer, BaseStatist list.ReadObject([&](Deserializer &item) { sub_columns[i]->DeserializeColumn(item, child_stats); }); }); - this->count = validity.count; + this->count = validity.count.load(); } void StructColumnData::GetColumnSegmentInfo(duckdb::idx_t row_group_index, vector col_path, diff --git a/src/duckdb/src/storage/table/table_statistics.cpp b/src/duckdb/src/storage/table/table_statistics.cpp index 5d3a00e1..78245236 100644 --- a/src/duckdb/src/storage/table/table_statistics.cpp +++ b/src/duckdb/src/storage/table/table_statistics.cpp @@ -9,6 +9,7 @@ namespace duckdb { void TableStatistics::Initialize(const vector &types, PersistentTableData &data) { D_ASSERT(Empty()); + stats_lock = make_shared_ptr(); column_stats = std::move(data.table_stats.column_stats); if (column_stats.size() != types.size()) { // LCOV_EXCL_START throw IOException("Table statistics column count is not aligned with table column count. Corrupt file?"); @@ -18,6 +19,7 @@ void TableStatistics::Initialize(const vector &types, PersistentTab void TableStatistics::InitializeEmpty(const vector &types) { D_ASSERT(Empty()); + stats_lock = make_shared_ptr(); for (auto &type : types) { column_stats.push_back(ColumnStatistics::CreateEmptyStats(type)); } @@ -25,8 +27,10 @@ void TableStatistics::InitializeEmpty(const vector &types) { void TableStatistics::InitializeAddColumn(TableStatistics &parent, const LogicalType &new_column_type) { D_ASSERT(Empty()); + D_ASSERT(parent.stats_lock); - lock_guard stats_lock(parent.stats_lock); + stats_lock = parent.stats_lock; + lock_guard lock(*stats_lock); for (idx_t i = 0; i < parent.column_stats.size(); i++) { column_stats.push_back(parent.column_stats[i]); } @@ -35,8 +39,10 @@ void TableStatistics::InitializeAddColumn(TableStatistics &parent, const Logical void TableStatistics::InitializeRemoveColumn(TableStatistics &parent, idx_t removed_column) { D_ASSERT(Empty()); + D_ASSERT(parent.stats_lock); - lock_guard stats_lock(parent.stats_lock); + stats_lock = parent.stats_lock; + lock_guard lock(*stats_lock); for (idx_t i = 0; i < parent.column_stats.size(); i++) { if (i != removed_column) { column_stats.push_back(parent.column_stats[i]); @@ -46,8 +52,10 @@ void TableStatistics::InitializeRemoveColumn(TableStatistics &parent, idx_t remo void TableStatistics::InitializeAlterType(TableStatistics &parent, idx_t changed_idx, const LogicalType &new_type) { D_ASSERT(Empty()); + D_ASSERT(parent.stats_lock); - lock_guard stats_lock(parent.stats_lock); + stats_lock = parent.stats_lock; + lock_guard lock(*stats_lock); for (idx_t i = 0; i < parent.column_stats.size(); i++) { if (i == changed_idx) { column_stats.push_back(ColumnStatistics::CreateEmptyStats(new_type)); @@ -59,8 +67,10 @@ void TableStatistics::InitializeAlterType(TableStatistics &parent, idx_t changed void TableStatistics::InitializeAddConstraint(TableStatistics &parent) { D_ASSERT(Empty()); + D_ASSERT(parent.stats_lock); - lock_guard stats_lock(parent.stats_lock); + stats_lock = parent.stats_lock; + lock_guard lock(*stats_lock); for (idx_t i = 0; i < parent.column_stats.size(); i++) { column_stats.push_back(parent.column_stats[i]); } @@ -86,12 +96,12 @@ void TableStatistics::MergeStats(TableStatisticsLock &lock, idx_t i, BaseStatist column_stats[i]->Statistics().Merge(stats); } -ColumnStatistics &TableStatistics::GetStats(idx_t i) { +ColumnStatistics &TableStatistics::GetStats(TableStatisticsLock &lock, idx_t i) { return *column_stats[i]; } unique_ptr TableStatistics::CopyStats(idx_t i) { - lock_guard l(stats_lock); + lock_guard l(*stats_lock); auto result = column_stats[i]->Statistics().Copy(); if (column_stats[i]->HasDistinctStats()) { result.SetDistinctCount(column_stats[i]->DistinctStats().GetCount()); @@ -100,6 +110,13 @@ unique_ptr TableStatistics::CopyStats(idx_t i) { } void TableStatistics::CopyStats(TableStatistics &other) { + TableStatisticsLock lock(*stats_lock); + CopyStats(lock, other); +} + +void TableStatistics::CopyStats(TableStatisticsLock &lock, TableStatistics &other) { + D_ASSERT(other.Empty()); + other.stats_lock = make_shared_ptr(); for (auto &stats : column_stats) { other.column_stats.push_back(stats->Copy()); } @@ -125,14 +142,16 @@ void TableStatistics::Deserialize(Deserializer &deserializer, ColumnList &column deserializer.Unset(); }); - table_sample = deserializer.ReadPropertyWithDefault>(101, "sample", nullptr); + table_sample = deserializer.ReadPropertyWithDefault>(101, "table_sample", nullptr); } unique_ptr TableStatistics::GetLock() { - return make_uniq(stats_lock); + D_ASSERT(stats_lock); + return make_uniq(*stats_lock); } bool TableStatistics::Empty() { + D_ASSERT(column_stats.empty() == (stats_lock.get() == nullptr)); return column_stats.empty(); } diff --git a/src/duckdb/src/storage/table/update_segment.cpp b/src/duckdb/src/storage/table/update_segment.cpp index 624d987e..317023de 100644 --- a/src/duckdb/src/storage/table/update_segment.cpp +++ b/src/duckdb/src/storage/table/update_segment.cpp @@ -581,7 +581,7 @@ void UpdateSegment::InitializeUpdateInfo(UpdateInfo &info, row_t *ids, const Sel auto idx = sel.get_index(i); auto id = ids[idx]; D_ASSERT(idx_t(id) >= vector_offset && idx_t(id) < vector_offset + STANDARD_VECTOR_SIZE); - info.tuples[i] = NumericCast(id - vector_offset); + info.tuples[i] = NumericCast(NumericCast(id) - vector_offset); }; } @@ -697,7 +697,7 @@ static idx_t MergeLoop(row_t a[], sel_t b[], idx_t acount, idx_t bcount, idx_t a idx_t count = 0; while (aidx < acount && bidx < bcount) { auto a_index = asel.get_index(aidx); - auto a_id = a[a_index] - aoffset; + auto a_id = UnsafeNumericCast(a[a_index]) - aoffset; auto b_id = b[bidx]; if (a_id == b_id) { merge(a_id, a_index, bidx, count); @@ -716,7 +716,7 @@ static idx_t MergeLoop(row_t a[], sel_t b[], idx_t acount, idx_t bcount, idx_t a } for (; aidx < acount; aidx++) { auto a_index = asel.get_index(aidx); - pick_a(a[a_index] - aoffset, a_index, count); + pick_a(UnsafeNumericCast(a[a_index]) - aoffset, a_index, count); count++; } for (; bidx < bcount; bidx++) { @@ -777,7 +777,7 @@ static void MergeUpdateLoopInternal(UpdateInfo *base_info, V *base_table_data, U for (idx_t i = 0; i < count; i++) { auto idx = sel.get_index(i); // we have to merge the info for "ids[i]" - auto update_id = ids[idx] - base_id; + auto update_id = UnsafeNumericCast(ids[idx]) - base_id; while (update_info_offset < update_info->N && update_info->tuples[update_info_offset] < update_id) { // old id comes before the current id: write it @@ -1103,7 +1103,7 @@ void UpdateSegment::Update(TransactionData transaction, idx_t column_index, Vect // get the vector index based on the first id // we assert that all updates must be part of the same vector auto first_id = ids[sel.get_index(0)]; - idx_t vector_index = (first_id - column_data.start) / STANDARD_VECTOR_SIZE; + idx_t vector_index = (UnsafeNumericCast(first_id) - column_data.start) / STANDARD_VECTOR_SIZE; idx_t vector_offset = column_data.start + vector_index * STANDARD_VECTOR_SIZE; D_ASSERT(idx_t(first_id) >= column_data.start); @@ -1116,7 +1116,7 @@ void UpdateSegment::Update(TransactionData transaction, idx_t column_index, Vect // there is already a version here, check if there are any conflicts and search for the node that belongs to // this transaction in the version chain auto base_info = root->info[vector_index]->info.get(); - CheckForConflicts(base_info->next, transaction, ids, sel, count, vector_offset, node); + CheckForConflicts(base_info->next, transaction, ids, sel, count, UnsafeNumericCast(vector_offset), node); // there are no conflicts // first, check if this thread has already done any updates diff --git a/src/duckdb/src/storage/table/validity_column_data.cpp b/src/duckdb/src/storage/table/validity_column_data.cpp index bd594fd1..c6659d90 100644 --- a/src/duckdb/src/storage/table/validity_column_data.cpp +++ b/src/duckdb/src/storage/table/validity_column_data.cpp @@ -13,4 +13,9 @@ bool ValidityColumnData::CheckZonemap(ColumnScanState &state, TableFilter &filte return true; } +void ValidityColumnData::AppendData(BaseStatistics &stats, ColumnAppendState &state, UnifiedVectorFormat &vdata, + idx_t count) { + lock_guard l(stats_lock); + ColumnData::AppendData(stats, state, vdata, count); +} } // namespace duckdb diff --git a/src/duckdb/src/storage/table_index_list.cpp b/src/duckdb/src/storage/table_index_list.cpp index 1e07ce6f..8cc8487e 100644 --- a/src/duckdb/src/storage/table_index_list.cpp +++ b/src/duckdb/src/storage/table_index_list.cpp @@ -1,12 +1,14 @@ #include "duckdb/storage/table/table_index_list.hpp" -#include "duckdb/storage/data_table.hpp" #include "duckdb/common/types/conflict_manager.hpp" -#include "duckdb/execution/index/unknown_index.hpp" #include "duckdb/execution/index/index_type_set.hpp" -#include "duckdb/storage/table/data_table_info.hpp" -#include "duckdb/main/database.hpp" +#include "duckdb/execution/index/unbound_index.hpp" #include "duckdb/main/config.hpp" +#include "duckdb/main/database.hpp" +#include "duckdb/storage/data_table.hpp" +#include "duckdb/storage/table/data_table_info.hpp" +#include "duckdb/catalog/catalog_entry/duck_table_entry.hpp" +#include "duckdb/planner/expression_binder/index_binder.hpp" namespace duckdb { void TableIndexList::AddIndex(unique_ptr index) { @@ -20,8 +22,9 @@ void TableIndexList::RemoveIndex(const string &name) { for (idx_t index_idx = 0; index_idx < indexes.size(); index_idx++) { auto &index_entry = indexes[index_idx]; - if (index_entry->name == name) { - indexes.erase(indexes.begin() + index_idx); + + if (index_entry->GetIndexName() == name) { + indexes.erase_at(index_idx); break; } } @@ -32,9 +35,8 @@ void TableIndexList::CommitDrop(const string &name) { for (idx_t index_idx = 0; index_idx < indexes.size(); index_idx++) { auto &index_entry = indexes[index_idx]; - if (index_entry->name == name) { + if (index_entry->GetIndexName() == name) { index_entry->CommitDrop(); - break; } } } @@ -46,7 +48,7 @@ bool TableIndexList::NameIsUnique(const string &name) { for (idx_t index_idx = 0; index_idx < indexes.size(); index_idx++) { auto &index_entry = indexes[index_idx]; if (index_entry->IsPrimary() || index_entry->IsForeign() || index_entry->IsUnique()) { - if (index_entry->name == name) { + if (index_entry->GetIndexName() == name) { return false; } } @@ -55,38 +57,53 @@ bool TableIndexList::NameIsUnique(const string &name) { return true; } -void TableIndexList::InitializeIndexes(ClientContext &context, DataTableInfo &table_info, bool throw_on_failure) { - lock_guard lock(indexes_lock); - for (auto &index : indexes) { - if (!index->IsUnknown()) { - continue; - } - - auto &unknown_index = index->Cast(); - auto &index_type_name = unknown_index.GetIndexType(); - - // Do we know the type of this index now? - auto index_type = context.db->config.GetIndexTypes().FindByName(index_type_name); - if (!index_type) { - if (throw_on_failure) { - throw MissingExtensionException( - "Cannot initialize index '%s', unknown index type '%s'. You probably need to load an extension.", - unknown_index.name, index_type_name); +void TableIndexList::InitializeIndexes(ClientContext &context, DataTableInfo &table_info, const char *index_type) { + // Fast path: do we have any unbound indexes? + bool needs_binding = false; + { + lock_guard lock(indexes_lock); + for (auto &index : indexes) { + if (!index->IsBound() && (index_type == nullptr || index->GetIndexType() == index_type)) { + needs_binding = true; + break; } - continue; } + } + if (!needs_binding) { + return; + } - // Swap this with a new index - auto &create_info = unknown_index.GetCreateInfo(); - auto &storage_info = unknown_index.GetStorageInfo(); - - CreateIndexInput input(*table_info.table_io_manager, table_info.db, create_info.constraint_type, - create_info.index_name, create_info.column_ids, unknown_index.unbound_expressions, - storage_info, create_info.options); - - auto index_instance = index_type->create_instance(input); + // Get the table from the catalog so we can add it to the binder + auto &catalog = table_info.GetDB().GetCatalog(); + auto &table = + catalog.GetEntry(context, CatalogType::TABLE_ENTRY, table_info.GetSchemaName(), table_info.GetTableName()) + .Cast(); + vector column_types; + vector column_names; + for (auto &col : table.GetColumns().Logical()) { + column_types.push_back(col.Type()); + column_names.push_back(col.Name()); + } - index = std::move(index_instance); + lock_guard lock(indexes_lock); + for (auto &index : indexes) { + if (!index->IsBound() && (index_type == nullptr || index->GetIndexType() == index_type)) { + // Create a binder to bind this index (we cant reuse this binder for other indexes) + auto binder = Binder::CreateBinder(context); + + // Add the table to the binder + // We're not interested in the column_ids here, so just pass a dummy vector + vector dummy_column_ids; + binder->bind_context.AddBaseTable(0, table_info.GetTableName(), column_names, column_types, + dummy_column_ids, &table); + + // Create an IndexBinder to bind the index + IndexBinder idx_binder(*binder, context); + + // Replace the unbound index with a bound index + auto bound_idx = idx_binder.BindIndex(index->Cast()); + index = std::move(bound_idx); + } } } @@ -127,15 +144,18 @@ void TableIndexList::VerifyForeignKey(const vector &fk_keys, Data if (!index) { throw InternalException("Internal Foreign Key error: could not find index to verify..."); } + if (!index->IsBound()) { + throw InternalException("Internal Foreign Key error: trying to verify an unbound index..."); + } conflict_manager.SetIndexCount(1); - index->CheckConstraintsForChunk(chunk, conflict_manager); + index->Cast().CheckConstraintsForChunk(chunk, conflict_manager); } vector TableIndexList::GetRequiredColumns() { lock_guard lock(indexes_lock); set unique_indexes; for (auto &index : indexes) { - for (auto col_index : index->column_ids) { + for (auto col_index : index->GetColumnIds()) { unique_indexes.insert(col_index); } } @@ -151,9 +171,16 @@ vector TableIndexList::GetStorageInfos() { vector index_storage_infos; for (auto &index : indexes) { - auto index_storage_info = index->GetStorageInfo(false); - D_ASSERT(index_storage_info.IsValid() && !index_storage_info.name.empty()); - index_storage_infos.push_back(index_storage_info); + if (index->IsBound()) { + auto index_storage_info = index->Cast().GetStorageInfo(false); + D_ASSERT(index_storage_info.IsValid() && !index_storage_info.name.empty()); + index_storage_infos.push_back(index_storage_info); + } else { + // TODO: Will/should this ever happen? + auto index_storage_info = index->Cast().GetStorageInfo(); + D_ASSERT(index_storage_info.IsValid() && !index_storage_info.name.empty()); + index_storage_infos.push_back(index_storage_info); + } } return index_storage_infos; } diff --git a/src/duckdb/src/storage/temporary_file_manager.cpp b/src/duckdb/src/storage/temporary_file_manager.cpp index c3748290..d9a894cc 100644 --- a/src/duckdb/src/storage/temporary_file_manager.cpp +++ b/src/duckdb/src/storage/temporary_file_manager.cpp @@ -8,7 +8,10 @@ namespace duckdb { // BlockIndexManager //===--------------------------------------------------------------------===// -BlockIndexManager::BlockIndexManager() : max_index(0) { +BlockIndexManager::BlockIndexManager(TemporaryFileManager &manager) : max_index(0), manager(&manager) { +} + +BlockIndexManager::BlockIndexManager() : max_index(0), manager(nullptr) { } idx_t BlockIndexManager::GetNewBlockIndex() { @@ -28,11 +31,11 @@ bool BlockIndexManager::RemoveIndex(idx_t index) { // check if we can truncate the file // get the max_index in use right now - auto max_index_in_use = indexes_in_use.empty() ? 0 : *indexes_in_use.rbegin(); + auto max_index_in_use = indexes_in_use.empty() ? 0 : *indexes_in_use.rbegin() + 1; if (max_index_in_use < max_index) { // max index in use is lower than the max_index // reduce the max_index - max_index = indexes_in_use.empty() ? 0 : max_index_in_use + 1; + SetMaxIndex(max_index_in_use); // we can remove any free_indexes that are larger than the current max_index while (!free_indexes.empty()) { auto max_entry = *free_indexes.rbegin(); @@ -54,9 +57,32 @@ bool BlockIndexManager::HasFreeBlocks() { return !free_indexes.empty(); } +void BlockIndexManager::SetMaxIndex(idx_t new_index) { + static constexpr idx_t TEMPFILE_BLOCK_SIZE = Storage::BLOCK_ALLOC_SIZE; + if (!manager) { + max_index = new_index; + } else { + auto old = max_index; + if (new_index < old) { + max_index = new_index; + auto difference = old - new_index; + auto size_on_disk = difference * TEMPFILE_BLOCK_SIZE; + manager->DecreaseSizeOnDisk(size_on_disk); + } else if (new_index > old) { + auto difference = new_index - old; + auto size_on_disk = difference * TEMPFILE_BLOCK_SIZE; + manager->IncreaseSizeOnDisk(size_on_disk); + // Increase can throw, so this is only updated after it was succesfully updated + max_index = new_index; + } + } +} + idx_t BlockIndexManager::GetNewBlockIndexInternal() { if (free_indexes.empty()) { - return max_index++; + auto new_index = max_index; + SetMaxIndex(max_index + 1); + return new_index; } auto entry = free_indexes.begin(); auto index = *entry; @@ -69,9 +95,10 @@ idx_t BlockIndexManager::GetNewBlockIndexInternal() { //===--------------------------------------------------------------------===// TemporaryFileHandle::TemporaryFileHandle(idx_t temp_file_count, DatabaseInstance &db, const string &temp_directory, - idx_t index) + idx_t index, TemporaryFileManager &manager) : max_allowed_index((1 << temp_file_count) * MAX_ALLOWED_INDEX_BASE), db(db), file_index(index), - path(FileSystem::GetFileSystem(db).JoinPath(temp_directory, "duckdb_temp_storage-" + to_string(index) + ".tmp")) { + path(FileSystem::GetFileSystem(db).JoinPath(temp_directory, "duckdb_temp_storage-" + to_string(index) + ".tmp")), + index_manager(manager) { } TemporaryFileHandle::TemporaryFileLock::TemporaryFileLock(mutex &mutex) : lock(mutex) { @@ -106,7 +133,7 @@ void TemporaryFileHandle::EraseBlockIndex(block_id_t block_index) { // remove the block (and potentially truncate the temp file) TemporaryFileLock lock(file_lock); D_ASSERT(handle); - RemoveTempBlockIndex(lock, block_index); + RemoveTempBlockIndex(lock, NumericCast(block_index)); } bool TemporaryFileHandle::DeleteIfEmpty() { @@ -147,7 +174,7 @@ void TemporaryFileHandle::RemoveTempBlockIndex(TemporaryFileLock &, idx_t index) #ifndef WIN32 // this ended up causing issues when sorting auto max_index = index_manager.GetMaxIndex(); auto &fs = FileSystem::GetFileSystem(db); - fs.Truncate(*handle, GetPositionInFile(max_index + 1)); + fs.Truncate(*handle, NumericCast(GetPositionInFile(max_index + 1))); #endif } } @@ -160,15 +187,15 @@ idx_t TemporaryFileHandle::GetPositionInFile(idx_t index) { // TemporaryDirectoryHandle //===--------------------------------------------------------------------===// -TemporaryDirectoryHandle::TemporaryDirectoryHandle(DatabaseInstance &db, string path_p) +TemporaryDirectoryHandle::TemporaryDirectoryHandle(DatabaseInstance &db, string path_p, optional_idx max_swap_space) : db(db), temp_directory(std::move(path_p)), temp_file(make_uniq(db, temp_directory)) { auto &fs = FileSystem::GetFileSystem(db); - if (!temp_directory.empty()) { - if (!fs.DirectoryExists(temp_directory)) { - fs.CreateDirectory(temp_directory); - created_directory = true; - } + D_ASSERT(!temp_directory.empty()); + if (!fs.DirectoryExists(temp_directory)) { + fs.CreateDirectory(temp_directory); + created_directory = true; } + temp_file->SetMaxSwapSpace(max_swap_space); } TemporaryDirectoryHandle::~TemporaryDirectoryHandle() { @@ -224,8 +251,26 @@ bool TemporaryFileIndex::IsValid() const { // TemporaryFileManager //===--------------------------------------------------------------------===// +static idx_t GetDefaultMax(const string &path) { + D_ASSERT(!path.empty()); + auto disk_space = FileSystem::GetAvailableDiskSpace(path); + // Use the available disk space + // We have made sure that the file exists before we call this, it shouldn't fail + if (!disk_space.IsValid()) { + // But if it does (i.e because the system call is not implemented) + // we don't cap the available swap space + return DConstants::INVALID_INDEX - 1; + } + // Only use 90% of the available disk space + return static_cast(static_cast(disk_space.GetIndex()) * 0.9); +} + TemporaryFileManager::TemporaryFileManager(DatabaseInstance &db, const string &temp_directory_p) - : db(db), temp_directory(temp_directory_p) { + : db(db), temp_directory(temp_directory_p), size_on_disk(0), max_swap_space(0) { +} + +TemporaryFileManager::~TemporaryFileManager() { + files.clear(); } TemporaryFileManager::TemporaryManagerLock::TemporaryManagerLock(mutex &mutex) : lock(mutex) { @@ -250,7 +295,7 @@ void TemporaryFileManager::WriteTemporaryBuffer(block_id_t block_id, FileBuffer if (!handle) { // no existing handle to write to; we need to create & open a new file auto new_file_index = index_manager.GetNewBlockIndex(); - auto new_file = make_uniq(files.size(), db, temp_directory, new_file_index); + auto new_file = make_uniq(files.size(), db, temp_directory, new_file_index, *this); handle = new_file.get(); files[new_file_index] = std::move(new_file); @@ -269,6 +314,55 @@ bool TemporaryFileManager::HasTemporaryBuffer(block_id_t block_id) { return used_blocks.find(block_id) != used_blocks.end(); } +idx_t TemporaryFileManager::GetTotalUsedSpaceInBytes() { + return size_on_disk.load(); +} + +optional_idx TemporaryFileManager::GetMaxSwapSpace() const { + return max_swap_space; +} + +void TemporaryFileManager::SetMaxSwapSpace(optional_idx limit) { + idx_t new_limit; + if (limit.IsValid()) { + new_limit = limit.GetIndex(); + } else { + new_limit = GetDefaultMax(temp_directory); + } + + auto current_size_on_disk = size_on_disk.load(); + if (current_size_on_disk > new_limit) { + auto used = StringUtil::BytesToHumanReadableString(current_size_on_disk); + auto max = StringUtil::BytesToHumanReadableString(new_limit); + throw OutOfMemoryException( + R"(failed to adjust the 'max_temp_directory_size', currently used space (%s) exceeds the new limit (%s) +Please increase the limit or destroy the buffers stored in the temp directory by e.g removing temporary tables. +To get usage information of the temp_directory, use 'CALL duckdb_temporary_files();' + )", + used, max); + } + max_swap_space = new_limit; +} + +void TemporaryFileManager::IncreaseSizeOnDisk(idx_t bytes) { + auto current_size_on_disk = size_on_disk.load(); + if (current_size_on_disk + bytes > max_swap_space) { + auto used = StringUtil::BytesToHumanReadableString(current_size_on_disk); + auto max = StringUtil::BytesToHumanReadableString(max_swap_space); + auto data_size = StringUtil::BytesToHumanReadableString(bytes); + throw OutOfMemoryException(R"(failed to offload data block of size %s (%s/%s used). +This limit was set by the 'max_temp_directory_size' setting. +By default, this setting utilizes the available disk space on the drive where the 'temp_directory' is located. +You can adjust this setting, by using (for example) PRAGMA max_temp_directory_size='10GiB')", + data_size, used, max); + } + size_on_disk += bytes; +} + +void TemporaryFileManager::DecreaseSizeOnDisk(idx_t bytes) { + size_on_disk -= bytes; +} + unique_ptr TemporaryFileManager::ReadTemporaryBuffer(block_id_t id, unique_ptr reusable_buffer) { TemporaryFileIndex index; @@ -310,7 +404,7 @@ void TemporaryFileManager::EraseUsedBlock(TemporaryManagerLock &lock, block_id_t throw InternalException("EraseUsedBlock - Block %llu not found in used blocks", id); } used_blocks.erase(entry); - handle->EraseBlockIndex(index.block_index); + handle->EraseBlockIndex(NumericCast(index.block_index)); if (handle->DeleteIfEmpty()) { EraseFileHandle(lock, index.file_index); } diff --git a/src/duckdb/src/storage/temporary_memory_manager.cpp b/src/duckdb/src/storage/temporary_memory_manager.cpp index a6d07b9b..2564e11c 100644 --- a/src/duckdb/src/storage/temporary_memory_manager.cpp +++ b/src/duckdb/src/storage/temporary_memory_manager.cpp @@ -45,9 +45,9 @@ void TemporaryMemoryManager::UpdateConfiguration(ClientContext &context) { auto &buffer_manager = BufferManager::GetBufferManager(context); auto &task_scheduler = TaskScheduler::GetScheduler(context); - memory_limit = MAXIMUM_MEMORY_LIMIT_RATIO * double(buffer_manager.GetMaxMemory()); + memory_limit = NumericCast(MAXIMUM_MEMORY_LIMIT_RATIO * static_cast(buffer_manager.GetMaxMemory())); has_temporary_directory = buffer_manager.HasTemporaryDirectory(); - num_threads = task_scheduler.NumberOfThreads(); + num_threads = NumericCast(task_scheduler.NumberOfThreads()); query_max_memory = buffer_manager.GetQueryMaxMemory(); } @@ -92,14 +92,14 @@ void TemporaryMemoryManager::UpdateState(ClientContext &context, TemporaryMemory // 3. MAXIMUM_FREE_MEMORY_RATIO * free memory auto upper_bound = MinValue(temporary_memory_state.remaining_size, query_max_memory); auto free_memory = memory_limit - (reservation - temporary_memory_state.reservation); - upper_bound = MinValue(upper_bound, MAXIMUM_FREE_MEMORY_RATIO * free_memory); + upper_bound = MinValue(upper_bound, NumericCast(MAXIMUM_FREE_MEMORY_RATIO * free_memory)); if (remaining_size > memory_limit) { // We're processing more data than fits in memory, so we must further limit memory usage. // The upper bound for the reservation of this state is now also the minimum of: // 3. The ratio of the remaining size of this state and the total remaining size * memory limit auto ratio_of_remaining = double(temporary_memory_state.remaining_size) / double(remaining_size); - upper_bound = MinValue(upper_bound, ratio_of_remaining * memory_limit); + upper_bound = MinValue(upper_bound, NumericCast(ratio_of_remaining * memory_limit)); } SetReservation(temporary_memory_state, MaxValue(lower_bound, upper_bound)); diff --git a/src/duckdb/src/storage/wal_replay.cpp b/src/duckdb/src/storage/wal_replay.cpp index 9699bbac..3f0cf4db 100644 --- a/src/duckdb/src/storage/wal_replay.cpp +++ b/src/duckdb/src/storage/wal_replay.cpp @@ -25,6 +25,9 @@ #include "duckdb/common/checksum.hpp" #include "duckdb/execution/index/index_type_set.hpp" #include "duckdb/execution/index/art/art.hpp" +#include "duckdb/main/config.hpp" +#include "duckdb/storage/table/delete_state.hpp" +#include "duckdb/transaction/meta_transaction.hpp" namespace duckdb { @@ -160,6 +163,7 @@ class WriteAheadLogDeserializer { //===--------------------------------------------------------------------===// bool WriteAheadLog::Replay(AttachedDatabase &database, unique_ptr handle) { Connection con(database.GetDatabase()); + auto wal_path = handle->GetPath(); BufferedFileReader reader(FileSystem::Get(database), std::move(handle)); if (reader.Finished()) { // WAL is empty @@ -167,7 +171,9 @@ bool WriteAheadLog::Replay(AttachedDatabase &database, unique_ptr ha } con.BeginTransaction(); + MetaTransaction::Get(*con.context).ModifyDatabase(database); + auto &config = DBConfig::GetConfig(database.GetDatabase()); // first deserialize the WAL to look for a checkpoint flag // if there is a checkpoint flag, we might have already flushed the contents of the WAL to disk ReplayState checkpoint_state(database, *con.context); @@ -185,16 +191,10 @@ bool WriteAheadLog::Replay(AttachedDatabase &database, unique_ptr ha } } catch (std::exception &ex) { // LCOV_EXCL_START ErrorData error(ex); - if (error.Type() == ExceptionType::SERIALIZATION) { - // serialization exception - torn WAL - // continue reading - } else { - Printer::PrintF("Exception in WAL playback during initial read: %s\n", error.RawMessage()); - return false; + // ignore serialization exceptions - they signal a torn WAL + if (error.Type() != ExceptionType::SERIALIZATION) { + error.Throw("Failure while replaying WAL file \"" + wal_path + "\": "); } - } catch (...) { - Printer::Print("Unknown Exception in WAL playback during initial read"); - return false; } // LCOV_EXCL_STOP if (checkpoint_state.checkpoint_id.IsValid()) { // there is a checkpoint flag: check if we need to deserialize the WAL @@ -215,7 +215,6 @@ bool WriteAheadLog::Replay(AttachedDatabase &database, unique_ptr ha // replay the WAL // note that everything is wrapped inside a try/catch block here // there can be errors in WAL replay because of a corrupt WAL file - // in this case we should throw a warning but startup anyway try { while (true) { // read the current entry @@ -228,20 +227,23 @@ bool WriteAheadLog::Replay(AttachedDatabase &database, unique_ptr ha break; } con.BeginTransaction(); + MetaTransaction::Get(*con.context).ModifyDatabase(database); } } } catch (std::exception &ex) { // LCOV_EXCL_START + // exception thrown in WAL replay: rollback + con.Query("ROLLBACK"); ErrorData error(ex); - if (error.Type() != ExceptionType::SERIALIZATION) { - // FIXME: this should report a proper warning in the connection - Printer::PrintF("Exception in WAL playback: %s\n", error.RawMessage()); - // exception thrown in WAL replay: rollback + // serialization failure means a truncated WAL + // these failures are ignored unless abort_on_wal_failure is true + // other failures always result in an error + if (config.options.abort_on_wal_failure || error.Type() != ExceptionType::SERIALIZATION) { + error.Throw("Failure while replaying WAL file \"" + wal_path + "\": "); } - con.Rollback(); } catch (...) { - Printer::Print("Unknown Exception in WAL playback: %s\n"); // exception thrown in WAL replay: rollback - con.Rollback(); + con.Query("ROLLBACK"); + throw; } // LCOV_EXCL_STOP return false; } @@ -346,7 +348,7 @@ void WriteAheadLogDeserializer::ReplayCreateTable() { // bind the constraints to the table again auto binder = Binder::CreateBinder(context); auto &schema = catalog.GetSchema(context, info->schema); - auto bound_info = binder->BindCreateTableInfo(std::move(info), schema); + auto bound_info = Binder::BindCreateTableCheckpoint(std::move(info), schema); catalog.CreateTable(context, *bound_info); } @@ -580,7 +582,7 @@ void WriteAheadLogDeserializer::ReplayCreateIndex() { // create the index in the catalog auto &table = catalog.GetEntry(context, create_info->schema, info.table).Cast(); auto &index = catalog.CreateIndex(context, info)->Cast(); - index.info = make_shared(table.GetStorage().info, index.name); + index.info = make_shared_ptr(table.GetStorage().GetDataTableInfo(), index.name); // insert the parsed expressions into the index so that we can (de)serialize them during consecutive checkpoints for (auto &parsed_expr : info.parsed_expressions) { @@ -621,7 +623,7 @@ void WriteAheadLogDeserializer::ReplayCreateIndex() { info.column_ids, unbound_expressions, index_info, info.options); auto index_instance = index_type->create_instance(input); - data_table.info->indexes.AddIndex(std::move(index_instance)); + data_table.AddIndex(std::move(index_instance)); } void WriteAheadLogDeserializer::ReplayDropIndex() { @@ -659,7 +661,9 @@ void WriteAheadLogDeserializer::ReplayInsert() { } // append to the current table - state.current_table->GetStorage().LocalAppend(*state.current_table, context, chunk); + // we don't do any constraint verification here + vector> bound_constraints; + state.current_table->GetStorage().LocalAppend(*state.current_table, context, chunk, bound_constraints); } void WriteAheadLogDeserializer::ReplayDelete() { @@ -678,9 +682,10 @@ void WriteAheadLogDeserializer::ReplayDelete() { auto source_ids = FlatVector::GetData(chunk.data[0]); // delete the tuples from the current table + TableDeleteState delete_state; for (idx_t i = 0; i < chunk.size(); i++) { row_ids[0] = source_ids[i]; - state.current_table->GetStorage().Delete(*state.current_table, context, row_identifiers, 1); + state.current_table->GetStorage().Delete(delete_state, context, row_identifiers, 1); } } diff --git a/src/duckdb/src/storage/write_ahead_log.cpp b/src/duckdb/src/storage/write_ahead_log.cpp index 165ef10e..c579812e 100644 --- a/src/duckdb/src/storage/write_ahead_log.cpp +++ b/src/duckdb/src/storage/write_ahead_log.cpp @@ -10,6 +10,7 @@ #include "duckdb/main/database.hpp" #include "duckdb/parser/parsed_data/alter_table_info.hpp" #include "duckdb/storage/index.hpp" +#include "duckdb/execution/index/bound_index.hpp" #include "duckdb/storage/table/data_table_info.hpp" #include "duckdb/storage/table_io_manager.hpp" #include "duckdb/common/checksum.hpp" @@ -19,27 +20,33 @@ namespace duckdb { const uint64_t WAL_VERSION_NUMBER = 2; -WriteAheadLog::WriteAheadLog(AttachedDatabase &database, const string &path) : skip_writing(false), database(database) { - wal_path = path; - writer = make_uniq(FileSystem::Get(database), path, - FileFlags::FILE_FLAGS_WRITE | FileFlags::FILE_FLAGS_FILE_CREATE | - FileFlags::FILE_FLAGS_APPEND); +WriteAheadLog::WriteAheadLog(AttachedDatabase &database, const string &wal_path) + : skip_writing(false), database(database), wal_path(wal_path) { } WriteAheadLog::~WriteAheadLog() { } -int64_t WriteAheadLog::GetWALSize() { - D_ASSERT(writer); - return writer->GetFileSize(); +BufferedFileWriter &WriteAheadLog::Initialize() { + if (!writer) { + writer = make_uniq(FileSystem::Get(database), wal_path, + FileFlags::FILE_FLAGS_WRITE | FileFlags::FILE_FLAGS_FILE_CREATE | + FileFlags::FILE_FLAGS_APPEND); + } + return GetWriter(); } idx_t WriteAheadLog::GetTotalWritten() { - D_ASSERT(writer); + if (!writer) { + return 0; + } return writer->GetTotalWritten(); } void WriteAheadLog::Truncate(int64_t size) { + if (!writer) { + return; + } writer->Truncate(size); } @@ -48,7 +55,6 @@ void WriteAheadLog::Delete() { return; } writer.reset(); - auto &fs = FileSystem::Get(database); fs.RemoveFile(wal_path); } @@ -58,7 +64,7 @@ void WriteAheadLog::Delete() { //===--------------------------------------------------------------------===// class ChecksumWriter : public WriteStream { public: - explicit ChecksumWriter(WriteAheadLog &wal) : wal(wal), stream(wal.GetWriter()) { + explicit ChecksumWriter(WriteAheadLog &wal) : wal(wal) { } void WriteData(const_data_ptr_t buffer, idx_t write_size) override { @@ -73,22 +79,25 @@ class ChecksumWriter : public WriteStream { if (wal.skip_writing) { return; } + if (!stream) { + stream = wal.Initialize(); + } auto data = memory_stream.GetData(); auto size = memory_stream.GetPosition(); // compute the checksum over the entry auto checksum = Checksum(data, size); // write the checksum and the length of the entry - stream.Write(size); - stream.Write(checksum); + stream->Write(size); + stream->Write(checksum); // write data to the underlying stream - stream.WriteData(memory_stream.GetData(), memory_stream.GetPosition()); + stream->WriteData(memory_stream.GetData(), memory_stream.GetPosition()); // rewind the buffer memory_stream.Rewind(); } private: WriteAheadLog &wal; - WriteStream &stream; + optional_ptr stream; MemoryStream memory_stream; }; @@ -99,6 +108,9 @@ class WriteAheadLogSerializer { if (wal.skip_writing) { return; } + if (!wal.Initialized()) { + wal.Initialize(); + } // write a version marker if none has been written yet wal.WriteVersion(); serializer.Begin(); @@ -109,6 +121,7 @@ class WriteAheadLogSerializer { if (wal.skip_writing) { return; } + D_ASSERT(wal.Initialized()); serializer.End(); checksum_writer.Flush(); } @@ -118,6 +131,7 @@ class WriteAheadLogSerializer { if (wal.skip_writing) { return; } + D_ASSERT(wal.Initialized()); serializer.WriteProperty(field_id, tag, value); } @@ -126,6 +140,7 @@ class WriteAheadLogSerializer { if (wal.skip_writing) { return; } + D_ASSERT(wal.Initialized()); serializer.WriteList(field_id, tag, count, func); } @@ -139,6 +154,7 @@ class WriteAheadLogSerializer { // Write Entries //===--------------------------------------------------------------------===// void WriteAheadLog::WriteVersion() { + D_ASSERT(writer); if (writer->GetFileSize() > 0) { // already written - no need to write a version marker return; @@ -202,10 +218,11 @@ void WriteAheadLog::WriteDropSequence(const SequenceCatalogEntry &entry) { serializer.End(); } -void WriteAheadLog::WriteSequenceValue(const SequenceCatalogEntry &entry, SequenceValue val) { +void WriteAheadLog::WriteSequenceValue(SequenceValue val) { + auto &sequence = *val.entry; WriteAheadLogSerializer serializer(*this, WALType::SEQUENCE_VALUE); - serializer.WriteProperty(101, "schema", entry.schema.name); - serializer.WriteProperty(102, "name", entry.name); + serializer.WriteProperty(101, "schema", sequence.schema.name); + serializer.WriteProperty(102, "name", sequence.name); serializer.WriteProperty(103, "usage_count", val.usage_count); serializer.WriteProperty(104, "counter", val.counter); serializer.End(); @@ -246,7 +263,9 @@ void WriteAheadLog::WriteDropTableMacro(const TableMacroCatalogEntry &entry) { void SerializeIndexToWAL(WriteAheadLogSerializer &serializer, const unique_ptr &index) { - auto index_storage_info = index->GetStorageInfo(true); + // We will never write an index to the WAL that is not bound + D_ASSERT(index->IsBound()); + auto index_storage_info = index->Cast().GetStorageInfo(true); serializer.WriteProperty(102, "index_storage_info", index_storage_info); serializer.WriteList(103, "index_storage", index_storage_info.buffers.size(), [&](Serializer::List &list, idx_t i) { @@ -267,11 +286,11 @@ void WriteAheadLog::WriteCreateIndex(const IndexCatalogEntry &entry) { // now serialize the index data to the persistent storage and write the index metadata auto &duck_index_entry = entry.Cast(); - auto &indexes = duck_index_entry.GetDataTableInfo().indexes.Indexes(); + auto &indexes = duck_index_entry.GetDataTableInfo().GetIndexes().Indexes(); // get the matching index and serialize its storage info for (auto const &index : indexes) { - if (duck_index_entry.name == index->name) { + if (duck_index_entry.name == index->GetIndexName()) { SerializeIndexToWAL(serializer, index); break; } @@ -331,7 +350,7 @@ void WriteAheadLog::WriteDropSchema(const SchemaCatalogEntry &entry) { //===--------------------------------------------------------------------===// // DATA //===--------------------------------------------------------------------===// -void WriteAheadLog::WriteSetTable(string &schema, string &table) { +void WriteAheadLog::WriteSetTable(const string &schema, const string &table) { WriteAheadLogSerializer serializer(*this, WALType::USE_TABLE); serializer.WriteProperty(101, "schema", schema); serializer.WriteProperty(102, "table", table); @@ -385,6 +404,7 @@ void WriteAheadLog::Flush() { if (skip_writing) { return; } + D_ASSERT(writer); // write an empty entry WriteAheadLogSerializer serializer(*this, WALType::WAL_FLUSH); diff --git a/src/duckdb/src/transaction/cleanup_state.cpp b/src/duckdb/src/transaction/cleanup_state.cpp index 0ec438c2..ab63d7bb 100644 --- a/src/duckdb/src/transaction/cleanup_state.cpp +++ b/src/duckdb/src/transaction/cleanup_state.cpp @@ -52,10 +52,7 @@ void CleanupState::CleanupUpdate(UpdateInfo &info) { void CleanupState::CleanupDelete(DeleteInfo &info) { auto version_table = info.table; - D_ASSERT(version_table->info->cardinality >= info.count); - version_table->info->cardinality -= info.count; - - if (version_table->info->indexes.Empty()) { + if (!version_table->HasIndexes()) { // this table has no indexes: no cleanup to be done return; } @@ -67,17 +64,17 @@ void CleanupState::CleanupDelete(DeleteInfo &info) { } // possibly vacuum any indexes in this table later - indexed_tables[current_table->info->table] = current_table; + indexed_tables[current_table->GetTableName()] = current_table; count = 0; if (info.is_consecutive) { for (idx_t i = 0; i < info.count; i++) { - row_numbers[count++] = info.base_row + i; + row_numbers[count++] = UnsafeNumericCast(info.base_row + i); } } else { auto rows = info.GetRows(); for (idx_t i = 0; i < info.count; i++) { - row_numbers[count++] = info.base_row + rows[i]; + row_numbers[count++] = UnsafeNumericCast(info.base_row + rows[i]); } } Flush(); diff --git a/src/duckdb/src/transaction/commit_state.cpp b/src/duckdb/src/transaction/commit_state.cpp index 986aac3b..7d073a8a 100644 --- a/src/duckdb/src/transaction/commit_state.cpp +++ b/src/duckdb/src/transaction/commit_state.cpp @@ -29,7 +29,7 @@ CommitState::CommitState(transaction_t commit_id, optional_ptr lo void CommitState::SwitchTable(DataTableInfo *table_info, UndoFlags new_op) { if (current_table_info != table_info) { // write the current table to the log - log->WriteSetTable(table_info->schema, table_info->table); + log->WriteSetTable(table_info->GetSchemaName(), table_info->GetTableName()); current_table_info = table_info; } } @@ -196,7 +196,7 @@ void CommitState::WriteCatalogEntry(CatalogEntry &entry, data_ptr_t dataptr) { void CommitState::WriteDelete(DeleteInfo &info) { D_ASSERT(log); // switch to the current table, if necessary - SwitchTable(info.table->info.get(), UndoFlags::DELETE_TUPLE); + SwitchTable(info.table->GetDataTableInfo().get(), UndoFlags::DELETE_TUPLE); if (!delete_chunk) { delete_chunk = make_uniq(); @@ -206,12 +206,12 @@ void CommitState::WriteDelete(DeleteInfo &info) { auto rows = FlatVector::GetData(delete_chunk->data[0]); if (info.is_consecutive) { for (idx_t i = 0; i < info.count; i++) { - rows[i] = info.base_row + i; + rows[i] = UnsafeNumericCast(info.base_row + i); } } else { auto delete_rows = info.GetRows(); for (idx_t i = 0; i < info.count; i++) { - rows[i] = info.base_row + delete_rows[i]; + rows[i] = UnsafeNumericCast(info.base_row) + delete_rows[i]; } } delete_chunk->SetCardinality(info.count); @@ -245,7 +245,7 @@ void CommitState::WriteUpdate(UpdateInfo &info) { auto row_ids = FlatVector::GetData(update_chunk->data[1]); idx_t start = column_data.start + info.vector_index * STANDARD_VECTOR_SIZE; for (idx_t i = 0; i < info.N; i++) { - row_ids[info.tuples[i]] = start + info.tuples[i]; + row_ids[info.tuples[i]] = UnsafeNumericCast(start + info.tuples[i]); } if (column_data.type.id() == LogicalTypeId::VALIDITY) { // zero-initialize the booleans @@ -303,7 +303,7 @@ void CommitState::CommitEntry(UndoFlags type, data_ptr_t data) { case UndoFlags::INSERT_TUPLE: { // append: auto info = reinterpret_cast(data); - if (HAS_LOG && !info->table->info->IsTemporary()) { + if (HAS_LOG && !info->table->IsTemporary()) { info->table->WriteToLog(*log, info->start_row, info->count); } // mark the tuples as committed @@ -313,7 +313,7 @@ void CommitState::CommitEntry(UndoFlags type, data_ptr_t data) { case UndoFlags::DELETE_TUPLE: { // deletion: auto info = reinterpret_cast(data); - if (HAS_LOG && !info->table->info->IsTemporary()) { + if (HAS_LOG && !info->table->IsTemporary()) { WriteDelete(*info); } // mark the tuples as committed @@ -329,6 +329,13 @@ void CommitState::CommitEntry(UndoFlags type, data_ptr_t data) { info->version_number = commit_id; break; } + case UndoFlags::SEQUENCE_VALUE: { + auto info = reinterpret_cast(data); + if (HAS_LOG) { + log->WriteSequenceValue(*info); + } + break; + } default: throw InternalException("UndoBuffer - don't know how to commit this type!"); } @@ -356,7 +363,6 @@ void CommitState::RevertCommit(UndoFlags type, data_ptr_t data) { case UndoFlags::DELETE_TUPLE: { // deletion: auto info = reinterpret_cast(data); - info->table->info->cardinality += info->count; // revert the commit by writing the (uncommitted) transaction_id back into the version info info->version_info->CommitDelete(info->vector_idx, transaction_id, *info); break; @@ -367,6 +373,9 @@ void CommitState::RevertCommit(UndoFlags type, data_ptr_t data) { info->version_number = transaction_id; break; } + case UndoFlags::SEQUENCE_VALUE: { + break; + } default: throw InternalException("UndoBuffer - don't know how to revert commit of this type!"); } diff --git a/src/duckdb/src/transaction/duck_transaction.cpp b/src/duckdb/src/transaction/duck_transaction.cpp index d2ce3657..b045993b 100644 --- a/src/duckdb/src/transaction/duck_transaction.cpp +++ b/src/duckdb/src/transaction/duck_transaction.cpp @@ -1,5 +1,5 @@ #include "duckdb/transaction/duck_transaction.hpp" - +#include "duckdb/transaction/duck_transaction_manager.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp" #include "duckdb/common/exception.hpp" @@ -16,6 +16,7 @@ #include "duckdb/storage/table/column_data.hpp" #include "duckdb/main/client_data.hpp" #include "duckdb/main/attached_database.hpp" +#include "duckdb/storage/storage_lock.hpp" namespace duckdb { @@ -26,10 +27,11 @@ TransactionData::TransactionData(transaction_t transaction_id_p, transaction_t s : transaction(nullptr), transaction_id(transaction_id_p), start_time(start_time_p) { } -DuckTransaction::DuckTransaction(TransactionManager &manager, ClientContext &context_p, transaction_t start_time, +DuckTransaction::DuckTransaction(DuckTransactionManager &manager, ClientContext &context_p, transaction_t start_time, transaction_t transaction_id) : Transaction(manager, context_p), start_time(start_time), transaction_id(transaction_id), commit_id(0), - highest_active_query(0), undo_buffer(context_p), storage(make_uniq(context_p, *this)) { + highest_active_query(0), transaction_manager(manager), undo_buffer(context_p), + storage(make_uniq(context_p, *this)) { } DuckTransaction::~DuckTransaction() { @@ -122,21 +124,58 @@ UpdateInfo *DuckTransaction::CreateUpdateInfo(idx_t type_size, idx_t entries) { return update_info; } +void DuckTransaction::PushSequenceUsage(SequenceCatalogEntry &sequence, const SequenceData &data) { + lock_guard l(sequence_lock); + auto entry = sequence_usage.find(sequence); + if (entry == sequence_usage.end()) { + auto sequence_ptr = undo_buffer.CreateEntry(UndoFlags::SEQUENCE_VALUE, sizeof(SequenceValue)); + auto sequence_info = reinterpret_cast(sequence_ptr); + sequence_info->entry = &sequence; + sequence_info->usage_count = data.usage_count; + sequence_info->counter = data.counter; + sequence_usage.emplace(sequence, *sequence_info); + } else { + auto &sequence_info = entry->second.get(); + D_ASSERT(RefersToSameObject(*sequence_info.entry, sequence)); + sequence_info.usage_count = data.usage_count; + sequence_info.counter = data.counter; + } +} + bool DuckTransaction::ChangesMade() { return undo_buffer.ChangesMade() || storage->ChangesMade(); } -bool DuckTransaction::AutomaticCheckpoint(AttachedDatabase &db) { +UndoBufferProperties DuckTransaction::GetUndoProperties() { + return undo_buffer.GetProperties(); +} + +bool DuckTransaction::AutomaticCheckpoint(AttachedDatabase &db, const UndoBufferProperties &properties) { + if (!ChangesMade()) { + // read-only transactions cannot trigger an automated checkpoint + return false; + } + if (db.IsReadOnly()) { + // when attaching a database in read-only mode we cannot checkpoint + // note that attaching a database in read-only mode does NOT mean we never make changes + // WAL replay can make changes to the database - but only in the in-memory copy of the + return false; + } auto &storage_manager = db.GetStorageManager(); - return storage_manager.AutomaticCheckpoint(storage->EstimatedSize() + undo_buffer.EstimatedSize()); + return storage_manager.AutomaticCheckpoint(storage->EstimatedSize() + properties.estimated_size); } -ErrorData DuckTransaction::Commit(AttachedDatabase &db, transaction_t commit_id, bool checkpoint) noexcept { +ErrorData DuckTransaction::Commit(AttachedDatabase &db, transaction_t new_commit_id, bool checkpoint) noexcept { // "checkpoint" parameter indicates if the caller will checkpoint. If checkpoint == // true: Then this function will NOT write to the WAL or flush/persist. // This method only makes commit in memory, expecting caller to checkpoint/flush. // false: Then this function WILL write to the WAL and Flush/Persist it. - this->commit_id = commit_id; + this->commit_id = new_commit_id; + if (!ChangesMade()) { + // no need to flush anything if we made no changes + return ErrorData(); + } + D_ASSERT(db.IsSystem() || db.IsTemporary() || !IsReadOnly()); UndoBuffer::IteratorState iterator_state; LocalStorage::CommitState commit_state; @@ -144,21 +183,14 @@ ErrorData DuckTransaction::Commit(AttachedDatabase &db, transaction_t commit_id, optional_ptr log; if (!db.IsSystem()) { auto &storage_manager = db.GetStorageManager(); - log = storage_manager.GetWriteAheadLog(); + log = storage_manager.GetWAL(); storage_commit_state = storage_manager.GenStorageCommitState(*this, checkpoint); } else { log = nullptr; } - try { storage->Commit(commit_state, *this); undo_buffer.Commit(iterator_state, log, commit_id); - if (log) { - // commit any sequences that were used to the WAL - for (auto &entry : sequence_usage) { - log->WriteSequenceValue(*entry.first, entry.second); - } - } if (storage_commit_state) { storage_commit_state->FlushCommit(); } @@ -178,4 +210,17 @@ void DuckTransaction::Cleanup() { undo_buffer.Cleanup(); } +void DuckTransaction::SetReadWrite() { + Transaction::SetReadWrite(); + // obtain a shared checkpoint lock to prevent concurrent checkpoints while this transaction is running + write_lock = transaction_manager.SharedCheckpointLock(); +} + +unique_ptr DuckTransaction::TryGetCheckpointLock() { + if (!write_lock) { + throw InternalException("TryUpgradeCheckpointLock - but thread has no shared lock!?"); + } + return transaction_manager.TryUpgradeCheckpointLock(*write_lock); +} + } // namespace duckdb diff --git a/src/duckdb/src/transaction/duck_transaction_manager.cpp b/src/duckdb/src/transaction/duck_transaction_manager.cpp index 008604c3..12feb9bb 100644 --- a/src/duckdb/src/transaction/duck_transaction_manager.cpp +++ b/src/duckdb/src/transaction/duck_transaction_manager.cpp @@ -17,33 +17,7 @@ namespace duckdb { -struct CheckpointLock { - explicit CheckpointLock(DuckTransactionManager &manager) : manager(manager), is_locked(false) { - } - ~CheckpointLock() { - Unlock(); - } - - DuckTransactionManager &manager; - bool is_locked; - - void Lock() { - D_ASSERT(!manager.thread_is_checkpointing); - manager.thread_is_checkpointing = true; - is_locked = true; - } - void Unlock() { - if (!is_locked) { - return; - } - D_ASSERT(manager.thread_is_checkpointing); - manager.thread_is_checkpointing = false; - is_locked = false; - } -}; - -DuckTransactionManager::DuckTransactionManager(AttachedDatabase &db) - : TransactionManager(db), thread_is_checkpointing(false) { +DuckTransactionManager::DuckTransactionManager(AttachedDatabase &db) : TransactionManager(db) { // start timestamp starts at two current_start_timestamp = 2; // transaction ID starts very high: @@ -68,6 +42,7 @@ DuckTransactionManager &DuckTransactionManager::Get(AttachedDatabase &db) { Transaction &DuckTransactionManager::StartTransaction(ClientContext &context) { // obtain the transaction lock during this function + lock_guard start_lock(start_transaction_lock); lock_guard lock(transaction_lock); if (current_start_timestamp >= TRANSACTION_ID_START) { // LCOV_EXCL_START throw InternalException("Cannot start more transactions, ran out of " @@ -91,136 +66,189 @@ Transaction &DuckTransactionManager::StartTransaction(ClientContext &context) { return transaction_ref; } -void DuckTransactionManager::Checkpoint(ClientContext &context, bool force) { +DuckTransactionManager::CheckpointDecision::CheckpointDecision(string reason_p) + : can_checkpoint(false), reason(std::move(reason_p)) { +} + +DuckTransactionManager::CheckpointDecision::CheckpointDecision(CheckpointType type) : can_checkpoint(true), type(type) { +} + +DuckTransactionManager::CheckpointDecision::~CheckpointDecision() { +} + +DuckTransactionManager::CheckpointDecision +DuckTransactionManager::CanCheckpoint(DuckTransaction &transaction, unique_ptr &lock, + const UndoBufferProperties &undo_properties) { + if (db.IsSystem()) { + return CheckpointDecision("system transaction"); + } auto &storage_manager = db.GetStorageManager(); if (storage_manager.InMemory()) { - return; + return CheckpointDecision("in memory db"); } - - // first check if no other thread is checkpointing right now - auto current = &DuckTransaction::Get(context, db); - auto lock = unique_lock(transaction_lock); - if (thread_is_checkpointing) { - throw TransactionException("Cannot CHECKPOINT: another thread is checkpointing right now"); + if (!storage_manager.IsLoaded()) { + return CheckpointDecision("cannot checkpoint while loading"); } - CheckpointLock checkpoint_lock(*this); - checkpoint_lock.Lock(); - if (current->ChangesMade()) { - throw TransactionException("Cannot CHECKPOINT: the current transaction has transaction local changes"); + if (!transaction.AutomaticCheckpoint(db, undo_properties)) { + return CheckpointDecision("no reason to automatically checkpoint"); } - if (!force) { - if (!CanCheckpoint(current).can_checkpoint) { - throw TransactionException("Cannot CHECKPOINT: there are other transactions. Use FORCE CHECKPOINT to abort " - "the other transactions and force a checkpoint"); - } - } else { - lock.unlock(); - - // lock all the clients AND the connection manager now - // this ensures no new queries can be started, and no new connections to the database can be made - // to avoid deadlock we release the transaction lock while locking the clients - auto &connection_manager = ConnectionManager::Get(context); - vector client_locks; - connection_manager.LockClients(client_locks, context); - - lock.lock(); - if (!CanCheckpoint(current).can_checkpoint) { - for (size_t i = 0; i < active_transactions.size(); i++) { - auto &transaction = active_transactions[i]; - // rollback the transaction - transaction->Rollback(); - auto transaction_context = transaction->context.lock(); - - // remove the transaction id from the list of active transactions - // potentially resulting in garbage collection - RemoveTransaction(*transaction); - if (transaction_context) { - // invalidate the active transaction for this connection - auto &meta_transaction = MetaTransaction::Get(*transaction_context); - meta_transaction.RemoveTransaction(db); - ValidChecker::Get(meta_transaction).Invalidate("Invalidated due to FORCE CHECKPOINT"); + // try to lock the checkpoint lock + lock = transaction.TryGetCheckpointLock(); + if (!lock) { + return CheckpointDecision("Failed to obtain checkpoint lock - another thread is writing/checkpointing or " + "another read transaction relies on data that is not yet committed"); + } + auto checkpoint_type = CheckpointType::FULL_CHECKPOINT; + if (undo_properties.has_updates || undo_properties.has_deletes || undo_properties.has_dropped_entries) { + // if we have made updates/deletes/catalog changes in this transaction we might need to change our strategy + // in the presence of other transactions + string other_transactions; + for (auto &active_transaction : active_transactions) { + if (!RefersToSameObject(*active_transaction, transaction)) { + if (!other_transactions.empty()) { + other_transactions += ", "; } - i--; + other_transactions += "[" + to_string(active_transaction->transaction_id) + "]"; + } + } + if (!other_transactions.empty()) { + // there are other transactions! + // these active transactions might need data from BEFORE this transaction + // we might need to change our strategy here based on what changes THIS transaction has made + if (undo_properties.has_dropped_entries) { + // this transaction has changed the catalog - we cannot checkpoint + return CheckpointDecision("Transaction has dropped catalog entries and there are other transactions " + "active\nActive transactions: " + + other_transactions); + } else if (undo_properties.has_updates) { + // this transaction has performed updates - we cannot checkpoint + return CheckpointDecision( + "Transaction has performed updates and there are other transactions active\nActive transactions: " + + other_transactions); + } else { + // this transaction has performed deletes - we cannot vacuum - initiate a concurrent checkpoint instead + D_ASSERT(undo_properties.has_deletes); + checkpoint_type = CheckpointType::CONCURRENT_CHECKPOINT; } - D_ASSERT(CanCheckpoint(nullptr).can_checkpoint); } } - storage_manager.CreateCheckpoint(); + return CheckpointDecision(checkpoint_type); } -DuckTransactionManager::CheckpointDecision -DuckTransactionManager::CanCheckpoint(optional_ptr current) { - if (db.IsSystem()) { - return {false, "system transaction"}; - } +void DuckTransactionManager::Checkpoint(ClientContext &context, bool force) { auto &storage_manager = db.GetStorageManager(); if (storage_manager.InMemory()) { - return {false, "in memory db"}; - } - auto trans_to_string = [](const unique_ptr &t) { - return std::to_string(t->transaction_id); - }; - if (!recently_committed_transactions.empty()) { - return {false, "recently committed transactions: [" + - StringUtil::Join(recently_committed_transactions, recently_committed_transactions.size(), - ",", trans_to_string) + - "]"}; + return; } - if (!old_transactions.empty()) { - return {false, "old transactions: [" + - StringUtil::Join(old_transactions, old_transactions.size(), ",", trans_to_string) + "]"}; + + auto current = Transaction::TryGet(context, db); + if (current) { + if (force) { + throw TransactionException( + "Cannot FORCE CHECKPOINT: the current transaction has been started for this database"); + } else { + auto &duck_transaction = current->Cast(); + if (duck_transaction.ChangesMade()) { + throw TransactionException("Cannot CHECKPOINT: the current transaction has transaction local changes"); + } + } } - for (auto &transaction : active_transactions) { - if (transaction.get() != current.get()) { - return {false, "current transaction [" + std::to_string(current->transaction_id) + "] isn't active"}; + unique_ptr lock; + if (!force) { + // not a force checkpoint + // try to get the checkpoint lock + lock = checkpoint_lock.TryGetExclusiveLock(); + if (!lock) { + // we could not manage to get the lock - cancel + throw TransactionException( + "Cannot CHECKPOINT: there are other write transactions active. Use FORCE CHECKPOINT to abort " + "the other transactions and force a checkpoint"); + } + + } else { + // force checkpoint - wait to get an exclusive lock + // grab the start_transaction_lock to prevent new transactions from starting + lock_guard start_lock(start_transaction_lock); + // wait until any active transactions are finished + while (!lock) { + if (context.interrupted) { + throw InterruptException(); + } + lock = checkpoint_lock.TryGetExclusiveLock(); } } - return {true, ""}; + CheckpointOptions options; + if (GetLastCommit() > LowestActiveStart()) { + // we cannot do a full checkpoint if any transaction needs to read old data + options.type = CheckpointType::CONCURRENT_CHECKPOINT; + } + storage_manager.CreateCheckpoint(options); +} + +unique_ptr DuckTransactionManager::SharedCheckpointLock() { + return checkpoint_lock.GetSharedLock(); +} + +unique_ptr DuckTransactionManager::TryUpgradeCheckpointLock(StorageLockKey &lock) { + return checkpoint_lock.TryUpgradeCheckpointLock(lock); +} + +transaction_t DuckTransactionManager::GetCommitTimestamp() { + auto commit_ts = current_start_timestamp++; + last_commit = commit_ts; + return commit_ts; } ErrorData DuckTransactionManager::CommitTransaction(ClientContext &context, Transaction &transaction_p) { auto &transaction = transaction_p.Cast(); - vector client_locks; - auto lock = make_uniq>(transaction_lock); - CheckpointLock checkpoint_lock(*this); - // check if we can checkpoint - auto checkpoint_decision = thread_is_checkpointing ? CheckpointDecision {false, "another thread is checkpointing"} - : CanCheckpoint(&transaction); - if (checkpoint_decision.can_checkpoint) { - if (transaction.AutomaticCheckpoint(db)) { - checkpoint_lock.Lock(); - } else { - checkpoint_decision = {false, "no reason to automatically checkpoint"}; + unique_lock tlock(transaction_lock); + if (!db.IsSystem() && !db.IsTemporary()) { + if (transaction.ChangesMade()) { + if (transaction.IsReadOnly()) { + throw InternalException("Attempting to commit a transaction that is read-only but has made changes - " + "this should not be possible"); + } } } - OnCommitCheckpointDecision(checkpoint_decision, transaction); - // obtain a commit id for the transaction - transaction_t commit_id = current_start_timestamp++; + transaction_t commit_id = GetCommitTimestamp(); + + // check if we can checkpoint + unique_ptr lock; + auto undo_properties = transaction.GetUndoProperties(); + auto checkpoint_decision = CanCheckpoint(transaction, lock, undo_properties); // commit the UndoBuffer of the transaction auto error = transaction.Commit(db, commit_id, checkpoint_decision.can_checkpoint); if (error.HasError()) { // commit unsuccessful: rollback the transaction instead - checkpoint_decision = CheckpointDecision {false, error.Message()}; + checkpoint_decision = CheckpointDecision(error.Message()); transaction.commit_id = 0; transaction.Rollback(); } - if (!checkpoint_decision.can_checkpoint) { - // we won't checkpoint after all: unlock the clients again - checkpoint_lock.Unlock(); - client_locks.clear(); + OnCommitCheckpointDecision(checkpoint_decision, transaction); + + if (!checkpoint_decision.can_checkpoint && lock) { + // we won't checkpoint after all: unlock the checkpoint lock again + lock.reset(); } // commit successful: remove the transaction id from the list of active transactions // potentially resulting in garbage collection - RemoveTransaction(transaction); + bool store_transaction = undo_properties.has_updates || undo_properties.has_catalog_changes || error.HasError(); + RemoveTransaction(transaction, store_transaction); // now perform a checkpoint if (1) we are able to checkpoint, and (2) the WAL has reached sufficient size to // checkpoint if (checkpoint_decision.can_checkpoint) { + D_ASSERT(lock); + // we can unlock the transaction lock while checkpointing + tlock.unlock(); // checkpoint the database to disk auto &storage_manager = db.GetStorageManager(); - storage_manager.CreateCheckpoint(false, true); + CheckpointOptions options; + options.action = CheckpointAction::FORCE_CHECKPOINT; + options.type = checkpoint_decision.type; + storage_manager.CreateCheckpoint(options); } return error; } @@ -239,7 +267,10 @@ void DuckTransactionManager::RollbackTransaction(Transaction &transaction_p) { } void DuckTransactionManager::RemoveTransaction(DuckTransaction &transaction) noexcept { - bool changes_made = transaction.ChangesMade(); + RemoveTransaction(transaction, transaction.ChangesMade()); +} + +void DuckTransactionManager::RemoveTransaction(DuckTransaction &transaction, bool store_transaction) noexcept { // remove the transaction from the list of active transactions idx_t t_index = active_transactions.size(); // check for the lowest and highest start time in the list of transactions @@ -263,7 +294,7 @@ void DuckTransactionManager::RemoveTransaction(DuckTransaction &transaction) noe D_ASSERT(t_index != active_transactions.size()); auto current_transaction = std::move(active_transactions[t_index]); auto current_query = DatabaseManager::Get(db).ActiveQueryNumber(); - if (changes_made) { + if (store_transaction) { // if the transaction made any changes we need to keep it around if (transaction.commit_id != 0) { // the transaction was committed, add it to the list of recently @@ -275,9 +306,11 @@ void DuckTransactionManager::RemoveTransaction(DuckTransaction &transaction) noe current_transaction->highest_active_query = current_query; old_transactions.push_back(std::move(current_transaction)); } + } else if (transaction.ChangesMade()) { + transaction.Cleanup(); } // remove the transaction from the set of currently active transactions - active_transactions.erase(active_transactions.begin() + t_index); + active_transactions.unsafe_erase_at(t_index); // traverse the recently_committed transactions to see if we can remove any idx_t i = 0; for (; i < recently_committed_transactions.size(); i++) { @@ -311,7 +344,7 @@ void DuckTransactionManager::RemoveTransaction(DuckTransaction &transaction) noe if (i > 0) { // we garbage collected transactions: remove them from the list recently_committed_transactions.erase(recently_committed_transactions.begin(), - recently_committed_transactions.begin() + i); + recently_committed_transactions.begin() + static_cast(i)); } // check if we can free the memory of any old transactions i = active_transactions.empty() ? old_transactions.size() : 0; @@ -326,7 +359,7 @@ void DuckTransactionManager::RemoveTransaction(DuckTransaction &transaction) noe } if (i > 0) { // we garbage collected transactions: remove them from the list - old_transactions.erase(old_transactions.begin(), old_transactions.begin() + i); + old_transactions.erase(old_transactions.begin(), old_transactions.begin() + static_cast(i)); } } diff --git a/src/duckdb/src/transaction/meta_transaction.cpp b/src/duckdb/src/transaction/meta_transaction.cpp index 7cd7fa45..fa2ce280 100644 --- a/src/duckdb/src/transaction/meta_transaction.cpp +++ b/src/duckdb/src/transaction/meta_transaction.cpp @@ -24,6 +24,11 @@ Transaction &Transaction::Get(ClientContext &context, AttachedDatabase &db) { return meta_transaction.GetTransaction(db); } +optional_ptr Transaction::TryGet(ClientContext &context, AttachedDatabase &db) { + auto &meta_transaction = MetaTransaction::Get(context); + return meta_transaction.TryGetTransaction(db); +} + #ifdef DEBUG static void VerifyAllTransactionsUnique(AttachedDatabase &db, vector> &all_transactions) { for (auto &tx : all_transactions) { @@ -34,6 +39,16 @@ static void VerifyAllTransactionsUnique(AttachedDatabase &db, vector MetaTransaction::TryGetTransaction(AttachedDatabase &db) { + lock_guard guard(lock); + auto entry = transactions.find(db); + if (entry == transactions.end()) { + return nullptr; + } else { + return &entry->second.get(); + } +} + Transaction &MetaTransaction::GetTransaction(AttachedDatabase &db) { lock_guard guard(lock); auto entry = transactions.find(db); @@ -63,7 +78,7 @@ void MetaTransaction::RemoveTransaction(AttachedDatabase &db) { for (idx_t i = 0; i < all_transactions.size(); i++) { auto &db_entry = all_transactions[i]; if (RefersToSameObject(db_entry.get(), db)) { - all_transactions.erase(all_transactions.begin() + i); + all_transactions.erase_at(i); break; } } @@ -134,6 +149,9 @@ void MetaTransaction::ModifyDatabase(AttachedDatabase &db) { } if (!modified_database) { modified_database = &db; + + auto &transaction = GetTransaction(db); + transaction.SetReadWrite(); return; } if (&db != modified_database.get()) { diff --git a/src/duckdb/src/transaction/rollback_state.cpp b/src/duckdb/src/transaction/rollback_state.cpp index 3210cffb..f7d1410c 100644 --- a/src/duckdb/src/transaction/rollback_state.cpp +++ b/src/duckdb/src/transaction/rollback_state.cpp @@ -39,6 +39,8 @@ void RollbackState::RollbackEntry(UndoFlags type, data_ptr_t data) { info->segment->RollbackUpdate(*info); break; } + case UndoFlags::SEQUENCE_VALUE: + break; default: // LCOV_EXCL_START D_ASSERT(type == UndoFlags::EMPTY_ENTRY); break; diff --git a/src/duckdb/src/transaction/transaction.cpp b/src/duckdb/src/transaction/transaction.cpp index 5c37879d..1f18a6d5 100644 --- a/src/duckdb/src/transaction/transaction.cpp +++ b/src/duckdb/src/transaction/transaction.cpp @@ -6,19 +6,19 @@ namespace duckdb { Transaction::Transaction(TransactionManager &manager_p, ClientContext &context_p) - : manager(manager_p), context(context_p.shared_from_this()), active_query(MAXIMUM_QUERY_ID) { + : manager(manager_p), context(context_p.shared_from_this()), active_query(MAXIMUM_QUERY_ID), is_read_only(true) { } Transaction::~Transaction() { } bool Transaction::IsReadOnly() { - auto ctxt = context.lock(); - if (!ctxt) { - throw InternalException("Transaction::IsReadOnly() called after client context has been destroyed"); - } - auto &db = manager.GetDB(); - return MetaTransaction::Get(*ctxt).ModifiedDatabase().get() != &db; + return is_read_only; +} + +void Transaction::SetReadWrite() { + D_ASSERT(is_read_only); + is_read_only = false; } } // namespace duckdb diff --git a/src/duckdb/src/transaction/undo_buffer.cpp b/src/duckdb/src/transaction/undo_buffer.cpp index 2e94aa7f..7aa4955e 100644 --- a/src/duckdb/src/transaction/undo_buffer.cpp +++ b/src/duckdb/src/transaction/undo_buffer.cpp @@ -10,6 +10,7 @@ #include "duckdb/transaction/cleanup_state.hpp" #include "duckdb/transaction/commit_state.hpp" #include "duckdb/transaction/rollback_state.hpp" +#include "duckdb/execution/index/bound_index.hpp" namespace duckdb { constexpr uint32_t UNDO_ENTRY_HEADER_SIZE = sizeof(UndoFlags) + sizeof(uint32_t); @@ -99,31 +100,55 @@ void UndoBuffer::ReverseIterateEntries(T &&callback) { } bool UndoBuffer::ChangesMade() { + // we need to search for any index creation entries return !allocator.IsEmpty(); } -idx_t UndoBuffer::EstimatedSize() { - - idx_t estimated_size = 0; +UndoBufferProperties UndoBuffer::GetProperties() { + UndoBufferProperties properties; + if (!ChangesMade()) { + return properties; + } auto node = allocator.GetHead(); while (node) { - estimated_size += node->current_position; + properties.estimated_size += node->current_position; node = node->next.get(); } // we need to search for any index creation entries IteratorState iterator_state; IterateEntries(iterator_state, [&](UndoFlags entry_type, data_ptr_t data) { - if (entry_type == UndoFlags::CATALOG_ENTRY) { + switch (entry_type) { + case UndoFlags::UPDATE_TUPLE: + properties.has_updates = true; + break; + case UndoFlags::DELETE_TUPLE: + properties.has_deletes = true; + break; + case UndoFlags::CATALOG_ENTRY: { + properties.has_catalog_changes = true; + auto catalog_entry = Load(data); - if (catalog_entry->Parent().type == CatalogType::INDEX_ENTRY) { - auto &index = catalog_entry->Parent().Cast(); - estimated_size += index.initial_index_size; + auto &parent = catalog_entry->Parent(); + switch (parent.type) { + case CatalogType::DELETED_ENTRY: + properties.has_dropped_entries = true; + break; + case CatalogType::INDEX_ENTRY: { + auto &index = parent.Cast(); + properties.estimated_size += index.initial_index_size; + break; } + default: + break; + } + break; + } + default: + break; } }); - - return estimated_size; + return properties; } void UndoBuffer::Cleanup() { @@ -140,13 +165,8 @@ void UndoBuffer::Cleanup() { IterateEntries(iterator_state, [&](UndoFlags type, data_ptr_t data) { state.CleanupEntry(type, data); }); // possibly vacuum indexes - for (const auto &table : state.indexed_tables) { - table.second->info->indexes.Scan([&](Index &index) { - if (!index.IsUnknown()) { - index.Vacuum(); - } - return false; - }); + for (auto &table : state.indexed_tables) { + table.second->VacuumIndexes(); } } diff --git a/src/duckdb/third_party/concurrentqueue/concurrentqueue.h b/src/duckdb/third_party/concurrentqueue/concurrentqueue.h index f3e2b100..0f5ad0a4 100644 --- a/src/duckdb/third_party/concurrentqueue/concurrentqueue.h +++ b/src/duckdb/third_party/concurrentqueue/concurrentqueue.h @@ -1942,7 +1942,7 @@ class ConcurrentQueue // block size (in order to get a correct signed block count offset in all cases): auto headBase = localBlockIndex->entries[localBlockIndexHead].base; auto blockBaseIndex = index & ~static_cast(BLOCK_SIZE - 1); - auto offset = static_cast(static_cast::type>(blockBaseIndex - headBase) / BLOCK_SIZE); + auto offset = static_cast(static_cast::type>(blockBaseIndex - headBase) / static_cast::type>(BLOCK_SIZE)); auto block = localBlockIndex->entries[(localBlockIndexHead + offset) & (localBlockIndex->size - 1)].block; // Dequeue @@ -2202,7 +2202,7 @@ class ConcurrentQueue auto headBase = localBlockIndex->entries[localBlockIndexHead].base; auto firstBlockBaseIndex = firstIndex & ~static_cast(BLOCK_SIZE - 1); - auto offset = static_cast(static_cast::type>(firstBlockBaseIndex - headBase) / BLOCK_SIZE); + auto offset = static_cast(static_cast::type>(firstBlockBaseIndex - headBase) / static_cast::type>(BLOCK_SIZE)); auto indexIndex = (localBlockIndexHead + offset) & (localBlockIndex->size - 1); // Iterate the blocks and dequeue @@ -2875,7 +2875,7 @@ class ConcurrentQueue assert(tailBase != INVALID_BLOCK_BASE); // Note: Must use division instead of shift because the index may wrap around, causing a negative // offset, whose negativity we want to preserve - auto offset = static_cast(static_cast::type>(index - tailBase) / BLOCK_SIZE); + auto offset = static_cast(static_cast::type>(index - tailBase) / static_cast::type>(BLOCK_SIZE)); size_t idx = (tail + offset) & (localBlockIndex->capacity - 1); assert(localBlockIndex->index[idx]->key.load(std::memory_order_relaxed) == index && localBlockIndex->index[idx]->value.load(std::memory_order_relaxed) != nullptr); return idx; @@ -3630,7 +3630,7 @@ ConsumerToken::ConsumerToken(ConcurrentQueue& queue) : itemsConsumedFromCurrent(0), currentProducer(nullptr), desiredProducer(nullptr) { initialOffset = queue.nextExplicitConsumerId.fetch_add(1, std::memory_order_release); - lastKnownGlobalOffset = -1; + lastKnownGlobalOffset = uint32_t(-1); } template @@ -3638,7 +3638,7 @@ ConsumerToken::ConsumerToken(BlockingConcurrentQueue& queue) : itemsConsumedFromCurrent(0), currentProducer(nullptr), desiredProducer(nullptr) { initialOffset = reinterpret_cast*>(&queue)->nextExplicitConsumerId.fetch_add(1, std::memory_order_release); - lastKnownGlobalOffset = -1; + lastKnownGlobalOffset = uint32_t(-1); } template diff --git a/src/duckdb/third_party/fsst/fsst.h b/src/duckdb/third_party/fsst/fsst.h index ea80be6c..dad32772 100644 --- a/src/duckdb/third_party/fsst/fsst.h +++ b/src/duckdb/third_party/fsst/fsst.h @@ -184,7 +184,7 @@ duckdb_fsst_decompress( code = strIn[posIn++]; FSST_UNALIGNED_STORE(strOut+posOut, symbol[code]); posOut += len[code]; code = strIn[posIn++]; FSST_UNALIGNED_STORE(strOut+posOut, symbol[code]); posOut += len[code]; } else { - unsigned long firstEscapePos=__builtin_ctzl((unsigned long long) escapeMask)>>3; + unsigned long firstEscapePos=static_cast(__builtin_ctzl((unsigned long long) escapeMask)>>3); switch(firstEscapePos) { /* Duff's device */ case 3: code = strIn[posIn++]; FSST_UNALIGNED_STORE(strOut+posOut, symbol[code]); posOut += len[code]; DUCKDB_FSST_EXPLICIT_FALLTHROUGH; diff --git a/src/duckdb/third_party/jaro_winkler/details/common.hpp b/src/duckdb/third_party/jaro_winkler/details/common.hpp index 0a3193fb..6855ce60 100644 --- a/src/duckdb/third_party/jaro_winkler/details/common.hpp +++ b/src/duckdb/third_party/jaro_winkler/details/common.hpp @@ -91,7 +91,7 @@ struct BitvectorHashmap { void insert_mask(CharT key, uint64_t mask) { uint64_t i = lookup(static_cast(key)); - m_map[i].key = key; + m_map[i].key = static_cast(key); m_map[i].value |= mask; } @@ -150,7 +150,7 @@ struct PatternMatchVector { for (int64_t i = 0; i < std::distance(first, last); ++i) { auto key = first[i]; if (key >= 0 && key <= 255) { - m_extendedAscii[key] |= mask; + m_extendedAscii[static_cast(key)] |= mask; } else { m_map.insert_mask(key, mask); @@ -175,7 +175,7 @@ struct PatternMatchVector { uint64_t get(CharT key) const { if (key >= 0 && key <= 255) { - return m_extendedAscii[key]; + return m_extendedAscii[static_cast(key)]; } else { return m_map.get(key); @@ -215,10 +215,10 @@ struct BlockPatternMatchVector { assert(block < m_block_count); if (key >= 0 && key <= 255) { - m_extendedAscii[key * m_block_count + block] |= mask; + m_extendedAscii[static_cast(key * m_block_count + block)] |= mask; } else { - m_map[block].insert_mask(key, mask); + m_map[static_cast(block)].insert_mask(key, mask); } } @@ -227,8 +227,8 @@ struct BlockPatternMatchVector { { int64_t len = std::distance(first, last); m_block_count = ceildiv(len, 64); - m_map.resize(m_block_count); - m_extendedAscii.resize(m_block_count * 256); + m_map.resize(static_cast(m_block_count)); + m_extendedAscii.resize(static_cast(m_block_count * 256)); for (int64_t i = 0; i < len; ++i) { int64_t block = i / 64; @@ -251,10 +251,10 @@ struct BlockPatternMatchVector { { assert(block < m_block_count); if (key >= 0 && key <= 255) { - return m_extendedAscii[key * m_block_count + block]; + return m_extendedAscii[static_cast(key * m_block_count + block)]; } else { - return m_map[block].get(key); + return m_map[static_cast(block)].get(key); } } diff --git a/src/duckdb/third_party/jaro_winkler/details/intrinsics.hpp b/src/duckdb/third_party/jaro_winkler/details/intrinsics.hpp index 174bdccd..45f07c40 100644 --- a/src/duckdb/third_party/jaro_winkler/details/intrinsics.hpp +++ b/src/duckdb/third_party/jaro_winkler/details/intrinsics.hpp @@ -15,7 +15,7 @@ namespace intrinsics { template T bit_mask_lsb(int n) { - T mask = -1; + T mask = static_cast(-1); if (n < static_cast(sizeof(T) * 8)) { mask += static_cast(1) << n; } diff --git a/src/duckdb/third_party/jaro_winkler/details/jaro_impl.hpp b/src/duckdb/third_party/jaro_winkler/details/jaro_impl.hpp index 7b8f28b8..47e6fa50 100644 --- a/src/duckdb/third_party/jaro_winkler/details/jaro_impl.hpp +++ b/src/duckdb/third_party/jaro_winkler/details/jaro_impl.hpp @@ -147,39 +147,39 @@ static inline void flag_similar_characters_step(const common::BlockPatternMatchV if (BoundMask.words == 1) { uint64_t PM_j = PM.get(word, T_j) & BoundMask.last_mask & BoundMask.first_mask & - (~flagged.P_flag[word]); + (~flagged.P_flag[static_cast(word)]); - flagged.P_flag[word] |= blsi(PM_j); - flagged.T_flag[j_word] |= static_cast(PM_j != 0) << j_pos; + flagged.P_flag[static_cast(word)] |= blsi(PM_j); + flagged.T_flag[static_cast(j_word)] |= static_cast(PM_j != 0) << j_pos; return; } if (BoundMask.first_mask) { - uint64_t PM_j = PM.get(word, T_j) & BoundMask.first_mask & (~flagged.P_flag[word]); + uint64_t PM_j = PM.get(word, T_j) & BoundMask.first_mask & (~flagged.P_flag[static_cast(word)]); if (PM_j) { - flagged.P_flag[word] |= blsi(PM_j); - flagged.T_flag[j_word] |= 1ull << j_pos; + flagged.P_flag[static_cast(word)] |= blsi(PM_j); + flagged.T_flag[static_cast(j_word)] |= 1ull << j_pos; return; } word++; } for (; word < last_word - 1; ++word) { - uint64_t PM_j = PM.get(word, T_j) & (~flagged.P_flag[word]); + uint64_t PM_j = PM.get(word, T_j) & (~flagged.P_flag[static_cast(word)]); if (PM_j) { - flagged.P_flag[word] |= blsi(PM_j); - flagged.T_flag[j_word] |= 1ull << j_pos; + flagged.P_flag[static_cast(word)] |= blsi(PM_j); + flagged.T_flag[static_cast(j_word)] |= 1ull << j_pos; return; } } if (BoundMask.last_mask) { - uint64_t PM_j = PM.get(word, T_j) & BoundMask.last_mask & (~flagged.P_flag[word]); + uint64_t PM_j = PM.get(word, T_j) & BoundMask.last_mask & (~flagged.P_flag[static_cast(word)]); - flagged.P_flag[word] |= blsi(PM_j); - flagged.T_flag[j_word] |= static_cast(PM_j != 0) << j_pos; + flagged.P_flag[static_cast(word)] |= blsi(PM_j); + flagged.T_flag[static_cast(j_word)] |= static_cast(PM_j != 0) << j_pos; } } @@ -199,8 +199,8 @@ flag_similar_characters_block(const common::BlockPatternMatchVector& PM, InputIt int64_t PatternWords = common::ceildiv(P_len, 64); FlaggedCharsMultiword flagged; - flagged.T_flag.resize(TextWords); - flagged.P_flag.resize(PatternWords); + flagged.T_flag.resize(static_cast(TextWords)); + flagged.P_flag.resize(static_cast(PatternWords)); SearchBoundMask BoundMask; int64_t start_range = std::min(Bound + 1, P_len); @@ -262,21 +262,21 @@ count_transpositions_block(const common::BlockPatternMatchVector& PM, InputIt1 T using namespace intrinsics; int64_t TextWord = 0; int64_t PatternWord = 0; - uint64_t T_flag = flagged.T_flag[TextWord]; - uint64_t P_flag = flagged.P_flag[PatternWord]; + uint64_t T_flag = flagged.T_flag[static_cast(TextWord)]; + uint64_t P_flag = flagged.P_flag[static_cast(PatternWord)]; int64_t Transpositions = 0; while (FlaggedChars) { while (!T_flag) { TextWord++; T_first += 64; - T_flag = flagged.T_flag[TextWord]; + T_flag = flagged.T_flag[static_cast(TextWord)]; } while (T_flag) { while (!P_flag) { PatternWord++; - P_flag = flagged.P_flag[PatternWord]; + P_flag = flagged.P_flag[static_cast(PatternWord)]; } uint64_t PatternFlagMask = blsi(P_flag); diff --git a/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp b/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp index 32c08a87..85ad6793 100644 --- a/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +++ b/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp @@ -312,6 +312,7 @@ typedef enum PGNodeTag { T_PGInsertStmt, T_PGDeleteStmt, T_PGUpdateStmt, + T_PGUpdateExtensionsStmt, T_PGSelectStmt, T_PGAlterTableStmt, T_PGAlterTableCmd, diff --git a/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp b/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp index 1a96c321..46472415 100644 --- a/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +++ b/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp @@ -1892,9 +1892,21 @@ typedef struct PGLoadStmt { PGNodeTag type; const char *filename; /* file to load */ const char *repository; /* optionally, the repository to load from */ + bool repo_is_alias; /* whether the repository was passed as an alias or a raw path */ + const char *version; /* optionally, the version of the extension to be loaded */ PGLoadInstallType load_type; } PGLoadStmt; +/* ---------------------- + * Update Extensions Statement + * ---------------------- + */ + +typedef struct PGUpdateExtensionsStmt { + PGNodeTag type; + PGList * extensions; +} PGUpdateExtensionsStmt; + /* ---------------------- * Vacuum and Analyze Statements * diff --git a/src/duckdb/third_party/libpg_query/include/parser/gram.hpp b/src/duckdb/third_party/libpg_query/include/parser/gram.hpp index c6485a96..ff511679 100644 --- a/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +++ b/src/duckdb/third_party/libpg_query/include/parser/gram.hpp @@ -1,14 +1,14 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,9 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -33,1023 +31,542 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* Tokens. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_BASE_YY_THIRD_PARTY_LIBPG_QUERY_GRAMMAR_GRAMMAR_OUT_HPP_INCLUDED +# define YY_BASE_YY_THIRD_PARTY_LIBPG_QUERY_GRAMMAR_GRAMMAR_OUT_HPP_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int base_yydebug; +#endif + +/* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - IDENT = 258, - FCONST = 259, - SCONST = 260, - BCONST = 261, - XCONST = 262, - Op = 263, - ICONST = 264, - PARAM = 265, - TYPECAST = 266, - DOT_DOT = 267, - COLON_EQUALS = 268, - EQUALS_GREATER = 269, - INTEGER_DIVISION = 270, - POWER_OF = 271, - LAMBDA_ARROW = 272, - DOUBLE_ARROW = 273, - LESS_EQUALS = 274, - GREATER_EQUALS = 275, - NOT_EQUALS = 276, - ABORT_P = 277, - ABSOLUTE_P = 278, - ACCESS = 279, - ACTION = 280, - ADD_P = 281, - ADMIN = 282, - AFTER = 283, - AGGREGATE = 284, - ALL = 285, - ALSO = 286, - ALTER = 287, - ALWAYS = 288, - ANALYSE = 289, - ANALYZE = 290, - AND = 291, - ANTI = 292, - ANY = 293, - ARRAY = 294, - AS = 295, - ASC_P = 296, - ASOF = 297, - ASSERTION = 298, - ASSIGNMENT = 299, - ASYMMETRIC = 300, - AT = 301, - ATTACH = 302, - ATTRIBUTE = 303, - AUTHORIZATION = 304, - BACKWARD = 305, - BEFORE = 306, - BEGIN_P = 307, - BETWEEN = 308, - BIGINT = 309, - BINARY = 310, - BIT = 311, - BOOLEAN_P = 312, - BOTH = 313, - BY = 314, - CACHE = 315, - CALL_P = 316, - CALLED = 317, - CASCADE = 318, - CASCADED = 319, - CASE = 320, - CAST = 321, - CATALOG_P = 322, - CENTURIES_P = 323, - CENTURY_P = 324, - CHAIN = 325, - CHAR_P = 326, - CHARACTER = 327, - CHARACTERISTICS = 328, - CHECK_P = 329, - CHECKPOINT = 330, - CLASS = 331, - CLOSE = 332, - CLUSTER = 333, - COALESCE = 334, - COLLATE = 335, - COLLATION = 336, - COLUMN = 337, - COLUMNS = 338, - COMMENT = 339, - COMMENTS = 340, - COMMIT = 341, - COMMITTED = 342, - COMPRESSION = 343, - CONCURRENTLY = 344, - CONFIGURATION = 345, - CONFLICT = 346, - CONNECTION = 347, - CONSTRAINT = 348, - CONSTRAINTS = 349, - CONTENT_P = 350, - CONTINUE_P = 351, - CONVERSION_P = 352, - COPY = 353, - COST = 354, - CREATE_P = 355, - CROSS = 356, - CSV = 357, - CUBE = 358, - CURRENT_P = 359, - CURSOR = 360, - CYCLE = 361, - DATA_P = 362, - DATABASE = 363, - DAY_P = 364, - DAYS_P = 365, - DEALLOCATE = 366, - DEC = 367, - DECADE_P = 368, - DECADES_P = 369, - DECIMAL_P = 370, - DECLARE = 371, - DEFAULT = 372, - DEFAULTS = 373, - DEFERRABLE = 374, - DEFERRED = 375, - DEFINER = 376, - DELETE_P = 377, - DELIMITER = 378, - DELIMITERS = 379, - DEPENDS = 380, - DESC_P = 381, - DESCRIBE = 382, - DETACH = 383, - DICTIONARY = 384, - DISABLE_P = 385, - DISCARD = 386, - DISTINCT = 387, - DO = 388, - DOCUMENT_P = 389, - DOMAIN_P = 390, - DOUBLE_P = 391, - DROP = 392, - EACH = 393, - ELSE = 394, - ENABLE_P = 395, - ENCODING = 396, - ENCRYPTED = 397, - END_P = 398, - ENUM_P = 399, - ESCAPE = 400, - EVENT = 401, - EXCEPT = 402, - EXCLUDE = 403, - EXCLUDING = 404, - EXCLUSIVE = 405, - EXECUTE = 406, - EXISTS = 407, - EXPLAIN = 408, - EXPORT_P = 409, - EXPORT_STATE = 410, - EXTENSION = 411, - EXTERNAL = 412, - EXTRACT = 413, - FALSE_P = 414, - FAMILY = 415, - FETCH = 416, - FILTER = 417, - FIRST_P = 418, - FLOAT_P = 419, - FOLLOWING = 420, - FOR = 421, - FORCE = 422, - FOREIGN = 423, - FORWARD = 424, - FREEZE = 425, - FROM = 426, - FULL = 427, - FUNCTION = 428, - FUNCTIONS = 429, - GENERATED = 430, - GLOB = 431, - GLOBAL = 432, - GRANT = 433, - GRANTED = 434, - GROUP_P = 435, - GROUPING = 436, - GROUPING_ID = 437, - GROUPS = 438, - HANDLER = 439, - HAVING = 440, - HEADER_P = 441, - HOLD = 442, - HOUR_P = 443, - HOURS_P = 444, - IDENTITY_P = 445, - IF_P = 446, - IGNORE_P = 447, - ILIKE = 448, - IMMEDIATE = 449, - IMMUTABLE = 450, - IMPLICIT_P = 451, - IMPORT_P = 452, - IN_P = 453, - INCLUDE_P = 454, - INCLUDING = 455, - INCREMENT = 456, - INDEX = 457, - INDEXES = 458, - INHERIT = 459, - INHERITS = 460, - INITIALLY = 461, - INLINE_P = 462, - INNER_P = 463, - INOUT = 464, - INPUT_P = 465, - INSENSITIVE = 466, - INSERT = 467, - INSTALL = 468, - INSTEAD = 469, - INT_P = 470, - INTEGER = 471, - INTERSECT = 472, - INTERVAL = 473, - INTO = 474, - INVOKER = 475, - IS = 476, - ISNULL = 477, - ISOLATION = 478, - JOIN = 479, - JSON = 480, - KEY = 481, - LABEL = 482, - LANGUAGE = 483, - LARGE_P = 484, - LAST_P = 485, - LATERAL_P = 486, - LEADING = 487, - LEAKPROOF = 488, - LEFT = 489, - LEVEL = 490, - LIKE = 491, - LIMIT = 492, - LISTEN = 493, - LOAD = 494, - LOCAL = 495, - LOCATION = 496, - LOCK_P = 497, - LOCKED = 498, - LOGGED = 499, - MACRO = 500, - MAP = 501, - MAPPING = 502, - MATCH = 503, - MATERIALIZED = 504, - MAXVALUE = 505, - METHOD = 506, - MICROSECOND_P = 507, - MICROSECONDS_P = 508, - MILLENNIA_P = 509, - MILLENNIUM_P = 510, - MILLISECOND_P = 511, - MILLISECONDS_P = 512, - MINUTE_P = 513, - MINUTES_P = 514, - MINVALUE = 515, - MODE = 516, - MONTH_P = 517, - MONTHS_P = 518, - MOVE = 519, - NAME_P = 520, - NAMES = 521, - NATIONAL = 522, - NATURAL = 523, - NCHAR = 524, - NEW = 525, - NEXT = 526, - NO = 527, - NONE = 528, - NOT = 529, - NOTHING = 530, - NOTIFY = 531, - NOTNULL = 532, - NOWAIT = 533, - NULL_P = 534, - NULLIF = 535, - NULLS_P = 536, - NUMERIC = 537, - OBJECT_P = 538, - OF = 539, - OFF = 540, - OFFSET = 541, - OIDS = 542, - OLD = 543, - ON = 544, - ONLY = 545, - OPERATOR = 546, - OPTION = 547, - OPTIONS = 548, - OR = 549, - ORDER = 550, - ORDINALITY = 551, - OTHERS = 552, - OUT_P = 553, - OUTER_P = 554, - OVER = 555, - OVERLAPS = 556, - OVERLAY = 557, - OVERRIDING = 558, - OWNED = 559, - OWNER = 560, - PARALLEL = 561, - PARSER = 562, - PARTIAL = 563, - PARTITION = 564, - PASSING = 565, - PASSWORD = 566, - PERCENT = 567, - PERSISTENT = 568, - PIVOT = 569, - PIVOT_LONGER = 570, - PIVOT_WIDER = 571, - PLACING = 572, - PLANS = 573, - POLICY = 574, - POSITION = 575, - POSITIONAL = 576, - PRAGMA_P = 577, - PRECEDING = 578, - PRECISION = 579, - PREPARE = 580, - PREPARED = 581, - PRESERVE = 582, - PRIMARY = 583, - PRIOR = 584, - PRIVILEGES = 585, - PROCEDURAL = 586, - PROCEDURE = 587, - PROGRAM = 588, - PUBLICATION = 589, - QUALIFY = 590, - QUOTE = 591, - RANGE = 592, - READ_P = 593, - REAL = 594, - REASSIGN = 595, - RECHECK = 596, - RECURSIVE = 597, - REF = 598, - REFERENCES = 599, - REFERENCING = 600, - REFRESH = 601, - REINDEX = 602, - RELATIVE_P = 603, - RELEASE = 604, - RENAME = 605, - REPEATABLE = 606, - REPLACE = 607, - REPLICA = 608, - RESET = 609, - RESPECT_P = 610, - RESTART = 611, - RESTRICT = 612, - RETURNING = 613, - RETURNS = 614, - REVOKE = 615, - RIGHT = 616, - ROLE = 617, - ROLLBACK = 618, - ROLLUP = 619, - ROW = 620, - ROWS = 621, - RULE = 622, - SAMPLE = 623, - SAVEPOINT = 624, - SCHEMA = 625, - SCHEMAS = 626, - SCOPE = 627, - SCROLL = 628, - SEARCH = 629, - SECOND_P = 630, - SECONDS_P = 631, - SECRET = 632, - SECURITY = 633, - SELECT = 634, - SEMI = 635, - SEQUENCE = 636, - SEQUENCES = 637, - SERIALIZABLE = 638, - SERVER = 639, - SESSION = 640, - SET = 641, - SETOF = 642, - SETS = 643, - SHARE = 644, - SHOW = 645, - SIMILAR = 646, - SIMPLE = 647, - SKIP = 648, - SMALLINT = 649, - SNAPSHOT = 650, - SOME = 651, - SQL_P = 652, - STABLE = 653, - STANDALONE_P = 654, - START = 655, - STATEMENT = 656, - STATISTICS = 657, - STDIN = 658, - STDOUT = 659, - STORAGE = 660, - STORED = 661, - STRICT_P = 662, - STRIP_P = 663, - STRUCT = 664, - SUBSCRIPTION = 665, - SUBSTRING = 666, - SUMMARIZE = 667, - SYMMETRIC = 668, - SYSID = 669, - SYSTEM_P = 670, - TABLE = 671, - TABLES = 672, - TABLESAMPLE = 673, - TABLESPACE = 674, - TEMP = 675, - TEMPLATE = 676, - TEMPORARY = 677, - TEXT_P = 678, - THEN = 679, - TIES = 680, - TIME = 681, - TIMESTAMP = 682, - TO = 683, - TRAILING = 684, - TRANSACTION = 685, - TRANSFORM = 686, - TREAT = 687, - TRIGGER = 688, - TRIM = 689, - TRUE_P = 690, - TRUNCATE = 691, - TRUSTED = 692, - TRY_CAST = 693, - TYPE_P = 694, - TYPES_P = 695, - UNBOUNDED = 696, - UNCOMMITTED = 697, - UNENCRYPTED = 698, - UNION = 699, - UNIQUE = 700, - UNKNOWN = 701, - UNLISTEN = 702, - UNLOGGED = 703, - UNPIVOT = 704, - UNTIL = 705, - UPDATE = 706, - USE_P = 707, - USER = 708, - USING = 709, - VACUUM = 710, - VALID = 711, - VALIDATE = 712, - VALIDATOR = 713, - VALUE_P = 714, - VALUES = 715, - VARCHAR = 716, - VARIADIC = 717, - VARYING = 718, - VERBOSE = 719, - VERSION_P = 720, - VIEW = 721, - VIEWS = 722, - VIRTUAL = 723, - VOLATILE = 724, - WEEK_P = 725, - WEEKS_P = 726, - WHEN = 727, - WHERE = 728, - WHITESPACE_P = 729, - WINDOW = 730, - WITH = 731, - WITHIN = 732, - WITHOUT = 733, - WORK = 734, - WRAPPER = 735, - WRITE_P = 736, - XML_P = 737, - XMLATTRIBUTES = 738, - XMLCONCAT = 739, - XMLELEMENT = 740, - XMLEXISTS = 741, - XMLFOREST = 742, - XMLNAMESPACES = 743, - XMLPARSE = 744, - XMLPI = 745, - XMLROOT = 746, - XMLSERIALIZE = 747, - XMLTABLE = 748, - YEAR_P = 749, - YEARS_P = 750, - YES_P = 751, - ZONE = 752, - NOT_LA = 753, - NULLS_LA = 754, - WITH_LA = 755, - POSTFIXOP = 756, - UMINUS = 757 - }; + enum yytokentype + { + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + IDENT = 258, /* IDENT */ + FCONST = 259, /* FCONST */ + SCONST = 260, /* SCONST */ + BCONST = 261, /* BCONST */ + XCONST = 262, /* XCONST */ + Op = 263, /* Op */ + ICONST = 264, /* ICONST */ + PARAM = 265, /* PARAM */ + TYPECAST = 266, /* TYPECAST */ + DOT_DOT = 267, /* DOT_DOT */ + COLON_EQUALS = 268, /* COLON_EQUALS */ + EQUALS_GREATER = 269, /* EQUALS_GREATER */ + INTEGER_DIVISION = 270, /* INTEGER_DIVISION */ + POWER_OF = 271, /* POWER_OF */ + LAMBDA_ARROW = 272, /* LAMBDA_ARROW */ + DOUBLE_ARROW = 273, /* DOUBLE_ARROW */ + LESS_EQUALS = 274, /* LESS_EQUALS */ + GREATER_EQUALS = 275, /* GREATER_EQUALS */ + NOT_EQUALS = 276, /* NOT_EQUALS */ + ABORT_P = 277, /* ABORT_P */ + ABSOLUTE_P = 278, /* ABSOLUTE_P */ + ACCESS = 279, /* ACCESS */ + ACTION = 280, /* ACTION */ + ADD_P = 281, /* ADD_P */ + ADMIN = 282, /* ADMIN */ + AFTER = 283, /* AFTER */ + AGGREGATE = 284, /* AGGREGATE */ + ALL = 285, /* ALL */ + ALSO = 286, /* ALSO */ + ALTER = 287, /* ALTER */ + ALWAYS = 288, /* ALWAYS */ + ANALYSE = 289, /* ANALYSE */ + ANALYZE = 290, /* ANALYZE */ + AND = 291, /* AND */ + ANTI = 292, /* ANTI */ + ANY = 293, /* ANY */ + ARRAY = 294, /* ARRAY */ + AS = 295, /* AS */ + ASC_P = 296, /* ASC_P */ + ASOF = 297, /* ASOF */ + ASSERTION = 298, /* ASSERTION */ + ASSIGNMENT = 299, /* ASSIGNMENT */ + ASYMMETRIC = 300, /* ASYMMETRIC */ + AT = 301, /* AT */ + ATTACH = 302, /* ATTACH */ + ATTRIBUTE = 303, /* ATTRIBUTE */ + AUTHORIZATION = 304, /* AUTHORIZATION */ + BACKWARD = 305, /* BACKWARD */ + BEFORE = 306, /* BEFORE */ + BEGIN_P = 307, /* BEGIN_P */ + BETWEEN = 308, /* BETWEEN */ + BIGINT = 309, /* BIGINT */ + BINARY = 310, /* BINARY */ + BIT = 311, /* BIT */ + BOOLEAN_P = 312, /* BOOLEAN_P */ + BOTH = 313, /* BOTH */ + BY = 314, /* BY */ + CACHE = 315, /* CACHE */ + CALL_P = 316, /* CALL_P */ + CALLED = 317, /* CALLED */ + CASCADE = 318, /* CASCADE */ + CASCADED = 319, /* CASCADED */ + CASE = 320, /* CASE */ + CAST = 321, /* CAST */ + CATALOG_P = 322, /* CATALOG_P */ + CENTURIES_P = 323, /* CENTURIES_P */ + CENTURY_P = 324, /* CENTURY_P */ + CHAIN = 325, /* CHAIN */ + CHAR_P = 326, /* CHAR_P */ + CHARACTER = 327, /* CHARACTER */ + CHARACTERISTICS = 328, /* CHARACTERISTICS */ + CHECK_P = 329, /* CHECK_P */ + CHECKPOINT = 330, /* CHECKPOINT */ + CLASS = 331, /* CLASS */ + CLOSE = 332, /* CLOSE */ + CLUSTER = 333, /* CLUSTER */ + COALESCE = 334, /* COALESCE */ + COLLATE = 335, /* COLLATE */ + COLLATION = 336, /* COLLATION */ + COLUMN = 337, /* COLUMN */ + COLUMNS = 338, /* COLUMNS */ + COMMENT = 339, /* COMMENT */ + COMMENTS = 340, /* COMMENTS */ + COMMIT = 341, /* COMMIT */ + COMMITTED = 342, /* COMMITTED */ + COMPRESSION = 343, /* COMPRESSION */ + CONCURRENTLY = 344, /* CONCURRENTLY */ + CONFIGURATION = 345, /* CONFIGURATION */ + CONFLICT = 346, /* CONFLICT */ + CONNECTION = 347, /* CONNECTION */ + CONSTRAINT = 348, /* CONSTRAINT */ + CONSTRAINTS = 349, /* CONSTRAINTS */ + CONTENT_P = 350, /* CONTENT_P */ + CONTINUE_P = 351, /* CONTINUE_P */ + CONVERSION_P = 352, /* CONVERSION_P */ + COPY = 353, /* COPY */ + COST = 354, /* COST */ + CREATE_P = 355, /* CREATE_P */ + CROSS = 356, /* CROSS */ + CSV = 357, /* CSV */ + CUBE = 358, /* CUBE */ + CURRENT_P = 359, /* CURRENT_P */ + CURSOR = 360, /* CURSOR */ + CYCLE = 361, /* CYCLE */ + DATA_P = 362, /* DATA_P */ + DATABASE = 363, /* DATABASE */ + DAY_P = 364, /* DAY_P */ + DAYS_P = 365, /* DAYS_P */ + DEALLOCATE = 366, /* DEALLOCATE */ + DEC = 367, /* DEC */ + DECADE_P = 368, /* DECADE_P */ + DECADES_P = 369, /* DECADES_P */ + DECIMAL_P = 370, /* DECIMAL_P */ + DECLARE = 371, /* DECLARE */ + DEFAULT = 372, /* DEFAULT */ + DEFAULTS = 373, /* DEFAULTS */ + DEFERRABLE = 374, /* DEFERRABLE */ + DEFERRED = 375, /* DEFERRED */ + DEFINER = 376, /* DEFINER */ + DELETE_P = 377, /* DELETE_P */ + DELIMITER = 378, /* DELIMITER */ + DELIMITERS = 379, /* DELIMITERS */ + DEPENDS = 380, /* DEPENDS */ + DESC_P = 381, /* DESC_P */ + DESCRIBE = 382, /* DESCRIBE */ + DETACH = 383, /* DETACH */ + DICTIONARY = 384, /* DICTIONARY */ + DISABLE_P = 385, /* DISABLE_P */ + DISCARD = 386, /* DISCARD */ + DISTINCT = 387, /* DISTINCT */ + DO = 388, /* DO */ + DOCUMENT_P = 389, /* DOCUMENT_P */ + DOMAIN_P = 390, /* DOMAIN_P */ + DOUBLE_P = 391, /* DOUBLE_P */ + DROP = 392, /* DROP */ + EACH = 393, /* EACH */ + ELSE = 394, /* ELSE */ + ENABLE_P = 395, /* ENABLE_P */ + ENCODING = 396, /* ENCODING */ + ENCRYPTED = 397, /* ENCRYPTED */ + END_P = 398, /* END_P */ + ENUM_P = 399, /* ENUM_P */ + ESCAPE = 400, /* ESCAPE */ + EVENT = 401, /* EVENT */ + EXCEPT = 402, /* EXCEPT */ + EXCLUDE = 403, /* EXCLUDE */ + EXCLUDING = 404, /* EXCLUDING */ + EXCLUSIVE = 405, /* EXCLUSIVE */ + EXECUTE = 406, /* EXECUTE */ + EXISTS = 407, /* EXISTS */ + EXPLAIN = 408, /* EXPLAIN */ + EXPORT_P = 409, /* EXPORT_P */ + EXPORT_STATE = 410, /* EXPORT_STATE */ + EXTENSION = 411, /* EXTENSION */ + EXTENSIONS = 412, /* EXTENSIONS */ + EXTERNAL = 413, /* EXTERNAL */ + EXTRACT = 414, /* EXTRACT */ + FALSE_P = 415, /* FALSE_P */ + FAMILY = 416, /* FAMILY */ + FETCH = 417, /* FETCH */ + FILTER = 418, /* FILTER */ + FIRST_P = 419, /* FIRST_P */ + FLOAT_P = 420, /* FLOAT_P */ + FOLLOWING = 421, /* FOLLOWING */ + FOR = 422, /* FOR */ + FORCE = 423, /* FORCE */ + FOREIGN = 424, /* FOREIGN */ + FORWARD = 425, /* FORWARD */ + FREEZE = 426, /* FREEZE */ + FROM = 427, /* FROM */ + FULL = 428, /* FULL */ + FUNCTION = 429, /* FUNCTION */ + FUNCTIONS = 430, /* FUNCTIONS */ + GENERATED = 431, /* GENERATED */ + GLOB = 432, /* GLOB */ + GLOBAL = 433, /* GLOBAL */ + GRANT = 434, /* GRANT */ + GRANTED = 435, /* GRANTED */ + GROUP_P = 436, /* GROUP_P */ + GROUPING = 437, /* GROUPING */ + GROUPING_ID = 438, /* GROUPING_ID */ + GROUPS = 439, /* GROUPS */ + HANDLER = 440, /* HANDLER */ + HAVING = 441, /* HAVING */ + HEADER_P = 442, /* HEADER_P */ + HOLD = 443, /* HOLD */ + HOUR_P = 444, /* HOUR_P */ + HOURS_P = 445, /* HOURS_P */ + IDENTITY_P = 446, /* IDENTITY_P */ + IF_P = 447, /* IF_P */ + IGNORE_P = 448, /* IGNORE_P */ + ILIKE = 449, /* ILIKE */ + IMMEDIATE = 450, /* IMMEDIATE */ + IMMUTABLE = 451, /* IMMUTABLE */ + IMPLICIT_P = 452, /* IMPLICIT_P */ + IMPORT_P = 453, /* IMPORT_P */ + IN_P = 454, /* IN_P */ + INCLUDE_P = 455, /* INCLUDE_P */ + INCLUDING = 456, /* INCLUDING */ + INCREMENT = 457, /* INCREMENT */ + INDEX = 458, /* INDEX */ + INDEXES = 459, /* INDEXES */ + INHERIT = 460, /* INHERIT */ + INHERITS = 461, /* INHERITS */ + INITIALLY = 462, /* INITIALLY */ + INLINE_P = 463, /* INLINE_P */ + INNER_P = 464, /* INNER_P */ + INOUT = 465, /* INOUT */ + INPUT_P = 466, /* INPUT_P */ + INSENSITIVE = 467, /* INSENSITIVE */ + INSERT = 468, /* INSERT */ + INSTALL = 469, /* INSTALL */ + INSTEAD = 470, /* INSTEAD */ + INT_P = 471, /* INT_P */ + INTEGER = 472, /* INTEGER */ + INTERSECT = 473, /* INTERSECT */ + INTERVAL = 474, /* INTERVAL */ + INTO = 475, /* INTO */ + INVOKER = 476, /* INVOKER */ + IS = 477, /* IS */ + ISNULL = 478, /* ISNULL */ + ISOLATION = 479, /* ISOLATION */ + JOIN = 480, /* JOIN */ + JSON = 481, /* JSON */ + KEY = 482, /* KEY */ + LABEL = 483, /* LABEL */ + LANGUAGE = 484, /* LANGUAGE */ + LARGE_P = 485, /* LARGE_P */ + LAST_P = 486, /* LAST_P */ + LATERAL_P = 487, /* LATERAL_P */ + LEADING = 488, /* LEADING */ + LEAKPROOF = 489, /* LEAKPROOF */ + LEFT = 490, /* LEFT */ + LEVEL = 491, /* LEVEL */ + LIKE = 492, /* LIKE */ + LIMIT = 493, /* LIMIT */ + LISTEN = 494, /* LISTEN */ + LOAD = 495, /* LOAD */ + LOCAL = 496, /* LOCAL */ + LOCATION = 497, /* LOCATION */ + LOCK_P = 498, /* LOCK_P */ + LOCKED = 499, /* LOCKED */ + LOGGED = 500, /* LOGGED */ + MACRO = 501, /* MACRO */ + MAP = 502, /* MAP */ + MAPPING = 503, /* MAPPING */ + MATCH = 504, /* MATCH */ + MATERIALIZED = 505, /* MATERIALIZED */ + MAXVALUE = 506, /* MAXVALUE */ + METHOD = 507, /* METHOD */ + MICROSECOND_P = 508, /* MICROSECOND_P */ + MICROSECONDS_P = 509, /* MICROSECONDS_P */ + MILLENNIA_P = 510, /* MILLENNIA_P */ + MILLENNIUM_P = 511, /* MILLENNIUM_P */ + MILLISECOND_P = 512, /* MILLISECOND_P */ + MILLISECONDS_P = 513, /* MILLISECONDS_P */ + MINUTE_P = 514, /* MINUTE_P */ + MINUTES_P = 515, /* MINUTES_P */ + MINVALUE = 516, /* MINVALUE */ + MODE = 517, /* MODE */ + MONTH_P = 518, /* MONTH_P */ + MONTHS_P = 519, /* MONTHS_P */ + MOVE = 520, /* MOVE */ + NAME_P = 521, /* NAME_P */ + NAMES = 522, /* NAMES */ + NATIONAL = 523, /* NATIONAL */ + NATURAL = 524, /* NATURAL */ + NCHAR = 525, /* NCHAR */ + NEW = 526, /* NEW */ + NEXT = 527, /* NEXT */ + NO = 528, /* NO */ + NONE = 529, /* NONE */ + NOT = 530, /* NOT */ + NOTHING = 531, /* NOTHING */ + NOTIFY = 532, /* NOTIFY */ + NOTNULL = 533, /* NOTNULL */ + NOWAIT = 534, /* NOWAIT */ + NULL_P = 535, /* NULL_P */ + NULLIF = 536, /* NULLIF */ + NULLS_P = 537, /* NULLS_P */ + NUMERIC = 538, /* NUMERIC */ + OBJECT_P = 539, /* OBJECT_P */ + OF = 540, /* OF */ + OFF = 541, /* OFF */ + OFFSET = 542, /* OFFSET */ + OIDS = 543, /* OIDS */ + OLD = 544, /* OLD */ + ON = 545, /* ON */ + ONLY = 546, /* ONLY */ + OPERATOR = 547, /* OPERATOR */ + OPTION = 548, /* OPTION */ + OPTIONS = 549, /* OPTIONS */ + OR = 550, /* OR */ + ORDER = 551, /* ORDER */ + ORDINALITY = 552, /* ORDINALITY */ + OTHERS = 553, /* OTHERS */ + OUT_P = 554, /* OUT_P */ + OUTER_P = 555, /* OUTER_P */ + OVER = 556, /* OVER */ + OVERLAPS = 557, /* OVERLAPS */ + OVERLAY = 558, /* OVERLAY */ + OVERRIDING = 559, /* OVERRIDING */ + OWNED = 560, /* OWNED */ + OWNER = 561, /* OWNER */ + PARALLEL = 562, /* PARALLEL */ + PARSER = 563, /* PARSER */ + PARTIAL = 564, /* PARTIAL */ + PARTITION = 565, /* PARTITION */ + PASSING = 566, /* PASSING */ + PASSWORD = 567, /* PASSWORD */ + PERCENT = 568, /* PERCENT */ + PERSISTENT = 569, /* PERSISTENT */ + PIVOT = 570, /* PIVOT */ + PIVOT_LONGER = 571, /* PIVOT_LONGER */ + PIVOT_WIDER = 572, /* PIVOT_WIDER */ + PLACING = 573, /* PLACING */ + PLANS = 574, /* PLANS */ + POLICY = 575, /* POLICY */ + POSITION = 576, /* POSITION */ + POSITIONAL = 577, /* POSITIONAL */ + PRAGMA_P = 578, /* PRAGMA_P */ + PRECEDING = 579, /* PRECEDING */ + PRECISION = 580, /* PRECISION */ + PREPARE = 581, /* PREPARE */ + PREPARED = 582, /* PREPARED */ + PRESERVE = 583, /* PRESERVE */ + PRIMARY = 584, /* PRIMARY */ + PRIOR = 585, /* PRIOR */ + PRIVILEGES = 586, /* PRIVILEGES */ + PROCEDURAL = 587, /* PROCEDURAL */ + PROCEDURE = 588, /* PROCEDURE */ + PROGRAM = 589, /* PROGRAM */ + PUBLICATION = 590, /* PUBLICATION */ + QUALIFY = 591, /* QUALIFY */ + QUARTER_P = 592, /* QUARTER_P */ + QUARTERS_P = 593, /* QUARTERS_P */ + QUOTE = 594, /* QUOTE */ + RANGE = 595, /* RANGE */ + READ_P = 596, /* READ_P */ + REAL = 597, /* REAL */ + REASSIGN = 598, /* REASSIGN */ + RECHECK = 599, /* RECHECK */ + RECURSIVE = 600, /* RECURSIVE */ + REF = 601, /* REF */ + REFERENCES = 602, /* REFERENCES */ + REFERENCING = 603, /* REFERENCING */ + REFRESH = 604, /* REFRESH */ + REINDEX = 605, /* REINDEX */ + RELATIVE_P = 606, /* RELATIVE_P */ + RELEASE = 607, /* RELEASE */ + RENAME = 608, /* RENAME */ + REPEATABLE = 609, /* REPEATABLE */ + REPLACE = 610, /* REPLACE */ + REPLICA = 611, /* REPLICA */ + RESET = 612, /* RESET */ + RESPECT_P = 613, /* RESPECT_P */ + RESTART = 614, /* RESTART */ + RESTRICT = 615, /* RESTRICT */ + RETURNING = 616, /* RETURNING */ + RETURNS = 617, /* RETURNS */ + REVOKE = 618, /* REVOKE */ + RIGHT = 619, /* RIGHT */ + ROLE = 620, /* ROLE */ + ROLLBACK = 621, /* ROLLBACK */ + ROLLUP = 622, /* ROLLUP */ + ROW = 623, /* ROW */ + ROWS = 624, /* ROWS */ + RULE = 625, /* RULE */ + SAMPLE = 626, /* SAMPLE */ + SAVEPOINT = 627, /* SAVEPOINT */ + SCHEMA = 628, /* SCHEMA */ + SCHEMAS = 629, /* SCHEMAS */ + SCOPE = 630, /* SCOPE */ + SCROLL = 631, /* SCROLL */ + SEARCH = 632, /* SEARCH */ + SECOND_P = 633, /* SECOND_P */ + SECONDS_P = 634, /* SECONDS_P */ + SECRET = 635, /* SECRET */ + SECURITY = 636, /* SECURITY */ + SELECT = 637, /* SELECT */ + SEMI = 638, /* SEMI */ + SEQUENCE = 639, /* SEQUENCE */ + SEQUENCES = 640, /* SEQUENCES */ + SERIALIZABLE = 641, /* SERIALIZABLE */ + SERVER = 642, /* SERVER */ + SESSION = 643, /* SESSION */ + SET = 644, /* SET */ + SETOF = 645, /* SETOF */ + SETS = 646, /* SETS */ + SHARE = 647, /* SHARE */ + SHOW = 648, /* SHOW */ + SIMILAR = 649, /* SIMILAR */ + SIMPLE = 650, /* SIMPLE */ + SKIP = 651, /* SKIP */ + SMALLINT = 652, /* SMALLINT */ + SNAPSHOT = 653, /* SNAPSHOT */ + SOME = 654, /* SOME */ + SQL_P = 655, /* SQL_P */ + STABLE = 656, /* STABLE */ + STANDALONE_P = 657, /* STANDALONE_P */ + START = 658, /* START */ + STATEMENT = 659, /* STATEMENT */ + STATISTICS = 660, /* STATISTICS */ + STDIN = 661, /* STDIN */ + STDOUT = 662, /* STDOUT */ + STORAGE = 663, /* STORAGE */ + STORED = 664, /* STORED */ + STRICT_P = 665, /* STRICT_P */ + STRIP_P = 666, /* STRIP_P */ + STRUCT = 667, /* STRUCT */ + SUBSCRIPTION = 668, /* SUBSCRIPTION */ + SUBSTRING = 669, /* SUBSTRING */ + SUMMARIZE = 670, /* SUMMARIZE */ + SYMMETRIC = 671, /* SYMMETRIC */ + SYSID = 672, /* SYSID */ + SYSTEM_P = 673, /* SYSTEM_P */ + TABLE = 674, /* TABLE */ + TABLES = 675, /* TABLES */ + TABLESAMPLE = 676, /* TABLESAMPLE */ + TABLESPACE = 677, /* TABLESPACE */ + TEMP = 678, /* TEMP */ + TEMPLATE = 679, /* TEMPLATE */ + TEMPORARY = 680, /* TEMPORARY */ + TEXT_P = 681, /* TEXT_P */ + THEN = 682, /* THEN */ + TIES = 683, /* TIES */ + TIME = 684, /* TIME */ + TIMESTAMP = 685, /* TIMESTAMP */ + TO = 686, /* TO */ + TRAILING = 687, /* TRAILING */ + TRANSACTION = 688, /* TRANSACTION */ + TRANSFORM = 689, /* TRANSFORM */ + TREAT = 690, /* TREAT */ + TRIGGER = 691, /* TRIGGER */ + TRIM = 692, /* TRIM */ + TRUE_P = 693, /* TRUE_P */ + TRUNCATE = 694, /* TRUNCATE */ + TRUSTED = 695, /* TRUSTED */ + TRY_CAST = 696, /* TRY_CAST */ + TYPE_P = 697, /* TYPE_P */ + TYPES_P = 698, /* TYPES_P */ + UNBOUNDED = 699, /* UNBOUNDED */ + UNCOMMITTED = 700, /* UNCOMMITTED */ + UNENCRYPTED = 701, /* UNENCRYPTED */ + UNION = 702, /* UNION */ + UNIQUE = 703, /* UNIQUE */ + UNKNOWN = 704, /* UNKNOWN */ + UNLISTEN = 705, /* UNLISTEN */ + UNLOGGED = 706, /* UNLOGGED */ + UNPIVOT = 707, /* UNPIVOT */ + UNTIL = 708, /* UNTIL */ + UPDATE = 709, /* UPDATE */ + USE_P = 710, /* USE_P */ + USER = 711, /* USER */ + USING = 712, /* USING */ + VACUUM = 713, /* VACUUM */ + VALID = 714, /* VALID */ + VALIDATE = 715, /* VALIDATE */ + VALIDATOR = 716, /* VALIDATOR */ + VALUE_P = 717, /* VALUE_P */ + VALUES = 718, /* VALUES */ + VARCHAR = 719, /* VARCHAR */ + VARIADIC = 720, /* VARIADIC */ + VARYING = 721, /* VARYING */ + VERBOSE = 722, /* VERBOSE */ + VERSION_P = 723, /* VERSION_P */ + VIEW = 724, /* VIEW */ + VIEWS = 725, /* VIEWS */ + VIRTUAL = 726, /* VIRTUAL */ + VOLATILE = 727, /* VOLATILE */ + WEEK_P = 728, /* WEEK_P */ + WEEKS_P = 729, /* WEEKS_P */ + WHEN = 730, /* WHEN */ + WHERE = 731, /* WHERE */ + WHITESPACE_P = 732, /* WHITESPACE_P */ + WINDOW = 733, /* WINDOW */ + WITH = 734, /* WITH */ + WITHIN = 735, /* WITHIN */ + WITHOUT = 736, /* WITHOUT */ + WORK = 737, /* WORK */ + WRAPPER = 738, /* WRAPPER */ + WRITE_P = 739, /* WRITE_P */ + XML_P = 740, /* XML_P */ + XMLATTRIBUTES = 741, /* XMLATTRIBUTES */ + XMLCONCAT = 742, /* XMLCONCAT */ + XMLELEMENT = 743, /* XMLELEMENT */ + XMLEXISTS = 744, /* XMLEXISTS */ + XMLFOREST = 745, /* XMLFOREST */ + XMLNAMESPACES = 746, /* XMLNAMESPACES */ + XMLPARSE = 747, /* XMLPARSE */ + XMLPI = 748, /* XMLPI */ + XMLROOT = 749, /* XMLROOT */ + XMLSERIALIZE = 750, /* XMLSERIALIZE */ + XMLTABLE = 751, /* XMLTABLE */ + YEAR_P = 752, /* YEAR_P */ + YEARS_P = 753, /* YEARS_P */ + YES_P = 754, /* YES_P */ + ZONE = 755, /* ZONE */ + NOT_LA = 756, /* NOT_LA */ + NULLS_LA = 757, /* NULLS_LA */ + WITH_LA = 758, /* WITH_LA */ + POSTFIXOP = 759, /* POSTFIXOP */ + UMINUS = 760 /* UMINUS */ + }; + typedef enum yytokentype yytoken_kind_t; #endif -/* Tokens. */ -#define IDENT 258 -#define FCONST 259 -#define SCONST 260 -#define BCONST 261 -#define XCONST 262 -#define Op 263 -#define ICONST 264 -#define PARAM 265 -#define TYPECAST 266 -#define DOT_DOT 267 -#define COLON_EQUALS 268 -#define EQUALS_GREATER 269 -#define INTEGER_DIVISION 270 -#define POWER_OF 271 -#define LAMBDA_ARROW 272 -#define DOUBLE_ARROW 273 -#define LESS_EQUALS 274 -#define GREATER_EQUALS 275 -#define NOT_EQUALS 276 -#define ABORT_P 277 -#define ABSOLUTE_P 278 -#define ACCESS 279 -#define ACTION 280 -#define ADD_P 281 -#define ADMIN 282 -#define AFTER 283 -#define AGGREGATE 284 -#define ALL 285 -#define ALSO 286 -#define ALTER 287 -#define ALWAYS 288 -#define ANALYSE 289 -#define ANALYZE 290 -#define AND 291 -#define ANTI 292 -#define ANY 293 -#define ARRAY 294 -#define AS 295 -#define ASC_P 296 -#define ASOF 297 -#define ASSERTION 298 -#define ASSIGNMENT 299 -#define ASYMMETRIC 300 -#define AT 301 -#define ATTACH 302 -#define ATTRIBUTE 303 -#define AUTHORIZATION 304 -#define BACKWARD 305 -#define BEFORE 306 -#define BEGIN_P 307 -#define BETWEEN 308 -#define BIGINT 309 -#define BINARY 310 -#define BIT 311 -#define BOOLEAN_P 312 -#define BOTH 313 -#define BY 314 -#define CACHE 315 -#define CALL_P 316 -#define CALLED 317 -#define CASCADE 318 -#define CASCADED 319 -#define CASE 320 -#define CAST 321 -#define CATALOG_P 322 -#define CENTURIES_P 323 -#define CENTURY_P 324 -#define CHAIN 325 -#define CHAR_P 326 -#define CHARACTER 327 -#define CHARACTERISTICS 328 -#define CHECK_P 329 -#define CHECKPOINT 330 -#define CLASS 331 -#define CLOSE 332 -#define CLUSTER 333 -#define COALESCE 334 -#define COLLATE 335 -#define COLLATION 336 -#define COLUMN 337 -#define COLUMNS 338 -#define COMMENT 339 -#define COMMENTS 340 -#define COMMIT 341 -#define COMMITTED 342 -#define COMPRESSION 343 -#define CONCURRENTLY 344 -#define CONFIGURATION 345 -#define CONFLICT 346 -#define CONNECTION 347 -#define CONSTRAINT 348 -#define CONSTRAINTS 349 -#define CONTENT_P 350 -#define CONTINUE_P 351 -#define CONVERSION_P 352 -#define COPY 353 -#define COST 354 -#define CREATE_P 355 -#define CROSS 356 -#define CSV 357 -#define CUBE 358 -#define CURRENT_P 359 -#define CURSOR 360 -#define CYCLE 361 -#define DATA_P 362 -#define DATABASE 363 -#define DAY_P 364 -#define DAYS_P 365 -#define DEALLOCATE 366 -#define DEC 367 -#define DECADE_P 368 -#define DECADES_P 369 -#define DECIMAL_P 370 -#define DECLARE 371 -#define DEFAULT 372 -#define DEFAULTS 373 -#define DEFERRABLE 374 -#define DEFERRED 375 -#define DEFINER 376 -#define DELETE_P 377 -#define DELIMITER 378 -#define DELIMITERS 379 -#define DEPENDS 380 -#define DESC_P 381 -#define DESCRIBE 382 -#define DETACH 383 -#define DICTIONARY 384 -#define DISABLE_P 385 -#define DISCARD 386 -#define DISTINCT 387 -#define DO 388 -#define DOCUMENT_P 389 -#define DOMAIN_P 390 -#define DOUBLE_P 391 -#define DROP 392 -#define EACH 393 -#define ELSE 394 -#define ENABLE_P 395 -#define ENCODING 396 -#define ENCRYPTED 397 -#define END_P 398 -#define ENUM_P 399 -#define ESCAPE 400 -#define EVENT 401 -#define EXCEPT 402 -#define EXCLUDE 403 -#define EXCLUDING 404 -#define EXCLUSIVE 405 -#define EXECUTE 406 -#define EXISTS 407 -#define EXPLAIN 408 -#define EXPORT_P 409 -#define EXPORT_STATE 410 -#define EXTENSION 411 -#define EXTERNAL 412 -#define EXTRACT 413 -#define FALSE_P 414 -#define FAMILY 415 -#define FETCH 416 -#define FILTER 417 -#define FIRST_P 418 -#define FLOAT_P 419 -#define FOLLOWING 420 -#define FOR 421 -#define FORCE 422 -#define FOREIGN 423 -#define FORWARD 424 -#define FREEZE 425 -#define FROM 426 -#define FULL 427 -#define FUNCTION 428 -#define FUNCTIONS 429 -#define GENERATED 430 -#define GLOB 431 -#define GLOBAL 432 -#define GRANT 433 -#define GRANTED 434 -#define GROUP_P 435 -#define GROUPING 436 -#define GROUPING_ID 437 -#define GROUPS 438 -#define HANDLER 439 -#define HAVING 440 -#define HEADER_P 441 -#define HOLD 442 -#define HOUR_P 443 -#define HOURS_P 444 -#define IDENTITY_P 445 -#define IF_P 446 -#define IGNORE_P 447 -#define ILIKE 448 -#define IMMEDIATE 449 -#define IMMUTABLE 450 -#define IMPLICIT_P 451 -#define IMPORT_P 452 -#define IN_P 453 -#define INCLUDE_P 454 -#define INCLUDING 455 -#define INCREMENT 456 -#define INDEX 457 -#define INDEXES 458 -#define INHERIT 459 -#define INHERITS 460 -#define INITIALLY 461 -#define INLINE_P 462 -#define INNER_P 463 -#define INOUT 464 -#define INPUT_P 465 -#define INSENSITIVE 466 -#define INSERT 467 -#define INSTALL 468 -#define INSTEAD 469 -#define INT_P 470 -#define INTEGER 471 -#define INTERSECT 472 -#define INTERVAL 473 -#define INTO 474 -#define INVOKER 475 -#define IS 476 -#define ISNULL 477 -#define ISOLATION 478 -#define JOIN 479 -#define JSON 480 -#define KEY 481 -#define LABEL 482 -#define LANGUAGE 483 -#define LARGE_P 484 -#define LAST_P 485 -#define LATERAL_P 486 -#define LEADING 487 -#define LEAKPROOF 488 -#define LEFT 489 -#define LEVEL 490 -#define LIKE 491 -#define LIMIT 492 -#define LISTEN 493 -#define LOAD 494 -#define LOCAL 495 -#define LOCATION 496 -#define LOCK_P 497 -#define LOCKED 498 -#define LOGGED 499 -#define MACRO 500 -#define MAP 501 -#define MAPPING 502 -#define MATCH 503 -#define MATERIALIZED 504 -#define MAXVALUE 505 -#define METHOD 506 -#define MICROSECOND_P 507 -#define MICROSECONDS_P 508 -#define MILLENNIA_P 509 -#define MILLENNIUM_P 510 -#define MILLISECOND_P 511 -#define MILLISECONDS_P 512 -#define MINUTE_P 513 -#define MINUTES_P 514 -#define MINVALUE 515 -#define MODE 516 -#define MONTH_P 517 -#define MONTHS_P 518 -#define MOVE 519 -#define NAME_P 520 -#define NAMES 521 -#define NATIONAL 522 -#define NATURAL 523 -#define NCHAR 524 -#define NEW 525 -#define NEXT 526 -#define NO 527 -#define NONE 528 -#define NOT 529 -#define NOTHING 530 -#define NOTIFY 531 -#define NOTNULL 532 -#define NOWAIT 533 -#define NULL_P 534 -#define NULLIF 535 -#define NULLS_P 536 -#define NUMERIC 537 -#define OBJECT_P 538 -#define OF 539 -#define OFF 540 -#define OFFSET 541 -#define OIDS 542 -#define OLD 543 -#define ON 544 -#define ONLY 545 -#define OPERATOR 546 -#define OPTION 547 -#define OPTIONS 548 -#define OR 549 -#define ORDER 550 -#define ORDINALITY 551 -#define OTHERS 552 -#define OUT_P 553 -#define OUTER_P 554 -#define OVER 555 -#define OVERLAPS 556 -#define OVERLAY 557 -#define OVERRIDING 558 -#define OWNED 559 -#define OWNER 560 -#define PARALLEL 561 -#define PARSER 562 -#define PARTIAL 563 -#define PARTITION 564 -#define PASSING 565 -#define PASSWORD 566 -#define PERCENT 567 -#define PERSISTENT 568 -#define PIVOT 569 -#define PIVOT_LONGER 570 -#define PIVOT_WIDER 571 -#define PLACING 572 -#define PLANS 573 -#define POLICY 574 -#define POSITION 575 -#define POSITIONAL 576 -#define PRAGMA_P 577 -#define PRECEDING 578 -#define PRECISION 579 -#define PREPARE 580 -#define PREPARED 581 -#define PRESERVE 582 -#define PRIMARY 583 -#define PRIOR 584 -#define PRIVILEGES 585 -#define PROCEDURAL 586 -#define PROCEDURE 587 -#define PROGRAM 588 -#define PUBLICATION 589 -#define QUALIFY 590 -#define QUOTE 591 -#define RANGE 592 -#define READ_P 593 -#define REAL 594 -#define REASSIGN 595 -#define RECHECK 596 -#define RECURSIVE 597 -#define REF 598 -#define REFERENCES 599 -#define REFERENCING 600 -#define REFRESH 601 -#define REINDEX 602 -#define RELATIVE_P 603 -#define RELEASE 604 -#define RENAME 605 -#define REPEATABLE 606 -#define REPLACE 607 -#define REPLICA 608 -#define RESET 609 -#define RESPECT_P 610 -#define RESTART 611 -#define RESTRICT 612 -#define RETURNING 613 -#define RETURNS 614 -#define REVOKE 615 -#define RIGHT 616 -#define ROLE 617 -#define ROLLBACK 618 -#define ROLLUP 619 -#define ROW 620 -#define ROWS 621 -#define RULE 622 -#define SAMPLE 623 -#define SAVEPOINT 624 -#define SCHEMA 625 -#define SCHEMAS 626 -#define SCOPE 627 -#define SCROLL 628 -#define SEARCH 629 -#define SECOND_P 630 -#define SECONDS_P 631 -#define SECRET 632 -#define SECURITY 633 -#define SELECT 634 -#define SEMI 635 -#define SEQUENCE 636 -#define SEQUENCES 637 -#define SERIALIZABLE 638 -#define SERVER 639 -#define SESSION 640 -#define SET 641 -#define SETOF 642 -#define SETS 643 -#define SHARE 644 -#define SHOW 645 -#define SIMILAR 646 -#define SIMPLE 647 -#define SKIP 648 -#define SMALLINT 649 -#define SNAPSHOT 650 -#define SOME 651 -#define SQL_P 652 -#define STABLE 653 -#define STANDALONE_P 654 -#define START 655 -#define STATEMENT 656 -#define STATISTICS 657 -#define STDIN 658 -#define STDOUT 659 -#define STORAGE 660 -#define STORED 661 -#define STRICT_P 662 -#define STRIP_P 663 -#define STRUCT 664 -#define SUBSCRIPTION 665 -#define SUBSTRING 666 -#define SUMMARIZE 667 -#define SYMMETRIC 668 -#define SYSID 669 -#define SYSTEM_P 670 -#define TABLE 671 -#define TABLES 672 -#define TABLESAMPLE 673 -#define TABLESPACE 674 -#define TEMP 675 -#define TEMPLATE 676 -#define TEMPORARY 677 -#define TEXT_P 678 -#define THEN 679 -#define TIES 680 -#define TIME 681 -#define TIMESTAMP 682 -#define TO 683 -#define TRAILING 684 -#define TRANSACTION 685 -#define TRANSFORM 686 -#define TREAT 687 -#define TRIGGER 688 -#define TRIM 689 -#define TRUE_P 690 -#define TRUNCATE 691 -#define TRUSTED 692 -#define TRY_CAST 693 -#define TYPE_P 694 -#define TYPES_P 695 -#define UNBOUNDED 696 -#define UNCOMMITTED 697 -#define UNENCRYPTED 698 -#define UNION 699 -#define UNIQUE 700 -#define UNKNOWN 701 -#define UNLISTEN 702 -#define UNLOGGED 703 -#define UNPIVOT 704 -#define UNTIL 705 -#define UPDATE 706 -#define USE_P 707 -#define USER 708 -#define USING 709 -#define VACUUM 710 -#define VALID 711 -#define VALIDATE 712 -#define VALIDATOR 713 -#define VALUE_P 714 -#define VALUES 715 -#define VARCHAR 716 -#define VARIADIC 717 -#define VARYING 718 -#define VERBOSE 719 -#define VERSION_P 720 -#define VIEW 721 -#define VIEWS 722 -#define VIRTUAL 723 -#define VOLATILE 724 -#define WEEK_P 725 -#define WEEKS_P 726 -#define WHEN 727 -#define WHERE 728 -#define WHITESPACE_P 729 -#define WINDOW 730 -#define WITH 731 -#define WITHIN 732 -#define WITHOUT 733 -#define WORK 734 -#define WRAPPER 735 -#define WRITE_P 736 -#define XML_P 737 -#define XMLATTRIBUTES 738 -#define XMLCONCAT 739 -#define XMLELEMENT 740 -#define XMLEXISTS 741 -#define XMLFOREST 742 -#define XMLNAMESPACES 743 -#define XMLPARSE 744 -#define XMLPI 745 -#define XMLROOT 746 -#define XMLSERIALIZE 747 -#define XMLTABLE 748 -#define YEAR_P 749 -#define YEARS_P 750 -#define YES_P 751 -#define ZONE 752 -#define NOT_LA 753 -#define NULLS_LA 754 -#define WITH_LA 755 -#define POSTFIXOP 756 -#define UMINUS 757 - - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 14 "third_party/libpg_query/grammar/grammar.y" +union YYSTYPE { +#line 14 "third_party/libpg_query/grammar/grammar.y" + core_YYSTYPE core_yystype; /* these fields must match core_YYSTYPE: */ int ival; @@ -1096,28 +613,34 @@ typedef union YYSTYPE PGSubLinkType subquerytype; PGViewCheckOption viewcheckoption; PGInsertColumnOrder bynameorposition; -} -/* Line 1529 of yacc.c. */ -#line 1102 "third_party/libpg_query/grammar/grammar_out.hpp" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif + PGLoadInstallType loadinstalltype; +#line 619 "third_party/libpg_query/grammar/grammar_out.hpp" +}; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif + + +int base_yyparse (core_yyscan_t yyscanner); + + +#endif /* !YY_BASE_YY_THIRD_PARTY_LIBPG_QUERY_GRAMMAR_GRAMMAR_OUT_HPP_INCLUDED */ diff --git a/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp b/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp index e39ca299..ce9d00db 100644 --- a/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +++ b/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp @@ -138,6 +138,7 @@ PG_KEYWORD("explain", EXPLAIN, UNRESERVED_KEYWORD) PG_KEYWORD("export", EXPORT_P, UNRESERVED_KEYWORD) PG_KEYWORD("export_state", EXPORT_STATE, UNRESERVED_KEYWORD) PG_KEYWORD("extension", EXTENSION, UNRESERVED_KEYWORD) +PG_KEYWORD("extensions", EXTENSIONS, UNRESERVED_KEYWORD) PG_KEYWORD("external", EXTERNAL, UNRESERVED_KEYWORD) PG_KEYWORD("extract", EXTRACT, COL_NAME_KEYWORD) PG_KEYWORD("false", FALSE_P, RESERVED_KEYWORD) @@ -317,6 +318,8 @@ PG_KEYWORD("procedure", PROCEDURE, UNRESERVED_KEYWORD) PG_KEYWORD("program", PROGRAM, UNRESERVED_KEYWORD) PG_KEYWORD("publication", PUBLICATION, UNRESERVED_KEYWORD) PG_KEYWORD("qualify", QUALIFY, RESERVED_KEYWORD) +PG_KEYWORD("quarter", QUARTER_P, UNRESERVED_KEYWORD) +PG_KEYWORD("quarters", QUARTERS_P, UNRESERVED_KEYWORD) PG_KEYWORD("quote", QUOTE, UNRESERVED_KEYWORD) PG_KEYWORD("range", RANGE, UNRESERVED_KEYWORD) PG_KEYWORD("read", READ_P, UNRESERVED_KEYWORD) diff --git a/src/duckdb/third_party/libpg_query/include/utils/datetime.hpp b/src/duckdb/third_party/libpg_query/include/utils/datetime.hpp index b15b890a..249652c7 100644 --- a/src/duckdb/third_party/libpg_query/include/utils/datetime.hpp +++ b/src/duckdb/third_party/libpg_query/include/utils/datetime.hpp @@ -64,6 +64,7 @@ #define MILLENNIUM 27 /* hack for parsing two-word timezone specs "MET DST" etc */ #define DTZMOD 28 /* "DST" as a separate word */ +#define QUARTER 29 /* reserved for unrecognized string values */ #define UNKNOWN_FIELD 31 diff --git a/src/duckdb/third_party/libpg_query/pg_functions.cpp b/src/duckdb/third_party/libpg_query/pg_functions.cpp index 9123bbd7..d3af77cf 100644 --- a/src/duckdb/third_party/libpg_query/pg_functions.cpp +++ b/src/duckdb/third_party/libpg_query/pg_functions.cpp @@ -49,6 +49,9 @@ static void allocate_new(parser_state *state, size_t n) { if (state->malloc_ptr_idx >= state->malloc_ptr_size) { size_t new_size = state->malloc_ptr_size * 2; auto new_malloc_ptrs = (char **) malloc(sizeof(char *) * new_size); + if (!new_malloc_ptrs) { + throw std::bad_alloc(); + } memset(new_malloc_ptrs, 0, sizeof(char*) * new_size); memcpy(new_malloc_ptrs, state->malloc_ptrs, state->malloc_ptr_size * sizeof(char*)); free(state->malloc_ptrs); @@ -58,9 +61,9 @@ static void allocate_new(parser_state *state, size_t n) { if (n < PG_MALLOC_SIZE) { n = PG_MALLOC_SIZE; } - char *base_ptr = (char *)malloc(n); + auto base_ptr = (char *)malloc(n); if (!base_ptr) { - throw std::runtime_error("Memory allocation failure"); + throw std::bad_alloc(); } state->malloc_ptrs[state->malloc_ptr_idx] = base_ptr; state->malloc_ptr_idx++; @@ -90,7 +93,11 @@ void pg_parser_init() { pg_parser_state.pg_err_msg[0] = '\0'; pg_parser_state.malloc_ptr_size = 4; - pg_parser_state.malloc_ptrs = (char **) malloc(sizeof(char *) * pg_parser_state.malloc_ptr_size); + auto new_malloc_ptrs = (char **) malloc(sizeof(char *) * pg_parser_state.malloc_ptr_size); + if (!new_malloc_ptrs) { + throw std::bad_alloc(); + } + pg_parser_state.malloc_ptrs = new_malloc_ptrs; memset(pg_parser_state.malloc_ptrs, 0, sizeof(char*) * pg_parser_state.malloc_ptr_size); pg_parser_state.malloc_ptr_idx = 0; allocate_new(&pg_parser_state, 1); @@ -166,7 +173,7 @@ char *psprintf(const char *fmt, ...) { } // attempt two, malloc - char *mbuf = (char *)palloc(newlen); + auto mbuf = (char *)palloc(newlen); va_start(args, fmt); vsnprintf(mbuf, newlen, fmt, args); va_end(args); @@ -174,7 +181,7 @@ char *psprintf(const char *fmt, ...) { } char *pstrdup(const char *in) { - char *new_str = (char *)palloc(strlen(in) + 1); + auto new_str = (char*) palloc(strlen(in) + 1); memcpy(new_str, in, strlen(in)); return new_str; } @@ -191,7 +198,7 @@ void *repalloc(void *ptr, size_t n) { char *old_len_ptr = (char *) ptr - sizeof(size_t); memcpy((void *) &old_len, old_len_ptr, sizeof(size_t)); // re-allocate and copy the data - void *new_buf = palloc(n); + auto new_buf = palloc(n); memcpy(new_buf, ptr, old_len); return new_buf; } diff --git a/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp b/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp index f8b6577f..b3189b24 100644 --- a/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +++ b/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp @@ -1,14 +1,14 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,9 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -36,6 +34,10 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -43,11 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 -/* Bison version. */ -#define YYBISON_VERSION "2.3" +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -55,1033 +57,21 @@ /* Pure parsers. */ #define YYPURE 1 -/* Using locations. */ -#define YYLSP_NEEDED 1 +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + /* Substitute the variable and function names. */ -#define yyparse base_yyparse -#define yylex base_yylex -#define yyerror base_yyerror -#define yylval base_yylval -#define yychar base_yychar -#define yydebug base_yydebug -#define yynerrs base_yynerrs -#define yylloc base_yylloc - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - IDENT = 258, - FCONST = 259, - SCONST = 260, - BCONST = 261, - XCONST = 262, - Op = 263, - ICONST = 264, - PARAM = 265, - TYPECAST = 266, - DOT_DOT = 267, - COLON_EQUALS = 268, - EQUALS_GREATER = 269, - INTEGER_DIVISION = 270, - POWER_OF = 271, - LAMBDA_ARROW = 272, - DOUBLE_ARROW = 273, - LESS_EQUALS = 274, - GREATER_EQUALS = 275, - NOT_EQUALS = 276, - ABORT_P = 277, - ABSOLUTE_P = 278, - ACCESS = 279, - ACTION = 280, - ADD_P = 281, - ADMIN = 282, - AFTER = 283, - AGGREGATE = 284, - ALL = 285, - ALSO = 286, - ALTER = 287, - ALWAYS = 288, - ANALYSE = 289, - ANALYZE = 290, - AND = 291, - ANTI = 292, - ANY = 293, - ARRAY = 294, - AS = 295, - ASC_P = 296, - ASOF = 297, - ASSERTION = 298, - ASSIGNMENT = 299, - ASYMMETRIC = 300, - AT = 301, - ATTACH = 302, - ATTRIBUTE = 303, - AUTHORIZATION = 304, - BACKWARD = 305, - BEFORE = 306, - BEGIN_P = 307, - BETWEEN = 308, - BIGINT = 309, - BINARY = 310, - BIT = 311, - BOOLEAN_P = 312, - BOTH = 313, - BY = 314, - CACHE = 315, - CALL_P = 316, - CALLED = 317, - CASCADE = 318, - CASCADED = 319, - CASE = 320, - CAST = 321, - CATALOG_P = 322, - CENTURIES_P = 323, - CENTURY_P = 324, - CHAIN = 325, - CHAR_P = 326, - CHARACTER = 327, - CHARACTERISTICS = 328, - CHECK_P = 329, - CHECKPOINT = 330, - CLASS = 331, - CLOSE = 332, - CLUSTER = 333, - COALESCE = 334, - COLLATE = 335, - COLLATION = 336, - COLUMN = 337, - COLUMNS = 338, - COMMENT = 339, - COMMENTS = 340, - COMMIT = 341, - COMMITTED = 342, - COMPRESSION = 343, - CONCURRENTLY = 344, - CONFIGURATION = 345, - CONFLICT = 346, - CONNECTION = 347, - CONSTRAINT = 348, - CONSTRAINTS = 349, - CONTENT_P = 350, - CONTINUE_P = 351, - CONVERSION_P = 352, - COPY = 353, - COST = 354, - CREATE_P = 355, - CROSS = 356, - CSV = 357, - CUBE = 358, - CURRENT_P = 359, - CURSOR = 360, - CYCLE = 361, - DATA_P = 362, - DATABASE = 363, - DAY_P = 364, - DAYS_P = 365, - DEALLOCATE = 366, - DEC = 367, - DECADE_P = 368, - DECADES_P = 369, - DECIMAL_P = 370, - DECLARE = 371, - DEFAULT = 372, - DEFAULTS = 373, - DEFERRABLE = 374, - DEFERRED = 375, - DEFINER = 376, - DELETE_P = 377, - DELIMITER = 378, - DELIMITERS = 379, - DEPENDS = 380, - DESC_P = 381, - DESCRIBE = 382, - DETACH = 383, - DICTIONARY = 384, - DISABLE_P = 385, - DISCARD = 386, - DISTINCT = 387, - DO = 388, - DOCUMENT_P = 389, - DOMAIN_P = 390, - DOUBLE_P = 391, - DROP = 392, - EACH = 393, - ELSE = 394, - ENABLE_P = 395, - ENCODING = 396, - ENCRYPTED = 397, - END_P = 398, - ENUM_P = 399, - ESCAPE = 400, - EVENT = 401, - EXCEPT = 402, - EXCLUDE = 403, - EXCLUDING = 404, - EXCLUSIVE = 405, - EXECUTE = 406, - EXISTS = 407, - EXPLAIN = 408, - EXPORT_P = 409, - EXPORT_STATE = 410, - EXTENSION = 411, - EXTERNAL = 412, - EXTRACT = 413, - FALSE_P = 414, - FAMILY = 415, - FETCH = 416, - FILTER = 417, - FIRST_P = 418, - FLOAT_P = 419, - FOLLOWING = 420, - FOR = 421, - FORCE = 422, - FOREIGN = 423, - FORWARD = 424, - FREEZE = 425, - FROM = 426, - FULL = 427, - FUNCTION = 428, - FUNCTIONS = 429, - GENERATED = 430, - GLOB = 431, - GLOBAL = 432, - GRANT = 433, - GRANTED = 434, - GROUP_P = 435, - GROUPING = 436, - GROUPING_ID = 437, - GROUPS = 438, - HANDLER = 439, - HAVING = 440, - HEADER_P = 441, - HOLD = 442, - HOUR_P = 443, - HOURS_P = 444, - IDENTITY_P = 445, - IF_P = 446, - IGNORE_P = 447, - ILIKE = 448, - IMMEDIATE = 449, - IMMUTABLE = 450, - IMPLICIT_P = 451, - IMPORT_P = 452, - IN_P = 453, - INCLUDE_P = 454, - INCLUDING = 455, - INCREMENT = 456, - INDEX = 457, - INDEXES = 458, - INHERIT = 459, - INHERITS = 460, - INITIALLY = 461, - INLINE_P = 462, - INNER_P = 463, - INOUT = 464, - INPUT_P = 465, - INSENSITIVE = 466, - INSERT = 467, - INSTALL = 468, - INSTEAD = 469, - INT_P = 470, - INTEGER = 471, - INTERSECT = 472, - INTERVAL = 473, - INTO = 474, - INVOKER = 475, - IS = 476, - ISNULL = 477, - ISOLATION = 478, - JOIN = 479, - JSON = 480, - KEY = 481, - LABEL = 482, - LANGUAGE = 483, - LARGE_P = 484, - LAST_P = 485, - LATERAL_P = 486, - LEADING = 487, - LEAKPROOF = 488, - LEFT = 489, - LEVEL = 490, - LIKE = 491, - LIMIT = 492, - LISTEN = 493, - LOAD = 494, - LOCAL = 495, - LOCATION = 496, - LOCK_P = 497, - LOCKED = 498, - LOGGED = 499, - MACRO = 500, - MAP = 501, - MAPPING = 502, - MATCH = 503, - MATERIALIZED = 504, - MAXVALUE = 505, - METHOD = 506, - MICROSECOND_P = 507, - MICROSECONDS_P = 508, - MILLENNIA_P = 509, - MILLENNIUM_P = 510, - MILLISECOND_P = 511, - MILLISECONDS_P = 512, - MINUTE_P = 513, - MINUTES_P = 514, - MINVALUE = 515, - MODE = 516, - MONTH_P = 517, - MONTHS_P = 518, - MOVE = 519, - NAME_P = 520, - NAMES = 521, - NATIONAL = 522, - NATURAL = 523, - NCHAR = 524, - NEW = 525, - NEXT = 526, - NO = 527, - NONE = 528, - NOT = 529, - NOTHING = 530, - NOTIFY = 531, - NOTNULL = 532, - NOWAIT = 533, - NULL_P = 534, - NULLIF = 535, - NULLS_P = 536, - NUMERIC = 537, - OBJECT_P = 538, - OF = 539, - OFF = 540, - OFFSET = 541, - OIDS = 542, - OLD = 543, - ON = 544, - ONLY = 545, - OPERATOR = 546, - OPTION = 547, - OPTIONS = 548, - OR = 549, - ORDER = 550, - ORDINALITY = 551, - OTHERS = 552, - OUT_P = 553, - OUTER_P = 554, - OVER = 555, - OVERLAPS = 556, - OVERLAY = 557, - OVERRIDING = 558, - OWNED = 559, - OWNER = 560, - PARALLEL = 561, - PARSER = 562, - PARTIAL = 563, - PARTITION = 564, - PASSING = 565, - PASSWORD = 566, - PERCENT = 567, - PERSISTENT = 568, - PIVOT = 569, - PIVOT_LONGER = 570, - PIVOT_WIDER = 571, - PLACING = 572, - PLANS = 573, - POLICY = 574, - POSITION = 575, - POSITIONAL = 576, - PRAGMA_P = 577, - PRECEDING = 578, - PRECISION = 579, - PREPARE = 580, - PREPARED = 581, - PRESERVE = 582, - PRIMARY = 583, - PRIOR = 584, - PRIVILEGES = 585, - PROCEDURAL = 586, - PROCEDURE = 587, - PROGRAM = 588, - PUBLICATION = 589, - QUALIFY = 590, - QUOTE = 591, - RANGE = 592, - READ_P = 593, - REAL = 594, - REASSIGN = 595, - RECHECK = 596, - RECURSIVE = 597, - REF = 598, - REFERENCES = 599, - REFERENCING = 600, - REFRESH = 601, - REINDEX = 602, - RELATIVE_P = 603, - RELEASE = 604, - RENAME = 605, - REPEATABLE = 606, - REPLACE = 607, - REPLICA = 608, - RESET = 609, - RESPECT_P = 610, - RESTART = 611, - RESTRICT = 612, - RETURNING = 613, - RETURNS = 614, - REVOKE = 615, - RIGHT = 616, - ROLE = 617, - ROLLBACK = 618, - ROLLUP = 619, - ROW = 620, - ROWS = 621, - RULE = 622, - SAMPLE = 623, - SAVEPOINT = 624, - SCHEMA = 625, - SCHEMAS = 626, - SCOPE = 627, - SCROLL = 628, - SEARCH = 629, - SECOND_P = 630, - SECONDS_P = 631, - SECRET = 632, - SECURITY = 633, - SELECT = 634, - SEMI = 635, - SEQUENCE = 636, - SEQUENCES = 637, - SERIALIZABLE = 638, - SERVER = 639, - SESSION = 640, - SET = 641, - SETOF = 642, - SETS = 643, - SHARE = 644, - SHOW = 645, - SIMILAR = 646, - SIMPLE = 647, - SKIP = 648, - SMALLINT = 649, - SNAPSHOT = 650, - SOME = 651, - SQL_P = 652, - STABLE = 653, - STANDALONE_P = 654, - START = 655, - STATEMENT = 656, - STATISTICS = 657, - STDIN = 658, - STDOUT = 659, - STORAGE = 660, - STORED = 661, - STRICT_P = 662, - STRIP_P = 663, - STRUCT = 664, - SUBSCRIPTION = 665, - SUBSTRING = 666, - SUMMARIZE = 667, - SYMMETRIC = 668, - SYSID = 669, - SYSTEM_P = 670, - TABLE = 671, - TABLES = 672, - TABLESAMPLE = 673, - TABLESPACE = 674, - TEMP = 675, - TEMPLATE = 676, - TEMPORARY = 677, - TEXT_P = 678, - THEN = 679, - TIES = 680, - TIME = 681, - TIMESTAMP = 682, - TO = 683, - TRAILING = 684, - TRANSACTION = 685, - TRANSFORM = 686, - TREAT = 687, - TRIGGER = 688, - TRIM = 689, - TRUE_P = 690, - TRUNCATE = 691, - TRUSTED = 692, - TRY_CAST = 693, - TYPE_P = 694, - TYPES_P = 695, - UNBOUNDED = 696, - UNCOMMITTED = 697, - UNENCRYPTED = 698, - UNION = 699, - UNIQUE = 700, - UNKNOWN = 701, - UNLISTEN = 702, - UNLOGGED = 703, - UNPIVOT = 704, - UNTIL = 705, - UPDATE = 706, - USE_P = 707, - USER = 708, - USING = 709, - VACUUM = 710, - VALID = 711, - VALIDATE = 712, - VALIDATOR = 713, - VALUE_P = 714, - VALUES = 715, - VARCHAR = 716, - VARIADIC = 717, - VARYING = 718, - VERBOSE = 719, - VERSION_P = 720, - VIEW = 721, - VIEWS = 722, - VIRTUAL = 723, - VOLATILE = 724, - WEEK_P = 725, - WEEKS_P = 726, - WHEN = 727, - WHERE = 728, - WHITESPACE_P = 729, - WINDOW = 730, - WITH = 731, - WITHIN = 732, - WITHOUT = 733, - WORK = 734, - WRAPPER = 735, - WRITE_P = 736, - XML_P = 737, - XMLATTRIBUTES = 738, - XMLCONCAT = 739, - XMLELEMENT = 740, - XMLEXISTS = 741, - XMLFOREST = 742, - XMLNAMESPACES = 743, - XMLPARSE = 744, - XMLPI = 745, - XMLROOT = 746, - XMLSERIALIZE = 747, - XMLTABLE = 748, - YEAR_P = 749, - YEARS_P = 750, - YES_P = 751, - ZONE = 752, - NOT_LA = 753, - NULLS_LA = 754, - WITH_LA = 755, - POSTFIXOP = 756, - UMINUS = 757 - }; -#endif -/* Tokens. */ -#define IDENT 258 -#define FCONST 259 -#define SCONST 260 -#define BCONST 261 -#define XCONST 262 -#define Op 263 -#define ICONST 264 -#define PARAM 265 -#define TYPECAST 266 -#define DOT_DOT 267 -#define COLON_EQUALS 268 -#define EQUALS_GREATER 269 -#define INTEGER_DIVISION 270 -#define POWER_OF 271 -#define LAMBDA_ARROW 272 -#define DOUBLE_ARROW 273 -#define LESS_EQUALS 274 -#define GREATER_EQUALS 275 -#define NOT_EQUALS 276 -#define ABORT_P 277 -#define ABSOLUTE_P 278 -#define ACCESS 279 -#define ACTION 280 -#define ADD_P 281 -#define ADMIN 282 -#define AFTER 283 -#define AGGREGATE 284 -#define ALL 285 -#define ALSO 286 -#define ALTER 287 -#define ALWAYS 288 -#define ANALYSE 289 -#define ANALYZE 290 -#define AND 291 -#define ANTI 292 -#define ANY 293 -#define ARRAY 294 -#define AS 295 -#define ASC_P 296 -#define ASOF 297 -#define ASSERTION 298 -#define ASSIGNMENT 299 -#define ASYMMETRIC 300 -#define AT 301 -#define ATTACH 302 -#define ATTRIBUTE 303 -#define AUTHORIZATION 304 -#define BACKWARD 305 -#define BEFORE 306 -#define BEGIN_P 307 -#define BETWEEN 308 -#define BIGINT 309 -#define BINARY 310 -#define BIT 311 -#define BOOLEAN_P 312 -#define BOTH 313 -#define BY 314 -#define CACHE 315 -#define CALL_P 316 -#define CALLED 317 -#define CASCADE 318 -#define CASCADED 319 -#define CASE 320 -#define CAST 321 -#define CATALOG_P 322 -#define CENTURIES_P 323 -#define CENTURY_P 324 -#define CHAIN 325 -#define CHAR_P 326 -#define CHARACTER 327 -#define CHARACTERISTICS 328 -#define CHECK_P 329 -#define CHECKPOINT 330 -#define CLASS 331 -#define CLOSE 332 -#define CLUSTER 333 -#define COALESCE 334 -#define COLLATE 335 -#define COLLATION 336 -#define COLUMN 337 -#define COLUMNS 338 -#define COMMENT 339 -#define COMMENTS 340 -#define COMMIT 341 -#define COMMITTED 342 -#define COMPRESSION 343 -#define CONCURRENTLY 344 -#define CONFIGURATION 345 -#define CONFLICT 346 -#define CONNECTION 347 -#define CONSTRAINT 348 -#define CONSTRAINTS 349 -#define CONTENT_P 350 -#define CONTINUE_P 351 -#define CONVERSION_P 352 -#define COPY 353 -#define COST 354 -#define CREATE_P 355 -#define CROSS 356 -#define CSV 357 -#define CUBE 358 -#define CURRENT_P 359 -#define CURSOR 360 -#define CYCLE 361 -#define DATA_P 362 -#define DATABASE 363 -#define DAY_P 364 -#define DAYS_P 365 -#define DEALLOCATE 366 -#define DEC 367 -#define DECADE_P 368 -#define DECADES_P 369 -#define DECIMAL_P 370 -#define DECLARE 371 -#define DEFAULT 372 -#define DEFAULTS 373 -#define DEFERRABLE 374 -#define DEFERRED 375 -#define DEFINER 376 -#define DELETE_P 377 -#define DELIMITER 378 -#define DELIMITERS 379 -#define DEPENDS 380 -#define DESC_P 381 -#define DESCRIBE 382 -#define DETACH 383 -#define DICTIONARY 384 -#define DISABLE_P 385 -#define DISCARD 386 -#define DISTINCT 387 -#define DO 388 -#define DOCUMENT_P 389 -#define DOMAIN_P 390 -#define DOUBLE_P 391 -#define DROP 392 -#define EACH 393 -#define ELSE 394 -#define ENABLE_P 395 -#define ENCODING 396 -#define ENCRYPTED 397 -#define END_P 398 -#define ENUM_P 399 -#define ESCAPE 400 -#define EVENT 401 -#define EXCEPT 402 -#define EXCLUDE 403 -#define EXCLUDING 404 -#define EXCLUSIVE 405 -#define EXECUTE 406 -#define EXISTS 407 -#define EXPLAIN 408 -#define EXPORT_P 409 -#define EXPORT_STATE 410 -#define EXTENSION 411 -#define EXTERNAL 412 -#define EXTRACT 413 -#define FALSE_P 414 -#define FAMILY 415 -#define FETCH 416 -#define FILTER 417 -#define FIRST_P 418 -#define FLOAT_P 419 -#define FOLLOWING 420 -#define FOR 421 -#define FORCE 422 -#define FOREIGN 423 -#define FORWARD 424 -#define FREEZE 425 -#define FROM 426 -#define FULL 427 -#define FUNCTION 428 -#define FUNCTIONS 429 -#define GENERATED 430 -#define GLOB 431 -#define GLOBAL 432 -#define GRANT 433 -#define GRANTED 434 -#define GROUP_P 435 -#define GROUPING 436 -#define GROUPING_ID 437 -#define GROUPS 438 -#define HANDLER 439 -#define HAVING 440 -#define HEADER_P 441 -#define HOLD 442 -#define HOUR_P 443 -#define HOURS_P 444 -#define IDENTITY_P 445 -#define IF_P 446 -#define IGNORE_P 447 -#define ILIKE 448 -#define IMMEDIATE 449 -#define IMMUTABLE 450 -#define IMPLICIT_P 451 -#define IMPORT_P 452 -#define IN_P 453 -#define INCLUDE_P 454 -#define INCLUDING 455 -#define INCREMENT 456 -#define INDEX 457 -#define INDEXES 458 -#define INHERIT 459 -#define INHERITS 460 -#define INITIALLY 461 -#define INLINE_P 462 -#define INNER_P 463 -#define INOUT 464 -#define INPUT_P 465 -#define INSENSITIVE 466 -#define INSERT 467 -#define INSTALL 468 -#define INSTEAD 469 -#define INT_P 470 -#define INTEGER 471 -#define INTERSECT 472 -#define INTERVAL 473 -#define INTO 474 -#define INVOKER 475 -#define IS 476 -#define ISNULL 477 -#define ISOLATION 478 -#define JOIN 479 -#define JSON 480 -#define KEY 481 -#define LABEL 482 -#define LANGUAGE 483 -#define LARGE_P 484 -#define LAST_P 485 -#define LATERAL_P 486 -#define LEADING 487 -#define LEAKPROOF 488 -#define LEFT 489 -#define LEVEL 490 -#define LIKE 491 -#define LIMIT 492 -#define LISTEN 493 -#define LOAD 494 -#define LOCAL 495 -#define LOCATION 496 -#define LOCK_P 497 -#define LOCKED 498 -#define LOGGED 499 -#define MACRO 500 -#define MAP 501 -#define MAPPING 502 -#define MATCH 503 -#define MATERIALIZED 504 -#define MAXVALUE 505 -#define METHOD 506 -#define MICROSECOND_P 507 -#define MICROSECONDS_P 508 -#define MILLENNIA_P 509 -#define MILLENNIUM_P 510 -#define MILLISECOND_P 511 -#define MILLISECONDS_P 512 -#define MINUTE_P 513 -#define MINUTES_P 514 -#define MINVALUE 515 -#define MODE 516 -#define MONTH_P 517 -#define MONTHS_P 518 -#define MOVE 519 -#define NAME_P 520 -#define NAMES 521 -#define NATIONAL 522 -#define NATURAL 523 -#define NCHAR 524 -#define NEW 525 -#define NEXT 526 -#define NO 527 -#define NONE 528 -#define NOT 529 -#define NOTHING 530 -#define NOTIFY 531 -#define NOTNULL 532 -#define NOWAIT 533 -#define NULL_P 534 -#define NULLIF 535 -#define NULLS_P 536 -#define NUMERIC 537 -#define OBJECT_P 538 -#define OF 539 -#define OFF 540 -#define OFFSET 541 -#define OIDS 542 -#define OLD 543 -#define ON 544 -#define ONLY 545 -#define OPERATOR 546 -#define OPTION 547 -#define OPTIONS 548 -#define OR 549 -#define ORDER 550 -#define ORDINALITY 551 -#define OTHERS 552 -#define OUT_P 553 -#define OUTER_P 554 -#define OVER 555 -#define OVERLAPS 556 -#define OVERLAY 557 -#define OVERRIDING 558 -#define OWNED 559 -#define OWNER 560 -#define PARALLEL 561 -#define PARSER 562 -#define PARTIAL 563 -#define PARTITION 564 -#define PASSING 565 -#define PASSWORD 566 -#define PERCENT 567 -#define PERSISTENT 568 -#define PIVOT 569 -#define PIVOT_LONGER 570 -#define PIVOT_WIDER 571 -#define PLACING 572 -#define PLANS 573 -#define POLICY 574 -#define POSITION 575 -#define POSITIONAL 576 -#define PRAGMA_P 577 -#define PRECEDING 578 -#define PRECISION 579 -#define PREPARE 580 -#define PREPARED 581 -#define PRESERVE 582 -#define PRIMARY 583 -#define PRIOR 584 -#define PRIVILEGES 585 -#define PROCEDURAL 586 -#define PROCEDURE 587 -#define PROGRAM 588 -#define PUBLICATION 589 -#define QUALIFY 590 -#define QUOTE 591 -#define RANGE 592 -#define READ_P 593 -#define REAL 594 -#define REASSIGN 595 -#define RECHECK 596 -#define RECURSIVE 597 -#define REF 598 -#define REFERENCES 599 -#define REFERENCING 600 -#define REFRESH 601 -#define REINDEX 602 -#define RELATIVE_P 603 -#define RELEASE 604 -#define RENAME 605 -#define REPEATABLE 606 -#define REPLACE 607 -#define REPLICA 608 -#define RESET 609 -#define RESPECT_P 610 -#define RESTART 611 -#define RESTRICT 612 -#define RETURNING 613 -#define RETURNS 614 -#define REVOKE 615 -#define RIGHT 616 -#define ROLE 617 -#define ROLLBACK 618 -#define ROLLUP 619 -#define ROW 620 -#define ROWS 621 -#define RULE 622 -#define SAMPLE 623 -#define SAVEPOINT 624 -#define SCHEMA 625 -#define SCHEMAS 626 -#define SCOPE 627 -#define SCROLL 628 -#define SEARCH 629 -#define SECOND_P 630 -#define SECONDS_P 631 -#define SECRET 632 -#define SECURITY 633 -#define SELECT 634 -#define SEMI 635 -#define SEQUENCE 636 -#define SEQUENCES 637 -#define SERIALIZABLE 638 -#define SERVER 639 -#define SESSION 640 -#define SET 641 -#define SETOF 642 -#define SETS 643 -#define SHARE 644 -#define SHOW 645 -#define SIMILAR 646 -#define SIMPLE 647 -#define SKIP 648 -#define SMALLINT 649 -#define SNAPSHOT 650 -#define SOME 651 -#define SQL_P 652 -#define STABLE 653 -#define STANDALONE_P 654 -#define START 655 -#define STATEMENT 656 -#define STATISTICS 657 -#define STDIN 658 -#define STDOUT 659 -#define STORAGE 660 -#define STORED 661 -#define STRICT_P 662 -#define STRIP_P 663 -#define STRUCT 664 -#define SUBSCRIPTION 665 -#define SUBSTRING 666 -#define SUMMARIZE 667 -#define SYMMETRIC 668 -#define SYSID 669 -#define SYSTEM_P 670 -#define TABLE 671 -#define TABLES 672 -#define TABLESAMPLE 673 -#define TABLESPACE 674 -#define TEMP 675 -#define TEMPLATE 676 -#define TEMPORARY 677 -#define TEXT_P 678 -#define THEN 679 -#define TIES 680 -#define TIME 681 -#define TIMESTAMP 682 -#define TO 683 -#define TRAILING 684 -#define TRANSACTION 685 -#define TRANSFORM 686 -#define TREAT 687 -#define TRIGGER 688 -#define TRIM 689 -#define TRUE_P 690 -#define TRUNCATE 691 -#define TRUSTED 692 -#define TRY_CAST 693 -#define TYPE_P 694 -#define TYPES_P 695 -#define UNBOUNDED 696 -#define UNCOMMITTED 697 -#define UNENCRYPTED 698 -#define UNION 699 -#define UNIQUE 700 -#define UNKNOWN 701 -#define UNLISTEN 702 -#define UNLOGGED 703 -#define UNPIVOT 704 -#define UNTIL 705 -#define UPDATE 706 -#define USE_P 707 -#define USER 708 -#define USING 709 -#define VACUUM 710 -#define VALID 711 -#define VALIDATE 712 -#define VALIDATOR 713 -#define VALUE_P 714 -#define VALUES 715 -#define VARCHAR 716 -#define VARIADIC 717 -#define VARYING 718 -#define VERBOSE 719 -#define VERSION_P 720 -#define VIEW 721 -#define VIEWS 722 -#define VIRTUAL 723 -#define VOLATILE 724 -#define WEEK_P 725 -#define WEEKS_P 726 -#define WHEN 727 -#define WHERE 728 -#define WHITESPACE_P 729 -#define WINDOW 730 -#define WITH 731 -#define WITHIN 732 -#define WITHOUT 733 -#define WORK 734 -#define WRAPPER 735 -#define WRITE_P 736 -#define XML_P 737 -#define XMLATTRIBUTES 738 -#define XMLCONCAT 739 -#define XMLELEMENT 740 -#define XMLEXISTS 741 -#define XMLFOREST 742 -#define XMLNAMESPACES 743 -#define XMLPARSE 744 -#define XMLPI 745 -#define XMLROOT 746 -#define XMLSERIALIZE 747 -#define XMLTABLE 748 -#define YEAR_P 749 -#define YEARS_P 750 -#define YES_P 751 -#define ZONE 752 -#define NOT_LA 753 -#define NULLS_LA 754 -#define WITH_LA 755 -#define POSTFIXOP 756 -#define UMINUS 757 - - - - -/* Copy the first part of user declarations. */ +#define yyparse base_yyparse +#define yylex base_yylex +#define yyerror base_yyerror +#define yydebug base_yydebug +#define yynerrs base_yynerrs + +/* First part of user prologue. */ #line 1 "third_party/libpg_query/grammar/grammar.y.tmp" #line 1 "third_party/libpg_query/grammar/grammar.hpp" @@ -1247,133 +237,1116 @@ static PGNode *makeRecursiveViewSelect(char *relname, PGList *aliases, PGNode *q static PGNode *makeLimitPercent(PGNode *limit_percent); +#line 241 "third_party/libpg_query/grammar/grammar_out.cpp" -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 14 "third_party/libpg_query/grammar/grammar.y" -{ - core_YYSTYPE core_yystype; - /* these fields must match core_YYSTYPE: */ - int ival; - char *str; - const char *keyword; - const char *conststr; - - char chr; - bool boolean; - PGJoinType jtype; - PGDropBehavior dbehavior; - PGOnCommitAction oncommit; - PGOnCreateConflict oncreateconflict; - PGList *list; - PGNode *node; - PGValue *value; - PGObjectType objtype; - PGTypeName *typnam; - PGObjectWithArgs *objwithargs; - PGDefElem *defelt; - PGSortBy *sortby; - PGWindowDef *windef; - PGJoinExpr *jexpr; - PGIndexElem *ielem; - PGAlias *alias; - PGRangeVar *range; - PGIntoClause *into; - PGCTEMaterialize ctematerialize; - PGWithClause *with; - PGInferClause *infer; - PGOnConflictClause *onconflict; - PGOnConflictActionAlias onconflictshorthand; - PGAIndices *aind; - PGResTarget *target; - PGInsertStmt *istmt; - PGVariableSetStmt *vsetstmt; - PGOverridingKind override; - PGSortByDir sortorder; - PGSortByNulls nullorder; - PGIgnoreNulls ignorenulls; - PGConstrType constr; - PGLockClauseStrength lockstrength; - PGLockWaitPolicy lockwaitpolicy; - PGSubLinkType subquerytype; - PGViewCheckOption viewcheckoption; - PGInsertColumnOrder bynameorposition; -} -/* Line 193 of yacc.c. */ -#line 1322 "third_party/libpg_query/grammar/grammar_out.cpp" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +#include "include/parser/gram.hpp" +/* Symbol kind. */ +enum yysymbol_kind_t { - int first_line; - int first_column; - int last_line; - int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 -#endif - + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_IDENT = 3, /* IDENT */ + YYSYMBOL_FCONST = 4, /* FCONST */ + YYSYMBOL_SCONST = 5, /* SCONST */ + YYSYMBOL_BCONST = 6, /* BCONST */ + YYSYMBOL_XCONST = 7, /* XCONST */ + YYSYMBOL_Op = 8, /* Op */ + YYSYMBOL_ICONST = 9, /* ICONST */ + YYSYMBOL_PARAM = 10, /* PARAM */ + YYSYMBOL_TYPECAST = 11, /* TYPECAST */ + YYSYMBOL_DOT_DOT = 12, /* DOT_DOT */ + YYSYMBOL_COLON_EQUALS = 13, /* COLON_EQUALS */ + YYSYMBOL_EQUALS_GREATER = 14, /* EQUALS_GREATER */ + YYSYMBOL_INTEGER_DIVISION = 15, /* INTEGER_DIVISION */ + YYSYMBOL_POWER_OF = 16, /* POWER_OF */ + YYSYMBOL_LAMBDA_ARROW = 17, /* LAMBDA_ARROW */ + YYSYMBOL_DOUBLE_ARROW = 18, /* DOUBLE_ARROW */ + YYSYMBOL_LESS_EQUALS = 19, /* LESS_EQUALS */ + YYSYMBOL_GREATER_EQUALS = 20, /* GREATER_EQUALS */ + YYSYMBOL_NOT_EQUALS = 21, /* NOT_EQUALS */ + YYSYMBOL_ABORT_P = 22, /* ABORT_P */ + YYSYMBOL_ABSOLUTE_P = 23, /* ABSOLUTE_P */ + YYSYMBOL_ACCESS = 24, /* ACCESS */ + YYSYMBOL_ACTION = 25, /* ACTION */ + YYSYMBOL_ADD_P = 26, /* ADD_P */ + YYSYMBOL_ADMIN = 27, /* ADMIN */ + YYSYMBOL_AFTER = 28, /* AFTER */ + YYSYMBOL_AGGREGATE = 29, /* AGGREGATE */ + YYSYMBOL_ALL = 30, /* ALL */ + YYSYMBOL_ALSO = 31, /* ALSO */ + YYSYMBOL_ALTER = 32, /* ALTER */ + YYSYMBOL_ALWAYS = 33, /* ALWAYS */ + YYSYMBOL_ANALYSE = 34, /* ANALYSE */ + YYSYMBOL_ANALYZE = 35, /* ANALYZE */ + YYSYMBOL_AND = 36, /* AND */ + YYSYMBOL_ANTI = 37, /* ANTI */ + YYSYMBOL_ANY = 38, /* ANY */ + YYSYMBOL_ARRAY = 39, /* ARRAY */ + YYSYMBOL_AS = 40, /* AS */ + YYSYMBOL_ASC_P = 41, /* ASC_P */ + YYSYMBOL_ASOF = 42, /* ASOF */ + YYSYMBOL_ASSERTION = 43, /* ASSERTION */ + YYSYMBOL_ASSIGNMENT = 44, /* ASSIGNMENT */ + YYSYMBOL_ASYMMETRIC = 45, /* ASYMMETRIC */ + YYSYMBOL_AT = 46, /* AT */ + YYSYMBOL_ATTACH = 47, /* ATTACH */ + YYSYMBOL_ATTRIBUTE = 48, /* ATTRIBUTE */ + YYSYMBOL_AUTHORIZATION = 49, /* AUTHORIZATION */ + YYSYMBOL_BACKWARD = 50, /* BACKWARD */ + YYSYMBOL_BEFORE = 51, /* BEFORE */ + YYSYMBOL_BEGIN_P = 52, /* BEGIN_P */ + YYSYMBOL_BETWEEN = 53, /* BETWEEN */ + YYSYMBOL_BIGINT = 54, /* BIGINT */ + YYSYMBOL_BINARY = 55, /* BINARY */ + YYSYMBOL_BIT = 56, /* BIT */ + YYSYMBOL_BOOLEAN_P = 57, /* BOOLEAN_P */ + YYSYMBOL_BOTH = 58, /* BOTH */ + YYSYMBOL_BY = 59, /* BY */ + YYSYMBOL_CACHE = 60, /* CACHE */ + YYSYMBOL_CALL_P = 61, /* CALL_P */ + YYSYMBOL_CALLED = 62, /* CALLED */ + YYSYMBOL_CASCADE = 63, /* CASCADE */ + YYSYMBOL_CASCADED = 64, /* CASCADED */ + YYSYMBOL_CASE = 65, /* CASE */ + YYSYMBOL_CAST = 66, /* CAST */ + YYSYMBOL_CATALOG_P = 67, /* CATALOG_P */ + YYSYMBOL_CENTURIES_P = 68, /* CENTURIES_P */ + YYSYMBOL_CENTURY_P = 69, /* CENTURY_P */ + YYSYMBOL_CHAIN = 70, /* CHAIN */ + YYSYMBOL_CHAR_P = 71, /* CHAR_P */ + YYSYMBOL_CHARACTER = 72, /* CHARACTER */ + YYSYMBOL_CHARACTERISTICS = 73, /* CHARACTERISTICS */ + YYSYMBOL_CHECK_P = 74, /* CHECK_P */ + YYSYMBOL_CHECKPOINT = 75, /* CHECKPOINT */ + YYSYMBOL_CLASS = 76, /* CLASS */ + YYSYMBOL_CLOSE = 77, /* CLOSE */ + YYSYMBOL_CLUSTER = 78, /* CLUSTER */ + YYSYMBOL_COALESCE = 79, /* COALESCE */ + YYSYMBOL_COLLATE = 80, /* COLLATE */ + YYSYMBOL_COLLATION = 81, /* COLLATION */ + YYSYMBOL_COLUMN = 82, /* COLUMN */ + YYSYMBOL_COLUMNS = 83, /* COLUMNS */ + YYSYMBOL_COMMENT = 84, /* COMMENT */ + YYSYMBOL_COMMENTS = 85, /* COMMENTS */ + YYSYMBOL_COMMIT = 86, /* COMMIT */ + YYSYMBOL_COMMITTED = 87, /* COMMITTED */ + YYSYMBOL_COMPRESSION = 88, /* COMPRESSION */ + YYSYMBOL_CONCURRENTLY = 89, /* CONCURRENTLY */ + YYSYMBOL_CONFIGURATION = 90, /* CONFIGURATION */ + YYSYMBOL_CONFLICT = 91, /* CONFLICT */ + YYSYMBOL_CONNECTION = 92, /* CONNECTION */ + YYSYMBOL_CONSTRAINT = 93, /* CONSTRAINT */ + YYSYMBOL_CONSTRAINTS = 94, /* CONSTRAINTS */ + YYSYMBOL_CONTENT_P = 95, /* CONTENT_P */ + YYSYMBOL_CONTINUE_P = 96, /* CONTINUE_P */ + YYSYMBOL_CONVERSION_P = 97, /* CONVERSION_P */ + YYSYMBOL_COPY = 98, /* COPY */ + YYSYMBOL_COST = 99, /* COST */ + YYSYMBOL_CREATE_P = 100, /* CREATE_P */ + YYSYMBOL_CROSS = 101, /* CROSS */ + YYSYMBOL_CSV = 102, /* CSV */ + YYSYMBOL_CUBE = 103, /* CUBE */ + YYSYMBOL_CURRENT_P = 104, /* CURRENT_P */ + YYSYMBOL_CURSOR = 105, /* CURSOR */ + YYSYMBOL_CYCLE = 106, /* CYCLE */ + YYSYMBOL_DATA_P = 107, /* DATA_P */ + YYSYMBOL_DATABASE = 108, /* DATABASE */ + YYSYMBOL_DAY_P = 109, /* DAY_P */ + YYSYMBOL_DAYS_P = 110, /* DAYS_P */ + YYSYMBOL_DEALLOCATE = 111, /* DEALLOCATE */ + YYSYMBOL_DEC = 112, /* DEC */ + YYSYMBOL_DECADE_P = 113, /* DECADE_P */ + YYSYMBOL_DECADES_P = 114, /* DECADES_P */ + YYSYMBOL_DECIMAL_P = 115, /* DECIMAL_P */ + YYSYMBOL_DECLARE = 116, /* DECLARE */ + YYSYMBOL_DEFAULT = 117, /* DEFAULT */ + YYSYMBOL_DEFAULTS = 118, /* DEFAULTS */ + YYSYMBOL_DEFERRABLE = 119, /* DEFERRABLE */ + YYSYMBOL_DEFERRED = 120, /* DEFERRED */ + YYSYMBOL_DEFINER = 121, /* DEFINER */ + YYSYMBOL_DELETE_P = 122, /* DELETE_P */ + YYSYMBOL_DELIMITER = 123, /* DELIMITER */ + YYSYMBOL_DELIMITERS = 124, /* DELIMITERS */ + YYSYMBOL_DEPENDS = 125, /* DEPENDS */ + YYSYMBOL_DESC_P = 126, /* DESC_P */ + YYSYMBOL_DESCRIBE = 127, /* DESCRIBE */ + YYSYMBOL_DETACH = 128, /* DETACH */ + YYSYMBOL_DICTIONARY = 129, /* DICTIONARY */ + YYSYMBOL_DISABLE_P = 130, /* DISABLE_P */ + YYSYMBOL_DISCARD = 131, /* DISCARD */ + YYSYMBOL_DISTINCT = 132, /* DISTINCT */ + YYSYMBOL_DO = 133, /* DO */ + YYSYMBOL_DOCUMENT_P = 134, /* DOCUMENT_P */ + YYSYMBOL_DOMAIN_P = 135, /* DOMAIN_P */ + YYSYMBOL_DOUBLE_P = 136, /* DOUBLE_P */ + YYSYMBOL_DROP = 137, /* DROP */ + YYSYMBOL_EACH = 138, /* EACH */ + YYSYMBOL_ELSE = 139, /* ELSE */ + YYSYMBOL_ENABLE_P = 140, /* ENABLE_P */ + YYSYMBOL_ENCODING = 141, /* ENCODING */ + YYSYMBOL_ENCRYPTED = 142, /* ENCRYPTED */ + YYSYMBOL_END_P = 143, /* END_P */ + YYSYMBOL_ENUM_P = 144, /* ENUM_P */ + YYSYMBOL_ESCAPE = 145, /* ESCAPE */ + YYSYMBOL_EVENT = 146, /* EVENT */ + YYSYMBOL_EXCEPT = 147, /* EXCEPT */ + YYSYMBOL_EXCLUDE = 148, /* EXCLUDE */ + YYSYMBOL_EXCLUDING = 149, /* EXCLUDING */ + YYSYMBOL_EXCLUSIVE = 150, /* EXCLUSIVE */ + YYSYMBOL_EXECUTE = 151, /* EXECUTE */ + YYSYMBOL_EXISTS = 152, /* EXISTS */ + YYSYMBOL_EXPLAIN = 153, /* EXPLAIN */ + YYSYMBOL_EXPORT_P = 154, /* EXPORT_P */ + YYSYMBOL_EXPORT_STATE = 155, /* EXPORT_STATE */ + YYSYMBOL_EXTENSION = 156, /* EXTENSION */ + YYSYMBOL_EXTENSIONS = 157, /* EXTENSIONS */ + YYSYMBOL_EXTERNAL = 158, /* EXTERNAL */ + YYSYMBOL_EXTRACT = 159, /* EXTRACT */ + YYSYMBOL_FALSE_P = 160, /* FALSE_P */ + YYSYMBOL_FAMILY = 161, /* FAMILY */ + YYSYMBOL_FETCH = 162, /* FETCH */ + YYSYMBOL_FILTER = 163, /* FILTER */ + YYSYMBOL_FIRST_P = 164, /* FIRST_P */ + YYSYMBOL_FLOAT_P = 165, /* FLOAT_P */ + YYSYMBOL_FOLLOWING = 166, /* FOLLOWING */ + YYSYMBOL_FOR = 167, /* FOR */ + YYSYMBOL_FORCE = 168, /* FORCE */ + YYSYMBOL_FOREIGN = 169, /* FOREIGN */ + YYSYMBOL_FORWARD = 170, /* FORWARD */ + YYSYMBOL_FREEZE = 171, /* FREEZE */ + YYSYMBOL_FROM = 172, /* FROM */ + YYSYMBOL_FULL = 173, /* FULL */ + YYSYMBOL_FUNCTION = 174, /* FUNCTION */ + YYSYMBOL_FUNCTIONS = 175, /* FUNCTIONS */ + YYSYMBOL_GENERATED = 176, /* GENERATED */ + YYSYMBOL_GLOB = 177, /* GLOB */ + YYSYMBOL_GLOBAL = 178, /* GLOBAL */ + YYSYMBOL_GRANT = 179, /* GRANT */ + YYSYMBOL_GRANTED = 180, /* GRANTED */ + YYSYMBOL_GROUP_P = 181, /* GROUP_P */ + YYSYMBOL_GROUPING = 182, /* GROUPING */ + YYSYMBOL_GROUPING_ID = 183, /* GROUPING_ID */ + YYSYMBOL_GROUPS = 184, /* GROUPS */ + YYSYMBOL_HANDLER = 185, /* HANDLER */ + YYSYMBOL_HAVING = 186, /* HAVING */ + YYSYMBOL_HEADER_P = 187, /* HEADER_P */ + YYSYMBOL_HOLD = 188, /* HOLD */ + YYSYMBOL_HOUR_P = 189, /* HOUR_P */ + YYSYMBOL_HOURS_P = 190, /* HOURS_P */ + YYSYMBOL_IDENTITY_P = 191, /* IDENTITY_P */ + YYSYMBOL_IF_P = 192, /* IF_P */ + YYSYMBOL_IGNORE_P = 193, /* IGNORE_P */ + YYSYMBOL_ILIKE = 194, /* ILIKE */ + YYSYMBOL_IMMEDIATE = 195, /* IMMEDIATE */ + YYSYMBOL_IMMUTABLE = 196, /* IMMUTABLE */ + YYSYMBOL_IMPLICIT_P = 197, /* IMPLICIT_P */ + YYSYMBOL_IMPORT_P = 198, /* IMPORT_P */ + YYSYMBOL_IN_P = 199, /* IN_P */ + YYSYMBOL_INCLUDE_P = 200, /* INCLUDE_P */ + YYSYMBOL_INCLUDING = 201, /* INCLUDING */ + YYSYMBOL_INCREMENT = 202, /* INCREMENT */ + YYSYMBOL_INDEX = 203, /* INDEX */ + YYSYMBOL_INDEXES = 204, /* INDEXES */ + YYSYMBOL_INHERIT = 205, /* INHERIT */ + YYSYMBOL_INHERITS = 206, /* INHERITS */ + YYSYMBOL_INITIALLY = 207, /* INITIALLY */ + YYSYMBOL_INLINE_P = 208, /* INLINE_P */ + YYSYMBOL_INNER_P = 209, /* INNER_P */ + YYSYMBOL_INOUT = 210, /* INOUT */ + YYSYMBOL_INPUT_P = 211, /* INPUT_P */ + YYSYMBOL_INSENSITIVE = 212, /* INSENSITIVE */ + YYSYMBOL_INSERT = 213, /* INSERT */ + YYSYMBOL_INSTALL = 214, /* INSTALL */ + YYSYMBOL_INSTEAD = 215, /* INSTEAD */ + YYSYMBOL_INT_P = 216, /* INT_P */ + YYSYMBOL_INTEGER = 217, /* INTEGER */ + YYSYMBOL_INTERSECT = 218, /* INTERSECT */ + YYSYMBOL_INTERVAL = 219, /* INTERVAL */ + YYSYMBOL_INTO = 220, /* INTO */ + YYSYMBOL_INVOKER = 221, /* INVOKER */ + YYSYMBOL_IS = 222, /* IS */ + YYSYMBOL_ISNULL = 223, /* ISNULL */ + YYSYMBOL_ISOLATION = 224, /* ISOLATION */ + YYSYMBOL_JOIN = 225, /* JOIN */ + YYSYMBOL_JSON = 226, /* JSON */ + YYSYMBOL_KEY = 227, /* KEY */ + YYSYMBOL_LABEL = 228, /* LABEL */ + YYSYMBOL_LANGUAGE = 229, /* LANGUAGE */ + YYSYMBOL_LARGE_P = 230, /* LARGE_P */ + YYSYMBOL_LAST_P = 231, /* LAST_P */ + YYSYMBOL_LATERAL_P = 232, /* LATERAL_P */ + YYSYMBOL_LEADING = 233, /* LEADING */ + YYSYMBOL_LEAKPROOF = 234, /* LEAKPROOF */ + YYSYMBOL_LEFT = 235, /* LEFT */ + YYSYMBOL_LEVEL = 236, /* LEVEL */ + YYSYMBOL_LIKE = 237, /* LIKE */ + YYSYMBOL_LIMIT = 238, /* LIMIT */ + YYSYMBOL_LISTEN = 239, /* LISTEN */ + YYSYMBOL_LOAD = 240, /* LOAD */ + YYSYMBOL_LOCAL = 241, /* LOCAL */ + YYSYMBOL_LOCATION = 242, /* LOCATION */ + YYSYMBOL_LOCK_P = 243, /* LOCK_P */ + YYSYMBOL_LOCKED = 244, /* LOCKED */ + YYSYMBOL_LOGGED = 245, /* LOGGED */ + YYSYMBOL_MACRO = 246, /* MACRO */ + YYSYMBOL_MAP = 247, /* MAP */ + YYSYMBOL_MAPPING = 248, /* MAPPING */ + YYSYMBOL_MATCH = 249, /* MATCH */ + YYSYMBOL_MATERIALIZED = 250, /* MATERIALIZED */ + YYSYMBOL_MAXVALUE = 251, /* MAXVALUE */ + YYSYMBOL_METHOD = 252, /* METHOD */ + YYSYMBOL_MICROSECOND_P = 253, /* MICROSECOND_P */ + YYSYMBOL_MICROSECONDS_P = 254, /* MICROSECONDS_P */ + YYSYMBOL_MILLENNIA_P = 255, /* MILLENNIA_P */ + YYSYMBOL_MILLENNIUM_P = 256, /* MILLENNIUM_P */ + YYSYMBOL_MILLISECOND_P = 257, /* MILLISECOND_P */ + YYSYMBOL_MILLISECONDS_P = 258, /* MILLISECONDS_P */ + YYSYMBOL_MINUTE_P = 259, /* MINUTE_P */ + YYSYMBOL_MINUTES_P = 260, /* MINUTES_P */ + YYSYMBOL_MINVALUE = 261, /* MINVALUE */ + YYSYMBOL_MODE = 262, /* MODE */ + YYSYMBOL_MONTH_P = 263, /* MONTH_P */ + YYSYMBOL_MONTHS_P = 264, /* MONTHS_P */ + YYSYMBOL_MOVE = 265, /* MOVE */ + YYSYMBOL_NAME_P = 266, /* NAME_P */ + YYSYMBOL_NAMES = 267, /* NAMES */ + YYSYMBOL_NATIONAL = 268, /* NATIONAL */ + YYSYMBOL_NATURAL = 269, /* NATURAL */ + YYSYMBOL_NCHAR = 270, /* NCHAR */ + YYSYMBOL_NEW = 271, /* NEW */ + YYSYMBOL_NEXT = 272, /* NEXT */ + YYSYMBOL_NO = 273, /* NO */ + YYSYMBOL_NONE = 274, /* NONE */ + YYSYMBOL_NOT = 275, /* NOT */ + YYSYMBOL_NOTHING = 276, /* NOTHING */ + YYSYMBOL_NOTIFY = 277, /* NOTIFY */ + YYSYMBOL_NOTNULL = 278, /* NOTNULL */ + YYSYMBOL_NOWAIT = 279, /* NOWAIT */ + YYSYMBOL_NULL_P = 280, /* NULL_P */ + YYSYMBOL_NULLIF = 281, /* NULLIF */ + YYSYMBOL_NULLS_P = 282, /* NULLS_P */ + YYSYMBOL_NUMERIC = 283, /* NUMERIC */ + YYSYMBOL_OBJECT_P = 284, /* OBJECT_P */ + YYSYMBOL_OF = 285, /* OF */ + YYSYMBOL_OFF = 286, /* OFF */ + YYSYMBOL_OFFSET = 287, /* OFFSET */ + YYSYMBOL_OIDS = 288, /* OIDS */ + YYSYMBOL_OLD = 289, /* OLD */ + YYSYMBOL_ON = 290, /* ON */ + YYSYMBOL_ONLY = 291, /* ONLY */ + YYSYMBOL_OPERATOR = 292, /* OPERATOR */ + YYSYMBOL_OPTION = 293, /* OPTION */ + YYSYMBOL_OPTIONS = 294, /* OPTIONS */ + YYSYMBOL_OR = 295, /* OR */ + YYSYMBOL_ORDER = 296, /* ORDER */ + YYSYMBOL_ORDINALITY = 297, /* ORDINALITY */ + YYSYMBOL_OTHERS = 298, /* OTHERS */ + YYSYMBOL_OUT_P = 299, /* OUT_P */ + YYSYMBOL_OUTER_P = 300, /* OUTER_P */ + YYSYMBOL_OVER = 301, /* OVER */ + YYSYMBOL_OVERLAPS = 302, /* OVERLAPS */ + YYSYMBOL_OVERLAY = 303, /* OVERLAY */ + YYSYMBOL_OVERRIDING = 304, /* OVERRIDING */ + YYSYMBOL_OWNED = 305, /* OWNED */ + YYSYMBOL_OWNER = 306, /* OWNER */ + YYSYMBOL_PARALLEL = 307, /* PARALLEL */ + YYSYMBOL_PARSER = 308, /* PARSER */ + YYSYMBOL_PARTIAL = 309, /* PARTIAL */ + YYSYMBOL_PARTITION = 310, /* PARTITION */ + YYSYMBOL_PASSING = 311, /* PASSING */ + YYSYMBOL_PASSWORD = 312, /* PASSWORD */ + YYSYMBOL_PERCENT = 313, /* PERCENT */ + YYSYMBOL_PERSISTENT = 314, /* PERSISTENT */ + YYSYMBOL_PIVOT = 315, /* PIVOT */ + YYSYMBOL_PIVOT_LONGER = 316, /* PIVOT_LONGER */ + YYSYMBOL_PIVOT_WIDER = 317, /* PIVOT_WIDER */ + YYSYMBOL_PLACING = 318, /* PLACING */ + YYSYMBOL_PLANS = 319, /* PLANS */ + YYSYMBOL_POLICY = 320, /* POLICY */ + YYSYMBOL_POSITION = 321, /* POSITION */ + YYSYMBOL_POSITIONAL = 322, /* POSITIONAL */ + YYSYMBOL_PRAGMA_P = 323, /* PRAGMA_P */ + YYSYMBOL_PRECEDING = 324, /* PRECEDING */ + YYSYMBOL_PRECISION = 325, /* PRECISION */ + YYSYMBOL_PREPARE = 326, /* PREPARE */ + YYSYMBOL_PREPARED = 327, /* PREPARED */ + YYSYMBOL_PRESERVE = 328, /* PRESERVE */ + YYSYMBOL_PRIMARY = 329, /* PRIMARY */ + YYSYMBOL_PRIOR = 330, /* PRIOR */ + YYSYMBOL_PRIVILEGES = 331, /* PRIVILEGES */ + YYSYMBOL_PROCEDURAL = 332, /* PROCEDURAL */ + YYSYMBOL_PROCEDURE = 333, /* PROCEDURE */ + YYSYMBOL_PROGRAM = 334, /* PROGRAM */ + YYSYMBOL_PUBLICATION = 335, /* PUBLICATION */ + YYSYMBOL_QUALIFY = 336, /* QUALIFY */ + YYSYMBOL_QUARTER_P = 337, /* QUARTER_P */ + YYSYMBOL_QUARTERS_P = 338, /* QUARTERS_P */ + YYSYMBOL_QUOTE = 339, /* QUOTE */ + YYSYMBOL_RANGE = 340, /* RANGE */ + YYSYMBOL_READ_P = 341, /* READ_P */ + YYSYMBOL_REAL = 342, /* REAL */ + YYSYMBOL_REASSIGN = 343, /* REASSIGN */ + YYSYMBOL_RECHECK = 344, /* RECHECK */ + YYSYMBOL_RECURSIVE = 345, /* RECURSIVE */ + YYSYMBOL_REF = 346, /* REF */ + YYSYMBOL_REFERENCES = 347, /* REFERENCES */ + YYSYMBOL_REFERENCING = 348, /* REFERENCING */ + YYSYMBOL_REFRESH = 349, /* REFRESH */ + YYSYMBOL_REINDEX = 350, /* REINDEX */ + YYSYMBOL_RELATIVE_P = 351, /* RELATIVE_P */ + YYSYMBOL_RELEASE = 352, /* RELEASE */ + YYSYMBOL_RENAME = 353, /* RENAME */ + YYSYMBOL_REPEATABLE = 354, /* REPEATABLE */ + YYSYMBOL_REPLACE = 355, /* REPLACE */ + YYSYMBOL_REPLICA = 356, /* REPLICA */ + YYSYMBOL_RESET = 357, /* RESET */ + YYSYMBOL_RESPECT_P = 358, /* RESPECT_P */ + YYSYMBOL_RESTART = 359, /* RESTART */ + YYSYMBOL_RESTRICT = 360, /* RESTRICT */ + YYSYMBOL_RETURNING = 361, /* RETURNING */ + YYSYMBOL_RETURNS = 362, /* RETURNS */ + YYSYMBOL_REVOKE = 363, /* REVOKE */ + YYSYMBOL_RIGHT = 364, /* RIGHT */ + YYSYMBOL_ROLE = 365, /* ROLE */ + YYSYMBOL_ROLLBACK = 366, /* ROLLBACK */ + YYSYMBOL_ROLLUP = 367, /* ROLLUP */ + YYSYMBOL_ROW = 368, /* ROW */ + YYSYMBOL_ROWS = 369, /* ROWS */ + YYSYMBOL_RULE = 370, /* RULE */ + YYSYMBOL_SAMPLE = 371, /* SAMPLE */ + YYSYMBOL_SAVEPOINT = 372, /* SAVEPOINT */ + YYSYMBOL_SCHEMA = 373, /* SCHEMA */ + YYSYMBOL_SCHEMAS = 374, /* SCHEMAS */ + YYSYMBOL_SCOPE = 375, /* SCOPE */ + YYSYMBOL_SCROLL = 376, /* SCROLL */ + YYSYMBOL_SEARCH = 377, /* SEARCH */ + YYSYMBOL_SECOND_P = 378, /* SECOND_P */ + YYSYMBOL_SECONDS_P = 379, /* SECONDS_P */ + YYSYMBOL_SECRET = 380, /* SECRET */ + YYSYMBOL_SECURITY = 381, /* SECURITY */ + YYSYMBOL_SELECT = 382, /* SELECT */ + YYSYMBOL_SEMI = 383, /* SEMI */ + YYSYMBOL_SEQUENCE = 384, /* SEQUENCE */ + YYSYMBOL_SEQUENCES = 385, /* SEQUENCES */ + YYSYMBOL_SERIALIZABLE = 386, /* SERIALIZABLE */ + YYSYMBOL_SERVER = 387, /* SERVER */ + YYSYMBOL_SESSION = 388, /* SESSION */ + YYSYMBOL_SET = 389, /* SET */ + YYSYMBOL_SETOF = 390, /* SETOF */ + YYSYMBOL_SETS = 391, /* SETS */ + YYSYMBOL_SHARE = 392, /* SHARE */ + YYSYMBOL_SHOW = 393, /* SHOW */ + YYSYMBOL_SIMILAR = 394, /* SIMILAR */ + YYSYMBOL_SIMPLE = 395, /* SIMPLE */ + YYSYMBOL_SKIP = 396, /* SKIP */ + YYSYMBOL_SMALLINT = 397, /* SMALLINT */ + YYSYMBOL_SNAPSHOT = 398, /* SNAPSHOT */ + YYSYMBOL_SOME = 399, /* SOME */ + YYSYMBOL_SQL_P = 400, /* SQL_P */ + YYSYMBOL_STABLE = 401, /* STABLE */ + YYSYMBOL_STANDALONE_P = 402, /* STANDALONE_P */ + YYSYMBOL_START = 403, /* START */ + YYSYMBOL_STATEMENT = 404, /* STATEMENT */ + YYSYMBOL_STATISTICS = 405, /* STATISTICS */ + YYSYMBOL_STDIN = 406, /* STDIN */ + YYSYMBOL_STDOUT = 407, /* STDOUT */ + YYSYMBOL_STORAGE = 408, /* STORAGE */ + YYSYMBOL_STORED = 409, /* STORED */ + YYSYMBOL_STRICT_P = 410, /* STRICT_P */ + YYSYMBOL_STRIP_P = 411, /* STRIP_P */ + YYSYMBOL_STRUCT = 412, /* STRUCT */ + YYSYMBOL_SUBSCRIPTION = 413, /* SUBSCRIPTION */ + YYSYMBOL_SUBSTRING = 414, /* SUBSTRING */ + YYSYMBOL_SUMMARIZE = 415, /* SUMMARIZE */ + YYSYMBOL_SYMMETRIC = 416, /* SYMMETRIC */ + YYSYMBOL_SYSID = 417, /* SYSID */ + YYSYMBOL_SYSTEM_P = 418, /* SYSTEM_P */ + YYSYMBOL_TABLE = 419, /* TABLE */ + YYSYMBOL_TABLES = 420, /* TABLES */ + YYSYMBOL_TABLESAMPLE = 421, /* TABLESAMPLE */ + YYSYMBOL_TABLESPACE = 422, /* TABLESPACE */ + YYSYMBOL_TEMP = 423, /* TEMP */ + YYSYMBOL_TEMPLATE = 424, /* TEMPLATE */ + YYSYMBOL_TEMPORARY = 425, /* TEMPORARY */ + YYSYMBOL_TEXT_P = 426, /* TEXT_P */ + YYSYMBOL_THEN = 427, /* THEN */ + YYSYMBOL_TIES = 428, /* TIES */ + YYSYMBOL_TIME = 429, /* TIME */ + YYSYMBOL_TIMESTAMP = 430, /* TIMESTAMP */ + YYSYMBOL_TO = 431, /* TO */ + YYSYMBOL_TRAILING = 432, /* TRAILING */ + YYSYMBOL_TRANSACTION = 433, /* TRANSACTION */ + YYSYMBOL_TRANSFORM = 434, /* TRANSFORM */ + YYSYMBOL_TREAT = 435, /* TREAT */ + YYSYMBOL_TRIGGER = 436, /* TRIGGER */ + YYSYMBOL_TRIM = 437, /* TRIM */ + YYSYMBOL_TRUE_P = 438, /* TRUE_P */ + YYSYMBOL_TRUNCATE = 439, /* TRUNCATE */ + YYSYMBOL_TRUSTED = 440, /* TRUSTED */ + YYSYMBOL_TRY_CAST = 441, /* TRY_CAST */ + YYSYMBOL_TYPE_P = 442, /* TYPE_P */ + YYSYMBOL_TYPES_P = 443, /* TYPES_P */ + YYSYMBOL_UNBOUNDED = 444, /* UNBOUNDED */ + YYSYMBOL_UNCOMMITTED = 445, /* UNCOMMITTED */ + YYSYMBOL_UNENCRYPTED = 446, /* UNENCRYPTED */ + YYSYMBOL_UNION = 447, /* UNION */ + YYSYMBOL_UNIQUE = 448, /* UNIQUE */ + YYSYMBOL_UNKNOWN = 449, /* UNKNOWN */ + YYSYMBOL_UNLISTEN = 450, /* UNLISTEN */ + YYSYMBOL_UNLOGGED = 451, /* UNLOGGED */ + YYSYMBOL_UNPIVOT = 452, /* UNPIVOT */ + YYSYMBOL_UNTIL = 453, /* UNTIL */ + YYSYMBOL_UPDATE = 454, /* UPDATE */ + YYSYMBOL_USE_P = 455, /* USE_P */ + YYSYMBOL_USER = 456, /* USER */ + YYSYMBOL_USING = 457, /* USING */ + YYSYMBOL_VACUUM = 458, /* VACUUM */ + YYSYMBOL_VALID = 459, /* VALID */ + YYSYMBOL_VALIDATE = 460, /* VALIDATE */ + YYSYMBOL_VALIDATOR = 461, /* VALIDATOR */ + YYSYMBOL_VALUE_P = 462, /* VALUE_P */ + YYSYMBOL_VALUES = 463, /* VALUES */ + YYSYMBOL_VARCHAR = 464, /* VARCHAR */ + YYSYMBOL_VARIADIC = 465, /* VARIADIC */ + YYSYMBOL_VARYING = 466, /* VARYING */ + YYSYMBOL_VERBOSE = 467, /* VERBOSE */ + YYSYMBOL_VERSION_P = 468, /* VERSION_P */ + YYSYMBOL_VIEW = 469, /* VIEW */ + YYSYMBOL_VIEWS = 470, /* VIEWS */ + YYSYMBOL_VIRTUAL = 471, /* VIRTUAL */ + YYSYMBOL_VOLATILE = 472, /* VOLATILE */ + YYSYMBOL_WEEK_P = 473, /* WEEK_P */ + YYSYMBOL_WEEKS_P = 474, /* WEEKS_P */ + YYSYMBOL_WHEN = 475, /* WHEN */ + YYSYMBOL_WHERE = 476, /* WHERE */ + YYSYMBOL_WHITESPACE_P = 477, /* WHITESPACE_P */ + YYSYMBOL_WINDOW = 478, /* WINDOW */ + YYSYMBOL_WITH = 479, /* WITH */ + YYSYMBOL_WITHIN = 480, /* WITHIN */ + YYSYMBOL_WITHOUT = 481, /* WITHOUT */ + YYSYMBOL_WORK = 482, /* WORK */ + YYSYMBOL_WRAPPER = 483, /* WRAPPER */ + YYSYMBOL_WRITE_P = 484, /* WRITE_P */ + YYSYMBOL_XML_P = 485, /* XML_P */ + YYSYMBOL_XMLATTRIBUTES = 486, /* XMLATTRIBUTES */ + YYSYMBOL_XMLCONCAT = 487, /* XMLCONCAT */ + YYSYMBOL_XMLELEMENT = 488, /* XMLELEMENT */ + YYSYMBOL_XMLEXISTS = 489, /* XMLEXISTS */ + YYSYMBOL_XMLFOREST = 490, /* XMLFOREST */ + YYSYMBOL_XMLNAMESPACES = 491, /* XMLNAMESPACES */ + YYSYMBOL_XMLPARSE = 492, /* XMLPARSE */ + YYSYMBOL_XMLPI = 493, /* XMLPI */ + YYSYMBOL_XMLROOT = 494, /* XMLROOT */ + YYSYMBOL_XMLSERIALIZE = 495, /* XMLSERIALIZE */ + YYSYMBOL_XMLTABLE = 496, /* XMLTABLE */ + YYSYMBOL_YEAR_P = 497, /* YEAR_P */ + YYSYMBOL_YEARS_P = 498, /* YEARS_P */ + YYSYMBOL_YES_P = 499, /* YES_P */ + YYSYMBOL_ZONE = 500, /* ZONE */ + YYSYMBOL_NOT_LA = 501, /* NOT_LA */ + YYSYMBOL_NULLS_LA = 502, /* NULLS_LA */ + YYSYMBOL_WITH_LA = 503, /* WITH_LA */ + YYSYMBOL_504_ = 504, /* '<' */ + YYSYMBOL_505_ = 505, /* '>' */ + YYSYMBOL_506_ = 506, /* '=' */ + YYSYMBOL_POSTFIXOP = 507, /* POSTFIXOP */ + YYSYMBOL_508_ = 508, /* '+' */ + YYSYMBOL_509_ = 509, /* '-' */ + YYSYMBOL_510_ = 510, /* '*' */ + YYSYMBOL_511_ = 511, /* '/' */ + YYSYMBOL_512_ = 512, /* '%' */ + YYSYMBOL_513_ = 513, /* '^' */ + YYSYMBOL_UMINUS = 514, /* UMINUS */ + YYSYMBOL_515_ = 515, /* '[' */ + YYSYMBOL_516_ = 516, /* ']' */ + YYSYMBOL_517_ = 517, /* '(' */ + YYSYMBOL_518_ = 518, /* ')' */ + YYSYMBOL_519_ = 519, /* '.' */ + YYSYMBOL_520_ = 520, /* ';' */ + YYSYMBOL_521_ = 521, /* ',' */ + YYSYMBOL_522_ = 522, /* '?' */ + YYSYMBOL_523_ = 523, /* '{' */ + YYSYMBOL_524_ = 524, /* '}' */ + YYSYMBOL_525_ = 525, /* '#' */ + YYSYMBOL_526_ = 526, /* '$' */ + YYSYMBOL_527_ = 527, /* ':' */ + YYSYMBOL_YYACCEPT = 528, /* $accept */ + YYSYMBOL_stmtblock = 529, /* stmtblock */ + YYSYMBOL_stmtmulti = 530, /* stmtmulti */ + YYSYMBOL_stmt = 531, /* stmt */ + YYSYMBOL_AlterObjectSchemaStmt = 532, /* AlterObjectSchemaStmt */ + YYSYMBOL_AlterSeqStmt = 533, /* AlterSeqStmt */ + YYSYMBOL_SeqOptList = 534, /* SeqOptList */ + YYSYMBOL_opt_with = 535, /* opt_with */ + YYSYMBOL_NumericOnly = 536, /* NumericOnly */ + YYSYMBOL_SeqOptElem = 537, /* SeqOptElem */ + YYSYMBOL_opt_by = 538, /* opt_by */ + YYSYMBOL_SignedIconst = 539, /* SignedIconst */ + YYSYMBOL_AlterTableStmt = 540, /* AlterTableStmt */ + YYSYMBOL_alter_identity_column_option_list = 541, /* alter_identity_column_option_list */ + YYSYMBOL_alter_column_default = 542, /* alter_column_default */ + YYSYMBOL_alter_identity_column_option = 543, /* alter_identity_column_option */ + YYSYMBOL_alter_generic_option_list = 544, /* alter_generic_option_list */ + YYSYMBOL_alter_table_cmd = 545, /* alter_table_cmd */ + YYSYMBOL_alter_using = 546, /* alter_using */ + YYSYMBOL_alter_generic_option_elem = 547, /* alter_generic_option_elem */ + YYSYMBOL_alter_table_cmds = 548, /* alter_table_cmds */ + YYSYMBOL_alter_generic_options = 549, /* alter_generic_options */ + YYSYMBOL_opt_set_data = 550, /* opt_set_data */ + YYSYMBOL_AnalyzeStmt = 551, /* AnalyzeStmt */ + YYSYMBOL_AttachStmt = 552, /* AttachStmt */ + YYSYMBOL_DetachStmt = 553, /* DetachStmt */ + YYSYMBOL_opt_database = 554, /* opt_database */ + YYSYMBOL_opt_database_alias = 555, /* opt_database_alias */ + YYSYMBOL_CallStmt = 556, /* CallStmt */ + YYSYMBOL_CheckPointStmt = 557, /* CheckPointStmt */ + YYSYMBOL_opt_col_id = 558, /* opt_col_id */ + YYSYMBOL_CommentOnStmt = 559, /* CommentOnStmt */ + YYSYMBOL_comment_value = 560, /* comment_value */ + YYSYMBOL_comment_on_type_any_name = 561, /* comment_on_type_any_name */ + YYSYMBOL_qualified_name = 562, /* qualified_name */ + YYSYMBOL_ColId = 563, /* ColId */ + YYSYMBOL_ColIdOrString = 564, /* ColIdOrString */ + YYSYMBOL_Sconst = 565, /* Sconst */ + YYSYMBOL_indirection = 566, /* indirection */ + YYSYMBOL_indirection_el = 567, /* indirection_el */ + YYSYMBOL_attr_name = 568, /* attr_name */ + YYSYMBOL_ColLabel = 569, /* ColLabel */ + YYSYMBOL_CopyStmt = 570, /* CopyStmt */ + YYSYMBOL_copy_database_flag = 571, /* copy_database_flag */ + YYSYMBOL_copy_from = 572, /* copy_from */ + YYSYMBOL_copy_delimiter = 573, /* copy_delimiter */ + YYSYMBOL_copy_generic_opt_arg_list = 574, /* copy_generic_opt_arg_list */ + YYSYMBOL_opt_using = 575, /* opt_using */ + YYSYMBOL_opt_as = 576, /* opt_as */ + YYSYMBOL_opt_program = 577, /* opt_program */ + YYSYMBOL_copy_options = 578, /* copy_options */ + YYSYMBOL_copy_generic_opt_arg = 579, /* copy_generic_opt_arg */ + YYSYMBOL_copy_generic_opt_elem = 580, /* copy_generic_opt_elem */ + YYSYMBOL_opt_oids = 581, /* opt_oids */ + YYSYMBOL_copy_opt_list = 582, /* copy_opt_list */ + YYSYMBOL_opt_binary = 583, /* opt_binary */ + YYSYMBOL_copy_opt_item = 584, /* copy_opt_item */ + YYSYMBOL_copy_generic_opt_arg_list_item = 585, /* copy_generic_opt_arg_list_item */ + YYSYMBOL_copy_file_name = 586, /* copy_file_name */ + YYSYMBOL_copy_generic_opt_list = 587, /* copy_generic_opt_list */ + YYSYMBOL_CreateStmt = 588, /* CreateStmt */ + YYSYMBOL_ConstraintAttributeSpec = 589, /* ConstraintAttributeSpec */ + YYSYMBOL_def_arg = 590, /* def_arg */ + YYSYMBOL_OptParenthesizedSeqOptList = 591, /* OptParenthesizedSeqOptList */ + YYSYMBOL_generic_option_arg = 592, /* generic_option_arg */ + YYSYMBOL_key_action = 593, /* key_action */ + YYSYMBOL_ColConstraint = 594, /* ColConstraint */ + YYSYMBOL_ColConstraintElem = 595, /* ColConstraintElem */ + YYSYMBOL_GeneratedColumnType = 596, /* GeneratedColumnType */ + YYSYMBOL_opt_GeneratedColumnType = 597, /* opt_GeneratedColumnType */ + YYSYMBOL_GeneratedConstraintElem = 598, /* GeneratedConstraintElem */ + YYSYMBOL_generic_option_elem = 599, /* generic_option_elem */ + YYSYMBOL_key_update = 600, /* key_update */ + YYSYMBOL_key_actions = 601, /* key_actions */ + YYSYMBOL_OnCommitOption = 602, /* OnCommitOption */ + YYSYMBOL_reloptions = 603, /* reloptions */ + YYSYMBOL_opt_no_inherit = 604, /* opt_no_inherit */ + YYSYMBOL_TableConstraint = 605, /* TableConstraint */ + YYSYMBOL_TableLikeOption = 606, /* TableLikeOption */ + YYSYMBOL_reloption_list = 607, /* reloption_list */ + YYSYMBOL_ExistingIndex = 608, /* ExistingIndex */ + YYSYMBOL_ConstraintAttr = 609, /* ConstraintAttr */ + YYSYMBOL_OptWith = 610, /* OptWith */ + YYSYMBOL_definition = 611, /* definition */ + YYSYMBOL_TableLikeOptionList = 612, /* TableLikeOptionList */ + YYSYMBOL_generic_option_name = 613, /* generic_option_name */ + YYSYMBOL_ConstraintAttributeElem = 614, /* ConstraintAttributeElem */ + YYSYMBOL_columnDef = 615, /* columnDef */ + YYSYMBOL_def_list = 616, /* def_list */ + YYSYMBOL_index_name = 617, /* index_name */ + YYSYMBOL_TableElement = 618, /* TableElement */ + YYSYMBOL_def_elem = 619, /* def_elem */ + YYSYMBOL_opt_definition = 620, /* opt_definition */ + YYSYMBOL_OptTableElementList = 621, /* OptTableElementList */ + YYSYMBOL_columnElem = 622, /* columnElem */ + YYSYMBOL_opt_column_list = 623, /* opt_column_list */ + YYSYMBOL_ColQualList = 624, /* ColQualList */ + YYSYMBOL_key_delete = 625, /* key_delete */ + YYSYMBOL_reloption_elem = 626, /* reloption_elem */ + YYSYMBOL_columnList = 627, /* columnList */ + YYSYMBOL_columnList_opt_comma = 628, /* columnList_opt_comma */ + YYSYMBOL_func_type = 629, /* func_type */ + YYSYMBOL_ConstraintElem = 630, /* ConstraintElem */ + YYSYMBOL_TableElementList = 631, /* TableElementList */ + YYSYMBOL_key_match = 632, /* key_match */ + YYSYMBOL_TableLikeClause = 633, /* TableLikeClause */ + YYSYMBOL_OptTemp = 634, /* OptTemp */ + YYSYMBOL_generated_when = 635, /* generated_when */ + YYSYMBOL_CreateAsStmt = 636, /* CreateAsStmt */ + YYSYMBOL_opt_with_data = 637, /* opt_with_data */ + YYSYMBOL_create_as_target = 638, /* create_as_target */ + YYSYMBOL_unreserved_keyword = 639, /* unreserved_keyword */ + YYSYMBOL_col_name_keyword = 640, /* col_name_keyword */ + YYSYMBOL_func_name_keyword = 641, /* func_name_keyword */ + YYSYMBOL_type_name_keyword = 642, /* type_name_keyword */ + YYSYMBOL_other_keyword = 643, /* other_keyword */ + YYSYMBOL_type_func_name_keyword = 644, /* type_func_name_keyword */ + YYSYMBOL_reserved_keyword = 645, /* reserved_keyword */ + YYSYMBOL_CreateFunctionStmt = 646, /* CreateFunctionStmt */ + YYSYMBOL_macro_alias = 647, /* macro_alias */ + YYSYMBOL_param_list = 648, /* param_list */ + YYSYMBOL_CreateSchemaStmt = 649, /* CreateSchemaStmt */ + YYSYMBOL_OptSchemaEltList = 650, /* OptSchemaEltList */ + YYSYMBOL_schema_stmt = 651, /* schema_stmt */ + YYSYMBOL_CreateSecretStmt = 652, /* CreateSecretStmt */ + YYSYMBOL_opt_secret_name = 653, /* opt_secret_name */ + YYSYMBOL_opt_persist = 654, /* opt_persist */ + YYSYMBOL_opt_storage_specifier = 655, /* opt_storage_specifier */ + YYSYMBOL_CreateSeqStmt = 656, /* CreateSeqStmt */ + YYSYMBOL_OptSeqOptList = 657, /* OptSeqOptList */ + YYSYMBOL_CreateTypeStmt = 658, /* CreateTypeStmt */ + YYSYMBOL_opt_enum_val_list = 659, /* opt_enum_val_list */ + YYSYMBOL_enum_val_list = 660, /* enum_val_list */ + YYSYMBOL_DeallocateStmt = 661, /* DeallocateStmt */ + YYSYMBOL_DeleteStmt = 662, /* DeleteStmt */ + YYSYMBOL_relation_expr_opt_alias = 663, /* relation_expr_opt_alias */ + YYSYMBOL_where_or_current_clause = 664, /* where_or_current_clause */ + YYSYMBOL_using_clause = 665, /* using_clause */ + YYSYMBOL_DropStmt = 666, /* DropStmt */ + YYSYMBOL_drop_type_any_name = 667, /* drop_type_any_name */ + YYSYMBOL_drop_type_name = 668, /* drop_type_name */ + YYSYMBOL_any_name_list = 669, /* any_name_list */ + YYSYMBOL_opt_drop_behavior = 670, /* opt_drop_behavior */ + YYSYMBOL_drop_type_name_on_any_name = 671, /* drop_type_name_on_any_name */ + YYSYMBOL_DropSecretStmt = 672, /* DropSecretStmt */ + YYSYMBOL_opt_storage_drop_specifier = 673, /* opt_storage_drop_specifier */ + YYSYMBOL_ExecuteStmt = 674, /* ExecuteStmt */ + YYSYMBOL_execute_param_expr = 675, /* execute_param_expr */ + YYSYMBOL_execute_param_list = 676, /* execute_param_list */ + YYSYMBOL_execute_param_clause = 677, /* execute_param_clause */ + YYSYMBOL_ExplainStmt = 678, /* ExplainStmt */ + YYSYMBOL_opt_verbose = 679, /* opt_verbose */ + YYSYMBOL_explain_option_arg = 680, /* explain_option_arg */ + YYSYMBOL_ExplainableStmt = 681, /* ExplainableStmt */ + YYSYMBOL_NonReservedWord = 682, /* NonReservedWord */ + YYSYMBOL_NonReservedWord_or_Sconst = 683, /* NonReservedWord_or_Sconst */ + YYSYMBOL_explain_option_list = 684, /* explain_option_list */ + YYSYMBOL_analyze_keyword = 685, /* analyze_keyword */ + YYSYMBOL_opt_boolean_or_string = 686, /* opt_boolean_or_string */ + YYSYMBOL_explain_option_elem = 687, /* explain_option_elem */ + YYSYMBOL_explain_option_name = 688, /* explain_option_name */ + YYSYMBOL_ExportStmt = 689, /* ExportStmt */ + YYSYMBOL_ImportStmt = 690, /* ImportStmt */ + YYSYMBOL_IndexStmt = 691, /* IndexStmt */ + YYSYMBOL_access_method = 692, /* access_method */ + YYSYMBOL_access_method_clause = 693, /* access_method_clause */ + YYSYMBOL_opt_concurrently = 694, /* opt_concurrently */ + YYSYMBOL_opt_index_name = 695, /* opt_index_name */ + YYSYMBOL_opt_reloptions = 696, /* opt_reloptions */ + YYSYMBOL_opt_unique = 697, /* opt_unique */ + YYSYMBOL_InsertStmt = 698, /* InsertStmt */ + YYSYMBOL_insert_rest = 699, /* insert_rest */ + YYSYMBOL_insert_target = 700, /* insert_target */ + YYSYMBOL_opt_by_name_or_position = 701, /* opt_by_name_or_position */ + YYSYMBOL_opt_conf_expr = 702, /* opt_conf_expr */ + YYSYMBOL_opt_with_clause = 703, /* opt_with_clause */ + YYSYMBOL_insert_column_item = 704, /* insert_column_item */ + YYSYMBOL_set_clause = 705, /* set_clause */ + YYSYMBOL_opt_or_action = 706, /* opt_or_action */ + YYSYMBOL_opt_on_conflict = 707, /* opt_on_conflict */ + YYSYMBOL_index_elem = 708, /* index_elem */ + YYSYMBOL_returning_clause = 709, /* returning_clause */ + YYSYMBOL_override_kind = 710, /* override_kind */ + YYSYMBOL_set_target_list = 711, /* set_target_list */ + YYSYMBOL_opt_collate = 712, /* opt_collate */ + YYSYMBOL_opt_class = 713, /* opt_class */ + YYSYMBOL_insert_column_list = 714, /* insert_column_list */ + YYSYMBOL_set_clause_list = 715, /* set_clause_list */ + YYSYMBOL_set_clause_list_opt_comma = 716, /* set_clause_list_opt_comma */ + YYSYMBOL_index_params = 717, /* index_params */ + YYSYMBOL_set_target = 718, /* set_target */ + YYSYMBOL_LoadStmt = 719, /* LoadStmt */ + YYSYMBOL_opt_force = 720, /* opt_force */ + YYSYMBOL_file_name = 721, /* file_name */ + YYSYMBOL_opt_ext_version = 722, /* opt_ext_version */ + YYSYMBOL_PragmaStmt = 723, /* PragmaStmt */ + YYSYMBOL_PrepareStmt = 724, /* PrepareStmt */ + YYSYMBOL_prep_type_clause = 725, /* prep_type_clause */ + YYSYMBOL_PreparableStmt = 726, /* PreparableStmt */ + YYSYMBOL_RenameStmt = 727, /* RenameStmt */ + YYSYMBOL_opt_column = 728, /* opt_column */ + YYSYMBOL_SelectStmt = 729, /* SelectStmt */ + YYSYMBOL_select_with_parens = 730, /* select_with_parens */ + YYSYMBOL_select_no_parens = 731, /* select_no_parens */ + YYSYMBOL_select_clause = 732, /* select_clause */ + YYSYMBOL_opt_select = 733, /* opt_select */ + YYSYMBOL_simple_select = 734, /* simple_select */ + YYSYMBOL_value_or_values = 735, /* value_or_values */ + YYSYMBOL_pivot_keyword = 736, /* pivot_keyword */ + YYSYMBOL_unpivot_keyword = 737, /* unpivot_keyword */ + YYSYMBOL_pivot_column_entry = 738, /* pivot_column_entry */ + YYSYMBOL_pivot_column_list_internal = 739, /* pivot_column_list_internal */ + YYSYMBOL_pivot_column_list = 740, /* pivot_column_list */ + YYSYMBOL_with_clause = 741, /* with_clause */ + YYSYMBOL_cte_list = 742, /* cte_list */ + YYSYMBOL_common_table_expr = 743, /* common_table_expr */ + YYSYMBOL_opt_materialized = 744, /* opt_materialized */ + YYSYMBOL_into_clause = 745, /* into_clause */ + YYSYMBOL_OptTempTableName = 746, /* OptTempTableName */ + YYSYMBOL_opt_table = 747, /* opt_table */ + YYSYMBOL_all_or_distinct = 748, /* all_or_distinct */ + YYSYMBOL_by_name = 749, /* by_name */ + YYSYMBOL_distinct_clause = 750, /* distinct_clause */ + YYSYMBOL_opt_all_clause = 751, /* opt_all_clause */ + YYSYMBOL_opt_ignore_nulls = 752, /* opt_ignore_nulls */ + YYSYMBOL_opt_sort_clause = 753, /* opt_sort_clause */ + YYSYMBOL_sort_clause = 754, /* sort_clause */ + YYSYMBOL_sortby_list = 755, /* sortby_list */ + YYSYMBOL_sortby = 756, /* sortby */ + YYSYMBOL_opt_asc_desc = 757, /* opt_asc_desc */ + YYSYMBOL_opt_nulls_order = 758, /* opt_nulls_order */ + YYSYMBOL_select_limit = 759, /* select_limit */ + YYSYMBOL_opt_select_limit = 760, /* opt_select_limit */ + YYSYMBOL_limit_clause = 761, /* limit_clause */ + YYSYMBOL_offset_clause = 762, /* offset_clause */ + YYSYMBOL_sample_count = 763, /* sample_count */ + YYSYMBOL_sample_clause = 764, /* sample_clause */ + YYSYMBOL_opt_sample_func = 765, /* opt_sample_func */ + YYSYMBOL_tablesample_entry = 766, /* tablesample_entry */ + YYSYMBOL_tablesample_clause = 767, /* tablesample_clause */ + YYSYMBOL_opt_tablesample_clause = 768, /* opt_tablesample_clause */ + YYSYMBOL_opt_repeatable_clause = 769, /* opt_repeatable_clause */ + YYSYMBOL_select_limit_value = 770, /* select_limit_value */ + YYSYMBOL_select_offset_value = 771, /* select_offset_value */ + YYSYMBOL_select_fetch_first_value = 772, /* select_fetch_first_value */ + YYSYMBOL_I_or_F_const = 773, /* I_or_F_const */ + YYSYMBOL_row_or_rows = 774, /* row_or_rows */ + YYSYMBOL_first_or_next = 775, /* first_or_next */ + YYSYMBOL_group_clause = 776, /* group_clause */ + YYSYMBOL_group_by_list = 777, /* group_by_list */ + YYSYMBOL_group_by_list_opt_comma = 778, /* group_by_list_opt_comma */ + YYSYMBOL_group_by_item = 779, /* group_by_item */ + YYSYMBOL_empty_grouping_set = 780, /* empty_grouping_set */ + YYSYMBOL_rollup_clause = 781, /* rollup_clause */ + YYSYMBOL_cube_clause = 782, /* cube_clause */ + YYSYMBOL_grouping_sets_clause = 783, /* grouping_sets_clause */ + YYSYMBOL_grouping_or_grouping_id = 784, /* grouping_or_grouping_id */ + YYSYMBOL_having_clause = 785, /* having_clause */ + YYSYMBOL_qualify_clause = 786, /* qualify_clause */ + YYSYMBOL_for_locking_clause = 787, /* for_locking_clause */ + YYSYMBOL_opt_for_locking_clause = 788, /* opt_for_locking_clause */ + YYSYMBOL_for_locking_items = 789, /* for_locking_items */ + YYSYMBOL_for_locking_item = 790, /* for_locking_item */ + YYSYMBOL_for_locking_strength = 791, /* for_locking_strength */ + YYSYMBOL_locked_rels_list = 792, /* locked_rels_list */ + YYSYMBOL_opt_nowait_or_skip = 793, /* opt_nowait_or_skip */ + YYSYMBOL_values_clause = 794, /* values_clause */ + YYSYMBOL_values_clause_opt_comma = 795, /* values_clause_opt_comma */ + YYSYMBOL_from_clause = 796, /* from_clause */ + YYSYMBOL_from_list = 797, /* from_list */ + YYSYMBOL_from_list_opt_comma = 798, /* from_list_opt_comma */ + YYSYMBOL_table_ref = 799, /* table_ref */ + YYSYMBOL_opt_pivot_group_by = 800, /* opt_pivot_group_by */ + YYSYMBOL_opt_include_nulls = 801, /* opt_include_nulls */ + YYSYMBOL_single_pivot_value = 802, /* single_pivot_value */ + YYSYMBOL_pivot_header = 803, /* pivot_header */ + YYSYMBOL_pivot_value = 804, /* pivot_value */ + YYSYMBOL_pivot_value_list = 805, /* pivot_value_list */ + YYSYMBOL_unpivot_header = 806, /* unpivot_header */ + YYSYMBOL_unpivot_value = 807, /* unpivot_value */ + YYSYMBOL_unpivot_value_list = 808, /* unpivot_value_list */ + YYSYMBOL_joined_table = 809, /* joined_table */ + YYSYMBOL_alias_clause = 810, /* alias_clause */ + YYSYMBOL_opt_alias_clause = 811, /* opt_alias_clause */ + YYSYMBOL_func_alias_clause = 812, /* func_alias_clause */ + YYSYMBOL_join_type = 813, /* join_type */ + YYSYMBOL_join_outer = 814, /* join_outer */ + YYSYMBOL_join_qual = 815, /* join_qual */ + YYSYMBOL_relation_expr = 816, /* relation_expr */ + YYSYMBOL_func_table = 817, /* func_table */ + YYSYMBOL_rowsfrom_item = 818, /* rowsfrom_item */ + YYSYMBOL_rowsfrom_list = 819, /* rowsfrom_list */ + YYSYMBOL_opt_col_def_list = 820, /* opt_col_def_list */ + YYSYMBOL_opt_ordinality = 821, /* opt_ordinality */ + YYSYMBOL_where_clause = 822, /* where_clause */ + YYSYMBOL_TableFuncElementList = 823, /* TableFuncElementList */ + YYSYMBOL_TableFuncElement = 824, /* TableFuncElement */ + YYSYMBOL_opt_collate_clause = 825, /* opt_collate_clause */ + YYSYMBOL_colid_type_list = 826, /* colid_type_list */ + YYSYMBOL_RowOrStruct = 827, /* RowOrStruct */ + YYSYMBOL_opt_Typename = 828, /* opt_Typename */ + YYSYMBOL_Typename = 829, /* Typename */ + YYSYMBOL_qualified_typename = 830, /* qualified_typename */ + YYSYMBOL_opt_array_bounds = 831, /* opt_array_bounds */ + YYSYMBOL_SimpleTypename = 832, /* SimpleTypename */ + YYSYMBOL_ConstTypename = 833, /* ConstTypename */ + YYSYMBOL_GenericType = 834, /* GenericType */ + YYSYMBOL_opt_type_modifiers = 835, /* opt_type_modifiers */ + YYSYMBOL_Numeric = 836, /* Numeric */ + YYSYMBOL_opt_float = 837, /* opt_float */ + YYSYMBOL_Bit = 838, /* Bit */ + YYSYMBOL_ConstBit = 839, /* ConstBit */ + YYSYMBOL_BitWithLength = 840, /* BitWithLength */ + YYSYMBOL_BitWithoutLength = 841, /* BitWithoutLength */ + YYSYMBOL_Character = 842, /* Character */ + YYSYMBOL_ConstCharacter = 843, /* ConstCharacter */ + YYSYMBOL_CharacterWithLength = 844, /* CharacterWithLength */ + YYSYMBOL_CharacterWithoutLength = 845, /* CharacterWithoutLength */ + YYSYMBOL_character = 846, /* character */ + YYSYMBOL_opt_varying = 847, /* opt_varying */ + YYSYMBOL_ConstDatetime = 848, /* ConstDatetime */ + YYSYMBOL_ConstInterval = 849, /* ConstInterval */ + YYSYMBOL_opt_timezone = 850, /* opt_timezone */ + YYSYMBOL_year_keyword = 851, /* year_keyword */ + YYSYMBOL_month_keyword = 852, /* month_keyword */ + YYSYMBOL_day_keyword = 853, /* day_keyword */ + YYSYMBOL_hour_keyword = 854, /* hour_keyword */ + YYSYMBOL_minute_keyword = 855, /* minute_keyword */ + YYSYMBOL_second_keyword = 856, /* second_keyword */ + YYSYMBOL_millisecond_keyword = 857, /* millisecond_keyword */ + YYSYMBOL_microsecond_keyword = 858, /* microsecond_keyword */ + YYSYMBOL_week_keyword = 859, /* week_keyword */ + YYSYMBOL_quarter_keyword = 860, /* quarter_keyword */ + YYSYMBOL_decade_keyword = 861, /* decade_keyword */ + YYSYMBOL_century_keyword = 862, /* century_keyword */ + YYSYMBOL_millennium_keyword = 863, /* millennium_keyword */ + YYSYMBOL_opt_interval = 864, /* opt_interval */ + YYSYMBOL_a_expr = 865, /* a_expr */ + YYSYMBOL_b_expr = 866, /* b_expr */ + YYSYMBOL_c_expr = 867, /* c_expr */ + YYSYMBOL_d_expr = 868, /* d_expr */ + YYSYMBOL_indirection_expr_or_a_expr = 869, /* indirection_expr_or_a_expr */ + YYSYMBOL_indirection_expr = 870, /* indirection_expr */ + YYSYMBOL_list_expr = 871, /* list_expr */ + YYSYMBOL_struct_expr = 872, /* struct_expr */ + YYSYMBOL_func_application = 873, /* func_application */ + YYSYMBOL_func_expr = 874, /* func_expr */ + YYSYMBOL_func_expr_windowless = 875, /* func_expr_windowless */ + YYSYMBOL_func_expr_common_subexpr = 876, /* func_expr_common_subexpr */ + YYSYMBOL_list_comprehension = 877, /* list_comprehension */ + YYSYMBOL_within_group_clause = 878, /* within_group_clause */ + YYSYMBOL_filter_clause = 879, /* filter_clause */ + YYSYMBOL_export_clause = 880, /* export_clause */ + YYSYMBOL_window_clause = 881, /* window_clause */ + YYSYMBOL_window_definition_list = 882, /* window_definition_list */ + YYSYMBOL_window_definition = 883, /* window_definition */ + YYSYMBOL_over_clause = 884, /* over_clause */ + YYSYMBOL_window_specification = 885, /* window_specification */ + YYSYMBOL_opt_existing_window_name = 886, /* opt_existing_window_name */ + YYSYMBOL_opt_partition_clause = 887, /* opt_partition_clause */ + YYSYMBOL_opt_frame_clause = 888, /* opt_frame_clause */ + YYSYMBOL_frame_extent = 889, /* frame_extent */ + YYSYMBOL_frame_bound = 890, /* frame_bound */ + YYSYMBOL_opt_window_exclusion_clause = 891, /* opt_window_exclusion_clause */ + YYSYMBOL_qualified_row = 892, /* qualified_row */ + YYSYMBOL_row = 893, /* row */ + YYSYMBOL_dict_arg = 894, /* dict_arg */ + YYSYMBOL_dict_arguments = 895, /* dict_arguments */ + YYSYMBOL_dict_arguments_opt_comma = 896, /* dict_arguments_opt_comma */ + YYSYMBOL_map_arg = 897, /* map_arg */ + YYSYMBOL_map_arguments = 898, /* map_arguments */ + YYSYMBOL_map_arguments_opt_comma = 899, /* map_arguments_opt_comma */ + YYSYMBOL_opt_map_arguments_opt_comma = 900, /* opt_map_arguments_opt_comma */ + YYSYMBOL_sub_type = 901, /* sub_type */ + YYSYMBOL_all_Op = 902, /* all_Op */ + YYSYMBOL_MathOp = 903, /* MathOp */ + YYSYMBOL_qual_Op = 904, /* qual_Op */ + YYSYMBOL_qual_all_Op = 905, /* qual_all_Op */ + YYSYMBOL_subquery_Op = 906, /* subquery_Op */ + YYSYMBOL_any_operator = 907, /* any_operator */ + YYSYMBOL_c_expr_list = 908, /* c_expr_list */ + YYSYMBOL_c_expr_list_opt_comma = 909, /* c_expr_list_opt_comma */ + YYSYMBOL_expr_list = 910, /* expr_list */ + YYSYMBOL_expr_list_opt_comma = 911, /* expr_list_opt_comma */ + YYSYMBOL_opt_expr_list_opt_comma = 912, /* opt_expr_list_opt_comma */ + YYSYMBOL_func_arg_list = 913, /* func_arg_list */ + YYSYMBOL_func_arg_expr = 914, /* func_arg_expr */ + YYSYMBOL_type_list = 915, /* type_list */ + YYSYMBOL_extract_list = 916, /* extract_list */ + YYSYMBOL_extract_arg = 917, /* extract_arg */ + YYSYMBOL_overlay_list = 918, /* overlay_list */ + YYSYMBOL_overlay_placing = 919, /* overlay_placing */ + YYSYMBOL_position_list = 920, /* position_list */ + YYSYMBOL_substr_list = 921, /* substr_list */ + YYSYMBOL_substr_from = 922, /* substr_from */ + YYSYMBOL_substr_for = 923, /* substr_for */ + YYSYMBOL_trim_list = 924, /* trim_list */ + YYSYMBOL_in_expr = 925, /* in_expr */ + YYSYMBOL_case_expr = 926, /* case_expr */ + YYSYMBOL_when_clause_list = 927, /* when_clause_list */ + YYSYMBOL_when_clause = 928, /* when_clause */ + YYSYMBOL_case_default = 929, /* case_default */ + YYSYMBOL_case_arg = 930, /* case_arg */ + YYSYMBOL_columnref = 931, /* columnref */ + YYSYMBOL_opt_slice_bound = 932, /* opt_slice_bound */ + YYSYMBOL_opt_indirection = 933, /* opt_indirection */ + YYSYMBOL_opt_func_arguments = 934, /* opt_func_arguments */ + YYSYMBOL_extended_indirection_el = 935, /* extended_indirection_el */ + YYSYMBOL_opt_extended_indirection = 936, /* opt_extended_indirection */ + YYSYMBOL_opt_asymmetric = 937, /* opt_asymmetric */ + YYSYMBOL_opt_target_list_opt_comma = 938, /* opt_target_list_opt_comma */ + YYSYMBOL_target_list = 939, /* target_list */ + YYSYMBOL_target_list_opt_comma = 940, /* target_list_opt_comma */ + YYSYMBOL_target_el = 941, /* target_el */ + YYSYMBOL_except_list = 942, /* except_list */ + YYSYMBOL_opt_except_list = 943, /* opt_except_list */ + YYSYMBOL_replace_list_el = 944, /* replace_list_el */ + YYSYMBOL_replace_list = 945, /* replace_list */ + YYSYMBOL_replace_list_opt_comma = 946, /* replace_list_opt_comma */ + YYSYMBOL_opt_replace_list = 947, /* opt_replace_list */ + YYSYMBOL_qualified_name_list = 948, /* qualified_name_list */ + YYSYMBOL_name_list = 949, /* name_list */ + YYSYMBOL_name_list_opt_comma = 950, /* name_list_opt_comma */ + YYSYMBOL_name_list_opt_comma_opt_bracket = 951, /* name_list_opt_comma_opt_bracket */ + YYSYMBOL_name = 952, /* name */ + YYSYMBOL_func_name = 953, /* func_name */ + YYSYMBOL_AexprConst = 954, /* AexprConst */ + YYSYMBOL_Iconst = 955, /* Iconst */ + YYSYMBOL_type_function_name = 956, /* type_function_name */ + YYSYMBOL_function_name_token = 957, /* function_name_token */ + YYSYMBOL_type_name_token = 958, /* type_name_token */ + YYSYMBOL_any_name = 959, /* any_name */ + YYSYMBOL_attrs = 960, /* attrs */ + YYSYMBOL_opt_name_list = 961, /* opt_name_list */ + YYSYMBOL_param_name = 962, /* param_name */ + YYSYMBOL_ColLabelOrString = 963, /* ColLabelOrString */ + YYSYMBOL_TransactionStmt = 964, /* TransactionStmt */ + YYSYMBOL_opt_transaction = 965, /* opt_transaction */ + YYSYMBOL_UpdateStmt = 966, /* UpdateStmt */ + YYSYMBOL_UpdateExtensionsStmt = 967, /* UpdateExtensionsStmt */ + YYSYMBOL_UseStmt = 968, /* UseStmt */ + YYSYMBOL_VacuumStmt = 969, /* VacuumStmt */ + YYSYMBOL_vacuum_option_elem = 970, /* vacuum_option_elem */ + YYSYMBOL_opt_full = 971, /* opt_full */ + YYSYMBOL_vacuum_option_list = 972, /* vacuum_option_list */ + YYSYMBOL_opt_freeze = 973, /* opt_freeze */ + YYSYMBOL_VariableResetStmt = 974, /* VariableResetStmt */ + YYSYMBOL_generic_reset = 975, /* generic_reset */ + YYSYMBOL_reset_rest = 976, /* reset_rest */ + YYSYMBOL_VariableSetStmt = 977, /* VariableSetStmt */ + YYSYMBOL_set_rest = 978, /* set_rest */ + YYSYMBOL_generic_set = 979, /* generic_set */ + YYSYMBOL_var_value = 980, /* var_value */ + YYSYMBOL_zone_value = 981, /* zone_value */ + YYSYMBOL_var_list = 982, /* var_list */ + YYSYMBOL_VariableShowStmt = 983, /* VariableShowStmt */ + YYSYMBOL_describe_or_desc = 984, /* describe_or_desc */ + YYSYMBOL_show_or_describe = 985, /* show_or_describe */ + YYSYMBOL_opt_tables = 986, /* opt_tables */ + YYSYMBOL_var_name = 987, /* var_name */ + YYSYMBOL_table_id = 988, /* table_id */ + YYSYMBOL_ViewStmt = 989, /* ViewStmt */ + YYSYMBOL_opt_check_option = 990 /* opt_check_option */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; -/* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 1347 "third_party/libpg_query/grammar/grammar_out.cpp" #ifdef short # undef short #endif -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif #endif -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; #else -typedef short int yytype_int8; +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 #endif -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; #else -typedef unsigned short int yytype_uint16; +typedef short yytype_uint8; #endif -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; #else -typedef short int yytype_int16; +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif #endif #ifndef YYSIZE_T @@ -1381,55 +1354,106 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T unsigned # endif #endif -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_int16 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid +# endif +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YY_USE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -static int -YYID (i) - int i; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return i; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END #endif -#if ! defined yyoverflow || YYERROR_VERBOSE + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -1446,11 +1470,11 @@ YYID (i) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -1458,8 +1482,8 @@ YYID (i) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -1473,127 +1497,134 @@ YYID (i) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - +#endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ - && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; - YYSTYPE yyvs; - YYLTYPE yyls; + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; + YYLTYPE yyls_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ + + YYSIZEOF (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 867 +#define YYFINAL 870 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 72739 +#define YYLAST 73750 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 525 +#define YYNTOKENS 528 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 460 +#define YYNNTS 463 /* YYNRULES -- Number of rules. */ -#define YYNRULES 2120 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 3529 +#define YYNRULES 2132 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 3538 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 757 +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 760 -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint16 yytranslate[] = +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int16 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 522, 523, 509, 2, 2, - 514, 515, 507, 505, 518, 506, 516, 508, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 524, 517, - 501, 503, 502, 519, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 525, 526, 512, 2, 2, + 517, 518, 510, 508, 521, 509, 519, 511, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 527, 520, + 504, 506, 505, 522, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 512, 2, 513, 510, 2, 2, 2, 2, 2, + 2, 515, 2, 516, 513, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 520, 2, 521, 2, 2, 2, 2, + 2, 2, 2, 523, 2, 524, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1656,1026 +1687,166 @@ static const yytype_uint16 yytranslate[] = 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 504, 511 + 495, 496, 497, 498, 499, 500, 501, 502, 503, 507, + 514 }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 9, 11, 13, 15, 17, 19, - 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, - 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, - 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, - 81, 83, 85, 87, 89, 91, 92, 97, 104, 109, - 116, 121, 128, 133, 140, 142, 145, 149, 152, 154, - 158, 161, 165, 167, 171, 174, 180, 184, 191, 196, - 203, 210, 217, 223, 229, 236, 246, 251, 257, 265, - 272, 277, 286, 291, 294, 299, 303, 310, 315, 318, - 321, 324, 327, 329, 332, 333, 335, 338, 341, 344, - 346, 350, 355, 358, 360, 361, 364, 368, 371, 375, - 377, 380, 382, 384, 386, 388, 390, 392, 394, 397, - 400, 402, 404, 406, 408, 410, 417, 424, 433, 440, - 449, 456, 465, 472, 481, 490, 501, 510, 521, 523, - 524, 534, 536, 541, 546, 554, 557, 559, 563, 566, - 569, 570, 575, 579, 580, 582, 583, 586, 590, 596, - 599, 602, 603, 612, 618, 619, 625, 631, 639, 642, - 643, 645, 647, 649, 653, 656, 657, 659, 660, 662, - 666, 668, 672, 674, 677, 679, 683, 686, 693, 702, - 708, 710, 711, 713, 717, 720, 725, 731, 737, 746, - 754, 756, 757, 766, 778, 789, 790, 792, 793, 795, - 797, 798, 801, 805, 815, 828, 830, 834, 836, 840, - 844, 845, 850, 857, 859, 862, 864, 866, 867, 869, - 872, 875, 877, 880, 883, 885, 888, 892, 895, 898, - 901, 904, 908, 912, 916, 918, 922, 924, 925, 927, - 930, 933, 939, 947, 948, 951, 954, 957, 960, 963, - 966, 969, 971, 973, 974, 977, 987, 1000, 1012, 1013, - 1016, 1018, 1020, 1022, 1024, 1026, 1028, 1032, 1033, 1035, - 1038, 1040, 1042, 1045, 1048, 1052, 1054, 1056, 1059, 1062, - 1064, 1067, 1071, 1077, 1081, 1084, 1090, 1092, 1094, 1096, - 1097, 1103, 1111, 1117, 1120, 1124, 1126, 1128, 1131, 1134, - 1135, 1139, 1144, 1149, 1150, 1154, 1157, 1158, 1162, 1164, - 1166, 1168, 1170, 1172, 1174, 1176, 1178, 1180, 1182, 1186, - 1190, 1192, 1195, 1198, 1201, 1204, 1207, 1210, 1211, 1215, - 1219, 1223, 1224, 1226, 1229, 1231, 1234, 1237, 1240, 1243, - 1247, 1252, 1254, 1258, 1260, 1262, 1264, 1266, 1270, 1272, - 1275, 1276, 1278, 1281, 1282, 1284, 1288, 1289, 1292, 1293, - 1297, 1301, 1303, 1309, 1313, 1315, 1319, 1321, 1324, 1326, - 1331, 1337, 1343, 1350, 1354, 1362, 1367, 1379, 1381, 1385, - 1388, 1391, 1394, 1395, 1399, 1401, 1403, 1406, 1409, 1412, - 1415, 1417, 1418, 1420, 1423, 1430, 1435, 1442, 1447, 1454, - 1463, 1465, 1467, 1469, 1471, 1474, 1476, 1479, 1481, 1484, - 1486, 1488, 1490, 1492, 1496, 1500, 1504, 1508, 1510, 1513, - 1516, 1518, 1522, 1524, 1526, 1528, 1532, 1534, 1536, 1537, - 1539, 1541, 1543, 1552, 1564, 1575, 1583, 1594, 1604, 1606, - 1608, 1611, 1615, 1624, 1636, 1646, 1654, 1655, 1659, 1663, - 1665, 1667, 1671, 1672, 1674, 1678, 1680, 1681, 1683, 1684, - 1686, 1687, 1689, 1693, 1695, 1697, 1699, 1701, 1705, 1707, - 1708, 1711, 1714, 1715, 1718, 1719, 1721, 1722, 1724, 1726, - 1728, 1732, 1736, 1738, 1740, 1744, 1748, 1752, 1756, 1760, - 1764, 1769, 1773, 1776, 1778, 1780, 1782, 1784, 1788, 1790, - 1792, 1796, 1798, 1800, 1804, 1808, 1812, 1814, 1817, 1822, - 1827, 1830, 1834, 1840, 1846, 1848, 1850, 1854, 1855, 1867, - 1879, 1890, 1903, 1905, 1908, 1914, 1919, 1924, 1929, 1934, - 1942, 1948, 1953, 1961, 1968, 1978, 1988, 1993, 1995, 1997, - 1999, 2001, 2003, 2005, 2007, 2013, 2015, 2017, 2021, 2023, - 2026, 2029, 2032, 2036, 2038, 2042, 2050, 2052, 2055, 2056, - 2059, 2060, 2064, 2068, 2073, 2078, 2083, 2088, 2092, 2095, - 2097, 2099, 2100, 2102, 2104, 2105, 2108, 2110, 2116, 2118, - 2119, 2122, 2125, 2126, 2128, 2129, 2133, 2139, 2141, 2145, - 2150, 2154, 2156, 2158, 2159, 2162, 2165, 2166, 2169, 2172, - 2174, 2176, 2178, 2179, 2182, 2187, 2193, 2198, 2201, 2205, - 2208, 2211, 2214, 2217, 2219, 2222, 2226, 2227, 2229, 2230, - 2236, 2238, 2243, 2250, 2253, 2255, 2256, 2261, 2262, 2264, - 2266, 2269, 2272, 2275, 2277, 2279, 2282, 2285, 2287, 2289, - 2291, 2293, 2295, 2297, 2301, 2305, 2306, 2308, 2312, 2314, - 2317, 2319, 2321, 2323, 2325, 2327, 2330, 2335, 2340, 2346, - 2348, 2350, 2353, 2354, 2357, 2358, 2360, 2364, 2366, 2367, - 2369, 2372, 2376, 2379, 2384, 2387, 2391, 2394, 2395, 2397, - 2400, 2401, 2406, 2412, 2414, 2417, 2420, 2421, 2423, 2427, - 2429, 2432, 2436, 2440, 2444, 2448, 2452, 2456, 2458, 2463, - 2473, 2483, 2487, 2488, 2491, 2494, 2495, 2501, 2505, 2506, - 2508, 2510, 2514, 2520, 2524, 2526, 2529, 2531, 2535, 2541, - 2543, 2546, 2550, 2555, 2561, 2566, 2572, 2577, 2584, 2590, - 2595, 2601, 2607, 2613, 2616, 2621, 2623, 2625, 2626, 2628, - 2633, 2639, 2644, 2645, 2648, 2651, 2654, 2656, 2658, 2660, - 2662, 2663, 2668, 2671, 2673, 2676, 2679, 2684, 2687, 2694, - 2697, 2699, 2703, 2708, 2709, 2712, 2713, 2716, 2717, 2719, - 2723, 2727, 2730, 2731, 2734, 2739, 2741, 2743, 2745, 2746, - 2749, 2753, 2759, 2766, 2769, 2773, 2775, 2781, 2787, 2793, - 2797, 2801, 2805, 2810, 2811, 2813, 2815, 2817, 2819, 2821, - 2824, 2829, 2831, 2833, 2835, 2837, 2840, 2844, 2845, 2847, - 2849, 2851, 2853, 2855, 2858, 2861, 2864, 2867, 2870, 2872, - 2876, 2877, 2879, 2881, 2883, 2885, 2891, 2894, 2896, 2898, - 2900, 2902, 2907, 2909, 2912, 2915, 2917, 2921, 2925, 2928, - 2930, 2931, 2937, 2940, 2946, 2949, 2951, 2955, 2959, 2960, - 2962, 2964, 2966, 2968, 2970, 2972, 2974, 2976, 2978, 2980, - 2982, 2984, 2986, 2988, 2990, 2992, 2994, 2996, 2998, 3000, - 3002, 3004, 3006, 3008, 3010, 3012, 3014, 3016, 3018, 3020, - 3022, 3024, 3026, 3028, 3030, 3032, 3036, 3040, 3044, 3048, - 3052, 3056, 3060, 3061, 3063, 3067, 3071, 3077, 3080, 3083, - 3087, 3091, 3095, 3099, 3103, 3107, 3111, 3115, 3119, 3123, - 3127, 3131, 3135, 3139, 3143, 3146, 3149, 3153, 3157, 3160, - 3163, 3167, 3171, 3177, 3182, 3189, 3193, 3199, 3204, 3211, - 3216, 3223, 3229, 3237, 3241, 3244, 3249, 3253, 3256, 3260, - 3264, 3268, 3272, 3277, 3281, 3286, 3290, 3295, 3301, 3308, - 3315, 3323, 3330, 3338, 3345, 3353, 3357, 3362, 3367, 3374, - 3376, 3381, 3385, 3391, 3393, 3397, 3400, 3403, 3407, 3411, - 3415, 3419, 3423, 3427, 3431, 3435, 3439, 3443, 3447, 3451, - 3455, 3459, 3463, 3466, 3469, 3475, 3482, 3489, 3497, 3499, - 3502, 3504, 3506, 3508, 3511, 3514, 3519, 3523, 3525, 3527, - 3529, 3531, 3533, 3538, 3540, 3542, 3544, 3546, 3549, 3554, - 3557, 3560, 3564, 3568, 3572, 3579, 3587, 3597, 3605, 3613, - 3619, 3621, 3623, 3625, 3631, 3638, 3645, 3650, 3655, 3660, - 3665, 3672, 3678, 3684, 3690, 3695, 3702, 3707, 3715, 3725, - 3731, 3732, 3738, 3743, 3744, 3746, 3747, 3750, 3751, 3753, - 3757, 3761, 3764, 3767, 3768, 3775, 3777, 3778, 3782, 3783, - 3787, 3791, 3795, 3796, 3798, 3803, 3806, 3809, 3812, 3815, - 3818, 3822, 3825, 3828, 3832, 3833, 3838, 3842, 3844, 3850, - 3854, 3856, 3860, 3862, 3865, 3869, 3871, 3875, 3877, 3880, - 3882, 3883, 3885, 3887, 3889, 3891, 3893, 3895, 3897, 3899, - 3901, 3903, 3905, 3907, 3909, 3911, 3913, 3915, 3917, 3919, - 3921, 3923, 3928, 3930, 3935, 3937, 3942, 3944, 3947, 3949, - 3952, 3954, 3957, 3959, 3963, 3965, 3969, 3971, 3974, 3976, - 3980, 3982, 3985, 3987, 3988, 3990, 3994, 3996, 4000, 4004, - 4006, 4010, 4014, 4015, 4017, 4019, 4021, 4023, 4025, 4027, - 4029, 4031, 4033, 4035, 4037, 4039, 4041, 4043, 4048, 4052, - 4055, 4059, 4060, 4064, 4068, 4071, 4074, 4076, 4077, 4080, - 4083, 4087, 4090, 4092, 4094, 4098, 4104, 4106, 4109, 4114, - 4117, 4118, 4120, 4121, 4123, 4126, 4130, 4136, 4144, 4152, - 4154, 4155, 4156, 4159, 4160, 4163, 4167, 4171, 4175, 4181, - 4189, 4197, 4198, 4201, 4203, 4204, 4206, 4207, 4209, 4213, - 4215, 4218, 4222, 4225, 4227, 4232, 4235, 4237, 4238, 4242, - 4244, 4248, 4250, 4253, 4258, 4261, 4262, 4264, 4268, 4270, - 4274, 4276, 4279, 4281, 4285, 4287, 4289, 4292, 4294, 4296, - 4299, 4301, 4303, 4306, 4314, 4317, 4323, 4327, 4331, 4333, - 4335, 4337, 4339, 4341, 4343, 4345, 4347, 4349, 4351, 4353, - 4355, 4357, 4359, 4362, 4365, 4369, 4373, 4374, 4376, 4378, - 4380, 4386, 4390, 4391, 4393, 4395, 4397, 4399, 4401, 4403, - 4408, 4416, 4423, 4426, 4427, 4429, 4431, 4433, 4435, 4449, - 4466, 4468, 4471, 4472, 4474, 4475, 4477, 4478, 4481, 4482, - 4484, 4485, 4492, 4501, 4508, 4517, 4524, 4533, 4537, 4540, - 4542, 4543, 4550, 4557, 4559, 4561, 4563, 4565, 4567, 4569, - 4572, 4574, 4576, 4578, 4580, 4582, 4587, 4594, 4598, 4601, - 4606, 4610, 4616, 4618, 4619, 4621, 4623, 4624, 4626, 4628, - 4630, 4632, 4634, 4636, 4638, 4640, 4642, 4644, 4646, 4648, - 4650, 4652, 4654, 4656, 4658, 4660, 4662, 4664, 4666, 4668, - 4670, 4672, 4674, 4676, 4678, 4680, 4682, 4684, 4686, 4688, - 4690, 4692, 4694, 4696, 4700, 4702, 4704, 4706, 4708, 4710, - 4712, 4715, 4717, 4719, 4722, 4726, 4730, 4734, 4736, 4740, - 4744, 4747, 4751, 4755, 4757, 4759, 4761, 4765, 4771, 4773, - 4775, 4777, 4779, 4783, 4786, 4789, 4793, 4798, 4804, 4806, - 4808, 4810, 4812, 4817, 4824, 4830, 4835, 4842, 4844, 4846, - 4848, 4850, 4852, 4854, 4855, 4857, 4861, 4863, 4864, 4872, - 4876, 4878, 4881, 4885, 4888, 4889, 4892, 4893, 4896, 4901, - 4907, 4916, 4919, 4923, 4929, 4931, 4932, 4935, 4936, 4939, - 4943, 4947, 4951, 4953, 4955, 4957, 4960, 4964, 4967, 4970, - 4973, 4976, 4980, 4985, 4989, 4991, 4993, 4995, 4997, 4999, - 5001, 5002, 5004, 5008, 5010, 5014, 5017, 5027, 5040, 5052, - 5065, 5080, 5084, 5089, 5094, 5095, 5103, 5114, 5124, 5127, - 5131, 5132, 5137, 5139, 5141, 5143, 5145, 5147, 5149, 5151, - 5153, 5155, 5157, 5159, 5161, 5163, 5165, 5167, 5169, 5171, - 5173, 5175, 5177, 5179, 5181, 5183, 5185, 5187, 5189, 5191, - 5193, 5195, 5197, 5199, 5201, 5203, 5205, 5207, 5209, 5211, - 5213, 5215, 5217, 5219, 5221, 5223, 5225, 5227, 5229, 5231, - 5233, 5235, 5237, 5239, 5241, 5243, 5245, 5247, 5249, 5251, - 5253, 5255, 5257, 5259, 5261, 5263, 5265, 5267, 5269, 5271, - 5273, 5275, 5277, 5279, 5281, 5283, 5285, 5287, 5289, 5291, - 5293, 5295, 5297, 5299, 5301, 5303, 5305, 5307, 5309, 5311, - 5313, 5315, 5317, 5319, 5321, 5323, 5325, 5327, 5329, 5331, - 5333, 5335, 5337, 5339, 5341, 5343, 5345, 5347, 5349, 5351, - 5353, 5355, 5357, 5359, 5361, 5363, 5365, 5367, 5369, 5371, - 5373, 5375, 5377, 5379, 5381, 5383, 5385, 5387, 5389, 5391, - 5393, 5395, 5397, 5399, 5401, 5403, 5405, 5407, 5409, 5411, - 5413, 5415, 5417, 5419, 5421, 5423, 5425, 5427, 5429, 5431, - 5433, 5435, 5437, 5439, 5441, 5443, 5445, 5447, 5449, 5451, - 5453, 5455, 5457, 5459, 5461, 5463, 5465, 5467, 5469, 5471, - 5473, 5475, 5477, 5479, 5481, 5483, 5485, 5487, 5489, 5491, - 5493, 5495, 5497, 5499, 5501, 5503, 5505, 5507, 5509, 5511, - 5513, 5515, 5517, 5519, 5521, 5523, 5525, 5527, 5529, 5531, - 5533, 5535, 5537, 5539, 5541, 5543, 5545, 5547, 5549, 5551, - 5553, 5555, 5557, 5559, 5561, 5563, 5565, 5567, 5569, 5571, - 5573, 5575, 5577, 5579, 5581, 5583, 5585, 5587, 5589, 5591, - 5593, 5595, 5597, 5599, 5601, 5603, 5605, 5607, 5609, 5611, - 5613, 5615, 5617, 5619, 5621, 5623, 5625, 5627, 5629, 5631, - 5633, 5635, 5637, 5639, 5641, 5643, 5645, 5647, 5649, 5651, - 5653, 5655, 5657, 5659, 5661, 5663, 5665, 5667, 5669, 5671, - 5673, 5675, 5677, 5679, 5681, 5683, 5685, 5687, 5689, 5691, - 5693, 5695, 5697, 5699, 5701, 5703, 5705, 5707, 5709, 5711, - 5713, 5715, 5717, 5719, 5721, 5723, 5725, 5727, 5729, 5731, - 5733, 5735, 5737, 5739, 5741, 5743, 5745, 5747, 5749, 5751, - 5753, 5755, 5757, 5759, 5761, 5763, 5765, 5767, 5769, 5771, - 5773, 5775, 5777, 5779, 5781, 5783, 5785, 5787, 5789, 5791, - 5793, 5795, 5797, 5799, 5801, 5803, 5805, 5807, 5809, 5811, - 5813, 5815, 5817, 5819, 5821, 5823, 5825, 5827, 5829, 5831, - 5833, 5835, 5837, 5839, 5841, 5843, 5845, 5847, 5849, 5851, - 5853, 5855, 5857, 5859, 5861, 5863, 5865, 5867, 5869, 5871, - 5873, 5875, 5877, 5879, 5881, 5883, 5885, 5887, 5889, 5891, - 5893, 5895, 5897, 5899, 5901, 5903, 5905, 5907, 5909, 5911, - 5913, 5915, 5917, 5919, 5921, 5923, 5925, 5927, 5929, 5931, - 5933, 5935, 5937, 5939, 5941, 5943, 5945, 5947, 5949, 5951, - 5953, 5955, 5957, 5959, 5961, 5963, 5965, 5967, 5969, 5971, - 5973, 5975, 5977, 5979, 5981, 5983, 5985, 5987, 5989, 5991, - 5993, 5995, 5997, 5999, 6001, 6003, 6005, 6007, 6009, 6011, - 6013, 6015, 6017, 6019, 6021, 6023, 6025, 6027, 6029, 6031, - 6033, 6035, 6037, 6039, 6041, 6043, 6045, 6047, 6049, 6051, - 6053, 6055, 6057, 6059, 6061, 6063, 6065, 6067, 6069, 6071, - 6073, 6075, 6077, 6079, 6081, 6083, 6085, 6087, 6089, 6091, - 6093, 6095, 6097, 6099, 6101, 6103, 6105, 6107, 6109, 6111, - 6113, 6115, 6117, 6119, 6121, 6123, 6125, 6127, 6129, 6131, - 6133, 6135, 6137, 6139, 6141, 6143, 6145, 6147, 6149, 6151, - 6153, 6155, 6157, 6159, 6161, 6163, 6165, 6167, 6169, 6171, - 6173, 6175, 6177, 6179, 6181, 6183, 6185, 6187, 6189, 6191, - 6193, 6195, 6197, 6199, 6201, 6203, 6205, 6207, 6209, 6211, - 6213, 6215, 6217, 6219, 6221, 6223, 6225, 6227, 6229, 6231, - 6233, 6235, 6237, 6239, 6241, 6243, 6245, 6247, 6249, 6251, - 6253, 6255, 6257, 6259, 6261, 6263, 6265, 6267, 6269, 6271, - 6273, 6275, 6277, 6279, 6281, 6283, 6285, 6287, 6289, 6291, - 6293, 6295, 6297, 6299, 6301, 6303, 6305, 6307, 6309, 6311, - 6313, 6315, 6317, 6319, 6321, 6323, 6325, 6327, 6329, 6331, - 6333, 6335, 6337, 6339, 6341, 6343, 6345, 6347, 6349, 6351, - 6353, 6355, 6357, 6359, 6361, 6363, 6365, 6367, 6369, 6371, - 6373 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 526, 0, -1, 527, -1, 527, 517, 528, -1, 528, - -1, 921, -1, 586, -1, 529, -1, 958, -1, 959, - -1, 972, -1, 922, -1, 924, -1, 656, -1, 975, - -1, 652, -1, 911, -1, 578, -1, 576, -1, 598, - -1, 572, -1, 540, -1, 954, -1, 960, -1, 593, - -1, 646, -1, 582, -1, 929, -1, 927, -1, 928, - -1, 914, -1, 551, -1, 946, -1, 575, -1, 908, - -1, 549, -1, 674, -1, 595, -1, 655, -1, 597, - -1, 949, -1, 963, -1, 940, -1, 966, -1, 973, - -1, -1, 32, 416, 761, 537, -1, 32, 416, 191, - 152, 761, 537, -1, 32, 202, 541, 537, -1, 32, - 202, 191, 152, 541, 537, -1, 32, 381, 541, 537, - -1, 32, 381, 191, 152, 541, 537, -1, 32, 466, - 541, 537, -1, 32, 466, 191, 152, 541, 537, -1, - 532, -1, 530, 532, -1, 386, 117, 809, -1, 137, - 117, -1, 356, -1, 356, 588, 589, -1, 386, 590, - -1, 386, 175, 645, -1, 536, -1, 533, 518, 536, - -1, 26, 625, -1, 26, 191, 274, 152, 625, -1, - 26, 82, 625, -1, 26, 82, 191, 274, 152, 625, - -1, 32, 550, 542, 531, -1, 32, 550, 542, 137, - 274, 279, -1, 32, 550, 542, 386, 274, 279, -1, - 32, 550, 542, 386, 402, 592, -1, 32, 550, 542, - 386, 613, -1, 32, 550, 542, 354, 613, -1, 32, - 550, 542, 386, 405, 542, -1, 32, 550, 542, 26, - 175, 645, 40, 190, 601, -1, 32, 550, 542, 530, - -1, 32, 550, 542, 137, 190, -1, 32, 550, 542, - 137, 190, 191, 152, -1, 137, 550, 191, 152, 542, - 650, -1, 137, 550, 542, 650, -1, 32, 550, 542, - 539, 439, 774, 770, 535, -1, 32, 550, 542, 538, - -1, 26, 615, -1, 32, 93, 896, 599, -1, 457, - 93, 896, -1, 137, 93, 191, 152, 896, 650, -1, - 137, 93, 896, 650, -1, 386, 244, -1, 386, 448, - -1, 386, 613, -1, 354, 613, -1, 538, -1, 454, - 809, -1, -1, 609, -1, 386, 609, -1, 26, 609, - -1, 137, 623, -1, 534, -1, 537, 518, 534, -1, - 293, 514, 533, 515, -1, 386, 107, -1, 386, -1, - -1, 111, 896, -1, 111, 325, 896, -1, 111, 30, - -1, 111, 325, 30, -1, 543, -1, 542, 545, -1, - 3, -1, 978, -1, 979, -1, 542, -1, 5, -1, - 5, -1, 546, -1, 545, 546, -1, 516, 547, -1, - 548, -1, 3, -1, 982, -1, 978, -1, 984, -1, - 32, 370, 896, 350, 428, 896, -1, 32, 416, 761, - 350, 428, 896, -1, 32, 416, 191, 152, 761, 350, - 428, 896, -1, 32, 381, 541, 350, 428, 896, -1, - 32, 381, 191, 152, 541, 350, 428, 896, -1, 32, - 466, 541, 350, 428, 896, -1, 32, 466, 191, 152, - 541, 350, 428, 896, -1, 32, 202, 541, 350, 428, - 896, -1, 32, 202, 191, 152, 541, 350, 428, 896, - -1, 32, 416, 761, 350, 550, 896, 428, 896, -1, - 32, 416, 191, 152, 761, 350, 550, 896, 428, 896, - -1, 32, 416, 761, 350, 93, 896, 428, 896, -1, - 32, 416, 191, 152, 761, 350, 93, 896, 428, 896, - -1, 82, -1, -1, 556, 212, 559, 219, 553, 554, - 552, 560, 562, -1, 674, -1, 303, 563, 459, 674, - -1, 514, 567, 515, 674, -1, 514, 567, 515, 303, - 563, 459, 674, -1, 117, 460, -1, 541, -1, 541, - 40, 542, -1, 59, 265, -1, 59, 320, -1, -1, - 514, 570, 515, 767, -1, 289, 93, 896, -1, -1, - 686, -1, -1, 542, 877, -1, 571, 503, 809, -1, - 514, 564, 515, 503, 809, -1, 294, 352, -1, 294, - 192, -1, -1, 289, 91, 555, 133, 451, 386, 569, - 767, -1, 289, 91, 555, 133, 275, -1, -1, 542, - 565, 566, 702, 703, -1, 819, 565, 566, 702, 703, - -1, 514, 809, 515, 565, 566, 702, 703, -1, 358, - 883, -1, -1, 453, -1, 415, -1, 571, -1, 564, - 518, 571, -1, 80, 903, -1, -1, 903, -1, -1, - 557, -1, 567, 518, 557, -1, 558, -1, 568, 518, - 558, -1, 568, -1, 568, 518, -1, 561, -1, 570, - 518, 561, -1, 542, 877, -1, 100, 439, 541, 40, - 144, 675, -1, 100, 439, 541, 40, 144, 514, 573, - 515, -1, 100, 439, 541, 40, 774, -1, 574, -1, - -1, 544, -1, 574, 518, 544, -1, 322, 542, -1, - 322, 542, 503, 945, -1, 322, 542, 514, 857, 515, - -1, 100, 644, 381, 541, 577, -1, 100, 644, 381, - 191, 274, 152, 541, 577, -1, 100, 294, 352, 644, - 381, 541, 577, -1, 587, -1, -1, 100, 580, 377, - 579, 581, 514, 673, 515, -1, 100, 580, 377, 191, - 274, 152, 579, 581, 514, 673, 515, -1, 100, 294, - 352, 580, 377, 579, 581, 514, 673, 515, -1, -1, - 542, -1, -1, 422, -1, 313, -1, -1, 198, 3, - -1, 151, 896, 585, -1, 100, 644, 416, 977, 40, - 151, 896, 585, 976, -1, 100, 644, 416, 191, 274, - 152, 977, 40, 151, 896, 585, 976, -1, 809, -1, - 906, 13, 809, -1, 583, -1, 584, 518, 583, -1, - 514, 584, 515, -1, -1, 32, 381, 541, 587, -1, - 32, 381, 191, 152, 541, 587, -1, 590, -1, 587, - 590, -1, 476, -1, 500, -1, -1, 4, -1, 505, - 4, -1, 506, 4, -1, 592, -1, 40, 777, -1, - 60, 589, -1, 106, -1, 272, 106, -1, 201, 591, - 589, -1, 250, 589, -1, 260, 589, -1, 272, 250, - -1, 272, 260, -1, 304, 59, 903, -1, 381, 265, - 903, -1, 400, 588, 589, -1, 356, -1, 356, 588, - 589, -1, 59, -1, -1, 899, -1, 505, 899, -1, - 506, 899, -1, 137, 580, 377, 542, 594, -1, 137, - 580, 377, 191, 152, 542, 594, -1, -1, 171, 3, - -1, 22, 596, -1, 52, 596, -1, 400, 596, -1, - 86, 596, -1, 143, 596, -1, 363, 596, -1, 479, - -1, 430, -1, -1, 452, 541, -1, 100, 644, 416, - 541, 514, 631, 515, 620, 612, -1, 100, 644, 416, - 191, 274, 152, 541, 514, 631, 515, 620, 612, -1, - 100, 294, 352, 644, 416, 541, 514, 631, 515, 620, - 612, -1, -1, 599, 624, -1, 639, -1, 984, -1, - 849, -1, 589, -1, 544, -1, 273, -1, 514, 587, - 515, -1, -1, 544, -1, 272, 25, -1, 357, -1, - 63, -1, 386, 279, -1, 386, 117, -1, 93, 896, - 605, -1, 605, -1, 619, -1, 80, 903, -1, 274, - 279, -1, 279, -1, 445, 630, -1, 328, 226, 630, - -1, 74, 514, 809, 515, 614, -1, 454, 88, 896, - -1, 117, 810, -1, 344, 541, 633, 642, 611, -1, - 468, -1, 406, -1, 606, -1, -1, 175, 645, 40, - 190, 601, -1, 175, 645, 40, 514, 809, 515, 607, - -1, 40, 514, 809, 515, 607, -1, 623, 602, -1, - 289, 451, 603, -1, 610, -1, 635, -1, 610, 635, - -1, 635, 610, -1, -1, 289, 86, 137, -1, 289, - 86, 122, 366, -1, 289, 86, 327, 366, -1, -1, - 514, 617, 515, -1, 272, 204, -1, -1, 93, 896, - 640, -1, 640, -1, 85, -1, 94, -1, 118, -1, - 190, -1, 203, -1, 402, -1, 405, -1, 30, -1, - 636, -1, 617, 518, 636, -1, 454, 202, 627, -1, - 119, -1, 274, 119, -1, 206, 120, -1, 206, 194, - -1, 476, 613, -1, 476, 287, -1, 478, 287, -1, - -1, 514, 626, 515, -1, 622, 200, 616, -1, 622, - 149, 616, -1, -1, 548, -1, 274, 119, -1, 119, - -1, 206, 194, -1, 206, 120, -1, 274, 456, -1, - 272, 204, -1, 542, 774, 634, -1, 542, 773, 608, - 634, -1, 629, -1, 626, 518, 629, -1, 542, -1, - 625, -1, 643, -1, 615, -1, 548, 503, 600, -1, - 548, -1, 476, 621, -1, -1, 641, -1, 641, 518, - -1, -1, 542, -1, 514, 637, 515, -1, -1, 634, - 604, -1, -1, 289, 122, 603, -1, 548, 503, 600, - -1, 548, -1, 548, 516, 548, 503, 600, -1, 548, - 516, 548, -1, 632, -1, 637, 518, 632, -1, 637, - -1, 637, 518, -1, 774, -1, 900, 904, 509, 439, - -1, 387, 900, 904, 509, 439, -1, 74, 514, 809, - 515, 599, -1, 445, 514, 638, 515, 630, 599, -1, - 445, 618, 599, -1, 328, 226, 514, 638, 515, 630, - 599, -1, 328, 226, 618, 599, -1, 168, 226, 514, - 638, 515, 344, 541, 633, 642, 611, 599, -1, 628, - -1, 641, 518, 628, -1, 248, 172, -1, 248, 308, - -1, 248, 392, -1, -1, 236, 541, 622, -1, 422, - -1, 420, -1, 240, 422, -1, 240, 420, -1, 177, - 422, -1, 177, 420, -1, 448, -1, -1, 33, -1, - 59, 117, -1, 137, 647, 191, 152, 649, 650, -1, - 137, 647, 649, 650, -1, 137, 648, 191, 152, 893, - 650, -1, 137, 648, 893, 650, -1, 137, 651, 896, - 289, 903, 650, -1, 137, 651, 191, 152, 896, 289, - 903, 650, -1, 416, -1, 381, -1, 173, -1, 245, - -1, 245, 416, -1, 466, -1, 249, 466, -1, 202, - -1, 168, 416, -1, 81, -1, 97, -1, 370, -1, - 402, -1, 423, 374, 307, -1, 423, 374, 129, -1, - 423, 374, 421, -1, 423, 374, 90, -1, 439, -1, - 24, 251, -1, 146, 433, -1, 156, -1, 168, 107, - 480, -1, 334, -1, 384, -1, 903, -1, 649, 518, - 903, -1, 63, -1, 357, -1, -1, 319, -1, 367, - -1, 433, -1, 100, 644, 653, 541, 654, 40, 416, - 674, -1, 100, 644, 653, 191, 274, 152, 541, 654, - 40, 416, 674, -1, 100, 294, 352, 644, 653, 541, - 654, 40, 416, 674, -1, 100, 644, 653, 541, 654, - 40, 809, -1, 100, 644, 653, 191, 274, 152, 541, - 654, 40, 809, -1, 100, 294, 352, 644, 653, 541, - 654, 40, 809, -1, 173, -1, 245, -1, 514, 515, - -1, 514, 857, 515, -1, 556, 451, 955, 386, 569, - 741, 956, 562, -1, 98, 669, 541, 633, 667, 658, - 663, 672, 659, 588, 664, -1, 98, 514, 674, 515, - 428, 663, 672, 588, 664, -1, 98, 171, 108, 542, - 428, 542, 657, -1, -1, 514, 370, 515, -1, 514, - 107, 515, -1, 171, -1, 428, -1, 661, 124, 544, - -1, -1, 671, -1, 660, 518, 671, -1, 454, -1, - -1, 40, -1, -1, 333, -1, -1, 668, -1, 514, - 673, 515, -1, 937, -1, 589, -1, 815, -1, 507, - -1, 514, 660, 515, -1, 816, -1, -1, 548, 665, - -1, 476, 287, -1, -1, 668, 670, -1, -1, 55, - -1, -1, 55, -1, 287, -1, 170, -1, 123, 662, - 544, -1, 279, 662, 544, -1, 102, -1, 186, -1, - 336, 662, 544, -1, 145, 662, 544, -1, 167, 336, - 637, -1, 167, 336, 507, -1, 309, 59, 637, -1, - 309, 59, 507, -1, 167, 274, 279, 637, -1, 167, - 279, 637, -1, 141, 544, -1, 937, -1, 544, -1, - 403, -1, 404, -1, 3, 516, 542, -1, 3, -1, - 666, -1, 673, 518, 666, -1, 676, -1, 675, -1, - 514, 676, 515, -1, 514, 675, 515, -1, 514, 966, - 515, -1, 679, -1, 677, 699, -1, 677, 698, 732, - 705, -1, 677, 698, 704, 733, -1, 686, 677, -1, - 686, 677, 699, -1, 686, 677, 698, 732, 705, -1, - 686, 677, 698, 704, 733, -1, 679, -1, 675, -1, - 379, 696, 882, -1, -1, 379, 696, 882, 690, 741, - 767, 721, 730, 825, 731, 709, -1, 379, 695, 884, - 690, 741, 767, 721, 730, 825, 731, 709, -1, 171, - 742, 678, 690, 767, 721, 730, 825, 731, 709, -1, - 171, 742, 379, 695, 884, 690, 767, 721, 730, 825, - 731, 709, -1, 740, -1, 416, 761, -1, 677, 444, - 693, 694, 677, -1, 677, 444, 693, 677, -1, 677, - 217, 693, 677, -1, 677, 147, 693, 677, -1, 681, - 744, 454, 884, -1, 681, 744, 454, 884, 180, 59, - 895, -1, 681, 744, 180, 59, 895, -1, 681, 744, - 289, 685, -1, 681, 744, 289, 685, 180, 59, 895, - -1, 681, 744, 289, 685, 454, 884, -1, 681, 744, - 289, 685, 454, 884, 180, 59, 895, -1, 682, 744, - 289, 884, 219, 265, 896, 680, 895, -1, 682, 744, - 289, 884, -1, 459, -1, 460, -1, 314, -1, 316, - -1, 449, -1, 315, -1, 810, -1, 810, 198, 514, - 676, 515, -1, 747, -1, 683, -1, 684, 518, 683, - -1, 684, -1, 684, 518, -1, 476, 687, -1, 500, - 687, -1, 476, 342, 687, -1, 688, -1, 687, 518, - 688, -1, 896, 905, 40, 689, 514, 910, 515, -1, - 249, -1, 274, 249, -1, -1, 219, 691, -1, -1, - 422, 692, 541, -1, 420, 692, 541, -1, 240, 422, - 692, 541, -1, 240, 420, 692, 541, -1, 177, 422, - 692, 541, -1, 177, 420, 692, 541, -1, 448, 692, - 541, -1, 416, 541, -1, 541, -1, 416, -1, -1, - 30, -1, 132, -1, -1, 59, 265, -1, 132, -1, - 132, 289, 514, 855, 515, -1, 30, -1, -1, 192, - 281, -1, 355, 281, -1, -1, 699, -1, -1, 295, - 59, 700, -1, 295, 59, 30, 702, 703, -1, 701, - -1, 700, 518, 701, -1, 809, 454, 849, 703, -1, - 809, 702, 703, -1, 41, -1, 126, -1, -1, 499, - 163, -1, 499, 230, -1, -1, 706, 707, -1, 707, - 706, -1, 706, -1, 707, -1, 704, -1, -1, 237, - 715, -1, 237, 715, 518, 716, -1, 161, 720, 717, - 719, 290, -1, 161, 720, 719, 290, -1, 286, 716, - -1, 286, 717, 719, -1, 4, 509, -1, 9, 509, - -1, 4, 312, -1, 9, 312, -1, 9, -1, 9, - 366, -1, 454, 368, 711, -1, -1, 542, -1, -1, - 710, 514, 708, 515, 714, -1, 708, -1, 708, 514, - 542, 515, -1, 708, 514, 542, 518, 9, 515, -1, - 418, 711, -1, 712, -1, -1, 351, 514, 9, 515, - -1, -1, 809, -1, 30, -1, 809, 509, -1, 4, - 312, -1, 9, 312, -1, 809, -1, 811, -1, 505, - 718, -1, 506, 718, -1, 899, -1, 4, -1, 365, - -1, 366, -1, 163, -1, 271, -1, 180, 59, 723, - -1, 180, 59, 30, -1, -1, 724, -1, 722, 518, - 724, -1, 722, -1, 722, 518, -1, 809, -1, 725, - -1, 727, -1, 726, -1, 728, -1, 514, 515, -1, - 364, 514, 855, 515, -1, 103, 514, 855, 515, -1, - 181, 388, 514, 723, 515, -1, 181, -1, 182, -1, - 185, 809, -1, -1, 335, 809, -1, -1, 734, -1, - 166, 338, 290, -1, 732, -1, -1, 735, -1, 734, - 735, -1, 736, 737, 738, -1, 166, 451, -1, 166, - 272, 226, 451, -1, 166, 389, -1, 166, 226, 389, - -1, 284, 892, -1, -1, 278, -1, 393, 243, -1, - -1, 460, 514, 855, 515, -1, 739, 518, 514, 855, - 515, -1, 739, -1, 739, 518, -1, 171, 743, -1, - -1, 744, -1, 742, 518, 744, -1, 742, -1, 742, - 518, -1, 761, 756, 713, -1, 762, 757, 713, -1, - 740, 755, 713, -1, 231, 762, 757, -1, 675, 756, - 713, -1, 231, 675, 756, -1, 754, -1, 514, 754, - 515, 755, -1, 744, 314, 514, 884, 166, 750, 745, - 515, 756, -1, 744, 449, 746, 514, 751, 166, 753, - 515, 756, -1, 180, 59, 894, -1, -1, 199, 281, - -1, 148, 281, -1, -1, 810, 198, 514, 884, 515, - -1, 810, 198, 543, -1, -1, 812, -1, 814, -1, - 514, 853, 515, -1, 748, 198, 514, 884, 515, -1, - 748, 198, 543, -1, 749, -1, 750, 749, -1, 543, - -1, 514, 894, 515, -1, 751, 198, 514, 884, 515, - -1, 752, -1, 753, 752, -1, 514, 754, 515, -1, - 744, 101, 224, 744, -1, 744, 758, 224, 744, 760, - -1, 744, 224, 744, 760, -1, 744, 268, 758, 224, - 744, -1, 744, 268, 224, 744, -1, 744, 42, 758, - 224, 744, 760, -1, 744, 42, 224, 744, 760, -1, - 744, 321, 224, 744, -1, 744, 37, 224, 744, 760, - -1, 744, 380, 224, 744, 760, -1, 40, 543, 514, - 894, 515, -1, 40, 543, -1, 542, 514, 894, 515, - -1, 542, -1, 755, -1, -1, 755, -1, 40, 514, - 768, 515, -1, 40, 543, 514, 768, 515, -1, 542, - 514, 768, 515, -1, -1, 172, 759, -1, 234, 759, - -1, 361, 759, -1, 380, -1, 37, -1, 208, -1, - 299, -1, -1, 454, 514, 894, 515, -1, 289, 809, - -1, 541, -1, 541, 507, -1, 290, 541, -1, 290, - 514, 541, 515, -1, 819, 766, -1, 366, 171, 514, - 764, 515, 766, -1, 819, 765, -1, 763, -1, 764, - 518, 763, -1, 40, 514, 768, 515, -1, -1, 500, - 296, -1, -1, 473, 809, -1, -1, 769, -1, 768, - 518, 769, -1, 543, 774, 770, -1, 80, 903, -1, - -1, 542, 774, -1, 771, 518, 542, 774, -1, 365, - -1, 409, -1, 774, -1, -1, 777, 776, -1, 387, - 777, 776, -1, 777, 39, 512, 899, 513, -1, 387, - 777, 39, 512, 899, 513, -1, 777, 39, -1, 387, - 777, 39, -1, 775, -1, 772, 514, 771, 515, 776, - -1, 246, 514, 859, 515, 776, -1, 444, 514, 771, - 515, 776, -1, 3, 516, 3, -1, 775, 516, 3, - -1, 776, 512, 513, -1, 776, 512, 899, 513, -1, - -1, 779, -1, 781, -1, 783, -1, 787, -1, 793, - -1, 794, 808, -1, 794, 514, 899, 515, -1, 781, - -1, 784, -1, 788, -1, 793, -1, 902, 780, -1, - 514, 856, 515, -1, -1, 215, -1, 216, -1, 394, - -1, 54, -1, 339, -1, 164, 782, -1, 136, 324, - -1, 115, 780, -1, 112, 780, -1, 282, 780, -1, - 57, -1, 514, 899, 515, -1, -1, 785, -1, 786, - -1, 785, -1, 786, -1, 56, 792, 514, 855, 515, - -1, 56, 792, -1, 789, -1, 790, -1, 789, -1, - 790, -1, 791, 514, 899, 515, -1, 791, -1, 72, - 792, -1, 71, 792, -1, 461, -1, 267, 72, 792, - -1, 267, 71, 792, -1, 269, 792, -1, 463, -1, - -1, 427, 514, 899, 515, 795, -1, 427, 795, -1, - 426, 514, 899, 515, 795, -1, 426, 795, -1, 218, - -1, 500, 426, 497, -1, 478, 426, 497, -1, -1, - 494, -1, 495, -1, 262, -1, 263, -1, 109, -1, - 110, -1, 188, -1, 189, -1, 258, -1, 259, -1, - 375, -1, 376, -1, 256, -1, 257, -1, 252, -1, - 253, -1, 470, -1, 471, -1, 113, -1, 114, -1, - 69, -1, 68, -1, 255, -1, 254, -1, 796, -1, - 797, -1, 798, -1, 799, -1, 800, -1, 801, -1, - 802, -1, 803, -1, 804, -1, 805, -1, 806, -1, - 807, -1, 796, 428, 797, -1, 798, 428, 799, -1, - 798, 428, 800, -1, 798, 428, 801, -1, 799, 428, - 800, -1, 799, 428, 801, -1, 800, 428, 801, -1, - -1, 811, -1, 809, 11, 774, -1, 809, 80, 903, - -1, 809, 46, 426, 497, 809, -1, 505, 809, -1, - 506, 809, -1, 809, 505, 809, -1, 809, 506, 809, - -1, 809, 507, 809, -1, 809, 508, 809, -1, 809, - 15, 809, -1, 809, 509, 809, -1, 809, 510, 809, - -1, 809, 16, 809, -1, 809, 501, 809, -1, 809, - 502, 809, -1, 809, 503, 809, -1, 809, 19, 809, - -1, 809, 20, 809, -1, 809, 21, 809, -1, 809, - 848, 809, -1, 848, 809, -1, 809, 848, -1, 809, - 36, 809, -1, 809, 294, 809, -1, 274, 809, -1, - 498, 809, -1, 809, 176, 809, -1, 809, 236, 809, - -1, 809, 236, 809, 145, 809, -1, 809, 498, 236, - 809, -1, 809, 498, 236, 809, 145, 809, -1, 809, - 193, 809, -1, 809, 193, 809, 145, 809, -1, 809, - 498, 193, 809, -1, 809, 498, 193, 809, 145, 809, - -1, 809, 391, 428, 809, -1, 809, 391, 428, 809, - 145, 809, -1, 809, 498, 391, 428, 809, -1, 809, - 498, 391, 428, 809, 145, 809, -1, 809, 221, 279, - -1, 809, 222, -1, 809, 221, 274, 279, -1, 809, - 274, 279, -1, 809, 277, -1, 809, 17, 809, -1, - 809, 18, 809, -1, 837, 301, 837, -1, 809, 221, - 435, -1, 809, 221, 274, 435, -1, 809, 221, 159, - -1, 809, 221, 274, 159, -1, 809, 221, 446, -1, - 809, 221, 274, 446, -1, 809, 221, 132, 171, 809, - -1, 809, 221, 274, 132, 171, 809, -1, 809, 221, - 284, 514, 859, 515, -1, 809, 221, 274, 284, 514, - 859, 515, -1, 809, 53, 881, 810, 36, 809, -1, - 809, 498, 53, 881, 810, 36, 809, -1, 809, 53, - 413, 810, 36, 809, -1, 809, 498, 53, 413, 810, - 36, 809, -1, 809, 198, 869, -1, 809, 498, 198, - 869, -1, 809, 850, 845, 675, -1, 809, 850, 845, - 514, 809, 515, -1, 117, -1, 83, 514, 809, 515, - -1, 507, 887, 891, -1, 542, 516, 507, 887, 891, - -1, 811, -1, 810, 11, 774, -1, 505, 810, -1, - 506, 810, -1, 810, 505, 810, -1, 810, 506, 810, - -1, 810, 507, 810, -1, 810, 508, 810, -1, 810, - 15, 810, -1, 810, 509, 810, -1, 810, 510, 810, - -1, 810, 16, 810, -1, 810, 501, 810, -1, 810, - 502, 810, -1, 810, 503, 810, -1, 810, 19, 810, - -1, 810, 20, 810, -1, 810, 21, 810, -1, 810, - 848, 810, -1, 848, 810, -1, 810, 848, -1, 810, - 221, 132, 171, 810, -1, 810, 221, 274, 132, 171, - 810, -1, 810, 221, 284, 514, 859, 515, -1, 810, - 221, 274, 284, 514, 859, 515, -1, 812, -1, 813, - 880, -1, 875, -1, 898, -1, 675, -1, 675, 545, - -1, 152, 675, -1, 729, 514, 855, 515, -1, 514, - 809, 515, -1, 814, -1, 837, -1, 519, -1, 10, - -1, 816, -1, 246, 520, 844, 521, -1, 818, -1, - 870, -1, 815, -1, 821, -1, 39, 675, -1, 39, - 512, 856, 513, -1, 522, 9, -1, 523, 548, -1, - 512, 856, 513, -1, 520, 840, 521, -1, 897, 514, - 515, -1, 897, 514, 857, 698, 697, 515, -1, 897, - 514, 462, 858, 698, 697, 515, -1, 897, 514, 857, - 518, 462, 858, 698, 697, 515, -1, 897, 514, 30, - 857, 698, 697, 515, -1, 897, 514, 132, 857, 698, - 697, 515, -1, 817, 822, 823, 824, 828, -1, 820, - -1, 817, -1, 820, -1, 81, 166, 514, 809, 515, - -1, 66, 514, 809, 40, 774, 515, -1, 438, 514, - 809, 40, 774, 515, -1, 158, 514, 860, 515, -1, - 302, 514, 862, 515, -1, 320, 514, 864, 515, -1, - 411, 514, 865, 515, -1, 432, 514, 809, 40, 774, - 515, -1, 434, 514, 58, 868, 515, -1, 434, 514, - 232, 868, 515, -1, 434, 514, 429, 868, 515, -1, - 434, 514, 868, 515, -1, 280, 514, 809, 518, 809, - 515, -1, 79, 514, 855, 515, -1, 512, 809, 166, - 542, 198, 809, 513, -1, 512, 809, 166, 542, 198, - 811, 191, 809, 513, -1, 477, 180, 514, 699, 515, - -1, -1, 162, 514, 473, 809, 515, -1, 162, 514, - 809, 515, -1, -1, 155, -1, -1, 475, 826, -1, - -1, 827, -1, 826, 518, 827, -1, 542, 40, 829, - -1, 300, 829, -1, 300, 542, -1, -1, 514, 830, - 831, 698, 832, 515, -1, 542, -1, -1, 309, 59, - 854, -1, -1, 337, 833, 835, -1, 366, 833, 835, - -1, 183, 833, 835, -1, -1, 834, -1, 53, 834, - 36, 834, -1, 441, 323, -1, 441, 165, -1, 104, - 365, -1, 809, 323, -1, 809, 165, -1, 148, 104, - 365, -1, 148, 180, -1, 148, 425, -1, 148, 272, - 297, -1, -1, 365, 514, 855, 515, -1, 365, 514, - 515, -1, 836, -1, 514, 854, 518, 809, 515, -1, - 543, 524, 809, -1, 838, -1, 839, 518, 838, -1, - 839, -1, 839, 518, -1, 809, 524, 809, -1, 841, - -1, 842, 518, 841, -1, 842, -1, 842, 518, -1, - 843, -1, -1, 38, -1, 396, -1, 30, -1, 8, - -1, 847, -1, 505, -1, 506, -1, 507, -1, 508, - -1, 15, -1, 509, -1, 510, -1, 16, -1, 501, - -1, 502, -1, 503, -1, 19, -1, 20, -1, 21, - -1, 8, -1, 291, 514, 851, 515, -1, 846, -1, - 291, 514, 851, 515, -1, 846, -1, 291, 514, 851, - 515, -1, 236, -1, 498, 236, -1, 176, -1, 498, - 176, -1, 193, -1, 498, 193, -1, 846, -1, 542, - 516, 851, -1, 811, -1, 852, 518, 811, -1, 852, - -1, 852, 518, -1, 809, -1, 854, 518, 809, -1, - 854, -1, 854, 518, -1, 855, -1, -1, 858, -1, - 857, 518, 858, -1, 809, -1, 906, 13, 809, -1, - 906, 14, 809, -1, 774, -1, 859, 518, 774, -1, - 861, 171, 809, -1, -1, 3, -1, 796, -1, 797, - -1, 798, -1, 799, -1, 800, -1, 801, -1, 802, - -1, 803, -1, 804, -1, 805, -1, 806, -1, 807, - -1, 544, -1, 809, 863, 866, 867, -1, 809, 863, - 866, -1, 317, 809, -1, 810, 198, 810, -1, -1, - 809, 866, 867, -1, 809, 867, 866, -1, 809, 866, - -1, 809, 867, -1, 854, -1, -1, 171, 809, -1, - 166, 809, -1, 809, 171, 855, -1, 171, 855, -1, - 855, -1, 675, -1, 514, 855, 515, -1, 65, 874, - 871, 873, 143, -1, 872, -1, 871, 872, -1, 472, - 809, 424, 809, -1, 139, 809, -1, -1, 809, -1, - -1, 542, -1, 542, 545, -1, 512, 809, 513, -1, - 512, 876, 524, 876, 513, -1, 512, 876, 524, 876, - 524, 876, 513, -1, 512, 876, 524, 506, 524, 876, - 513, -1, 809, -1, -1, -1, 877, 546, -1, -1, - 514, 515, -1, 514, 857, 515, -1, 516, 547, 878, - -1, 512, 809, 513, -1, 512, 876, 524, 876, 513, - -1, 512, 876, 524, 876, 524, 876, 513, -1, 512, - 876, 524, 506, 524, 876, 513, -1, -1, 880, 879, - -1, 45, -1, -1, 884, -1, -1, 885, -1, 883, - 518, 885, -1, 883, -1, 883, 518, -1, 809, 40, - 907, -1, 809, 3, -1, 809, -1, 148, 514, 894, - 515, -1, 148, 542, -1, 886, -1, -1, 809, 40, - 542, -1, 888, -1, 889, 518, 888, -1, 889, -1, - 889, 518, -1, 352, 514, 890, 515, -1, 352, 888, - -1, -1, 541, -1, 892, 518, 541, -1, 896, -1, - 893, 518, 896, -1, 893, -1, 893, 518, -1, 894, - -1, 514, 894, 515, -1, 543, -1, 901, -1, 542, - 545, -1, 899, -1, 4, -1, 544, 877, -1, 6, - -1, 7, -1, 897, 544, -1, 897, 514, 857, 698, - 697, 515, 544, -1, 778, 544, -1, 794, 514, 809, - 515, 808, -1, 794, 899, 808, -1, 794, 544, 808, - -1, 435, -1, 159, -1, 279, -1, 9, -1, 3, - -1, 978, -1, 983, -1, 3, -1, 978, -1, 980, - -1, 3, -1, 978, -1, 981, -1, 542, -1, 542, - 904, -1, 516, 547, -1, 904, 516, 547, -1, 514, - 894, 515, -1, -1, 900, -1, 548, -1, 5, -1, - 325, 896, 909, 40, 910, -1, 514, 859, 515, -1, - -1, 674, -1, 551, -1, 655, -1, 656, -1, 954, - -1, 966, -1, 100, 370, 541, 912, -1, 100, 370, - 191, 274, 152, 541, 912, -1, 100, 294, 352, 370, - 541, 912, -1, 912, 913, -1, -1, 598, -1, 914, - -1, 576, -1, 973, -1, 100, 920, 202, 917, 918, - 289, 541, 916, 514, 570, 515, 919, 767, -1, 100, - 920, 202, 917, 191, 274, 152, 627, 289, 541, 916, - 514, 570, 515, 919, 767, -1, 542, -1, 454, 915, - -1, -1, 89, -1, -1, 627, -1, -1, 476, 613, - -1, -1, 445, -1, -1, 32, 416, 761, 386, 370, - 896, -1, 32, 416, 191, 152, 761, 386, 370, 896, - -1, 32, 381, 541, 386, 370, 896, -1, 32, 381, - 191, 152, 541, 386, 370, 896, -1, 32, 466, 541, - 386, 370, 896, -1, 32, 466, 191, 152, 541, 386, - 370, 896, -1, 167, 75, 923, -1, 75, 923, -1, - 542, -1, -1, 84, 289, 926, 541, 221, 925, -1, - 84, 289, 82, 809, 221, 925, -1, 544, -1, 279, - -1, 416, -1, 381, -1, 173, -1, 245, -1, 245, - 416, -1, 466, -1, 108, -1, 202, -1, 370, -1, - 439, -1, 154, 108, 544, 664, -1, 154, 108, 542, - 428, 544, 664, -1, 197, 108, 544, -1, 153, 932, - -1, 153, 936, 930, 932, -1, 153, 464, 932, -1, - 153, 514, 935, 515, 932, -1, 464, -1, -1, 937, - -1, 589, -1, -1, 921, -1, 586, -1, 529, -1, - 972, -1, 922, -1, 656, -1, 975, -1, 652, -1, - 911, -1, 576, -1, 598, -1, 572, -1, 540, -1, - 954, -1, 646, -1, 582, -1, 914, -1, 551, -1, - 946, -1, 575, -1, 908, -1, 549, -1, 674, -1, - 595, -1, 655, -1, 949, -1, 963, -1, 940, -1, - 966, -1, 973, -1, 3, -1, 978, -1, 982, -1, - 933, -1, 544, -1, 938, -1, 935, 518, 938, -1, - 35, -1, 34, -1, 435, -1, 159, -1, 289, -1, - 934, -1, 939, 931, -1, 933, -1, 936, -1, 386, - 941, -1, 386, 240, 941, -1, 386, 385, 941, -1, - 386, 177, 941, -1, 942, -1, 970, 171, 104, -1, - 426, 497, 944, -1, 370, 544, -1, 970, 428, 945, - -1, 970, 503, 945, -1, 809, -1, 544, -1, 3, - -1, 794, 544, 808, -1, 794, 514, 899, 515, 544, - -1, 589, -1, 117, -1, 240, -1, 943, -1, 945, - 518, 943, -1, 239, 947, -1, 213, 947, -1, 167, - 213, 947, -1, 213, 947, 171, 948, -1, 167, 213, - 947, 171, 948, -1, 544, -1, 542, -1, 544, -1, - 542, -1, 455, 951, 953, 930, -1, 455, 951, 953, - 930, 541, 905, -1, 455, 951, 953, 930, 958, -1, - 455, 514, 952, 515, -1, 455, 514, 952, 515, 541, - 905, -1, 936, -1, 464, -1, 170, -1, 172, -1, - 3, -1, 172, -1, -1, 950, -1, 952, 518, 950, - -1, 170, -1, -1, 556, 122, 171, 955, 957, 956, - 562, -1, 436, 692, 955, -1, 761, -1, 761, 542, - -1, 761, 40, 542, -1, 473, 809, -1, -1, 454, - 743, -1, -1, 936, 930, -1, 936, 930, 541, 905, - -1, 47, 961, 544, 962, 664, -1, 47, 191, 274, - 152, 961, 544, 962, 664, -1, 128, 548, -1, 128, - 108, 548, -1, 128, 108, 191, 152, 548, -1, 108, - -1, -1, 40, 542, -1, -1, 354, 965, -1, 354, - 240, 965, -1, 354, 385, 965, -1, 354, 177, 965, - -1, 970, -1, 30, -1, 964, -1, 426, 497, -1, - 430, 223, 235, -1, 968, 674, -1, 412, 674, -1, - 412, 971, -1, 968, 971, -1, 968, 426, 497, -1, - 968, 430, 223, 235, -1, 968, 30, 969, -1, 968, - -1, 127, -1, 126, -1, 390, -1, 967, -1, 417, - -1, -1, 542, -1, 970, 516, 542, -1, 542, -1, - 971, 516, 542, -1, 61, 817, -1, 100, 644, 466, - 541, 633, 919, 40, 674, 974, -1, 100, 644, 466, - 191, 274, 152, 541, 633, 919, 40, 674, 974, -1, - 100, 294, 352, 644, 466, 541, 633, 919, 40, 674, - 974, -1, 100, 644, 342, 466, 541, 514, 637, 515, - 919, 40, 674, 974, -1, 100, 294, 352, 644, 342, - 466, 541, 514, 637, 515, 919, 40, 674, 974, -1, - 476, 74, 292, -1, 476, 64, 74, 292, -1, 476, - 240, 74, 292, -1, -1, 100, 644, 416, 977, 40, - 674, 976, -1, 100, 644, 416, 191, 274, 152, 977, - 40, 674, 976, -1, 100, 294, 352, 644, 416, 977, - 40, 674, 976, -1, 476, 107, -1, 476, 272, 107, - -1, -1, 541, 633, 620, 612, -1, 22, -1, 23, - -1, 24, -1, 25, -1, 26, -1, 27, -1, 28, - -1, 29, -1, 31, -1, 32, -1, 33, -1, 43, - -1, 44, -1, 46, -1, 47, -1, 48, -1, 50, - -1, 51, -1, 52, -1, 59, -1, 60, -1, 61, - -1, 62, -1, 63, -1, 64, -1, 67, -1, 68, - -1, 69, -1, 70, -1, 73, -1, 75, -1, 76, - -1, 77, -1, 78, -1, 84, -1, 85, -1, 86, - -1, 87, -1, 88, -1, 90, -1, 91, -1, 92, - -1, 94, -1, 95, -1, 96, -1, 97, -1, 98, - -1, 99, -1, 102, -1, 103, -1, 104, -1, 105, - -1, 106, -1, 107, -1, 108, -1, 109, -1, 110, - -1, 111, -1, 113, -1, 114, -1, 116, -1, 118, - -1, 120, -1, 121, -1, 122, -1, 123, -1, 124, - -1, 125, -1, 128, -1, 129, -1, 130, -1, 131, - -1, 134, -1, 135, -1, 136, -1, 137, -1, 138, - -1, 140, -1, 141, -1, 142, -1, 144, -1, 145, - -1, 146, -1, 148, -1, 149, -1, 150, -1, 151, - -1, 153, -1, 154, -1, 155, -1, 156, -1, 157, - -1, 160, -1, 162, -1, 163, -1, 165, -1, 167, - -1, 169, -1, 173, -1, 174, -1, 177, -1, 179, - -1, 183, -1, 184, -1, 186, -1, 187, -1, 188, - -1, 189, -1, 190, -1, 191, -1, 192, -1, 194, - -1, 195, -1, 196, -1, 197, -1, 199, -1, 200, - -1, 201, -1, 202, -1, 203, -1, 204, -1, 205, - -1, 207, -1, 210, -1, 211, -1, 212, -1, 213, - -1, 214, -1, 220, -1, 223, -1, 225, -1, 226, - -1, 227, -1, 228, -1, 229, -1, 230, -1, 233, - -1, 235, -1, 238, -1, 239, -1, 240, -1, 241, - -1, 242, -1, 243, -1, 244, -1, 245, -1, 247, - -1, 248, -1, 249, -1, 250, -1, 251, -1, 252, - -1, 253, -1, 254, -1, 255, -1, 256, -1, 257, - -1, 258, -1, 259, -1, 260, -1, 261, -1, 262, - -1, 263, -1, 264, -1, 265, -1, 266, -1, 270, - -1, 271, -1, 272, -1, 275, -1, 276, -1, 278, - -1, 281, -1, 283, -1, 284, -1, 285, -1, 287, - -1, 288, -1, 291, -1, 292, -1, 293, -1, 296, - -1, 297, -1, 300, -1, 303, -1, 304, -1, 305, - -1, 306, -1, 307, -1, 308, -1, 309, -1, 310, - -1, 311, -1, 312, -1, 313, -1, 318, -1, 319, - -1, 322, -1, 323, -1, 325, -1, 326, -1, 327, - -1, 329, -1, 330, -1, 331, -1, 332, -1, 333, - -1, 334, -1, 336, -1, 337, -1, 338, -1, 340, - -1, 341, -1, 342, -1, 343, -1, 345, -1, 346, - -1, 347, -1, 348, -1, 349, -1, 350, -1, 351, - -1, 352, -1, 353, -1, 354, -1, 355, -1, 356, - -1, 357, -1, 359, -1, 360, -1, 362, -1, 363, - -1, 364, -1, 366, -1, 367, -1, 368, -1, 369, - -1, 370, -1, 371, -1, 372, -1, 373, -1, 374, - -1, 375, -1, 376, -1, 377, -1, 378, -1, 381, - -1, 382, -1, 383, -1, 384, -1, 385, -1, 386, - -1, 388, -1, 389, -1, 392, -1, 393, -1, 395, - -1, 397, -1, 398, -1, 399, -1, 400, -1, 401, - -1, 402, -1, 403, -1, 404, -1, 405, -1, 406, - -1, 407, -1, 408, -1, 410, -1, 414, -1, 415, - -1, 417, -1, 419, -1, 420, -1, 421, -1, 422, - -1, 423, -1, 425, -1, 430, -1, 431, -1, 433, - -1, 436, -1, 437, -1, 439, -1, 440, -1, 441, - -1, 442, -1, 443, -1, 446, -1, 447, -1, 448, - -1, 450, -1, 451, -1, 452, -1, 453, -1, 455, - -1, 456, -1, 457, -1, 458, -1, 459, -1, 463, - -1, 465, -1, 466, -1, 467, -1, 468, -1, 469, - -1, 470, -1, 471, -1, 474, -1, 477, -1, 478, - -1, 479, -1, 480, -1, 481, -1, 482, -1, 494, - -1, 495, -1, 496, -1, 497, -1, 53, -1, 54, - -1, 56, -1, 57, -1, 71, -1, 72, -1, 79, - -1, 83, -1, 112, -1, 115, -1, 152, -1, 158, - -1, 164, -1, 175, -1, 181, -1, 182, -1, 209, - -1, 215, -1, 216, -1, 218, -1, 246, -1, 267, - -1, 269, -1, 273, -1, 280, -1, 282, -1, 298, - -1, 302, -1, 320, -1, 324, -1, 339, -1, 365, - -1, 387, -1, 394, -1, 409, -1, 411, -1, 426, - -1, 427, -1, 432, -1, 434, -1, 438, -1, 460, - -1, 461, -1, 483, -1, 484, -1, 485, -1, 486, - -1, 487, -1, 488, -1, 489, -1, 490, -1, 491, - -1, 492, -1, 493, -1, 42, -1, 49, -1, 55, - -1, 81, -1, 89, -1, 101, -1, 170, -1, 172, - -1, 175, -1, 176, -1, 193, -1, 208, -1, 221, - -1, 222, -1, 224, -1, 234, -1, 236, -1, 246, - -1, 268, -1, 277, -1, 299, -1, 301, -1, 321, - -1, 361, -1, 391, -1, 409, -1, 418, -1, 464, - -1, 37, -1, 42, -1, 49, -1, 55, -1, 81, - -1, 83, -1, 89, -1, 101, -1, 170, -1, 172, - -1, 176, -1, 193, -1, 208, -1, 221, -1, 222, - -1, 224, -1, 234, -1, 236, -1, 268, -1, 277, - -1, 299, -1, 301, -1, 321, -1, 361, -1, 380, - -1, 391, -1, 418, -1, 438, -1, 464, -1, 37, - -1, 42, -1, 49, -1, 53, -1, 54, -1, 55, - -1, 56, -1, 57, -1, 72, -1, 71, -1, 79, - -1, 81, -1, 83, -1, 89, -1, 101, -1, 112, - -1, 115, -1, 152, -1, 158, -1, 164, -1, 170, - -1, 172, -1, 175, -1, 176, -1, 181, -1, 182, - -1, 193, -1, 208, -1, 209, -1, 216, -1, 218, - -1, 215, -1, 221, -1, 222, -1, 224, -1, 234, - -1, 236, -1, 246, -1, 267, -1, 268, -1, 269, - -1, 273, -1, 277, -1, 280, -1, 282, -1, 299, - -1, 298, -1, 301, -1, 302, -1, 320, -1, 321, - -1, 324, -1, 339, -1, 361, -1, 365, -1, 380, - -1, 387, -1, 391, -1, 394, -1, 409, -1, 411, - -1, 418, -1, 426, -1, 427, -1, 432, -1, 434, - -1, 438, -1, 460, -1, 461, -1, 464, -1, 483, - -1, 484, -1, 485, -1, 486, -1, 487, -1, 488, - -1, 489, -1, 490, -1, 491, -1, 492, -1, 493, - -1, 37, -1, 42, -1, 49, -1, 55, -1, 81, - -1, 83, -1, 89, -1, 101, -1, 170, -1, 172, - -1, 175, -1, 176, -1, 193, -1, 208, -1, 221, - -1, 222, -1, 224, -1, 234, -1, 236, -1, 246, - -1, 268, -1, 277, -1, 299, -1, 301, -1, 321, - -1, 361, -1, 380, -1, 391, -1, 409, -1, 418, - -1, 438, -1, 464, -1, 30, -1, 34, -1, 35, - -1, 36, -1, 38, -1, 39, -1, 40, -1, 41, - -1, 45, -1, 58, -1, 65, -1, 66, -1, 74, - -1, 80, -1, 82, -1, 93, -1, 100, -1, 117, - -1, 119, -1, 126, -1, 127, -1, 132, -1, 133, - -1, 139, -1, 143, -1, 147, -1, 159, -1, 161, - -1, 166, -1, 168, -1, 171, -1, 178, -1, 180, - -1, 185, -1, 198, -1, 206, -1, 217, -1, 219, - -1, 231, -1, 232, -1, 237, -1, 274, -1, 279, - -1, 286, -1, 289, -1, 290, -1, 294, -1, 295, - -1, 314, -1, 315, -1, 316, -1, 317, -1, 328, - -1, 335, -1, 344, -1, 358, -1, 379, -1, 390, - -1, 396, -1, 412, -1, 413, -1, 416, -1, 424, - -1, 428, -1, 429, -1, 435, -1, 444, -1, 445, - -1, 449, -1, 454, -1, 462, -1, 472, -1, 473, - -1, 475, -1, 476, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = { - 0, 502, 502, 518, 530, 539, 540, 541, 542, 543, - 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, - 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, - 574, 575, 576, 577, 578, 580, 9, 18, 27, 36, - 45, 54, 63, 72, 85, 87, 93, 94, 99, 103, - 107, 118, 126, 130, 139, 148, 157, 166, 175, 184, - 192, 200, 209, 218, 227, 236, 253, 262, 271, 280, - 290, 303, 318, 327, 335, 350, 358, 368, 378, 385, - 392, 400, 407, 418, 419, 424, 428, 433, 438, 446, - 447, 452, 456, 457, 458, 7, 13, 19, 25, 9, - 13, 44, 45, 46, 50, 51, 55, 59, 60, 64, - 70, 75, 76, 77, 78, 6, 15, 25, 35, 45, - 55, 65, 75, 85, 95, 106, 117, 127, 140, 141, - 9, 23, 29, 36, 42, 49, 59, 63, 71, 72, - 73, 77, 86, 95, 102, 103, 108, 120, 125, 150, - 155, 160, 166, 176, 186, 192, 203, 214, 229, 230, - 236, 237, 242, 243, 249, 250, 254, 255, 260, 262, - 268, 269, 273, 274, 277, 278, 283, 7, 16, 25, - 46, 47, 50, 54, 7, 14, 22, 9, 19, 29, - 42, 43, 7, 17, 27, 40, 41, 45, 46, 47, - 51, 52, 7, 14, 31, 51, 55, 65, 69, 75, - 76, 9, 17, 29, 30, 34, 35, 36, 41, 42, - 43, 48, 52, 56, 60, 64, 68, 72, 76, 80, - 84, 88, 92, 97, 101, 105, 112, 113, 117, 118, - 119, 7, 16, 28, 29, 2, 9, 15, 21, 28, - 35, 45, 46, 47, 2, 7, 21, 36, 56, 57, - 84, 85, 86, 87, 88, 89, 93, 94, 99, 104, - 105, 106, 107, 108, 113, 120, 121, 122, 139, 146, - 153, 163, 173, 185, 193, 202, 220, 221, 225, 226, - 230, 239, 262, 276, 283, 288, 290, 292, 294, 297, - 300, 301, 302, 303, 308, 312, 313, 318, 325, 330, - 331, 332, 333, 334, 335, 336, 337, 343, 344, 348, - 353, 360, 367, 374, 386, 387, 388, 389, 393, 398, - 399, 400, 405, 410, 411, 412, 413, 414, 415, 420, - 440, 469, 470, 474, 478, 479, 480, 484, 488, 496, - 497, 502, 503, 504, 508, 516, 517, 522, 523, 527, - 532, 536, 540, 545, 553, 554, 558, 559, 563, 564, - 570, 581, 594, 608, 622, 636, 650, 673, 677, 684, - 688, 696, 701, 708, 718, 719, 720, 721, 722, 729, - 736, 737, 742, 743, 9, 19, 29, 39, 49, 59, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 95, 96, - 97, 98, 99, 100, 105, 106, 111, 112, 113, 118, - 119, 120, 8, 20, 33, 46, 58, 70, 86, 87, - 91, 95, 7, 1, 30, 49, 61, 62, 63, 67, - 68, 73, 77, 82, 86, 94, 95, 99, 100, 105, - 106, 110, 111, 116, 117, 118, 119, 120, 121, 122, - 127, 135, 139, 144, 145, 150, 154, 159, 163, 167, - 171, 175, 179, 183, 187, 191, 195, 199, 203, 207, - 211, 215, 219, 227, 232, 233, 234, 235, 236, 242, - 246, 47, 48, 52, 53, 54, 72, 73, 80, 88, - 96, 104, 112, 120, 131, 132, 159, 164, 172, 188, - 205, 222, 239, 240, 259, 263, 267, 271, 275, 285, - 296, 306, 315, 326, 337, 349, 364, 382, 382, 386, - 386, 390, 390, 394, 400, 407, 411, 412, 416, 417, - 431, 438, 445, 455, 456, 459, 472, 473, 474, 478, - 489, 497, 502, 507, 512, 517, 525, 533, 538, 543, - 550, 551, 555, 556, 557, 561, 568, 569, 573, 574, - 578, 579, 580, 584, 585, 589, 590, 606, 607, 610, - 619, 630, 631, 632, 635, 636, 637, 641, 642, 643, - 644, 648, 649, 653, 655, 671, 673, 678, 681, 689, - 693, 697, 701, 705, 709, 716, 721, 728, 729, 733, - 738, 742, 746, 754, 761, 762, 767, 768, 772, 773, - 778, 780, 782, 787, 807, 808, 810, 815, 816, 820, - 821, 824, 825, 850, 851, 856, 860, 861, 865, 866, - 870, 871, 872, 873, 874, 878, 891, 898, 905, 912, - 913, 917, 918, 922, 923, 927, 928, 932, 933, 937, - 938, 942, 953, 954, 955, 956, 960, 961, 966, 967, - 968, 977, 983, 992, 993, 1006, 1007, 1011, 1012, 1016, - 1017, 1023, 1029, 1037, 1046, 1054, 1063, 1072, 1076, 1081, - 1092, 1106, 1107, 1110, 1111, 1112, 1115, 1123, 1132, 1133, - 1134, 1135, 1138, 1146, 1155, 1159, 1166, 1167, 1171, 1180, - 1184, 1209, 1213, 1226, 1240, 1255, 1267, 1280, 1294, 1308, - 1321, 1336, 1355, 1361, 1366, 1372, 1379, 1380, 1388, 1392, - 1396, 1402, 1409, 1414, 1415, 1416, 1417, 1418, 1419, 1423, - 1424, 1436, 1437, 1442, 1449, 1456, 1463, 1495, 1506, 1519, - 1524, 1525, 1528, 1529, 1532, 1533, 1538, 1539, 1544, 1548, - 1554, 1575, 1583, 1596, 1599, 1603, 1603, 1606, 1607, 1609, - 1614, 1621, 1626, 1632, 1637, 1643, 1647, 1654, 1661, 1671, - 1672, 1676, 1678, 1681, 1685, 1686, 1687, 1688, 1689, 1690, - 1695, 1715, 1716, 1717, 1718, 1729, 1743, 1744, 1750, 1755, - 1760, 1765, 1770, 1775, 1780, 1785, 1791, 1797, 1803, 1810, - 1832, 1841, 1845, 1853, 1857, 1865, 1877, 1898, 1902, 1908, - 1912, 1925, 1933, 1943, 1945, 1947, 1949, 1951, 1953, 1958, - 1959, 1966, 1975, 1983, 1992, 2003, 2011, 2012, 2013, 2017, - 2017, 2020, 2020, 2023, 2023, 2026, 2026, 2029, 2029, 2032, - 2032, 2035, 2035, 2038, 2038, 2041, 2041, 2044, 2044, 2047, - 2047, 2050, 2050, 2053, 2055, 2057, 2059, 2061, 2063, 2065, - 2067, 2069, 2071, 2073, 2075, 2077, 2082, 2087, 2093, 2100, - 2105, 2111, 2117, 2148, 2150, 2152, 2160, 2175, 2177, 2179, - 2181, 2183, 2185, 2187, 2189, 2191, 2193, 2195, 2197, 2199, - 2201, 2203, 2205, 2208, 2210, 2212, 2215, 2217, 2219, 2221, - 2223, 2228, 2233, 2240, 2245, 2252, 2257, 2264, 2269, 2277, - 2285, 2293, 2301, 2319, 2327, 2335, 2343, 2351, 2359, 2367, - 2371, 2387, 2395, 2403, 2411, 2419, 2427, 2435, 2439, 2443, - 2447, 2451, 2459, 2467, 2475, 2483, 2503, 2525, 2536, 2543, - 2557, 2565, 2573, 2593, 2595, 2597, 2599, 2601, 2603, 2605, - 2607, 2609, 2611, 2613, 2615, 2617, 2619, 2621, 2623, 2625, - 2627, 2629, 2631, 2633, 2635, 2639, 2643, 2647, 2661, 2662, - 2676, 2677, 2678, 2689, 2713, 2724, 2734, 2738, 2742, 2749, - 2753, 2760, 2764, 2781, 2785, 2787, 2790, 2793, 2804, 2809, - 2816, 2822, 2828, 2837, 2841, 2848, 2856, 2864, 2875, 2895, - 2931, 2942, 2943, 2950, 2956, 2958, 2960, 2964, 2973, 2978, - 2985, 3000, 3007, 3011, 3015, 3019, 3023, 3033, 3042, 3064, - 3065, 3069, 3070, 3071, 3075, 3076, 3083, 3084, 3088, 3089, - 3094, 3102, 3104, 3118, 3121, 3148, 3149, 3152, 3153, 3161, - 3169, 3177, 3186, 3196, 3214, 3260, 3269, 3278, 3287, 3296, - 3308, 3309, 3310, 3311, 3312, 3326, 3327, 3330, 3331, 3335, - 3345, 3346, 3350, 3351, 3355, 3362, 3363, 3368, 3369, 3374, - 3375, 3378, 3379, 3380, 3383, 3384, 3387, 3388, 3389, 3390, - 3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, - 3403, 3405, 3410, 3412, 3417, 3419, 3421, 3423, 3425, 3427, - 3429, 3431, 3445, 3447, 3452, 3456, 3463, 3468, 3474, 3478, - 3485, 3490, 3497, 3502, 3510, 3514, 3520, 3524, 3533, 3544, - 3545, 3549, 3553, 3560, 3561, 3562, 3563, 3564, 3565, 3566, - 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3583, 3587, 3594, - 3601, 3602, 3618, 3622, 3627, 3631, 3646, 3651, 3655, 3658, - 3661, 3662, 3663, 3666, 3673, 3683, 3697, 3698, 3702, 3713, - 3714, 3717, 3718, 3721, 3725, 3732, 3740, 3748, 3756, 3766, - 3767, 3772, 3773, 3777, 3778, 3779, 3783, 3792, 3800, 3808, - 3817, 3832, 3833, 3838, 3839, 3849, 3850, 3854, 3855, 3859, - 3860, 3863, 3879, 3887, 3897, 3898, 3901, 3902, 3905, 3909, - 3910, 3914, 3915, 3918, 3919, 3920, 3930, 3931, 3935, 3937, - 3943, 3944, 3948, 3949, 3952, 3963, 3966, 3977, 3981, 3985, - 3997, 4001, 4010, 4017, 4055, 4059, 4063, 4067, 4071, 4075, - 4079, 4085, 4102, 4103, 4104, 4107, 4108, 4109, 4112, 4113, - 4114, 4117, 4118, 4121, 4123, 4128, 4129, 4132, 4136, 4137, - 7, 18, 19, 23, 24, 25, 26, 27, 28, 7, - 26, 50, 73, 80, 85, 86, 87, 88, 8, 33, - 62, 66, 67, 72, 73, 78, 79, 83, 84, 89, - 90, 7, 16, 25, 34, 43, 52, 5, 12, 22, - 23, 7, 15, 26, 27, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 7, 19, 33, 9, 16, - 26, 33, 44, 45, 50, 51, 52, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 90, 91, 92, - 97, 98, 103, 107, 115, 116, 121, 122, 123, 129, - 134, 142, 143, 10, 16, 22, 28, 38, 39, 47, - 58, 70, 78, 89, 95, 99, 103, 118, 125, 126, - 127, 131, 132, 7, 15, 22, 29, 36, 45, 46, - 48, 49, 8, 22, 36, 48, 56, 70, 71, 72, - 73, 74, 87, 88, 93, 94, 98, 99, 7, 18, - 31, 35, 42, 53, 54, 60, 61, 9, 19, 7, - 16, 28, 35, 42, 51, 52, 56, 57, 2, 7, - 12, 17, 26, 33, 43, 44, 51, 3, 10, 17, - 24, 31, 38, 45, 52, 61, 61, 63, 63, 65, - 65, 67, 68, 72, 73, 6, 8, 21, 34, 47, - 65, 87, 88, 89, 90, 11, 24, 37, 54, 55, - 56, 61, 74, 74, 74, 74, 74, 74, 74, 74, + 0, 504, 504, 520, 532, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 583, 9, 18, 27, + 36, 45, 54, 63, 72, 85, 87, 93, 94, 99, + 103, 107, 118, 126, 130, 139, 148, 157, 166, 175, + 184, 192, 200, 209, 218, 227, 236, 253, 262, 271, + 280, 290, 303, 318, 327, 335, 350, 358, 368, 378, + 385, 392, 400, 407, 418, 419, 424, 428, 433, 438, + 446, 447, 452, 456, 457, 458, 7, 13, 19, 25, + 9, 13, 44, 45, 46, 50, 51, 55, 59, 60, + 64, 70, 75, 76, 77, 78, 6, 15, 25, 35, + 45, 55, 65, 75, 85, 95, 106, 117, 127, 140, + 141, 9, 23, 29, 36, 42, 49, 59, 63, 71, + 72, 73, 77, 86, 95, 102, 103, 108, 120, 125, + 150, 155, 160, 166, 176, 186, 192, 203, 214, 229, + 230, 236, 237, 242, 243, 249, 250, 254, 255, 260, + 262, 268, 269, 273, 274, 277, 278, 283, 7, 16, + 25, 46, 47, 50, 54, 7, 14, 22, 9, 19, + 29, 42, 43, 7, 17, 27, 40, 41, 45, 46, + 47, 51, 52, 7, 7, 14, 31, 51, 55, 65, + 69, 75, 76, 9, 17, 29, 30, 34, 35, 36, + 41, 42, 43, 48, 52, 56, 60, 64, 68, 72, + 76, 80, 84, 88, 92, 97, 101, 105, 112, 113, + 117, 118, 119, 7, 16, 28, 29, 2, 9, 15, + 21, 28, 35, 45, 46, 47, 2, 7, 21, 36, + 56, 57, 84, 85, 86, 87, 88, 89, 93, 94, + 99, 104, 105, 106, 107, 108, 113, 120, 121, 122, + 139, 146, 153, 163, 173, 185, 193, 202, 220, 221, + 225, 226, 230, 239, 262, 276, 283, 288, 290, 292, + 294, 297, 300, 301, 302, 303, 308, 312, 313, 318, + 325, 330, 331, 332, 333, 334, 335, 336, 337, 343, + 344, 348, 353, 360, 367, 374, 386, 387, 388, 389, + 393, 398, 399, 400, 405, 410, 411, 412, 413, 414, + 415, 420, 440, 469, 470, 474, 478, 479, 480, 484, + 488, 496, 497, 502, 503, 504, 508, 516, 517, 522, + 523, 527, 532, 536, 540, 545, 553, 554, 558, 559, + 563, 564, 570, 581, 594, 608, 622, 636, 650, 673, + 677, 684, 688, 696, 701, 708, 718, 719, 720, 721, + 722, 729, 736, 737, 742, 743, 9, 19, 29, 39, + 49, 59, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 95, 96, 97, 98, 99, 100, 105, 106, 111, 112, + 113, 118, 119, 120, 8, 20, 33, 46, 58, 70, + 86, 87, 91, 95, 7, 1, 30, 49, 61, 62, + 63, 67, 68, 73, 77, 82, 86, 94, 95, 99, + 100, 105, 106, 110, 111, 116, 117, 118, 119, 120, + 121, 122, 127, 135, 139, 144, 145, 150, 154, 159, + 163, 167, 171, 175, 179, 183, 187, 191, 195, 199, + 203, 207, 211, 215, 219, 227, 232, 233, 234, 235, + 236, 242, 246, 47, 48, 52, 53, 54, 72, 73, + 80, 88, 96, 104, 112, 120, 131, 132, 159, 164, + 172, 188, 205, 222, 239, 240, 259, 263, 267, 271, + 275, 285, 296, 306, 315, 326, 337, 349, 364, 382, + 382, 386, 386, 390, 390, 394, 400, 407, 411, 412, + 416, 417, 431, 438, 445, 455, 456, 459, 472, 473, + 474, 478, 489, 497, 502, 507, 512, 517, 525, 533, + 538, 543, 550, 551, 555, 556, 557, 561, 568, 569, + 573, 574, 578, 579, 580, 584, 585, 589, 590, 606, + 607, 610, 619, 630, 631, 632, 635, 636, 637, 641, + 642, 643, 644, 648, 649, 653, 655, 671, 673, 678, + 681, 689, 693, 697, 701, 705, 709, 716, 721, 728, + 729, 733, 738, 742, 746, 754, 761, 762, 767, 768, + 772, 773, 778, 780, 782, 787, 807, 808, 810, 815, + 816, 820, 821, 824, 825, 850, 851, 856, 860, 861, + 865, 866, 870, 871, 872, 873, 874, 878, 891, 898, + 905, 912, 913, 917, 918, 922, 923, 927, 928, 932, + 933, 937, 938, 942, 953, 954, 955, 956, 960, 961, + 966, 967, 968, 977, 983, 992, 993, 1006, 1007, 1011, + 1012, 1016, 1017, 1023, 1029, 1037, 1046, 1054, 1063, 1072, + 1076, 1081, 1092, 1106, 1107, 1110, 1111, 1112, 1115, 1123, + 1132, 1133, 1134, 1135, 1138, 1146, 1155, 1159, 1166, 1167, + 1171, 1180, 1184, 1209, 1213, 1226, 1240, 1255, 1267, 1280, + 1294, 1308, 1321, 1336, 1355, 1361, 1366, 1372, 1379, 1380, + 1388, 1392, 1396, 1402, 1409, 1414, 1415, 1416, 1417, 1418, + 1419, 1423, 1424, 1436, 1437, 1442, 1449, 1456, 1463, 1495, + 1506, 1519, 1524, 1525, 1528, 1529, 1532, 1533, 1538, 1539, + 1544, 1548, 1554, 1575, 1583, 1596, 1599, 1603, 1603, 1606, + 1607, 1609, 1614, 1621, 1626, 1632, 1637, 1643, 1647, 1654, + 1661, 1671, 1672, 1676, 1678, 1681, 1685, 1686, 1687, 1688, + 1689, 1690, 1695, 1715, 1716, 1717, 1718, 1729, 1743, 1744, + 1750, 1755, 1760, 1765, 1770, 1775, 1780, 1785, 1791, 1797, + 1803, 1810, 1832, 1841, 1845, 1853, 1857, 1865, 1877, 1898, + 1902, 1908, 1912, 1925, 1933, 1943, 1945, 1947, 1949, 1951, + 1953, 1958, 1959, 1966, 1975, 1983, 1992, 2003, 2011, 2012, + 2013, 2017, 2017, 2020, 2020, 2023, 2023, 2026, 2026, 2029, + 2029, 2032, 2032, 2035, 2035, 2038, 2038, 2041, 2041, 2044, + 2044, 2047, 2047, 2050, 2050, 2053, 2053, 2056, 2058, 2060, + 2062, 2064, 2066, 2068, 2070, 2072, 2074, 2076, 2078, 2080, + 2082, 2087, 2092, 2098, 2105, 2110, 2116, 2122, 2153, 2155, + 2157, 2165, 2180, 2182, 2184, 2186, 2188, 2190, 2192, 2194, + 2196, 2198, 2200, 2202, 2204, 2206, 2208, 2210, 2213, 2215, + 2217, 2220, 2222, 2224, 2226, 2228, 2233, 2238, 2245, 2250, + 2257, 2262, 2269, 2274, 2282, 2290, 2298, 2306, 2324, 2332, + 2340, 2348, 2356, 2364, 2372, 2376, 2392, 2400, 2408, 2416, + 2424, 2432, 2440, 2444, 2448, 2452, 2456, 2464, 2472, 2480, + 2488, 2508, 2530, 2541, 2548, 2562, 2570, 2578, 2598, 2600, + 2602, 2604, 2606, 2608, 2610, 2612, 2614, 2616, 2618, 2620, + 2622, 2624, 2626, 2628, 2630, 2632, 2634, 2636, 2638, 2640, + 2644, 2648, 2652, 2666, 2667, 2681, 2682, 2683, 2694, 2718, + 2729, 2739, 2743, 2747, 2754, 2758, 2765, 2769, 2786, 2790, + 2792, 2795, 2798, 2809, 2814, 2821, 2827, 2833, 2842, 2846, + 2853, 2861, 2869, 2880, 2900, 2936, 2947, 2948, 2955, 2961, + 2963, 2965, 2969, 2978, 2983, 2990, 3005, 3012, 3016, 3020, + 3024, 3028, 3038, 3047, 3069, 3070, 3074, 3075, 3076, 3080, + 3081, 3088, 3089, 3093, 3094, 3099, 3107, 3109, 3123, 3126, + 3153, 3154, 3157, 3158, 3166, 3174, 3182, 3191, 3201, 3219, + 3265, 3274, 3283, 3292, 3301, 3313, 3314, 3315, 3316, 3317, + 3331, 3332, 3335, 3336, 3340, 3350, 3351, 3355, 3356, 3360, + 3367, 3368, 3373, 3374, 3379, 3380, 3383, 3384, 3385, 3388, + 3389, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, + 3401, 3402, 3403, 3404, 3405, 3408, 3410, 3415, 3417, 3422, + 3424, 3426, 3428, 3430, 3432, 3434, 3436, 3450, 3452, 3457, + 3461, 3468, 3473, 3479, 3483, 3490, 3495, 3502, 3507, 3515, + 3519, 3525, 3529, 3538, 3549, 3550, 3554, 3558, 3565, 3566, + 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3576, + 3577, 3578, 3579, 3589, 3593, 3600, 3607, 3608, 3624, 3628, + 3633, 3637, 3652, 3657, 3661, 3664, 3667, 3668, 3669, 3672, + 3679, 3689, 3703, 3704, 3708, 3719, 3720, 3723, 3724, 3727, + 3731, 3738, 3746, 3754, 3762, 3772, 3773, 3778, 3779, 3783, + 3784, 3785, 3789, 3798, 3806, 3814, 3823, 3838, 3839, 3844, + 3845, 3855, 3856, 3860, 3861, 3865, 3866, 3869, 3885, 3893, + 3903, 3904, 3907, 3908, 3911, 3915, 3916, 3920, 3921, 3924, + 3925, 3926, 3936, 3937, 3941, 3943, 3949, 3950, 3954, 3955, + 3958, 3969, 3972, 3983, 3987, 3991, 4003, 4007, 4016, 4023, + 4061, 4065, 4069, 4073, 4077, 4081, 4085, 4091, 4108, 4109, + 4110, 4113, 4114, 4115, 4118, 4119, 4120, 4123, 4124, 4127, + 4129, 4134, 4135, 4138, 4142, 4143, 7, 18, 19, 23, + 24, 25, 26, 27, 28, 7, 26, 50, 73, 80, + 85, 86, 87, 88, 8, 33, 62, 66, 67, 72, + 73, 78, 79, 83, 84, 89, 90, 7, 16, 25, + 34, 43, 52, 5, 12, 22, 23, 7, 15, 26, + 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 7, 19, 33, 9, 16, 26, 33, 44, 45, + 50, 51, 52, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 91, 92, 93, 98, 99, 104, + 108, 116, 117, 122, 123, 124, 130, 135, 143, 144, + 10, 16, 22, 28, 38, 39, 47, 58, 70, 78, + 89, 95, 99, 103, 118, 125, 126, 127, 131, 132, + 7, 17, 26, 35, 46, 47, 49, 50, 53, 54, + 55, 8, 22, 36, 48, 56, 70, 71, 72, 73, + 74, 87, 88, 93, 94, 98, 99, 7, 18, 31, + 35, 42, 53, 54, 60, 61, 9, 19, 7, 16, + 28, 35, 42, 51, 52, 56, 57, 2, 7, 12, + 17, 26, 33, 43, 44, 51, 3, 10, 17, 24, + 31, 38, 45, 52, 61, 61, 63, 63, 65, 65, + 67, 68, 72, 73, 6, 8, 21, 34, 47, 65, + 87, 88, 89, 90, 11, 24, 37, 54, 55, 56, + 61, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, @@ -2707,18 +1878,18 @@ static const yytype_uint16 yyrline[] = 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, + 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, + 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 77, 77, 77, 77, 77, 77, + 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, + 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, @@ -2726,10 +1897,10 @@ static const yytype_uint16 yyrline[] = 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, + 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, + 79, 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, @@ -2737,69 +1908,78 @@ static const yytype_uint16 yyrline[] = 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80 + 80, 80, 80 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "IDENT", "FCONST", "SCONST", "BCONST", - "XCONST", "Op", "ICONST", "PARAM", "TYPECAST", "DOT_DOT", "COLON_EQUALS", - "EQUALS_GREATER", "INTEGER_DIVISION", "POWER_OF", "LAMBDA_ARROW", - "DOUBLE_ARROW", "LESS_EQUALS", "GREATER_EQUALS", "NOT_EQUALS", "ABORT_P", - "ABSOLUTE_P", "ACCESS", "ACTION", "ADD_P", "ADMIN", "AFTER", "AGGREGATE", - "ALL", "ALSO", "ALTER", "ALWAYS", "ANALYSE", "ANALYZE", "AND", "ANTI", - "ANY", "ARRAY", "AS", "ASC_P", "ASOF", "ASSERTION", "ASSIGNMENT", - "ASYMMETRIC", "AT", "ATTACH", "ATTRIBUTE", "AUTHORIZATION", "BACKWARD", - "BEFORE", "BEGIN_P", "BETWEEN", "BIGINT", "BINARY", "BIT", "BOOLEAN_P", - "BOTH", "BY", "CACHE", "CALL_P", "CALLED", "CASCADE", "CASCADED", "CASE", - "CAST", "CATALOG_P", "CENTURIES_P", "CENTURY_P", "CHAIN", "CHAR_P", - "CHARACTER", "CHARACTERISTICS", "CHECK_P", "CHECKPOINT", "CLASS", - "CLOSE", "CLUSTER", "COALESCE", "COLLATE", "COLLATION", "COLUMN", - "COLUMNS", "COMMENT", "COMMENTS", "COMMIT", "COMMITTED", "COMPRESSION", - "CONCURRENTLY", "CONFIGURATION", "CONFLICT", "CONNECTION", "CONSTRAINT", - "CONSTRAINTS", "CONTENT_P", "CONTINUE_P", "CONVERSION_P", "COPY", "COST", - "CREATE_P", "CROSS", "CSV", "CUBE", "CURRENT_P", "CURSOR", "CYCLE", - "DATA_P", "DATABASE", "DAY_P", "DAYS_P", "DEALLOCATE", "DEC", "DECADE_P", + "\"end of file\"", "error", "\"invalid token\"", "IDENT", "FCONST", + "SCONST", "BCONST", "XCONST", "Op", "ICONST", "PARAM", "TYPECAST", + "DOT_DOT", "COLON_EQUALS", "EQUALS_GREATER", "INTEGER_DIVISION", + "POWER_OF", "LAMBDA_ARROW", "DOUBLE_ARROW", "LESS_EQUALS", + "GREATER_EQUALS", "NOT_EQUALS", "ABORT_P", "ABSOLUTE_P", "ACCESS", + "ACTION", "ADD_P", "ADMIN", "AFTER", "AGGREGATE", "ALL", "ALSO", "ALTER", + "ALWAYS", "ANALYSE", "ANALYZE", "AND", "ANTI", "ANY", "ARRAY", "AS", + "ASC_P", "ASOF", "ASSERTION", "ASSIGNMENT", "ASYMMETRIC", "AT", "ATTACH", + "ATTRIBUTE", "AUTHORIZATION", "BACKWARD", "BEFORE", "BEGIN_P", "BETWEEN", + "BIGINT", "BINARY", "BIT", "BOOLEAN_P", "BOTH", "BY", "CACHE", "CALL_P", + "CALLED", "CASCADE", "CASCADED", "CASE", "CAST", "CATALOG_P", + "CENTURIES_P", "CENTURY_P", "CHAIN", "CHAR_P", "CHARACTER", + "CHARACTERISTICS", "CHECK_P", "CHECKPOINT", "CLASS", "CLOSE", "CLUSTER", + "COALESCE", "COLLATE", "COLLATION", "COLUMN", "COLUMNS", "COMMENT", + "COMMENTS", "COMMIT", "COMMITTED", "COMPRESSION", "CONCURRENTLY", + "CONFIGURATION", "CONFLICT", "CONNECTION", "CONSTRAINT", "CONSTRAINTS", + "CONTENT_P", "CONTINUE_P", "CONVERSION_P", "COPY", "COST", "CREATE_P", + "CROSS", "CSV", "CUBE", "CURRENT_P", "CURSOR", "CYCLE", "DATA_P", + "DATABASE", "DAY_P", "DAYS_P", "DEALLOCATE", "DEC", "DECADE_P", "DECADES_P", "DECIMAL_P", "DECLARE", "DEFAULT", "DEFAULTS", "DEFERRABLE", "DEFERRED", "DEFINER", "DELETE_P", "DELIMITER", "DELIMITERS", "DEPENDS", "DESC_P", "DESCRIBE", "DETACH", "DICTIONARY", "DISABLE_P", "DISCARD", "DISTINCT", "DO", "DOCUMENT_P", "DOMAIN_P", "DOUBLE_P", "DROP", "EACH", "ELSE", "ENABLE_P", "ENCODING", "ENCRYPTED", "END_P", "ENUM_P", "ESCAPE", "EVENT", "EXCEPT", "EXCLUDE", "EXCLUDING", "EXCLUSIVE", "EXECUTE", - "EXISTS", "EXPLAIN", "EXPORT_P", "EXPORT_STATE", "EXTENSION", "EXTERNAL", - "EXTRACT", "FALSE_P", "FAMILY", "FETCH", "FILTER", "FIRST_P", "FLOAT_P", - "FOLLOWING", "FOR", "FORCE", "FOREIGN", "FORWARD", "FREEZE", "FROM", - "FULL", "FUNCTION", "FUNCTIONS", "GENERATED", "GLOB", "GLOBAL", "GRANT", - "GRANTED", "GROUP_P", "GROUPING", "GROUPING_ID", "GROUPS", "HANDLER", - "HAVING", "HEADER_P", "HOLD", "HOUR_P", "HOURS_P", "IDENTITY_P", "IF_P", - "IGNORE_P", "ILIKE", "IMMEDIATE", "IMMUTABLE", "IMPLICIT_P", "IMPORT_P", - "IN_P", "INCLUDE_P", "INCLUDING", "INCREMENT", "INDEX", "INDEXES", - "INHERIT", "INHERITS", "INITIALLY", "INLINE_P", "INNER_P", "INOUT", - "INPUT_P", "INSENSITIVE", "INSERT", "INSTALL", "INSTEAD", "INT_P", - "INTEGER", "INTERSECT", "INTERVAL", "INTO", "INVOKER", "IS", "ISNULL", - "ISOLATION", "JOIN", "JSON", "KEY", "LABEL", "LANGUAGE", "LARGE_P", - "LAST_P", "LATERAL_P", "LEADING", "LEAKPROOF", "LEFT", "LEVEL", "LIKE", - "LIMIT", "LISTEN", "LOAD", "LOCAL", "LOCATION", "LOCK_P", "LOCKED", - "LOGGED", "MACRO", "MAP", "MAPPING", "MATCH", "MATERIALIZED", "MAXVALUE", - "METHOD", "MICROSECOND_P", "MICROSECONDS_P", "MILLENNIA_P", - "MILLENNIUM_P", "MILLISECOND_P", "MILLISECONDS_P", "MINUTE_P", - "MINUTES_P", "MINVALUE", "MODE", "MONTH_P", "MONTHS_P", "MOVE", "NAME_P", - "NAMES", "NATIONAL", "NATURAL", "NCHAR", "NEW", "NEXT", "NO", "NONE", - "NOT", "NOTHING", "NOTIFY", "NOTNULL", "NOWAIT", "NULL_P", "NULLIF", - "NULLS_P", "NUMERIC", "OBJECT_P", "OF", "OFF", "OFFSET", "OIDS", "OLD", - "ON", "ONLY", "OPERATOR", "OPTION", "OPTIONS", "OR", "ORDER", - "ORDINALITY", "OTHERS", "OUT_P", "OUTER_P", "OVER", "OVERLAPS", - "OVERLAY", "OVERRIDING", "OWNED", "OWNER", "PARALLEL", "PARSER", - "PARTIAL", "PARTITION", "PASSING", "PASSWORD", "PERCENT", "PERSISTENT", - "PIVOT", "PIVOT_LONGER", "PIVOT_WIDER", "PLACING", "PLANS", "POLICY", - "POSITION", "POSITIONAL", "PRAGMA_P", "PRECEDING", "PRECISION", - "PREPARE", "PREPARED", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES", - "PROCEDURAL", "PROCEDURE", "PROGRAM", "PUBLICATION", "QUALIFY", "QUOTE", - "RANGE", "READ_P", "REAL", "REASSIGN", "RECHECK", "RECURSIVE", "REF", + "EXISTS", "EXPLAIN", "EXPORT_P", "EXPORT_STATE", "EXTENSION", + "EXTENSIONS", "EXTERNAL", "EXTRACT", "FALSE_P", "FAMILY", "FETCH", + "FILTER", "FIRST_P", "FLOAT_P", "FOLLOWING", "FOR", "FORCE", "FOREIGN", + "FORWARD", "FREEZE", "FROM", "FULL", "FUNCTION", "FUNCTIONS", + "GENERATED", "GLOB", "GLOBAL", "GRANT", "GRANTED", "GROUP_P", "GROUPING", + "GROUPING_ID", "GROUPS", "HANDLER", "HAVING", "HEADER_P", "HOLD", + "HOUR_P", "HOURS_P", "IDENTITY_P", "IF_P", "IGNORE_P", "ILIKE", + "IMMEDIATE", "IMMUTABLE", "IMPLICIT_P", "IMPORT_P", "IN_P", "INCLUDE_P", + "INCLUDING", "INCREMENT", "INDEX", "INDEXES", "INHERIT", "INHERITS", + "INITIALLY", "INLINE_P", "INNER_P", "INOUT", "INPUT_P", "INSENSITIVE", + "INSERT", "INSTALL", "INSTEAD", "INT_P", "INTEGER", "INTERSECT", + "INTERVAL", "INTO", "INVOKER", "IS", "ISNULL", "ISOLATION", "JOIN", + "JSON", "KEY", "LABEL", "LANGUAGE", "LARGE_P", "LAST_P", "LATERAL_P", + "LEADING", "LEAKPROOF", "LEFT", "LEVEL", "LIKE", "LIMIT", "LISTEN", + "LOAD", "LOCAL", "LOCATION", "LOCK_P", "LOCKED", "LOGGED", "MACRO", + "MAP", "MAPPING", "MATCH", "MATERIALIZED", "MAXVALUE", "METHOD", + "MICROSECOND_P", "MICROSECONDS_P", "MILLENNIA_P", "MILLENNIUM_P", + "MILLISECOND_P", "MILLISECONDS_P", "MINUTE_P", "MINUTES_P", "MINVALUE", + "MODE", "MONTH_P", "MONTHS_P", "MOVE", "NAME_P", "NAMES", "NATIONAL", + "NATURAL", "NCHAR", "NEW", "NEXT", "NO", "NONE", "NOT", "NOTHING", + "NOTIFY", "NOTNULL", "NOWAIT", "NULL_P", "NULLIF", "NULLS_P", "NUMERIC", + "OBJECT_P", "OF", "OFF", "OFFSET", "OIDS", "OLD", "ON", "ONLY", + "OPERATOR", "OPTION", "OPTIONS", "OR", "ORDER", "ORDINALITY", "OTHERS", + "OUT_P", "OUTER_P", "OVER", "OVERLAPS", "OVERLAY", "OVERRIDING", "OWNED", + "OWNER", "PARALLEL", "PARSER", "PARTIAL", "PARTITION", "PASSING", + "PASSWORD", "PERCENT", "PERSISTENT", "PIVOT", "PIVOT_LONGER", + "PIVOT_WIDER", "PLACING", "PLANS", "POLICY", "POSITION", "POSITIONAL", + "PRAGMA_P", "PRECEDING", "PRECISION", "PREPARE", "PREPARED", "PRESERVE", + "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURAL", "PROCEDURE", "PROGRAM", + "PUBLICATION", "QUALIFY", "QUARTER_P", "QUARTERS_P", "QUOTE", "RANGE", + "READ_P", "REAL", "REASSIGN", "RECHECK", "RECURSIVE", "REF", "REFERENCES", "REFERENCING", "REFRESH", "REINDEX", "RELATIVE_P", "RELEASE", "RENAME", "REPEATABLE", "REPLACE", "REPLICA", "RESET", "RESPECT_P", "RESTART", "RESTRICT", "RETURNING", "RETURNS", "REVOKE", @@ -2829,27 +2009,25 @@ static const char *const yytname[] = "POSTFIXOP", "'+'", "'-'", "'*'", "'/'", "'%'", "'^'", "UMINUS", "'['", "']'", "'('", "')'", "'.'", "';'", "','", "'?'", "'{'", "'}'", "'#'", "'$'", "':'", "$accept", "stmtblock", "stmtmulti", "stmt", - "AlterTableStmt", "alter_identity_column_option_list", - "alter_column_default", "alter_identity_column_option", - "alter_generic_option_list", "alter_table_cmd", "alter_using", - "alter_generic_option_elem", "alter_table_cmds", "alter_generic_options", - "opt_set_data", "DeallocateStmt", "qualified_name", "ColId", - "ColIdOrString", "Sconst", "indirection", "indirection_el", "attr_name", - "ColLabel", "RenameStmt", "opt_column", "InsertStmt", "insert_rest", - "insert_target", "opt_by_name_or_position", "opt_conf_expr", - "opt_with_clause", "insert_column_item", "set_clause", "opt_or_action", - "opt_on_conflict", "index_elem", "returning_clause", "override_kind", - "set_target_list", "opt_collate", "opt_class", "insert_column_list", - "set_clause_list", "set_clause_list_opt_comma", "index_params", - "set_target", "CreateTypeStmt", "opt_enum_val_list", "enum_val_list", - "PragmaStmt", "CreateSeqStmt", "OptSeqOptList", "CreateSecretStmt", - "opt_secret_name", "opt_persist", "opt_storage_specifier", "ExecuteStmt", - "execute_param_expr", "execute_param_list", "execute_param_clause", - "AlterSeqStmt", "SeqOptList", "opt_with", "NumericOnly", "SeqOptElem", - "opt_by", "SignedIconst", "DropSecretStmt", "opt_storage_drop_specifier", - "TransactionStmt", "opt_transaction", "UseStmt", "CreateStmt", - "ConstraintAttributeSpec", "def_arg", "OptParenthesizedSeqOptList", - "generic_option_arg", "key_action", "ColConstraint", "ColConstraintElem", + "AlterObjectSchemaStmt", "AlterSeqStmt", "SeqOptList", "opt_with", + "NumericOnly", "SeqOptElem", "opt_by", "SignedIconst", "AlterTableStmt", + "alter_identity_column_option_list", "alter_column_default", + "alter_identity_column_option", "alter_generic_option_list", + "alter_table_cmd", "alter_using", "alter_generic_option_elem", + "alter_table_cmds", "alter_generic_options", "opt_set_data", + "AnalyzeStmt", "AttachStmt", "DetachStmt", "opt_database", + "opt_database_alias", "CallStmt", "CheckPointStmt", "opt_col_id", + "CommentOnStmt", "comment_value", "comment_on_type_any_name", + "qualified_name", "ColId", "ColIdOrString", "Sconst", "indirection", + "indirection_el", "attr_name", "ColLabel", "CopyStmt", + "copy_database_flag", "copy_from", "copy_delimiter", + "copy_generic_opt_arg_list", "opt_using", "opt_as", "opt_program", + "copy_options", "copy_generic_opt_arg", "copy_generic_opt_elem", + "opt_oids", "copy_opt_list", "opt_binary", "copy_opt_item", + "copy_generic_opt_arg_list_item", "copy_file_name", + "copy_generic_opt_list", "CreateStmt", "ConstraintAttributeSpec", + "def_arg", "OptParenthesizedSeqOptList", "generic_option_arg", + "key_action", "ColConstraint", "ColConstraintElem", "GeneratedColumnType", "opt_GeneratedColumnType", "GeneratedConstraintElem", "generic_option_elem", "key_update", "key_actions", "OnCommitOption", "reloptions", "opt_no_inherit", @@ -2860,18 +2038,35 @@ static const char *const yytname[] = "OptTableElementList", "columnElem", "opt_column_list", "ColQualList", "key_delete", "reloption_elem", "columnList", "columnList_opt_comma", "func_type", "ConstraintElem", "TableElementList", "key_match", - "TableLikeClause", "OptTemp", "generated_when", "DropStmt", - "drop_type_any_name", "drop_type_name", "any_name_list", - "opt_drop_behavior", "drop_type_name_on_any_name", "CreateFunctionStmt", - "macro_alias", "param_list", "UpdateStmt", "CopyStmt", - "copy_database_flag", "copy_from", "copy_delimiter", - "copy_generic_opt_arg_list", "opt_using", "opt_as", "opt_program", - "copy_options", "copy_generic_opt_arg", "copy_generic_opt_elem", - "opt_oids", "copy_opt_list", "opt_binary", "copy_opt_item", - "copy_generic_opt_arg_list_item", "copy_file_name", - "copy_generic_opt_list", "SelectStmt", "select_with_parens", - "select_no_parens", "select_clause", "opt_select", "simple_select", - "value_or_values", "pivot_keyword", "unpivot_keyword", + "TableLikeClause", "OptTemp", "generated_when", "CreateAsStmt", + "opt_with_data", "create_as_target", "unreserved_keyword", + "col_name_keyword", "func_name_keyword", "type_name_keyword", + "other_keyword", "type_func_name_keyword", "reserved_keyword", + "CreateFunctionStmt", "macro_alias", "param_list", "CreateSchemaStmt", + "OptSchemaEltList", "schema_stmt", "CreateSecretStmt", "opt_secret_name", + "opt_persist", "opt_storage_specifier", "CreateSeqStmt", "OptSeqOptList", + "CreateTypeStmt", "opt_enum_val_list", "enum_val_list", "DeallocateStmt", + "DeleteStmt", "relation_expr_opt_alias", "where_or_current_clause", + "using_clause", "DropStmt", "drop_type_any_name", "drop_type_name", + "any_name_list", "opt_drop_behavior", "drop_type_name_on_any_name", + "DropSecretStmt", "opt_storage_drop_specifier", "ExecuteStmt", + "execute_param_expr", "execute_param_list", "execute_param_clause", + "ExplainStmt", "opt_verbose", "explain_option_arg", "ExplainableStmt", + "NonReservedWord", "NonReservedWord_or_Sconst", "explain_option_list", + "analyze_keyword", "opt_boolean_or_string", "explain_option_elem", + "explain_option_name", "ExportStmt", "ImportStmt", "IndexStmt", + "access_method", "access_method_clause", "opt_concurrently", + "opt_index_name", "opt_reloptions", "opt_unique", "InsertStmt", + "insert_rest", "insert_target", "opt_by_name_or_position", + "opt_conf_expr", "opt_with_clause", "insert_column_item", "set_clause", + "opt_or_action", "opt_on_conflict", "index_elem", "returning_clause", + "override_kind", "set_target_list", "opt_collate", "opt_class", + "insert_column_list", "set_clause_list", "set_clause_list_opt_comma", + "index_params", "set_target", "LoadStmt", "opt_force", "file_name", + "opt_ext_version", "PragmaStmt", "PrepareStmt", "prep_type_clause", + "PreparableStmt", "RenameStmt", "opt_column", "SelectStmt", + "select_with_parens", "select_no_parens", "select_clause", "opt_select", + "simple_select", "value_or_values", "pivot_keyword", "unpivot_keyword", "pivot_column_entry", "pivot_column_list_internal", "pivot_column_list", "with_clause", "cte_list", "common_table_expr", "opt_materialized", "into_clause", "OptTempTableName", "opt_table", "all_or_distinct", @@ -2906,9 +2101,9 @@ static const char *const yytname[] = "ConstInterval", "opt_timezone", "year_keyword", "month_keyword", "day_keyword", "hour_keyword", "minute_keyword", "second_keyword", "millisecond_keyword", "microsecond_keyword", "week_keyword", - "decade_keyword", "century_keyword", "millennium_keyword", - "opt_interval", "a_expr", "b_expr", "c_expr", "d_expr", - "indirection_expr_or_a_expr", "indirection_expr", "list_expr", + "quarter_keyword", "decade_keyword", "century_keyword", + "millennium_keyword", "opt_interval", "a_expr", "b_expr", "c_expr", + "d_expr", "indirection_expr_or_a_expr", "indirection_expr", "list_expr", "struct_expr", "func_application", "func_expr", "func_expr_windowless", "func_expr_common_subexpr", "list_comprehension", "within_group_clause", "filter_clause", "export_clause", "window_clause", @@ -2935,9600 +2130,9230 @@ static const char *const yytname[] = "name_list_opt_comma_opt_bracket", "name", "func_name", "AexprConst", "Iconst", "type_function_name", "function_name_token", "type_name_token", "any_name", "attrs", "opt_name_list", "param_name", "ColLabelOrString", - "PrepareStmt", "prep_type_clause", "PreparableStmt", "CreateSchemaStmt", - "OptSchemaEltList", "schema_stmt", "IndexStmt", "access_method", - "access_method_clause", "opt_concurrently", "opt_index_name", - "opt_reloptions", "opt_unique", "AlterObjectSchemaStmt", - "CheckPointStmt", "opt_col_id", "CommentOnStmt", "comment_value", - "comment_on_type_any_name", "ExportStmt", "ImportStmt", "ExplainStmt", - "opt_verbose", "explain_option_arg", "ExplainableStmt", - "NonReservedWord", "NonReservedWord_or_Sconst", "explain_option_list", - "analyze_keyword", "opt_boolean_or_string", "explain_option_elem", - "explain_option_name", "VariableSetStmt", "set_rest", "generic_set", - "var_value", "zone_value", "var_list", "LoadStmt", "file_name", - "repo_path", "VacuumStmt", "vacuum_option_elem", "opt_full", - "vacuum_option_list", "opt_freeze", "DeleteStmt", - "relation_expr_opt_alias", "where_or_current_clause", "using_clause", - "AnalyzeStmt", "AttachStmt", "DetachStmt", "opt_database", - "opt_database_alias", "VariableResetStmt", "generic_reset", "reset_rest", - "VariableShowStmt", "describe_or_desc", "show_or_describe", "opt_tables", - "var_name", "table_id", "CallStmt", "ViewStmt", "opt_check_option", - "CreateAsStmt", "opt_with_data", "create_as_target", - "unreserved_keyword", "col_name_keyword", "func_name_keyword", - "type_name_keyword", "other_keyword", "type_func_name_keyword", - "reserved_keyword", 0 + "TransactionStmt", "opt_transaction", "UpdateStmt", + "UpdateExtensionsStmt", "UseStmt", "VacuumStmt", "vacuum_option_elem", + "opt_full", "vacuum_option_list", "opt_freeze", "VariableResetStmt", + "generic_reset", "reset_rest", "VariableSetStmt", "set_rest", + "generic_set", "var_value", "zone_value", "var_list", "VariableShowStmt", + "describe_or_desc", "show_or_describe", "opt_tables", "var_name", + "table_id", "ViewStmt", "opt_check_option", YY_NULLPTR }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, - 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, - 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, - 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, - 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, - 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, - 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, - 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, - 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, - 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, - 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, - 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, - 755, 60, 62, 61, 756, 43, 45, 42, 47, 37, - 94, 757, 91, 93, 40, 41, 46, 59, 44, 63, - 123, 125, 35, 36, 58 -}; -# endif + return yytname[yysymbol]; +} +#endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = -{ - 0, 525, 526, 527, 527, 528, 528, 528, 528, 528, - 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, - 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, - 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, - 528, 528, 528, 528, 528, 528, 529, 529, 529, 529, - 529, 529, 529, 529, 530, 530, 531, 531, 532, 532, - 532, 532, 533, 533, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 535, 535, 536, 536, 536, 536, 537, - 537, 538, 539, 539, 539, 540, 540, 540, 540, 541, - 541, 542, 542, 542, 543, 543, 544, 545, 545, 546, - 547, 548, 548, 548, 548, 549, 549, 549, 549, 549, - 549, 549, 549, 549, 549, 549, 549, 549, 550, 550, - 551, 552, 552, 552, 552, 552, 553, 553, 554, 554, - 554, 555, 555, 555, 556, 556, 557, 558, 558, 559, - 559, 559, 560, 560, 560, 561, 561, 561, 562, 562, - 563, 563, 564, 564, 565, 565, 566, 566, 567, 567, - 568, 568, 569, 569, 570, 570, 571, 572, 572, 572, - 573, 573, 574, 574, 575, 575, 575, 576, 576, 576, - 577, 577, 578, 578, 578, 579, 579, 580, 580, 580, - 581, 581, 582, 582, 582, 583, 583, 584, 584, 585, - 585, 586, 586, 587, 587, 588, 588, 588, 589, 589, - 589, 589, 590, 590, 590, 590, 590, 590, 590, 590, - 590, 590, 590, 590, 590, 590, 591, 591, 592, 592, - 592, 593, 593, 594, 594, 595, 595, 595, 595, 595, - 595, 596, 596, 596, 597, 598, 598, 598, 599, 599, - 600, 600, 600, 600, 600, 600, 601, 601, 602, 603, - 603, 603, 603, 603, 604, 604, 604, 604, 605, 605, - 605, 605, 605, 605, 605, 605, 606, 606, 607, 607, - 608, 608, 608, 609, 610, 611, 611, 611, 611, 611, - 612, 612, 612, 612, 613, 614, 614, 615, 615, 616, - 616, 616, 616, 616, 616, 616, 616, 617, 617, 618, - 619, 619, 619, 619, 620, 620, 620, 620, 621, 622, - 622, 622, 623, 624, 624, 624, 624, 624, 624, 625, - 625, 626, 626, 627, 628, 628, 628, 629, 629, 630, - 630, 631, 631, 631, 632, 633, 633, 634, 634, 635, - 636, 636, 636, 636, 637, 637, 638, 638, 639, 639, - 639, 640, 640, 640, 640, 640, 640, 641, 641, 642, - 642, 642, 642, 643, 644, 644, 644, 644, 644, 644, - 644, 644, 645, 645, 646, 646, 646, 646, 646, 646, - 647, 647, 647, 647, 647, 647, 647, 647, 647, 647, - 647, 647, 647, 647, 647, 647, 647, 647, 648, 648, - 648, 648, 648, 648, 649, 649, 650, 650, 650, 651, - 651, 651, 652, 652, 652, 652, 652, 652, 653, 653, - 654, 654, 655, 656, 656, 656, 657, 657, 657, 658, - 658, 659, 659, 660, 660, 661, 661, 662, 662, 663, - 663, 664, 664, 665, 665, 665, 665, 665, 665, 665, - 666, 667, 667, 668, 668, 669, 669, 670, 670, 670, - 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, - 670, 670, 670, 671, 672, 672, 672, 672, 672, 673, - 673, 674, 674, 675, 675, 675, 676, 676, 676, 676, - 676, 676, 676, 676, 677, 677, 678, 678, 679, 679, - 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, - 679, 679, 679, 679, 679, 679, 679, 680, 680, 681, - 681, 682, 682, 683, 683, 683, 684, 684, 685, 685, - 686, 686, 686, 687, 687, 688, 689, 689, 689, 690, - 690, 691, 691, 691, 691, 691, 691, 691, 691, 691, - 692, 692, 693, 693, 693, 694, 695, 695, 696, 696, - 697, 697, 697, 698, 698, 699, 699, 700, 700, 701, - 701, 702, 702, 702, 703, 703, 703, 704, 704, 704, - 704, 705, 705, 706, 706, 706, 706, 707, 707, 708, - 708, 708, 708, 708, 708, 709, 709, 710, 710, 711, - 711, 711, 711, 712, 713, 713, 714, 714, 715, 715, - 715, 715, 715, 716, 717, 717, 717, 718, 718, 719, - 719, 720, 720, 721, 721, 721, 722, 722, 723, 723, - 724, 724, 724, 724, 724, 725, 726, 727, 728, 729, - 729, 730, 730, 731, 731, 732, 732, 733, 733, 734, - 734, 735, 736, 736, 736, 736, 737, 737, 738, 738, - 738, 739, 739, 740, 740, 741, 741, 742, 742, 743, - 743, 744, 744, 744, 744, 744, 744, 744, 744, 744, - 744, 745, 745, 746, 746, 746, 747, 747, 748, 748, - 748, 748, 749, 749, 750, 750, 751, 751, 752, 753, - 753, 754, 754, 754, 754, 754, 754, 754, 754, 754, - 754, 754, 755, 755, 755, 755, 756, 756, 757, 757, - 757, 757, 757, 758, 758, 758, 758, 758, 758, 759, - 759, 760, 760, 761, 761, 761, 761, 762, 762, 763, - 764, 764, 765, 765, 766, 766, 767, 767, 768, 768, - 769, 770, 770, 771, 771, 772, 772, 773, 773, 774, - 774, 774, 774, 774, 774, 774, 774, 774, 774, 775, - 775, 776, 776, 776, 777, 777, 777, 777, 777, 777, - 777, 778, 778, 778, 778, 779, 780, 780, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 782, - 782, 783, 783, 784, 784, 785, 786, 787, 787, 788, - 788, 789, 790, 791, 791, 791, 791, 791, 791, 792, - 792, 793, 793, 793, 793, 794, 795, 795, 795, 796, - 796, 797, 797, 798, 798, 799, 799, 800, 800, 801, - 801, 802, 802, 803, 803, 804, 804, 805, 805, 806, - 806, 807, 807, 808, 808, 808, 808, 808, 808, 808, - 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, - 808, 808, 808, 809, 809, 809, 809, 809, 809, 809, - 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, - 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, - 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, - 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, - 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, - 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, - 809, 809, 809, 810, 810, 810, 810, 810, 810, 810, - 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, - 810, 810, 810, 810, 810, 810, 810, 810, 811, 811, - 812, 812, 812, 812, 812, 812, 813, 813, 813, 814, - 814, 814, 814, 814, 814, 814, 814, 814, 814, 814, - 814, 815, 816, 817, 817, 817, 817, 817, 817, 818, - 818, 819, 819, 820, 820, 820, 820, 820, 820, 820, - 820, 820, 820, 820, 820, 820, 820, 821, 821, 822, - 822, 823, 823, 823, 824, 824, 825, 825, 826, 826, - 827, 828, 828, 828, 829, 830, 830, 831, 831, 832, - 832, 832, 832, 833, 833, 834, 834, 834, 834, 834, - 835, 835, 835, 835, 835, 836, 836, 837, 837, 838, - 839, 839, 840, 840, 841, 842, 842, 843, 843, 844, - 844, 845, 845, 845, 846, 846, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 847, 847, 847, - 848, 848, 849, 849, 850, 850, 850, 850, 850, 850, - 850, 850, 851, 851, 852, 852, 853, 853, 854, 854, - 855, 855, 856, 856, 857, 857, 858, 858, 858, 859, - 859, 860, 860, 861, 861, 861, 861, 861, 861, 861, - 861, 861, 861, 861, 861, 861, 861, 862, 862, 863, - 864, 864, 865, 865, 865, 865, 865, 865, 866, 867, - 868, 868, 868, 869, 869, 870, 871, 871, 872, 873, - 873, 874, 874, 875, 875, 546, 546, 546, 546, 876, - 876, 877, 877, 878, 878, 878, 879, 879, 879, 879, - 879, 880, 880, 881, 881, 882, 882, 883, 883, 884, - 884, 885, 885, 885, 886, 886, 887, 887, 888, 889, - 889, 890, 890, 891, 891, 891, 892, 892, 893, 893, - 894, 894, 895, 895, 896, 897, 897, 898, 898, 898, - 898, 898, 898, 898, 898, 898, 898, 898, 898, 898, - 898, 899, 900, 900, 900, 901, 901, 901, 902, 902, - 902, 903, 903, 904, 904, 905, 905, 906, 907, 907, - 908, 909, 909, 910, 910, 910, 910, 910, 910, 911, - 911, 911, 912, 912, 913, 913, 913, 913, 914, 914, - 915, 916, 916, 917, 917, 918, 918, 919, 919, 920, - 920, 921, 921, 921, 921, 921, 921, 922, 922, 923, - 923, 924, 924, 925, 925, 926, 926, 926, 926, 926, - 926, 926, 926, 926, 926, 927, 927, 928, 929, 929, - 929, 929, 930, 930, 931, 931, 931, 932, 932, 932, - 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, - 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, - 932, 932, 932, 932, 932, 932, 932, 933, 933, 933, - 934, 934, 935, 935, 936, 936, 937, 937, 937, 937, - 938, 939, 939, 940, 940, 940, 940, 941, 941, 941, - 941, 942, 942, 943, 944, 944, 944, 944, 944, 944, - 944, 945, 945, 946, 946, 946, 946, 946, 947, 947, - 948, 948, 949, 949, 949, 949, 949, 950, 950, 950, - 950, 950, 951, 951, 952, 952, 953, 953, 954, 954, - 955, 955, 955, 956, 956, 957, 957, 958, 958, 959, - 959, 960, 960, 960, 961, 961, 962, 962, 963, 963, - 963, 963, 964, 964, 965, 965, 965, 966, 966, 966, - 966, 966, 966, 966, 966, 967, 967, 968, 968, 969, - 969, 970, 970, 971, 971, 972, 973, 973, 973, 973, - 973, 974, 974, 974, 974, 975, 975, 975, 976, 976, - 976, 977, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, - 978, 978, 979, 979, 979, 979, 979, 979, 979, 979, - 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, - 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, - 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, - 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, - 979, 979, 979, 979, 979, 979, 980, 980, 980, 980, - 980, 980, 980, 980, 980, 980, 980, 980, 980, 980, - 980, 980, 980, 980, 980, 980, 980, 980, 980, 980, - 980, 980, 980, 980, 981, 981, 981, 981, 981, 981, - 981, 981, 981, 981, 981, 981, 981, 981, 981, 981, - 981, 981, 981, 981, 981, 981, 981, 981, 981, 981, - 981, 981, 981, 982, 982, 982, 982, 982, 982, 982, - 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, - 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, - 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, - 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, - 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, - 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, - 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, - 982, 982, 982, 982, 983, 983, 983, 983, 983, 983, - 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - 983, 983, 983, 983, 983, 983, 984, 984, 984, 984, - 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, - 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, - 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, - 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, - 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, - 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, - 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, - 984 -}; +#define YYPACT_NINF (-3116) -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 4, 6, 4, 6, - 4, 6, 4, 6, 1, 2, 3, 2, 1, 3, - 2, 3, 1, 3, 2, 5, 3, 6, 4, 6, - 6, 6, 5, 5, 6, 9, 4, 5, 7, 6, - 4, 8, 4, 2, 4, 3, 6, 4, 2, 2, - 2, 2, 1, 2, 0, 1, 2, 2, 2, 1, - 3, 4, 2, 1, 0, 2, 3, 2, 3, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 1, 1, 1, 1, 1, 6, 6, 8, 6, 8, - 6, 8, 6, 8, 8, 10, 8, 10, 1, 0, - 9, 1, 4, 4, 7, 2, 1, 3, 2, 2, - 0, 4, 3, 0, 1, 0, 2, 3, 5, 2, - 2, 0, 8, 5, 0, 5, 5, 7, 2, 0, - 1, 1, 1, 3, 2, 0, 1, 0, 1, 3, - 1, 3, 1, 2, 1, 3, 2, 6, 8, 5, - 1, 0, 1, 3, 2, 4, 5, 5, 8, 7, - 1, 0, 8, 11, 10, 0, 1, 0, 1, 1, - 0, 2, 3, 9, 12, 1, 3, 1, 3, 3, - 0, 4, 6, 1, 2, 1, 1, 0, 1, 2, - 2, 1, 2, 2, 1, 2, 3, 2, 2, 2, - 2, 3, 3, 3, 1, 3, 1, 0, 1, 2, - 2, 5, 7, 0, 2, 2, 2, 2, 2, 2, - 2, 1, 1, 0, 2, 9, 12, 11, 0, 2, - 1, 1, 1, 1, 1, 1, 3, 0, 1, 2, - 1, 1, 2, 2, 3, 1, 1, 2, 2, 1, - 2, 3, 5, 3, 2, 5, 1, 1, 1, 0, - 5, 7, 5, 2, 3, 1, 1, 2, 2, 0, - 3, 4, 4, 0, 3, 2, 0, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, - 1, 2, 2, 2, 2, 2, 2, 0, 3, 3, - 3, 0, 1, 2, 1, 2, 2, 2, 2, 3, - 4, 1, 3, 1, 1, 1, 1, 3, 1, 2, - 0, 1, 2, 0, 1, 3, 0, 2, 0, 3, - 3, 1, 5, 3, 1, 3, 1, 2, 1, 4, - 5, 5, 6, 3, 7, 4, 11, 1, 3, 2, - 2, 2, 0, 3, 1, 1, 2, 2, 2, 2, - 1, 0, 1, 2, 6, 4, 6, 4, 6, 8, - 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, - 1, 1, 1, 3, 3, 3, 3, 1, 2, 2, - 1, 3, 1, 1, 1, 3, 1, 1, 0, 1, - 1, 1, 8, 11, 10, 7, 10, 9, 1, 1, - 2, 3, 8, 11, 9, 7, 0, 3, 3, 1, - 1, 3, 0, 1, 3, 1, 0, 1, 0, 1, - 0, 1, 3, 1, 1, 1, 1, 3, 1, 0, - 2, 2, 0, 2, 0, 1, 0, 1, 1, 1, - 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, - 4, 3, 2, 1, 1, 1, 1, 3, 1, 1, - 3, 1, 1, 3, 3, 3, 1, 2, 4, 4, - 2, 3, 5, 5, 1, 1, 3, 0, 11, 11, - 10, 12, 1, 2, 5, 4, 4, 4, 4, 7, - 5, 4, 7, 6, 9, 9, 4, 1, 1, 1, - 1, 1, 1, 1, 5, 1, 1, 3, 1, 2, - 2, 2, 3, 1, 3, 7, 1, 2, 0, 2, - 0, 3, 3, 4, 4, 4, 4, 3, 2, 1, - 1, 0, 1, 1, 0, 2, 1, 5, 1, 0, - 2, 2, 0, 1, 0, 3, 5, 1, 3, 4, - 3, 1, 1, 0, 2, 2, 0, 2, 2, 1, - 1, 1, 0, 2, 4, 5, 4, 2, 3, 2, - 2, 2, 2, 1, 2, 3, 0, 1, 0, 5, - 1, 4, 6, 2, 1, 0, 4, 0, 1, 1, - 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, - 1, 1, 1, 3, 3, 0, 1, 3, 1, 2, - 1, 1, 1, 1, 1, 2, 4, 4, 5, 1, - 1, 2, 0, 2, 0, 1, 3, 1, 0, 1, - 2, 3, 2, 4, 2, 3, 2, 0, 1, 2, - 0, 4, 5, 1, 2, 2, 0, 1, 3, 1, - 2, 3, 3, 3, 3, 3, 3, 1, 4, 9, - 9, 3, 0, 2, 2, 0, 5, 3, 0, 1, - 1, 3, 5, 3, 1, 2, 1, 3, 5, 1, - 2, 3, 4, 5, 4, 5, 4, 6, 5, 4, - 5, 5, 5, 2, 4, 1, 1, 0, 1, 4, - 5, 4, 0, 2, 2, 2, 1, 1, 1, 1, - 0, 4, 2, 1, 2, 2, 4, 2, 6, 2, - 1, 3, 4, 0, 2, 0, 2, 0, 1, 3, - 3, 2, 0, 2, 4, 1, 1, 1, 0, 2, - 3, 5, 6, 2, 3, 1, 5, 5, 5, 3, - 3, 3, 4, 0, 1, 1, 1, 1, 1, 2, - 4, 1, 1, 1, 1, 2, 3, 0, 1, 1, - 1, 1, 1, 2, 2, 2, 2, 2, 1, 3, - 0, 1, 1, 1, 1, 5, 2, 1, 1, 1, - 1, 4, 1, 2, 2, 1, 3, 3, 2, 1, - 0, 5, 2, 5, 2, 1, 3, 3, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, - 3, 3, 0, 1, 3, 3, 5, 2, 2, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 2, 2, 3, 3, 2, 2, - 3, 3, 5, 4, 6, 3, 5, 4, 6, 4, - 6, 5, 7, 3, 2, 4, 3, 2, 3, 3, - 3, 3, 4, 3, 4, 3, 4, 5, 6, 6, - 7, 6, 7, 6, 7, 3, 4, 4, 6, 1, - 4, 3, 5, 1, 3, 2, 2, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 2, 2, 5, 6, 6, 7, 1, 2, - 1, 1, 1, 2, 2, 4, 3, 1, 1, 1, - 1, 1, 4, 1, 1, 1, 1, 2, 4, 2, - 2, 3, 3, 3, 6, 7, 9, 7, 7, 5, - 1, 1, 1, 5, 6, 6, 4, 4, 4, 4, - 6, 5, 5, 5, 4, 6, 4, 7, 9, 5, - 0, 5, 4, 0, 1, 0, 2, 0, 1, 3, - 3, 2, 2, 0, 6, 1, 0, 3, 0, 3, - 3, 3, 0, 1, 4, 2, 2, 2, 2, 2, - 3, 2, 2, 3, 0, 4, 3, 1, 5, 3, - 1, 3, 1, 2, 3, 1, 3, 1, 2, 1, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 1, 4, 1, 4, 1, 2, 1, 2, - 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, - 1, 2, 1, 0, 1, 3, 1, 3, 3, 1, - 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 3, 2, - 3, 0, 3, 3, 2, 2, 1, 0, 2, 2, - 3, 2, 1, 1, 3, 5, 1, 2, 4, 2, - 0, 1, 0, 1, 2, 3, 5, 7, 7, 1, - 0, 0, 2, 0, 2, 3, 3, 3, 5, 7, - 7, 0, 2, 1, 0, 1, 0, 1, 3, 1, - 2, 3, 2, 1, 4, 2, 1, 0, 3, 1, - 3, 1, 2, 4, 2, 0, 1, 3, 1, 3, - 1, 2, 1, 3, 1, 1, 2, 1, 1, 2, - 1, 1, 2, 7, 2, 5, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 3, 3, 0, 1, 1, 1, - 5, 3, 0, 1, 1, 1, 1, 1, 1, 4, - 7, 6, 2, 0, 1, 1, 1, 1, 13, 16, - 1, 2, 0, 1, 0, 1, 0, 2, 0, 1, - 0, 6, 8, 6, 8, 6, 8, 3, 2, 1, - 0, 6, 6, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 4, 6, 3, 2, 4, - 3, 5, 1, 0, 1, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 2, 3, 3, 3, 1, 3, 3, - 2, 3, 3, 1, 1, 1, 3, 5, 1, 1, - 1, 1, 3, 2, 2, 3, 4, 5, 1, 1, - 1, 1, 4, 6, 5, 4, 6, 1, 1, 1, - 1, 1, 1, 0, 1, 3, 1, 0, 7, 3, - 1, 2, 3, 2, 0, 2, 0, 2, 4, 5, - 8, 2, 3, 5, 1, 0, 2, 0, 2, 3, - 3, 3, 1, 1, 1, 2, 3, 2, 2, 2, - 2, 3, 4, 3, 1, 1, 1, 1, 1, 1, - 0, 1, 3, 1, 3, 2, 9, 12, 11, 12, - 14, 3, 4, 4, 0, 7, 10, 9, 2, 3, - 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1 -}; +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 155, 263, 0, 1385, 1384, 1455, 263, 0, 1320, 0, - 263, 486, 401, 0, 1476, 1475, 0, 207, 263, 0, - 155, 0, 0, 0, 0, 0, 0, 549, 552, 550, - 0, 0, 0, 263, 589, 0, 1477, 263, 0, 0, - 581, 551, 0, 1433, 0, 0, 0, 0, 0, 2, - 4, 7, 21, 35, 31, 0, 20, 33, 18, 17, - 26, 6, 24, 37, 39, 19, 25, 15, 38, 13, - 36, 525, 511, 594, 524, 0, 0, 154, 693, 532, - 34, 16, 30, 5, 11, 12, 28, 29, 27, 1343, - 42, 32, 40, 22, 8, 9, 23, 41, 43, 1478, - 1474, 10, 44, 14, 262, 261, 255, 0, 0, 0, - 0, 0, 1454, 0, 0, 256, 111, 1502, 1503, 1504, - 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1876, 1513, - 1514, 1515, 1516, 1517, 1877, 1518, 1519, 1520, 1822, 1823, - 1878, 1824, 1825, 1521, 1522, 1523, 1524, 1525, 1526, 1527, - 1528, 1529, 1530, 1826, 1827, 1531, 1532, 1533, 1534, 1535, - 1828, 1879, 1829, 1536, 1537, 1538, 1539, 1540, 1880, 1541, - 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1881, 1550, - 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1830, - 1560, 1561, 1831, 1562, 1563, 1564, 1565, 1566, 1567, 1568, - 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, - 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, - 1832, 1589, 1590, 1591, 1592, 1593, 1833, 1594, 1595, 1596, - 1834, 1597, 1598, 1599, 1882, 1883, 1600, 1601, 1835, 1885, - 1602, 1603, 1836, 1837, 1604, 1605, 1606, 1607, 1608, 1609, - 1610, 1611, 1612, 1886, 1613, 1614, 1615, 1616, 1617, 1618, - 1619, 1620, 1621, 1622, 1623, 1624, 1887, 1838, 1625, 1626, - 1627, 1628, 1629, 1839, 1840, 1841, 1630, 1888, 1889, 1631, - 1890, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1891, 1639, - 1892, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1842, - 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, - 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 1667, - 1843, 1894, 1844, 1668, 1669, 1670, 1845, 1671, 1672, 1895, - 1673, 1846, 1674, 1847, 1675, 1676, 1677, 1678, 1679, 1680, - 1681, 1682, 1683, 1684, 1848, 1896, 1685, 1897, 1849, 1686, - 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, - 1697, 1698, 1850, 1898, 1699, 1700, 1851, 1701, 1702, 1703, - 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1852, - 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, - 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1899, - 1732, 1733, 1734, 1853, 1735, 1736, 1737, 1738, 1739, 1740, - 1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, - 1751, 1752, 1753, 1854, 1754, 1755, 1900, 1756, 1757, 1855, - 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 1767, - 1768, 1769, 1770, 1856, 1771, 1857, 1772, 1773, 1774, 1902, - 1775, 1776, 1777, 1778, 1779, 1780, 1858, 1859, 1781, 1782, - 1860, 1783, 1861, 1784, 1785, 1862, 1786, 1787, 1788, 1789, - 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, - 1800, 1801, 1802, 1863, 1864, 1803, 1903, 1804, 1805, 1806, - 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, - 1817, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, - 1874, 1875, 1818, 1819, 1820, 1821, 0, 1485, 0, 1245, - 112, 113, 1267, 111, 1835, 1842, 1856, 1319, 1318, 112, - 0, 258, 485, 0, 0, 0, 0, 0, 0, 209, - 0, 395, 394, 0, 1309, 400, 0, 0, 0, 115, - 107, 1701, 114, 1244, 105, 121, 2046, 2047, 2048, 2049, - 1933, 2050, 2051, 2052, 2053, 1934, 2054, 1935, 1936, 1937, - 1938, 1939, 1940, 2055, 2056, 2057, 1942, 1941, 2058, 1943, - 2059, 1944, 2060, 1945, 1946, 2061, 2062, 1947, 1556, 1948, - 1949, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, - 1950, 1951, 2072, 2073, 1952, 2074, 2075, 1953, 2076, 1954, - 1955, 1956, 2077, 2078, 1957, 1958, 2079, 1959, 2080, 2081, - 1960, 1961, 1964, 1962, 2082, 1963, 2083, 1965, 1966, 1967, - 2084, 2085, 1968, 1969, 2086, 1970, 1971, 1972, 1973, 1974, - 2087, 1975, 2088, 1976, 1977, 2089, 2090, 2091, 2092, 2093, - 1979, 1978, 1980, 1981, 2094, 2095, 2096, 2097, 1982, 1983, - 1984, 2098, 2099, 1985, 2100, 2101, 1986, 1987, 2102, 1988, - 1989, 2103, 1990, 1991, 2104, 1992, 1993, 2105, 2106, 2107, - 1994, 2108, 1995, 1996, 2109, 2110, 1997, 1998, 2111, 1999, - 2112, 2113, 2114, 2115, 2000, 2001, 2116, 2002, 2117, 2118, - 2119, 2120, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, - 2011, 2012, 2013, 1451, 123, 122, 124, 0, 419, 420, - 0, 430, 0, 412, 417, 413, 0, 439, 432, 440, - 421, 411, 433, 422, 410, 208, 0, 441, 427, 415, - 0, 0, 0, 0, 259, 220, 401, 0, 155, 0, - 1349, 1359, 1368, 1364, 1358, 1366, 1356, 1362, 1348, 1370, - 1357, 1361, 1354, 1371, 1352, 1369, 1367, 1355, 1363, 1347, - 1351, 1338, 1343, 1374, 1365, 1372, 1360, 1373, 1375, 1350, - 1376, 1353, 0, 1320, 0, 0, 1828, 1879, 1833, 0, - 1846, 0, 1849, 1850, 1735, 1857, 1860, 1861, 1862, 1863, - 0, 763, 114, 109, 747, 0, 527, 697, 707, 747, - 752, 1031, 775, 1032, 0, 116, 1419, 1418, 1414, 1413, - 194, 1282, 1463, 1602, 1642, 1752, 1858, 1781, 1481, 1464, - 1458, 1462, 260, 588, 586, 0, 1216, 1602, 1642, 1739, - 1752, 1858, 1393, 1397, 0, 257, 1483, 1468, 0, 1469, - 114, 533, 580, 0, 264, 1432, 0, 1437, 0, 1715, - 560, 563, 1276, 561, 525, 0, 0, 1, 155, 0, - 161, 0, 584, 584, 0, 584, 0, 517, 0, 0, - 525, 520, 524, 694, 1342, 1447, 1480, 1858, 1781, 1467, - 1470, 1611, 0, 0, 1611, 0, 1611, 0, 1611, 0, - 0, 1457, 1200, 0, 1246, 117, 0, 0, 1331, 1327, - 1332, 1328, 1333, 1326, 1325, 1334, 1330, 0, 0, 0, - 366, 399, 398, 397, 396, 401, 1611, 1293, 0, 205, - 448, 449, 0, 0, 0, 0, 0, 1304, 108, 106, - 1611, 1452, 428, 429, 0, 418, 414, 416, 0, 0, - 1611, 1271, 438, 434, 1611, 438, 1238, 1611, 0, 0, - 212, 0, 394, 1340, 1377, 2000, 1391, 0, 1392, 1382, - 1346, 1378, 1379, 155, 0, 484, 1317, 1415, 0, 0, - 0, 1152, 747, 752, 0, 0, 765, 0, 1171, 0, - 1177, 0, 0, 0, 747, 532, 0, 707, 764, 110, - 0, 745, 746, 635, 635, 589, 0, 570, 757, 0, - 0, 760, 758, 0, 760, 0, 0, 0, 760, 756, - 715, 0, 635, 0, 745, 748, 635, 0, 767, 1337, - 0, 0, 0, 0, 0, 1461, 1459, 1460, 1465, 0, - 0, 0, 1248, 1250, 1251, 1120, 1261, 1010, 0, 1823, - 1824, 1825, 1192, 1826, 1827, 1829, 1830, 1831, 969, 1576, - 1832, 1259, 1834, 1836, 1837, 1839, 1840, 1841, 1842, 1843, - 1844, 0, 1260, 1847, 1680, 1852, 1853, 1855, 1858, 1859, - 1258, 1864, 0, 0, 0, 1227, 1143, 0, 1009, 0, - 0, 0, 1193, 1201, 1002, 0, 0, 811, 812, 833, - 834, 813, 839, 840, 842, 814, 0, 1223, 903, 998, - 1211, 1007, 1015, 1011, 1050, 1013, 1030, 1016, 1087, 1008, - 0, 1014, 1000, 1219, 570, 1217, 0, 1001, 1247, 570, - 1215, 1396, 1394, 1400, 1395, 0, 0, 0, 0, 0, - 110, 1440, 1439, 1431, 1429, 1430, 1428, 1427, 1434, 0, - 1436, 1343, 1138, 1140, 0, 562, 0, 0, 0, 514, - 513, 515, 3, 0, 0, 0, 0, 582, 583, 0, - 0, 0, 0, 0, 0, 0, 0, 678, 609, 610, - 612, 675, 679, 687, 0, 0, 0, 0, 0, 521, - 0, 1276, 1479, 1473, 1471, 0, 0, 0, 139, 139, - 0, 0, 0, 0, 0, 99, 48, 92, 0, 0, - 0, 0, 234, 247, 0, 0, 0, 0, 0, 244, - 0, 0, 227, 50, 221, 223, 0, 139, 0, 46, - 0, 0, 0, 52, 1455, 0, 484, 1199, 0, 119, - 120, 118, 111, 0, 2014, 1876, 1877, 1878, 1879, 1829, - 1880, 1881, 0, 1882, 1883, 1835, 1885, 1886, 1887, 1888, - 1889, 1890, 1891, 1892, 1842, 1894, 1895, 1896, 1897, 1898, - 1899, 2040, 1900, 1856, 1902, 1862, 0, 1903, 1023, 1146, - 594, 1144, 1277, 0, 112, 1264, 0, 1329, 0, 0, - 0, 0, 482, 0, 0, 0, 0, 1289, 0, 1611, - 206, 210, 0, 1611, 201, 1611, 366, 0, 1611, 366, - 1611, 0, 1303, 1306, 0, 431, 426, 424, 423, 425, - 1611, 253, 0, 0, 1272, 436, 437, 0, 405, 0, - 0, 407, 0, 0, 217, 0, 215, 0, 401, 155, - 0, 228, 1387, 1388, 1386, 0, 0, 1381, 1345, 231, - 248, 1390, 1380, 1389, 1344, 1339, 0, 0, 1335, 471, - 0, 0, 0, 0, 1153, 880, 879, 863, 864, 877, - 878, 865, 866, 873, 874, 882, 881, 871, 872, 867, - 868, 861, 862, 869, 870, 875, 876, 859, 860, 1166, - 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, - 1164, 1165, 0, 0, 706, 704, 0, 0, 0, 0, - 0, 0, 1193, 0, 973, 1008, 0, 0, 0, 1138, - 1176, 0, 0, 0, 0, 0, 0, 1138, 1182, 0, - 0, 731, 743, 0, 628, 634, 705, 703, 0, 1216, - 698, 0, 777, 0, 757, 0, 756, 0, 0, 759, - 753, 0, 754, 0, 0, 0, 0, 755, 0, 0, - 0, 0, 0, 701, 0, 743, 0, 702, 774, 1421, - 1420, 1416, 1403, 1411, 195, 0, 1268, 1904, 1905, 1906, - 821, 1907, 850, 828, 850, 850, 1908, 1909, 1910, 1911, - 817, 817, 830, 1912, 1913, 1914, 1915, 1916, 818, 819, - 855, 1917, 1918, 1919, 1920, 1921, 0, 0, 1922, 850, - 1923, 817, 1924, 1925, 1926, 822, 1927, 785, 1928, 0, - 1929, 820, 786, 1930, 858, 858, 1931, 0, 845, 1932, - 0, 1149, 795, 803, 804, 805, 806, 831, 832, 807, - 837, 838, 808, 902, 0, 817, 1269, 1270, 155, 1466, - 1482, 0, 1143, 1017, 849, 836, 1191, 0, 844, 843, - 0, 1143, 826, 825, 824, 1004, 0, 823, 1100, 850, - 850, 848, 928, 827, 0, 0, 0, 0, 0, 854, - 0, 852, 929, 907, 908, 0, 1226, 1235, 1138, 1142, - 0, 1002, 1138, 0, 0, 1090, 1092, 0, 1019, 1020, - 0, 1194, 1249, 1003, 0, 1254, 0, 0, 902, 902, - 1222, 1120, 0, 1110, 1113, 0, 0, 1117, 1118, 1119, - 0, 0, 0, 1214, 0, 1128, 1130, 0, 0, 944, - 1126, 0, 947, 0, 0, 0, 0, 1114, 1115, 1116, - 1106, 1107, 1108, 1109, 1111, 1112, 1124, 1105, 925, 0, - 999, 0, 1053, 0, 924, 1220, 696, 0, 1252, 696, - 1405, 1409, 1410, 1404, 1408, 0, 1399, 1398, 1401, 1402, - 1484, 0, 1441, 1425, 0, 1422, 1141, 691, 564, 1240, - 0, 568, 1446, 160, 159, 0, 0, 537, 536, 603, - 595, 597, 603, 0, 535, 0, 651, 652, 0, 0, - 0, 0, 684, 682, 1248, 1261, 639, 613, 638, 0, - 0, 617, 0, 643, 903, 677, 519, 607, 608, 611, - 518, 0, 680, 0, 690, 0, 556, 558, 541, 555, - 553, 538, 546, 678, 612, 0, 1448, 1472, 0, 0, - 0, 0, 0, 1611, 0, 0, 788, 83, 64, 318, - 138, 0, 0, 0, 0, 0, 0, 0, 91, 88, - 89, 90, 0, 0, 0, 0, 1268, 232, 233, 246, - 0, 237, 238, 235, 239, 240, 0, 0, 225, 226, - 0, 0, 0, 0, 224, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1456, 1449, 1195, 1200, 594, 594, - 594, 0, 592, 593, 0, 0, 0, 0, 0, 470, - 364, 374, 0, 0, 0, 1293, 205, 0, 0, 0, - 0, 0, 0, 401, 1296, 1294, 1292, 1295, 1297, 1582, - 189, 0, 0, 0, 0, 0, 197, 200, 0, 363, - 337, 0, 0, 1308, 0, 0, 0, 1611, 353, 1305, - 0, 1453, 0, 0, 251, 438, 1273, 0, 435, 438, - 1239, 0, 438, 219, 0, 0, 1341, 1383, 229, 249, - 230, 250, 484, 479, 509, 0, 487, 492, 468, 0, - 468, 0, 489, 493, 468, 488, 0, 468, 483, 1417, - 0, 1046, 0, 1036, 0, 0, 766, 0, 0, 1037, - 975, 976, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 993, 992, 1038, 770, 0, 773, 0, 0, 1174, 1175, - 0, 1039, 0, 0, 1181, 0, 0, 0, 1044, 0, - 708, 0, 0, 0, 623, 627, 630, 0, 633, 570, - 526, 1602, 1642, 0, 581, 581, 581, 579, 569, 0, - 655, 0, 0, 0, 732, 0, 0, 734, 736, 0, - 0, 739, 0, 714, 713, 0, 0, 0, 0, 778, - 0, 1244, 0, 0, 196, 0, 0, 0, 803, 0, - 0, 0, 793, 789, 0, 883, 884, 885, 886, 887, - 888, 889, 890, 891, 892, 893, 894, 809, 1281, 0, - 815, 1284, 1285, 1286, 1283, 1280, 1287, 1288, 0, 0, - 0, 0, 1190, 1186, 0, 0, 0, 0, 1095, 1097, - 1099, 0, 847, 846, 1104, 1110, 1113, 1117, 1118, 1119, - 1114, 1115, 1116, 1106, 1107, 1108, 1109, 1111, 1112, 0, - 1132, 0, 1086, 0, 0, 0, 0, 0, 0, 1225, - 0, 971, 0, 1021, 1006, 0, 0, 1093, 1022, 1227, - 1202, 0, 0, 0, 1257, 1256, 904, 913, 916, 948, - 949, 920, 921, 922, 926, 1279, 1278, 1221, 0, 1213, - 0, 0, 905, 930, 935, 0, 1183, 965, 0, 953, - 0, 943, 0, 951, 955, 931, 946, 0, 927, 0, - 1214, 1129, 1131, 0, 1127, 0, 917, 918, 919, 909, - 910, 911, 912, 914, 915, 923, 1103, 1101, 1102, 0, - 1200, 0, 1212, 0, 0, 1055, 0, 0, 950, 1218, - 0, 777, 594, 777, 0, 902, 1442, 1276, 1435, 1276, - 1424, 1139, 1241, 1275, 566, 0, 0, 0, 1444, 146, - 150, 0, 1201, 180, 182, 696, 0, 601, 602, 606, - 0, 0, 606, 585, 534, 1853, 1735, 0, 0, 0, - 0, 644, 685, 0, 676, 641, 642, 0, 640, 1248, - 645, 1247, 646, 649, 650, 618, 1236, 686, 688, 0, - 681, 0, 1242, 540, 559, 0, 0, 0, 0, 0, - 523, 522, 692, 0, 49, 0, 1611, 66, 0, 0, - 0, 0, 0, 0, 268, 0, 368, 268, 104, 1611, - 438, 1611, 438, 1506, 1577, 1753, 0, 62, 342, 95, - 0, 132, 371, 0, 327, 85, 100, 125, 0, 0, - 51, 222, 236, 241, 128, 245, 242, 1313, 243, 139, - 0, 47, 0, 126, 0, 1311, 0, 0, 53, 130, - 1315, 1457, 0, 1199, 0, 592, 592, 592, 0, 1145, - 0, 0, 0, 1147, 1148, 943, 1323, 1322, 1324, 1321, - 456, 469, 0, 365, 0, 481, 459, 460, 470, 1291, - 210, 0, 201, 366, 0, 366, 0, 1293, 0, 0, - 191, 187, 205, 211, 0, 0, 0, 0, 0, 364, - 356, 354, 387, 0, 361, 355, 0, 0, 313, 0, - 1500, 0, 0, 0, 0, 450, 0, 0, 0, 0, - 253, 254, 404, 1274, 406, 0, 408, 218, 216, 1336, - 476, 1143, 0, 474, 480, 475, 478, 473, 472, 0, - 467, 0, 502, 0, 0, 0, 0, 0, 0, 0, - 0, 1033, 1151, 0, 1169, 1168, 974, 981, 984, 988, - 989, 990, 1170, 0, 0, 0, 985, 986, 987, 977, - 978, 979, 980, 982, 983, 991, 775, 0, 0, 769, - 1179, 1178, 1172, 1173, 0, 1041, 1042, 1043, 1180, 0, - 0, 744, 621, 619, 622, 624, 620, 0, 0, 777, - 581, 581, 581, 581, 578, 0, 0, 0, 776, 0, - 672, 740, 738, 0, 762, 0, 735, 718, 741, 0, - 726, 0, 733, 782, 749, 0, 0, 751, 1412, 799, - 0, 794, 790, 0, 0, 0, 800, 0, 0, 0, - 0, 0, 0, 0, 1150, 587, 1018, 0, 0, 0, - 1187, 0, 970, 816, 829, 0, 1098, 1012, 0, 1121, - 1085, 857, 856, 858, 858, 0, 0, 0, 1234, 0, - 1139, 1089, 1091, 1235, 1005, 841, 902, 0, 0, 0, - 0, 0, 0, 0, 954, 945, 0, 952, 956, 0, - 0, 0, 939, 0, 0, 937, 966, 933, 0, 0, - 967, 1199, 0, 1203, 0, 0, 1054, 1063, 699, 695, - 655, 592, 655, 0, 1406, 1426, 1423, 567, 155, 1445, - 0, 169, 0, 0, 0, 0, 172, 186, 183, 1444, - 0, 0, 596, 598, 0, 1122, 606, 600, 648, 647, - 0, 616, 683, 614, 0, 689, 0, 557, 0, 543, - 0, 717, 0, 0, 0, 0, 0, 317, 0, 0, - 0, 268, 0, 376, 0, 383, 0, 0, 368, 349, - 84, 0, 0, 0, 58, 103, 76, 68, 54, 82, - 0, 0, 87, 0, 80, 97, 98, 96, 101, 0, - 278, 303, 0, 0, 314, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 484, 1200, 1196, 1200, - 0, 0, 0, 594, 590, 591, 1024, 0, 455, 508, - 505, 506, 504, 227, 375, 0, 0, 0, 199, 363, - 0, 1308, 0, 1290, 401, 0, 192, 0, 190, 210, - 0, 0, 201, 366, 0, 341, 337, 362, 335, 334, - 336, 0, 1501, 220, 0, 1495, 366, 1307, 0, 0, - 451, 0, 445, 0, 1302, 252, 438, 0, 463, 503, - 510, 490, 495, 0, 501, 497, 496, 491, 499, 498, - 494, 1034, 1045, 1167, 0, 0, 0, 0, 768, 771, - 0, 1040, 1035, 742, 0, 0, 655, 0, 0, 0, - 0, 572, 571, 577, 0, 0, 1057, 737, 0, 0, - 0, 724, 712, 719, 720, 0, 0, 0, 780, 779, - 750, 803, 0, 783, 803, 0, 803, 0, 801, 0, - 810, 895, 896, 897, 898, 899, 900, 901, 835, 0, - 1189, 1185, 1094, 1096, 1133, 853, 851, 1224, 1138, 1229, - 1231, 0, 0, 0, 1088, 972, 1255, 906, 0, 0, - 936, 1184, 957, 0, 0, 0, 932, 1121, 0, 0, - 0, 0, 0, 941, 0, 1207, 1200, 0, 1206, 0, - 0, 0, 0, 1029, 700, 672, 0, 672, 0, 0, - 1443, 0, 1438, 147, 148, 149, 0, 0, 0, 164, - 141, 0, 0, 181, 169, 157, 604, 605, 0, 599, - 615, 1237, 1243, 542, 0, 1002, 0, 0, 539, 0, - 133, 268, 0, 0, 65, 0, 385, 329, 377, 360, - 344, 0, 0, 0, 269, 0, 402, 0, 0, 350, - 0, 0, 0, 0, 330, 0, 0, 289, 0, 0, - 360, 0, 367, 285, 286, 0, 57, 77, 0, 73, - 0, 102, 0, 0, 0, 0, 0, 60, 72, 0, - 55, 0, 438, 438, 63, 1268, 1904, 1905, 1906, 1907, - 1908, 1909, 1910, 1911, 1912, 1913, 2024, 1914, 1915, 1916, - 1917, 1918, 1919, 1920, 1921, 2033, 1922, 275, 1923, 1680, - 1924, 1925, 1926, 1927, 1928, 0, 1929, 786, 1930, 1931, - 2112, 1932, 1106, 1107, 274, 273, 370, 270, 378, 272, - 0, 1269, 271, 373, 328, 129, 1314, 0, 127, 0, - 1312, 136, 134, 131, 1316, 1450, 0, 0, 1027, 1028, - 1025, 592, 0, 0, 0, 484, 462, 0, 0, 0, - 1500, 0, 0, 0, 1611, 0, 188, 0, 0, 202, - 1308, 198, 363, 0, 393, 313, 388, 0, 1500, 1498, - 0, 1308, 1494, 0, 442, 0, 0, 0, 409, 477, - 0, 500, 994, 0, 0, 0, 0, 631, 0, 637, - 672, 576, 575, 574, 573, 654, 1551, 1836, 1734, 0, - 658, 653, 656, 661, 663, 662, 664, 660, 671, 0, - 674, 761, 1134, 1136, 0, 0, 0, 0, 725, 727, - 0, 729, 0, 781, 797, 0, 798, 0, 796, 791, - 802, 1188, 1232, 1233, 1228, 0, 903, 963, 961, 958, - 0, 959, 940, 0, 0, 938, 934, 0, 968, 0, - 0, 1204, 0, 1049, 0, 1052, 1066, 1062, 1061, 1057, - 1024, 1057, 1407, 565, 168, 145, 171, 170, 0, 1201, - 178, 0, 0, 169, 0, 173, 452, 0, 0, 554, - 716, 547, 548, 0, 381, 67, 0, 360, 0, 268, - 346, 345, 348, 343, 347, 0, 403, 0, 0, 287, - 0, 294, 332, 333, 331, 288, 360, 366, 290, 0, - 0, 0, 69, 59, 56, 61, 70, 0, 0, 71, - 74, 782, 86, 79, 1268, 2033, 2042, 0, 0, 0, - 0, 0, 1198, 1197, 0, 458, 457, 507, 454, 465, - 227, 0, 0, 0, 337, 1497, 0, 0, 447, 0, - 0, 363, 193, 0, 0, 0, 0, 1500, 0, 0, - 265, 0, 310, 0, 213, 1499, 0, 0, 1486, 0, - 0, 1300, 1301, 0, 464, 995, 0, 996, 772, 0, - 0, 629, 1057, 0, 0, 0, 665, 659, 0, 1056, - 1058, 0, 626, 1137, 721, 0, 723, 0, 747, 0, - 747, 730, 792, 784, 1230, 1047, 0, 960, 964, 962, - 942, 1200, 1208, 1200, 1205, 1051, 1065, 1068, 674, 1253, - 674, 0, 0, 156, 0, 0, 153, 140, 158, 1123, - 544, 545, 0, 268, 0, 359, 382, 299, 277, 0, - 0, 0, 284, 291, 392, 293, 0, 78, 94, 0, - 0, 372, 137, 135, 1026, 484, 0, 204, 1308, 313, - 1494, 444, 0, 0, 0, 0, 337, 220, 1496, 326, - 319, 320, 321, 322, 323, 324, 325, 340, 339, 311, - 312, 0, 0, 0, 0, 0, 446, 1302, 0, 175, - 184, 0, 175, 997, 632, 0, 674, 0, 0, 0, - 657, 0, 0, 673, 0, 530, 1135, 0, 711, 709, - 0, 710, 0, 0, 0, 0, 594, 626, 626, 142, - 0, 143, 179, 0, 0, 0, 366, 384, 358, 0, - 351, 297, 296, 298, 302, 0, 300, 0, 316, 0, - 309, 277, 0, 81, 0, 379, 453, 461, 0, 267, - 1488, 363, 0, 203, 1494, 313, 1500, 1494, 0, 1491, - 0, 443, 0, 0, 0, 177, 1308, 0, 177, 0, - 626, 667, 0, 666, 1060, 1059, 628, 722, 0, 1048, - 1210, 1209, 0, 1072, 529, 528, 0, 0, 0, 0, - 392, 0, 338, 0, 0, 299, 0, 292, 389, 390, - 391, 0, 305, 295, 306, 75, 93, 380, 0, 363, - 1489, 266, 214, 1487, 1492, 1493, 0, 175, 174, 603, - 176, 777, 185, 603, 636, 531, 668, 625, 728, 1067, - 0, 0, 0, 0, 0, 152, 777, 163, 0, 309, - 357, 352, 276, 301, 315, 0, 0, 0, 307, 0, - 308, 1494, 0, 177, 606, 1298, 606, 1822, 1552, 1788, - 0, 1084, 1073, 1084, 1084, 1064, 144, 151, 0, 268, - 281, 0, 280, 0, 369, 304, 1490, 1308, 603, 165, - 166, 0, 1077, 1076, 1075, 1079, 1078, 0, 1071, 1069, - 1070, 777, 386, 279, 283, 282, 777, 606, 0, 0, - 1081, 0, 1082, 162, 1299, 167, 1074, 1080, 1083 -}; +#define YYTABLE_NINF (-2058) -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 48, 49, 50, 750, 2596, 2597, 2598, 2236, 1205, - 3363, 2237, 1206, 1207, 2600, 751, 801, 1092, 803, 1093, - 1603, 905, 1239, 1240, 752, 1752, 753, 2819, 2160, 2544, - 3345, 55, 3090, 2163, 1165, 3093, 3310, 2812, 3088, 2545, - 3385, 3439, 3091, 2164, 2165, 3311, 2166, 754, 2657, 2658, - 755, 756, 1836, 59, 1301, 546, 1833, 757, 1334, 1335, - 960, 758, 1837, 1780, 2935, 1225, 1770, 1349, 62, 1854, - 759, 106, 64, 760, 2585, 2936, 3356, 2611, 3494, 2872, - 2873, 3353, 3354, 2588, 2239, 3422, 3423, 2672, 1761, 3417, - 2320, 3297, 2243, 2224, 2874, 2328, 3255, 2984, 2240, 2854, - 2321, 3349, 1849, 2322, 3350, 3109, 2323, 1811, 1840, 2589, - 3424, 2244, 1812, 2584, 2937, 1749, 2324, 3360, 2325, 547, - 2858, 761, 741, 742, 952, 1328, 743, 762, 936, 1846, - 763, 764, 2638, 2298, 3160, 2687, 3161, 2361, 2292, 1358, - 2354, 1874, 1814, 1359, 535, 1888, 2688, 2643, 1875, 765, - 1094, 72, 73, 1007, 74, 3103, 75, 76, 1726, 1727, - 1728, 848, 860, 861, 2156, 1442, 1958, 853, 1169, 1695, - 835, 836, 2282, 876, 1803, 1690, 1691, 2169, 2552, 1719, - 1720, 1178, 1179, 1946, 3325, 1947, 1948, 1435, 1436, 3201, - 1707, 1711, 1712, 2190, 2180, 1698, 2430, 3020, 3021, 3022, - 3023, 3024, 3025, 3026, 1095, 2726, 3212, 1715, 1716, 1181, - 1182, 1183, 1724, 2200, 78, 79, 2141, 2528, 2529, 807, - 3037, 1461, 1729, 2730, 2731, 2732, 3040, 3041, 3042, 808, - 1002, 1003, 1026, 1021, 1450, 1967, 809, 810, 1923, 1924, - 2399, 1028, 1960, 1978, 1979, 2738, 2454, 1530, 2225, 1531, - 1532, 1993, 1533, 1096, 1534, 1562, 1097, 1567, 1536, 1098, - 1099, 1100, 1539, 1101, 1102, 1103, 1104, 1555, 1105, 1106, - 1579, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 1152, 1730, 1108, 1109, 1110, 1111, - 1112, 1113, 1114, 1115, 812, 1116, 1117, 1652, 2135, 2527, - 3030, 3209, 3210, 2803, 3078, 3237, 3336, 3453, 3481, 3482, - 3508, 1118, 1119, 1595, 1596, 1597, 2028, 2029, 2030, 2031, - 2129, 1646, 1647, 1120, 2939, 1649, 2051, 3033, 3034, 1153, - 1428, 1590, 1280, 1281, 1544, 1402, 1403, 1409, 1898, 1417, - 1421, 1928, 1929, 1429, 2097, 1121, 2022, 2023, 2471, 1557, - 1122, 1238, 1602, 2798, 2132, 1650, 2091, 1129, 1123, 1130, - 1125, 1586, 1587, 2488, 2770, 2771, 2061, 2197, 1679, 2202, - 2203, 956, 1126, 1127, 1128, 1282, 519, 1545, 3440, 1324, - 1158, 1283, 2087, 766, 1034, 2015, 767, 1297, 1826, 768, - 3192, 2997, 1313, 1850, 2333, 548, 769, 770, 528, 85, - 2287, 917, 86, 87, 88, 885, 1351, 771, 1352, 1353, - 967, 89, 2689, 969, 970, 773, 842, 843, 1473, 1666, - 1474, 774, 818, 1471, 775, 1148, 857, 1149, 1151, 776, - 1142, 2541, 2158, 94, 95, 96, 114, 1236, 777, 829, - 830, 866, 99, 100, 1193, 831, 849, 779, 780, 3188, - 781, 2675, 1307, 529, 521, 522, 1547, 715, 1285, 716 -}; +#define yytable_value_is_error(Yyn) \ + ((Yyn) == YYTABLE_NINF) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -3059 static const int yypact[] = { - 6375, 351, 1052, -3059, -3059, 657, 351, 50036, 64871, 293, - 351, 181, 3103, 52016, -3059, -3059, 46571, 4517, 351, 54986, - 72207, 328, 274, 31911, 355, 55481, 55481, -3059, -3059, -3059, - 64871, 54986, 55976, 351, 358, 65366, -3059, 351, 34386, 52511, - 198, -3059, 54986, 65, 257, 56471, 54986, 4726, 600, 263, - -3059, -3059, -3059, -3059, -3059, 178, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, 150, -3059, 189, 154, 31911, 31911, 1366, 118, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 442, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - 33891, -3059, -3059, -3059, -3059, -3059, -3059, 56966, 54986, 57461, - 53006, 57956, -3059, 645, 965, -3059, 165, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 170, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 481, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, 183, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, 376, -3059, 516, -3059, - 195, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - 1178, -3059, -3059, 957, 3143, 54986, 432, 665, 718, -3059, - 58451, -3059, 725, 54986, -3059, -3059, 731, 774, 916, -3059, - -3059, 53501, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 47066, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, 877, -3059, -3059, - 706, -3059, 194, -3059, -3059, 729, 686, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, 787, -3059, -3059, -3059, - 789, 65861, 58946, 59441, -3059, 667, 2978, 6731, 72225, 30919, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, 442, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, 55481, 64871, 55481, 709, 723, 1076, 734, 32406, - 737, 34882, 753, 769, 1117, 776, 778, 785, 796, 257, - 31415, 807, 376, -3059, 59936, 59936, -26, 2686, -3059, 59936, - 60431, -3059, 822, -3059, 965, -3059, -3059, -3059, 1157, -3059, - -61, 816, -3059, 60926, 60926, 60926, 842, 1124, -3059, -3059, - -3059, 866, -3059, -3059, 1095, 20588, 20588, 66356, 66356, 965, - 66356, 876, -3059, -3059, 91, -3059, -3059, -3059, 1366, 882, - 376, -3059, -3059, 52511, -3059, -3059, 237, 1219, 20588, 54986, - 884, -3059, 886, 884, 892, 906, 913, -3059, 6375, 1264, - 1145, 52511, 364, 364, 1386, 364, 212, 587, 4710, 2869, - -3059, 887, -3059, 944, -3059, 54986, 1048, 974, 1244, -3059, - 882, 1329, 1242, 1133, 1338, 5360, 1346, 1336, 1375, 1623, - 1382, 1523, 20588, 47561, 376, -3059, 11731, 20588, -3059, -3059, - -3059, 1149, -3059, -3059, -3059, -3059, -3059, 54986, 64871, 1072, - 1075, -3059, -3059, -3059, -3059, 1022, 1317, -3059, 1558, 66851, - -3059, -3059, 1160, 61421, 61916, 62411, 62906, 1514, -3059, -3059, - 1490, -3059, -3059, -3059, 1167, -3059, -3059, -3059, 176, 67346, - 1500, 1154, 110, -3059, 1509, 172, -3059, 1522, 1409, 15378, - -3059, 1353, -3059, -3059, -3059, 257, -3059, 403, -3059, -3059, - 43428, -3059, -3059, 72225, 1281, 1207, -3059, 1556, 20588, 20588, - 1221, 5787, 59936, 60431, 20588, 54986, -3059, 20588, 25277, 1235, - 20588, 20588, 12773, 20588, 29929, 59936, 2686, 1248, -3059, 582, - 54986, 1243, -3059, 1347, 1347, 358, 31911, 1548, -3059, 375, - 1545, 1479, -3059, 31911, 1479, 977, 1269, 1562, 1479, -3059, - 253, 1567, 1347, 35377, 1282, -3059, 1347, 1516, -3059, -3059, - 55481, 20588, 15378, 69821, 1776, -3059, -3059, -3059, -3059, 1585, - 64871, 1308, -3059, -3059, -3059, -3059, -3059, -3059, 615, 1818, - 158, 1819, 20588, 158, 158, 1311, 196, 196, -3059, 1503, - 1314, -3059, 200, 1315, 1316, 1827, 1831, 180, 134, 871, - 158, 20588, -3059, 196, 1326, 1839, 1334, 1846, 138, 173, - -3059, 201, 20588, 20588, 20588, 1704, 20588, 10689, -3059, 54986, - 1844, 47561, 545, -3059, 376, 1341, 965, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, 1356, -3059, 185, 7003, -3059, -3059, - -3059, -3059, -3059, -3059, 1377, -3059, -3059, -3059, -3059, 1559, - 20588, -3059, -3059, 1343, 1548, -3059, 202, -3059, -3059, 1548, - -3059, -3059, -3059, -3059, -3059, 217, 1768, 20588, 20588, 64871, - 376, 67841, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 628, - -3059, 442, 45116, 1355, 1359, 884, 54986, 54986, 1835, -3059, - -3059, -3059, -3059, 52511, 159, 1657, 1491, -3059, -3059, 1366, - 1366, 15899, 1027, 220, 70, 16420, 21109, 1713, 1592, 225, - 586, 1715, -3059, 1598, 1825, 25277, 20588, 20588, 212, 587, - 20588, 886, -3059, -3059, -3059, 1651, 54986, 50531, 482, 553, - 1371, 1461, 1378, 29, 1798, -3059, 1376, -3059, 1465, 54986, - 71756, 244, -3059, 1855, 244, 244, 235, 1856, 1493, 261, - 1659, 630, -32, 1376, 2912, -3059, 52511, 156, 643, 1376, - 54986, 1494, 688, 1376, 1820, 64871, 1207, 41015, 1403, -3059, - -3059, -3059, 147, 15378, -3059, 1292, 1339, 1364, 367, 184, - 1400, 1542, 15378, 1602, 1650, 163, 1652, 1663, 1671, 1679, - 1683, 1687, 1703, 1705, 144, 1710, 1712, 1716, 1718, 1720, - 1724, -3059, 1728, 169, 1730, 199, 15378, 1733, -3059, 45116, - 8, -3059, -3059, 1738, 182, -3059, 45205, -3059, 1708, 1505, - 1506, 64871, 1455, 54986, 1560, 823, 1783, 1836, 70301, 1664, - -3059, 1741, 54986, 1666, 2912, 1667, 1429, 1904, 1672, 1075, - 1674, 1431, -3059, 68336, 47561, -3059, -3059, -3059, -3059, -3059, - 1797, 1780, 64871, 47561, 1437, -3059, -3059, 64871, -3059, 54986, - 54986, -3059, 54986, 64871, -3059, 644, 45116, 1941, 865, 72225, - 49046, -3059, -3059, -3059, -3059, 428, 951, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, 965, 47561, -3059, 2564, - 55481, 44046, 1444, 20588, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, 1449, 1801, -3059, -3059, 6587, 1453, 44086, 1454, - 25277, 25277, 376, 530, -3059, -3059, 25277, 1460, 49541, 43959, - 1463, 1467, 44434, 16941, 20588, 16941, 16941, 44521, -3059, 1471, - 44598, 59936, 1473, 54986, 53996, -3059, -3059, -3059, 20588, 20588, - 2686, 54491, 1515, 31911, -3059, 31911, -3059, 1765, 31911, -3059, - -3059, 2074, -3059, 31911, 1766, 20588, 31911, -3059, 31911, 1714, - 1717, 1477, 31911, -3059, 54986, 1482, 54986, -3059, -3059, -3059, - -3059, -3059, 45116, -3059, 1481, 690, 1485, -3059, -3059, -3059, - -3059, -3059, 1534, -3059, 1534, 1534, -3059, -3059, -3059, -3059, - 1492, 1492, 1497, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, 1498, 871, -3059, 1534, - -3059, 1492, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 71756, - -3059, -3059, -3059, -3059, -50, 501, -3059, 1501, -3059, -3059, - 1507, -3059, 1489, 1978, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, 5696, 699, 1492, -3059, -3059, 5470, -3059, - -3059, 20588, 20588, -3059, -3059, 1508, 45116, 1547, -3059, -3059, - 20588, 20588, -3059, -3059, -3059, -3059, 2011, -3059, 20588, 1534, - 1534, -3059, 45587, -3059, 39834, 17462, 1597, 1599, 2011, -3059, - 2011, -3059, 45587, 2015, 2015, 37852, -3059, 1675, 44685, -3059, - 1518, 2122, 7670, 1510, 1511, -3059, 1519, 1513, -3059, -3059, - 41943, 166, 376, 376, 20588, -3059, 2011, 20588, 8642, 8642, - -3059, 295, 69821, 20588, 20588, 20588, 20588, 20588, 20588, 20588, - 20588, 46076, 1606, 127, 64871, 20588, 20588, 1524, 858, -3059, - 20588, 1754, -3059, 1525, 20588, 1608, 312, 20588, 20588, 20588, - 20588, 20588, 20588, 20588, 20588, 20588, -3059, -3059, 28924, 344, - 550, 1860, 1879, 46, 291, 20588, 1871, 11731, -3059, 1871, - -3059, -3059, -3059, -3059, -3059, 204, -3059, -3059, 1481, 1481, - -3059, 64871, -3059, 54986, 237, 51521, 20588, -3059, -3059, 1527, - 1531, 485, 1594, -3059, -3059, 54986, 38347, 1833, -3059, 350, - 1533, -3059, 43920, 1790, 1833, 1366, -3059, -3059, 26319, 1673, - 1830, 1770, -3059, -3059, 1749, 1751, -3059, 1546, 45338, 21630, - 21630, -3059, 646, 45116, 1293, -3059, -3059, -3059, -3059, -3059, - -3059, 733, -3059, 54986, 82, 35872, -3059, 1552, 111, -3059, - 3217, 1885, 1847, 1713, 586, 1557, -3059, -3059, 1781, 1563, - 68831, 54986, 1845, 1804, 1859, 308, 69821, -3059, -3059, -3059, - -3059, 54986, 64871, 63401, 69326, 48056, 54986, 47561, -3059, -3059, - -3059, -3059, 54986, 1218, 54986, 8381, -3059, -3059, -3059, -3059, - 244, -3059, -3059, -3059, -3059, -3059, 64871, 54986, -3059, -3059, - 244, 64871, 54986, 244, -3059, 1939, 54986, 54986, 54986, 54986, - 2069, 54986, 54986, 965, -3059, -3059, -3059, 22151, 24, 24, - 1786, 13294, 203, -3059, 20588, 20588, 306, 294, 64871, 1753, - -3059, -3059, 700, 1795, 103, -3059, 64871, 1621, 54986, 54986, - 54986, 54986, 54986, 2076, -3059, -3059, -3059, -3059, -3059, 1575, - -3059, 1940, 2090, 1582, 1586, 1947, -3059, 2912, 1951, 51026, - 698, 2699, 1952, 1630, 1956, 13815, 2072, 1840, -3059, -3059, - 1824, -3059, 64871, 2106, -3059, 110, -3059, 47561, -3059, 172, - -3059, 1829, 205, -3059, 15378, 20588, -3059, -3059, -3059, -3059, - -3059, -3059, 1207, 29430, -3059, 714, -3059, -3059, 2075, 965, - 2075, 565, -3059, -3059, 2075, -3059, 2060, 2075, -3059, -3059, - 69821, -3059, 7960, -3059, 20588, 20588, -3059, 20588, 1949, -3059, - 2110, 2110, 69821, 25277, 25277, 25277, 25277, 25277, 25277, 486, - 1326, 25277, 25277, 25277, 25277, 25277, 25277, 25277, 25277, 25277, - 26840, 301, -3059, -3059, 715, 2085, 20588, 20588, 1960, 1949, - 20588, -3059, 69821, 1613, -3059, 1614, 1617, 20588, -3059, 69821, - -3059, 54986, 1619, 9, -2, -3059, 1622, 1627, -3059, 1548, - -3059, 713, 775, 54986, 2465, 5151, 5636, -3059, -3059, 20588, - 1962, 2074, 2074, 31911, -3059, 20588, 1629, -3059, -3059, 31911, - 1979, -3059, 2074, -3059, -3059, 36367, 2074, 69821, 748, -3059, - 54986, 69821, 758, 20588, -3059, 15378, 2143, 69821, 2108, 64871, - 64871, 2145, 1637, 1639, 2011, 1725, -3059, 1727, 1729, 1731, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 69821, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 1643, 1647, - 20588, 20588, 80, -3059, 8114, 1646, 1653, 6163, -3059, 1644, - -3059, 1649, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 1655, - -3059, 1661, -3059, 1669, 1677, 1682, 1676, 1681, 54986, -3059, - 22672, -3059, 64871, -3059, -3059, 20588, 20588, 54986, -3059, 1704, - -3059, 1685, 1688, 8303, -3059, -3059, -3059, 153, 394, 45444, - 291, 3594, 3594, 3594, 45587, -3059, -3059, -3059, 1692, -3059, - 25277, 25277, -3059, 2523, 2753, 10689, -3059, -3059, 1995, -3059, - 891, -3059, 1658, -3059, -3059, 3090, -3059, 39834, 45547, 20588, - 179, -3059, 20588, 1524, 20588, 1762, 3594, 3594, 3594, 268, - 268, 153, 153, 153, 394, 291, -3059, -3059, -3059, 1668, - 20588, 47561, -3059, 1680, 1684, 2038, 1334, 20588, -3059, -3059, - 31911, 1515, 8, 1515, 2011, 8642, -3059, 886, -3059, 886, - -3059, 45116, 54986, -3059, -3059, 1953, 1690, 31911, 1732, 2167, - 2157, 64871, -3059, -3059, 1693, 1871, 1719, -3059, -3059, 1721, - 20588, 3753, 1721, -3059, 1833, -5, 1929, 998, 998, 646, - 1931, -3059, -3059, 1774, -3059, -3059, -3059, 20588, 14336, 1389, - -3059, 1407, -3059, -3059, -3059, -3059, -3059, 1699, -3059, 1986, - -3059, 54986, -3059, -3059, 25277, 2172, 20588, 36862, 2174, 1974, - -3059, -3059, -3059, 1812, 1376, 20588, 1971, -3059, 187, 1734, - 2097, 371, 2049, 64871, -3059, 318, 353, -3059, 978, 2100, - 205, 2105, 205, 47561, 47561, 47561, 760, -3059, -3059, -3059, - 965, -3059, 271, 762, -3059, -3059, -3059, -3059, 1834, 933, - 1376, 2912, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 222, - 948, 1376, 1842, -3059, 1849, -3059, 1851, 1015, 1376, -3059, - -3059, 1523, 9124, 45116, 336, 203, 203, 203, 15378, -3059, - 1982, 1983, 1758, 45116, 45116, 142, -3059, -3059, -3059, -3059, - 1760, -3059, 236, -3059, 64871, -3059, -3059, -3059, 1753, 1836, - 1741, 54986, 2912, 1767, 2236, 1075, 1431, -3059, 1928, 901, - 1678, -3059, 64871, -3059, 47561, 64871, 54986, 54986, 54986, 63896, - -3059, -3059, -3059, 1769, 1772, -3059, -11, 2004, 2005, 54986, - 1821, 54986, 1378, 2255, 54986, -3059, 766, 17983, 2144, 54986, - 1780, -3059, -3059, -3059, -3059, 64871, -3059, -3059, 45116, -3059, - -3059, 20588, 48551, -3059, -3059, -3059, -3059, -3059, -3059, 47561, - -3059, 965, -3059, 965, 2020, 64871, 42438, 965, 42933, 965, - 1785, -3059, 45116, 8353, 45116, 1960, -3059, 214, 2110, 1848, - 1848, 1848, 4127, 2130, 240, 1788, 1848, 1848, 1848, 282, - 282, 214, 214, 214, 2110, 301, 822, 49541, 1789, -3059, - 45116, 45116, -3059, -3059, 1794, -3059, -3059, -3059, -3059, 1802, - 1803, -3059, -3059, -3059, -3059, -3059, -3059, 64871, 1037, 1515, - 198, 198, 198, 198, -3059, 54986, 54986, 54986, 45116, 2245, - 2120, -3059, -3059, 2074, 45116, 54986, -3059, 27882, -3059, 54986, - -3059, 2153, -3059, 2240, -3059, 54986, 830, -3059, -3059, -3059, - 857, 1809, 1639, 69821, 873, 879, -3059, 2011, 136, 1807, - 1512, 1319, 750, 1413, -3059, -3059, -3059, 1808, 44820, 20588, - -3059, 2181, -3059, -3059, -3059, 20588, 20588, -3059, 39834, -3059, - -3059, -3059, -3059, -45, -45, 1811, 10689, 45042, -3059, 2139, - 8435, 45116, -3059, 1675, -3059, -3059, 8642, 20588, 1205, 1826, - 20588, 1823, 20588, 2169, -3059, -3059, 1832, -3059, -3059, 69821, - 20588, 1850, 5197, 25277, 25277, 6403, -3059, 7322, 20588, 10689, - -3059, 41101, 1817, 1852, 1786, 18504, -3059, 2047, 1843, -3059, - 1962, 203, 1962, 1854, -3059, -3059, -3059, -3059, 5470, -3059, - 20588, 1990, 64871, 518, 1927, 890, -3059, 376, 38347, 1732, - 20588, 252, -3059, -3059, 1857, -3059, 1721, -3059, -3059, -3059, - 2083, -3059, -3059, -3059, 54986, -3059, 1862, -3059, 35872, 2184, - 11210, -3059, 35872, 54986, 54986, 40337, 2223, -3059, 64871, 64871, - 64871, -3059, 64871, 1861, 1863, 653, 1866, 389, -3059, 1021, - 653, 2206, 296, 1378, 261, 1561, 521, -3059, -3059, -3059, - 1943, 54986, -3059, 64871, -3059, -3059, -3059, -3059, -3059, 48056, - -3059, -3059, 39338, 47561, -3059, 47561, 54986, 54986, 54986, 54986, - 54986, 54986, 54986, 54986, 54986, 54986, 1207, 20588, -3059, 20588, - 1868, 1869, 1874, 1786, -3059, -3059, -3059, 206, -3059, 1870, - -3059, -3059, -3059, -32, -3059, 236, 1877, 1878, -3059, 51026, - 3143, 1630, 2353, 1836, 850, 64376, -3059, 1882, 1876, 1741, - 897, 912, 2912, 1884, 2359, -3059, 698, 51026, -3059, -3059, - -3059, 2315, -3059, 667, 232, -3059, 1075, -3059, 3143, 1431, - -3059, 3143, 45116, 64871, 1948, -3059, 205, 922, -3059, -3059, - -3059, -3059, -3059, 64871, 1886, -3059, 1886, -3059, -3059, 1886, - -3059, -3059, -3059, -3059, 25277, 2234, 1892, 69821, -3059, -3059, - 54986, -3059, -3059, -3059, 942, 1894, 1962, 54986, 54986, 54986, - 54986, -3059, -3059, -3059, 19025, 20588, 1932, -3059, 1895, 12252, - 2213, -3059, 27361, -3059, -3059, 1899, 36367, 64871, -3059, -3059, - -3059, -3059, 2011, -3059, -3059, 64871, -3059, 1902, -3059, 1903, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, 20588, - 45116, -3059, 45116, -3059, -3059, -3059, -3059, -3059, 7369, -3059, - 1907, 1905, 64871, 20588, -3059, -3059, -3059, 747, 20588, 20588, - 2523, -3059, 6937, 20588, 69821, 962, 2523, 347, 20588, 2239, - 3853, 20588, 20588, 7350, 40376, -3059, 23193, 14857, -3059, 1906, - 20588, 40415, 38842, -3059, 31911, 2120, 1911, 2120, 965, 1913, - 45116, 20588, -3059, -3059, -3059, -3059, 1969, 349, 33396, 2142, - -3059, 1930, 64871, -3059, 1990, 45116, -3059, -3059, 39834, -3059, - -3059, -3059, -3059, -3059, 2373, 2635, 1923, 1924, -3059, 1340, - -3059, -3059, 64871, 1925, -3059, 1935, 653, -3059, 64871, 1968, - -3059, 272, 2241, 113, -3059, 20588, -3059, 2330, 2411, 1021, - 1942, 64871, 54986, 25277, -3059, 625, 243, -3059, 2227, 54986, - 1968, 2369, -3059, -3059, -3059, 389, -3059, 2268, 2185, -3059, - 244, -3059, 20588, 389, 2188, 137, 64871, -3059, -3059, 2738, - -3059, 69821, 205, 205, -3059, 1485, 1954, 1955, 1958, 1959, - 1961, 1965, 1967, 1972, 1973, 1976, -3059, 1988, 1989, 1992, - 1993, 1994, 1997, 1998, 1999, 1498, 2000, -3059, 2001, 1857, - 2006, 2013, 2016, 2019, 2021, 70781, 2026, 2028, 2031, 2033, - 1501, 2034, 428, 951, -3059, -3059, -3059, -3059, -3059, -3059, - 1154, 2035, -3059, 1975, -3059, -3059, -3059, 2044, -3059, 2056, - -3059, -3059, -3059, -3059, -3059, -3059, 1981, 2007, -3059, -3059, - -3059, 203, 1970, 1984, 64871, 1207, 151, 47561, 64871, 2037, - 1821, 2496, 19546, 1159, 2279, 2041, -3059, 965, 2053, -3059, - 1630, -3059, 51026, 3125, 669, 2005, -3059, 208, 1821, -3059, - 2451, 1630, 2094, 2521, -3059, 2282, 64871, 2059, -3059, -3059, - 48551, 1886, 4313, 25277, 69821, 964, 970, -3059, 2568, 2231, - 2120, -3059, -3059, -3059, -3059, -3059, 2064, -25, 2078, 10168, - 2065, -3059, -3059, -3059, -3059, -3059, -3059, 45116, 45116, 64871, - 2251, -3059, -3059, 2071, 2081, 37357, 2531, 2082, -3059, -3059, - 2395, -3059, 30424, -3059, 1639, 2086, 1639, 69821, 1639, -3059, - -3059, 45116, 20588, -3059, -3059, 41369, 2407, 2523, 2523, 6937, - 987, -3059, 2523, 20588, 20588, 2523, 2523, 20588, -3059, 9646, - 409, -3059, 995, -3059, 40462, -3059, 71261, -3059, -3059, 1932, - 965, 1932, -3059, -3059, 2089, -3059, -3059, -3059, 2141, -3059, - -3059, 1049, 2510, 1990, 20588, -3059, -3059, 2096, 35872, -3059, - -3059, -3059, -3059, 35872, 653, -3059, 2260, 1968, 2095, -3059, - -3059, -3059, -3059, -3059, -3059, 40501, -3059, 52, 20588, -3059, - 1046, 4127, -3059, -3059, -3059, -3059, 1968, 1075, -3059, 54986, - 2573, 2463, -3059, -3059, 45116, -3059, -3059, 2011, 2011, -3059, - -3059, 2240, -3059, -3059, 2101, -3059, -3059, 1154, 512, 39338, - 54986, 54986, -3059, -3059, 2103, -3059, -3059, -3059, -3059, -3059, - -32, 2497, 1064, 1065, 698, -3059, 3143, 3143, 45116, 54986, - 2471, 51026, -3059, 47561, 2587, 2113, 54986, 1821, 1137, 1137, - -3059, 2263, -3059, 2266, -3059, -3059, 2595, 276, -3059, 20067, - 54986, -3059, -3059, 32901, -3059, 4313, 1070, -3059, -3059, 2124, - 2126, -3059, 1932, 20588, 2127, 20588, -3059, 23714, 2602, 2125, - -3059, 20588, 2190, 28403, -3059, 20588, -3059, 54986, 59936, 2132, - 59936, -3059, -3059, -3059, -3059, -3059, 20588, -3059, 2523, 2523, - 2523, 20588, -3059, 20588, -3059, -3059, -3059, 2338, 2251, -3059, - 2251, 20588, 3143, 376, 2620, 64871, 20, -3059, 45116, -3059, - -3059, -3059, 54986, -3059, 47561, -3059, 653, 326, 2134, 20588, - 40851, 2372, -3059, -3059, 2405, -3059, 2464, -3059, 2201, 573, - 2222, -3059, -3059, -3059, -3059, 1207, 965, -3059, 1630, 2005, - 2094, -3059, 2148, 54986, 1084, 3143, 698, 667, -3059, -3059, - -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, -3059, - -3059, 3143, 2596, 2377, 2597, 3143, 45116, 1948, 20588, 79, - -3059, 1128, 2592, -3059, -3059, 2664, 2251, 2159, 23714, 2160, - -3059, 2162, 64871, 45116, 2309, -3059, -3059, 2166, -3059, -3059, - 20588, -3059, 41451, 2171, 2175, 2626, 1786, 2190, 2190, -3059, - 349, -3059, -3059, 2586, 32901, 2556, 1075, 653, 2187, 1136, - -3059, -3059, -3059, -3059, -3059, 2912, -3059, 40937, 2419, 122, - 2403, 2134, 20588, -3059, 2256, -3059, -3059, -3059, 2654, -3059, - -3059, 51026, 2182, -3059, 2094, 2005, 1821, 2094, 2406, -3059, - 2409, -3059, 2189, 40976, 64871, 64871, 1630, 32901, 64871, 2191, - 2190, -3059, 2192, -3059, -3059, -3059, 53996, -3059, 2193, -3059, - -3059, -3059, 20588, 135, -3059, -3059, 2252, 54986, 1138, 51, - 2405, 39338, -3059, 47561, 174, 326, 2500, -3059, -3059, -3059, - -3059, 209, 2421, -3059, 2423, -3059, 45116, -3059, 3143, 51026, - -3059, -3059, -3059, -3059, -3059, -3059, 32901, 2592, -3059, 350, - -3059, 1515, -3059, 350, -3059, -3059, -3059, -3059, -3059, 1463, - 24235, 24235, 24235, 2198, 3143, -3059, 1515, -3059, 2328, 2403, - -3059, -3059, -3059, -3059, -3059, 457, 457, 2598, -3059, 2273, - -3059, 2094, 1142, 64871, 1721, -3059, 1721, 25798, 2354, 238, - 43998, 2578, -3059, 2578, 2578, -3059, -3059, -3059, 38347, -3059, - -3059, 2702, -3059, 227, -3059, -3059, -3059, 1630, 350, -3059, - -3059, 2693, -3059, -3059, -3059, -3059, -3059, 343, -3059, -3059, - -3059, 1515, 653, -3059, -3059, -3059, 1515, 1721, 24756, 2365, - -3059, 2435, -3059, -3059, -3059, -3059, -3059, -3059, -3059 + 6260, -36, 142, -3116, -3116, 274, -36, 50411, 65834, 268, + -36, 130, 4307, 52403, -3116, -3116, 46925, 8772, -36, 55889, + 73215, 294, 565, 32270, 680, 56387, -3116, -3116, -3116, 65834, + 55889, 56885, -36, 366, 66332, -3116, -36, 34760, 52901, 449, + -3116, 55889, 89, 385, 57383, 55889, 1805, 911, 420, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, 483, -3116, -3116, -3116, -3116, 150, -3116, + 750, -3116, -3116, -3116, -3116, 160, -3116, 137, 177, 32270, + 32270, 881, 504, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, 34262, -3116, -3116, -3116, -3116, 57881, 55889, + 58379, 53399, 58877, -3116, 763, 1043, -3116, 195, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + 200, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, 585, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, 202, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -101, 211, -3116, -3116, -3116, 613, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, 1992, -3116, -3116, 1034, 4038, 55889, + 382, 731, 820, -3116, 59375, -3116, 801, 55889, -3116, -3116, + 924, 806, 990, -3116, -3116, 53897, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, 47423, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, 972, -3116, -3116, 803, -3116, 112, -3116, -3116, 829, + 792, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + 894, -3116, -3116, -3116, 901, 66830, 59873, 60371, -3116, 788, + 2069, 8111, 73233, 31272, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, 483, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, 56387, 65834, 810, + 817, 1146, 831, 32768, 835, 35259, 848, 854, 1203, 865, + 869, 875, 882, 385, 31771, 906, -101, -3116, 60869, 60869, + -52, 3771, -3116, 60869, 61367, -3116, 917, -3116, 1043, -3116, + -3116, -3116, -3116, 334, 887, -3116, 61865, 61865, 61865, 928, + 1216, -3116, -3116, -3116, 931, -3116, -3116, 1152, 20881, 20881, + 67328, 67328, 1043, 67328, 962, -3116, -3116, 61, -3116, -3116, + -3116, 881, 979, -101, -3116, -3116, 52901, -3116, -3116, 297, + 1345, 20881, 55889, 1002, -3116, 1010, 1002, 1022, 1047, 1059, + -3116, 6260, -3116, 55889, 1359, 1257, 54395, 56387, 661, 661, + 1523, 661, 857, 1169, 2616, 2052, -3116, 1437, -3116, 1069, + 1171, 1103, 1403, -3116, 979, 1496, 1232, 1313, 1519, 5283, + 1529, 1669, 1535, 1697, 1537, 1656, 20881, 47921, -101, -3116, + 11973, 20881, -3116, -3116, -3116, 1272, -3116, -3116, -3116, -3116, + -3116, 55889, 65834, 1181, 1187, -3116, -3116, -3116, -3116, 1619, + 1432, -3116, 1679, -3116, -3116, 1241, 62363, 62861, 63359, 63857, + 67826, 1632, -3116, -3116, 1588, -3116, -3116, -3116, 1269, -3116, + -3116, -3116, 189, 68324, 1594, 1235, 111, -3116, 1607, 125, + -3116, 1612, 1479, 15641, -3116, 1431, -3116, -3116, -3116, 385, + -3116, -3116, -3116, 169, -3116, -3116, 43856, 73233, 1344, 1273, + -3116, 20881, 20881, 1277, 7311, 60869, 61367, 20881, 55889, -3116, + 20881, 25597, 1281, 20881, 20881, 13021, 20881, 30276, 60869, 3771, + 1289, -3116, 377, 55889, 1302, -3116, 1409, 1409, 366, 32270, + 1611, -3116, 284, 1608, 1532, -3116, 32270, 1532, 1019, 1320, + 1613, 1532, -3116, 241, 1616, 1409, 35757, 1325, -3116, 1409, + 1546, -3116, -3116, 20881, 15641, 70814, 1804, -3116, -3116, -3116, + -3116, 1614, 65834, 1330, -3116, -3116, -3116, -3116, -3116, -3116, + 691, 1843, 158, 1849, 20881, 158, 158, 1332, 219, 219, + -3116, 1526, 1339, -3116, 220, 1342, 1350, 1856, 1864, 182, + 154, 1285, 158, 20881, -3116, 219, 1355, 1868, 1357, 1870, + 179, 181, -3116, 221, 20881, 20881, 20881, 1730, 20881, 10925, + -3116, 55889, 1871, 47921, 610, -3116, -101, 1362, 1043, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, 1364, -3116, 187, 5427, + -3116, -3116, -3116, -3116, -3116, -3116, 1402, -3116, -3116, -3116, + -3116, 1583, 20881, -3116, -3116, 1365, 1611, -3116, 222, -3116, + -3116, 1611, -3116, -3116, -3116, -3116, -3116, 260, 1784, 20881, + 20881, 65834, -101, -3116, 68822, -3116, -3116, -3116, -3116, -3116, + -3116, 344, -3116, 483, 45512, 1369, 1375, 1002, 55889, 55889, + 1857, -3116, -3116, -3116, -3116, 1010, 52901, 167, 1676, 146, + 1509, 131, -3116, -3116, 881, 881, 16165, 719, 235, 560, + 16689, 21405, 1740, 1631, 619, 721, 1752, -3116, 1635, 1862, + 25597, 20881, 20881, 857, 1169, 20881, -3116, -3116, -3116, 1686, + 55889, 50909, 703, 849, 1408, 1495, 1411, 275, 1842, -3116, + 1417, -3116, 1510, 55889, 72761, 240, -3116, 1883, 240, 240, + 251, 1884, 1513, 262, 1681, 65, -84, 907, -3116, 1417, + 52901, 148, 88, 1417, 55889, 1514, 404, 1417, 1838, 65834, + 1273, 41389, 1421, -3116, -3116, -3116, 185, 15641, -3116, 639, + 823, 987, 809, 208, 1422, 1444, 15641, 1464, 1508, 197, + 1543, 1558, 1603, 1633, 1645, 1647, 1651, 1655, 153, 1664, + 1670, 1672, 1680, 1699, 1701, -3116, 1712, 199, 1729, 225, + 15641, 1743, -3116, 201, -3116, 45512, 12, -3116, -3116, 1754, + 45641, -3116, 1727, 1520, 1521, 65834, 1474, 55889, 932, 1574, + 1803, 1858, 71297, 55889, 1682, 907, 1687, 1447, 1927, 1696, + 1187, 1700, 1466, 1709, -3116, 1786, -3116, 69320, 47921, -3116, + -3116, -3116, -3116, -3116, 1834, 1818, 65834, 47921, 1475, -3116, + -3116, 65834, -3116, 55889, 55889, -3116, 55889, 65834, -3116, 542, + 45512, 1983, 1249, 73233, 49415, -3116, -3116, -3116, -3116, 528, + 1013, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + 1043, 47921, -3116, 1219, 44429, 1480, 20881, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, 1482, 1836, + -3116, -3116, 5967, 1488, 44478, 1492, 25597, 25597, -101, 2128, + -3116, -3116, 25597, 1493, 49913, 44351, 1494, 1498, 44771, 17213, + 20881, 17213, 17213, 44900, -3116, 1501, 44995, 60869, 1497, 55889, + 54893, -3116, -3116, -3116, 20881, 20881, 3771, 55391, 1544, -3116, + 32270, -3116, 1788, 32270, -3116, -3116, 3313, -3116, 32270, 1796, + 20881, 32270, -3116, 1741, 1742, 1511, 32270, -3116, 55889, 1512, + 55889, -3116, -3116, 45512, -3116, 1504, 682, 1516, -3116, -3116, + -3116, -3116, -3116, 1564, -3116, 1564, 1564, -3116, -3116, -3116, + -3116, 1515, 1515, 1524, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, 1528, 1285, -3116, + 1564, -3116, 1515, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + 72761, -3116, -3116, -3116, -3116, 611, 642, -3116, 1530, -3116, + -3116, -3116, -3116, 1531, -3116, 1517, 1988, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, 6167, 692, 1515, 2571, + -3116, -3116, 20881, 20881, -3116, -3116, 1534, 45512, 1556, -3116, + -3116, 20881, 20881, -3116, -3116, -3116, -3116, 2029, -3116, 20881, + 1564, 1564, -3116, 7693, -3116, 40241, 17737, 1617, 1620, 2029, + -3116, 2029, -3116, 7693, 2032, 2032, 38247, -3116, 1685, 45124, + -3116, 1536, 2660, 6825, 1538, 1533, -3116, 1545, 1540, -3116, + -3116, 42362, 192, -101, -101, 20881, -3116, 2029, 20881, 7324, + 7324, -3116, 218, 70814, 20881, 20881, 20881, 20881, 20881, 20881, + 20881, 20881, 46427, 1624, 172, 65834, 20881, 20881, 1552, 929, + -3116, 20881, 1775, -3116, 1560, 20881, 1648, 319, 20881, 20881, + 20881, 20881, 20881, 20881, 20881, 20881, 20881, -3116, -3116, 29265, + 238, 612, 1897, 1928, -3, 290, 20881, 1918, 11973, -3116, + 1918, -3116, -3116, -3116, -3116, -3116, 223, -3116, -3116, 1504, + 1504, -3116, 65834, -3116, 55889, 297, 51905, 20881, -3116, -3116, + 1575, 1577, 544, -3116, 1636, -3116, -3116, 55889, -3116, 38745, + 56387, 56387, -3116, 1879, -3116, 321, 1578, -3116, 8657, 1832, + 1879, 881, -3116, -3116, 26645, 1710, 1876, 1816, -3116, -3116, + 1801, 1802, -3116, 1602, 45805, 21929, 21929, -3116, 1416, 45512, + 1420, -3116, -3116, -3116, -3116, -3116, -3116, 768, -3116, 55889, + 109, 36255, -3116, 1604, 178, -3116, 3020, 1943, 1906, 1740, + 721, 1615, -3116, 1715, 1623, 69818, 55889, 1903, 1866, 1904, + -74, 70814, -3116, -3116, -3116, -3116, 55889, 65834, 64355, 70316, + 48419, 55889, 47921, -3116, -3116, -3116, -3116, 55889, 1135, 55889, + 6905, -3116, -3116, -3116, -3116, 240, -3116, -3116, -3116, -3116, + -3116, 65834, 55889, -3116, -3116, 240, 65834, 55889, 240, -3116, + 1844, 55889, 55889, 55889, 55889, 1851, 55889, 55889, 1043, -3116, + -3116, -3116, 22453, 53, 53, 1855, 13545, 132, -3116, 20881, + 20881, 936, 249, 65834, 1798, -3116, -3116, 738, 1867, 252, + -3116, 1683, 55889, 55889, 55889, 55889, 65834, 55889, 1297, -3116, + -3116, -3116, -3116, -3116, 1639, -3116, 1642, 2008, 907, -3116, + 2009, 51407, 786, 3977, 2010, 1689, 2012, 14069, 2129, 2018, + 2169, 1657, 1898, -3116, -3116, 1886, -3116, 65834, 2174, -3116, + 111, -3116, 47921, -3116, 125, -3116, 1888, 190, -3116, 15641, + 20881, -3116, -3116, -3116, -3116, -3116, -3116, 1273, 29774, -3116, + 739, -3116, -3116, 2140, 1043, 2140, 774, -3116, -3116, 2140, + -3116, 2122, 2140, -3116, 70814, -3116, 7252, -3116, 20881, 20881, + -3116, 20881, 2013, -3116, 2175, 2175, 70814, 25597, 25597, 25597, + 25597, 25597, 25597, 206, 1355, 25597, 25597, 25597, 25597, 25597, + 25597, 25597, 25597, 25597, 27169, 414, -3116, -3116, 757, 2150, + 20881, 20881, 2024, 2013, 20881, -3116, 70814, 1674, -3116, 1684, + 1688, 20881, -3116, 70814, -3116, 55889, 1691, 16, -2, -3116, + 1677, 1693, -3116, 1611, -3116, 794, 980, 55889, 2914, 3759, + 4406, -3116, -3116, 20881, 2019, 3313, 32270, -3116, 20881, 1695, + -3116, -3116, 32270, 2036, -3116, -3116, -3116, 36753, 3313, 70814, + 772, -3116, 55889, 70814, 776, 20881, -3116, 15641, 2210, 70814, + 2176, 65834, 65834, 2211, 1702, 1703, 2029, 1790, -3116, 1791, + 1792, 1795, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, 70814, -3116, -3116, -3116, -3116, 174, -3116, -3116, + -3116, -3116, 1711, 1716, 20881, 20881, 108, -3116, 7589, 1713, + 1719, 5027, -3116, 1698, -3116, 1717, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, 1708, -3116, 1728, -3116, 1732, 1745, 1748, + 1733, 1734, 55889, -3116, 22977, -3116, 65834, -3116, -3116, 20881, + 20881, 55889, -3116, 1730, -3116, 1735, 1737, 7889, -3116, -3116, + -3116, 239, 873, 6681, 290, 5574, 5574, 5574, 7693, -3116, + -3116, -3116, 1758, -3116, 25597, 25597, -3116, 4166, 1572, 10925, + -3116, -3116, 2087, -3116, 1070, -3116, 1746, -3116, -3116, 2254, + -3116, 40241, 45888, 20881, 186, -3116, 20881, 1552, 20881, 1829, + 5574, 5574, 5574, 298, 298, 239, 239, 239, 873, 290, + -3116, -3116, -3116, 1747, 20881, 47921, -3116, 1749, 1750, 2119, + 1357, 20881, -3116, -3116, 32270, 1544, 12, 1544, 2029, 7324, + -3116, 1010, -3116, -3116, 1010, 45512, 55889, -3116, -3116, 2026, + 1765, 32270, 1810, 2249, 2232, 65834, -3116, -3116, 1771, 1918, + 1797, 1828, 1828, -3116, -3116, -3116, -3116, 1800, 20881, 1268, + 1800, -3116, 1879, 0, 2006, 1081, 1081, 1416, 2007, -3116, + -3116, 1852, -3116, -3116, -3116, 20881, 14593, 1424, -3116, 1436, + -3116, -3116, -3116, -3116, -3116, 1809, -3116, 2061, -3116, 55889, + -3116, -3116, 25597, 2250, 20881, 37251, 2257, 2065, -3116, -3116, + -3116, 1901, 1417, 20881, 2058, -3116, 155, 1819, 2185, -63, + 2136, 65834, -3116, 299, 301, -3116, 209, 2188, 190, 2189, + 190, 47921, 47921, 47921, 778, -3116, -3116, -3116, 1043, -3116, + 374, 796, -3116, -3116, -3116, -3116, 1912, 684, 907, 1417, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, 164, 784, 1417, + 1913, -3116, 1914, -3116, 1916, 879, 1417, -3116, -3116, 1656, + 9351, 45512, 581, 132, 132, 132, 15641, -3116, 2066, 2067, + 1833, 45512, 45512, 152, -3116, -3116, -3116, -3116, 1837, -3116, + 376, -3116, 65834, -3116, -3116, -3116, 1798, 1858, 55889, 907, + 1839, 2315, 1187, 1466, 1786, -3116, 2002, 459, 171, -3116, + 65834, 55889, 55889, 55889, 64853, -3116, -3116, -3116, 1840, 1845, + -3116, 7, 2071, 2079, 55889, 1882, 55889, 1411, 2323, 55889, + -3116, 797, 18261, 65834, -3116, 47921, 2218, 55889, 1818, -3116, + -3116, -3116, -3116, 65834, -3116, -3116, 45512, -3116, -3116, 20881, + 48917, -3116, -3116, -3116, -3116, -3116, -3116, 47921, -3116, 1043, + -3116, 1043, 2092, 65834, 42860, 1043, 43358, 1043, 1859, -3116, + 45512, 8332, 45512, 2024, -3116, 207, 2175, 2097, 2097, 2097, + 3941, 2201, 226, 1865, 2097, 2097, 2097, 337, 337, 207, + 207, 207, 2175, 414, 917, 49913, 1869, -3116, 45512, 45512, + -3116, -3116, 1861, -3116, -3116, -3116, -3116, 1863, 1872, -3116, + -3116, -3116, -3116, -3116, -3116, 65834, 1101, 1544, 449, 449, + 449, 449, -3116, 55889, 55889, 55889, 45512, 2316, 2198, -3116, + 3313, 45512, 55889, -3116, 28217, 55889, -3116, 2220, -3116, 2311, + -3116, 55889, 804, -3116, -3116, -3116, 828, 1877, 1703, 70814, + 845, 870, -3116, 2029, 145, 1875, 1547, 1561, 485, 1434, + -3116, 52901, -3116, -3116, 1878, 45288, 20881, -3116, 2251, -3116, + -3116, -3116, 20881, 20881, -3116, 40241, -3116, -3116, -3116, -3116, + -66, -66, 1885, 10925, 45417, -3116, 2196, 8458, 45512, -3116, + 1685, -3116, -3116, 7324, 20881, 1226, 3108, 20881, 1890, 20881, + 2225, -3116, -3116, 1887, -3116, -3116, 70814, 20881, 1891, 3263, + 25597, 25597, 4145, -3116, 5674, 20881, 10925, -3116, 41428, 1892, + 1889, 1855, 18785, -3116, 2109, 1893, -3116, 2019, 132, 2019, + 1894, -3116, -3116, -3116, -3116, 2571, -3116, 20881, 2054, 65834, + 507, 916, 900, -3116, -101, 38745, 1810, 20881, -3116, -3116, + 258, -3116, -3116, 1896, -3116, 1800, -3116, -3116, -3116, 2126, + -3116, -3116, -3116, 55889, -3116, 1900, -3116, 36255, 2240, 11449, + -3116, 36255, 55889, 55889, 8525, 2270, -3116, 65834, 65834, 65834, + -3116, 65834, 1902, 1907, 877, 1910, 375, -3116, 2784, 877, + 2248, 269, 1411, 262, 3458, 34, -3116, -3116, -3116, 1987, + 55889, -3116, 65834, -3116, -3116, -3116, -3116, -3116, 48419, -3116, + -3116, 39742, 47921, -3116, 47921, 55889, 55889, 55889, 55889, 55889, + 55889, 55889, 55889, 55889, 55889, 1273, 20881, -3116, 20881, 1915, + 1920, 1921, 1855, -3116, -3116, -3116, 205, -3116, 1911, -3116, + -3116, -3116, -84, -3116, 376, 1919, -3116, 51407, 4038, 1689, + 2392, 1923, 1858, 696, 65336, -3116, 1926, 1925, 923, 907, + 1924, 2407, -3116, 786, 51407, -3116, -3116, -3116, 2363, -3116, + 788, 210, -3116, 1187, -3116, 4038, 1466, -3116, 4038, 45512, + 1786, 948, 65834, 1994, -3116, 190, 965, -3116, -3116, -3116, + -3116, -3116, 65834, 1933, -3116, 1933, -3116, -3116, 1933, -3116, + -3116, -3116, -3116, 25597, 2283, 1940, 70814, -3116, -3116, 55889, + -3116, -3116, -3116, 976, 1942, 2019, 55889, 55889, 55889, 55889, + -3116, -3116, -3116, 19309, 20881, 1980, -3116, 1944, 12497, 2264, + -3116, 27693, -3116, -3116, 1947, 36753, 65834, -3116, -3116, -3116, + -3116, 2029, -3116, -3116, 65834, -3116, 1951, -3116, 1954, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, 20881, 45512, + -3116, 45512, -3116, -3116, -3116, -3116, -3116, 6735, -3116, 1950, + 1959, 65834, 20881, -3116, -3116, -3116, 746, 20881, 20881, 4166, + -3116, 45935, 20881, 70814, 984, 4166, 243, 20881, 3633, 4607, + 20881, 20881, 5828, 40747, -3116, 23501, 15117, -3116, 1961, 20881, + 40786, 39243, -3116, 32270, 2198, 1962, 2198, 1043, 1966, 45512, + 20881, -3116, -3116, -3116, -3116, 2025, -20, 33764, 2197, -3116, + 1984, 65834, -3116, 2054, 45512, -3116, -3116, 40241, -3116, -3116, + -3116, -3116, -3116, 2434, 2707, 1978, 1981, -3116, 1353, -3116, + -3116, 65834, 1985, -3116, 1990, 877, -3116, 65834, 2022, -3116, + 256, 2293, 113, -3116, 20881, -3116, 2388, 2466, 2784, 1995, + 65834, 55889, 25597, -3116, 285, 215, -3116, 2288, 55889, 2022, + 2433, -3116, -3116, -3116, 375, -3116, 2331, 2244, -3116, 240, + -3116, 20881, 375, 2246, 266, 65834, -3116, -3116, 3248, -3116, + 70814, 190, 190, -3116, 1516, 2011, 2014, 2015, 2016, 2020, + 2023, 2033, 2035, 2037, 2039, -3116, 2047, 2050, 2051, 2055, + 2056, 2057, 2059, 2068, 1528, 2070, -3116, 2074, 1896, 2075, + 2077, 2078, 2081, 2085, 71780, 2099, 2101, 2102, 2103, 1530, + 2105, 528, 1013, -3116, -3116, -3116, -3116, 2107, -3116, -3116, + -3116, 1235, 2021, -3116, -3116, -3116, 2098, -3116, 2100, -3116, + -3116, -3116, -3116, -3116, -3116, 2027, 2028, -3116, -3116, -3116, + 132, 2030, 2062, 65834, 1273, 116, 65834, 2072, 1882, 2492, + 19833, 47921, 884, 2262, 2034, -3116, 1043, 1689, -3116, 51407, + 4016, 421, 2079, -3116, 279, 1882, -3116, 2431, 1689, 2089, + 2501, -3116, 2110, -3116, 2255, 65834, 2111, -3116, -3116, 48917, + 1933, 4946, 25597, 70814, 985, 993, -3116, 2577, 2276, 2198, + -3116, -3116, -3116, -3116, -3116, 2118, -23, 2125, 10401, 2095, + -3116, -3116, -3116, -3116, -3116, -3116, 45512, 45512, 65834, 2309, + -3116, -3116, 2130, 2131, 37749, 2587, 2132, -3116, -3116, 2448, + -3116, 30774, -3116, 1703, 2138, 1703, 70814, 1703, -3116, -3116, + 45512, 20881, -3116, -3116, 41514, 2460, 4166, 4166, 45935, 1014, + -3116, 4166, 20881, 20881, 4166, 4166, 20881, -3116, 9876, 595, + -3116, 1016, -3116, 40825, -3116, 72263, -3116, -3116, 1980, 1043, + 1980, -3116, -3116, 2134, -3116, -3116, -3116, 2194, -3116, -3116, + 1018, 2570, 2054, 20881, -3116, -3116, 2156, 36255, -3116, -3116, + -3116, -3116, 36255, 877, -3116, 2328, 2022, 2159, -3116, -3116, + -3116, -3116, -3116, -3116, 40872, -3116, 43, 20881, -3116, 770, + 3941, -3116, -3116, -3116, -3116, 2022, 1187, -3116, 55889, 2637, + 2526, -3116, -3116, 45512, -3116, -3116, 2029, 2029, -3116, -3116, + 2311, -3116, -3116, 2160, -3116, -3116, 1235, 634, 39742, 55889, + 55889, -3116, -3116, 2162, -3116, -3116, -3116, -3116, -3116, -84, + 2558, 1052, 786, -3116, 4038, 4038, 45512, 1058, 55889, 2531, + 51407, -3116, 2644, 2167, 55889, 1882, 355, 355, -3116, 2317, + -3116, 2320, -3116, -3116, 2651, 371, -3116, 20357, 47921, 55889, + -3116, -3116, 33266, -3116, 4946, 1060, -3116, -3116, 2178, 2177, + -3116, 1980, 20881, 2183, 20881, -3116, 24025, 2652, 2172, -3116, + 20881, 2247, 28741, -3116, 20881, -3116, 55889, 60869, 2186, 60869, + -3116, -3116, -3116, -3116, -3116, 20881, -3116, 4166, 4166, 4166, + 20881, -3116, 20881, -3116, -3116, -3116, 2395, 2309, -3116, 2309, + 20881, 4038, -101, 3413, 65834, 17, -3116, 45512, -3116, -3116, + -3116, 55889, -3116, 47921, -3116, 877, -29, 2190, 20881, 40911, + 2430, -3116, -3116, 2462, -3116, 2521, -3116, 2256, 643, 2272, + -3116, -3116, -3116, -3116, 1273, 1043, 1689, 2079, 2089, -3116, + -3116, 2199, 55889, 4038, 786, 788, -3116, -3116, -3116, -3116, + -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, -3116, 4038, + 2641, 2425, 2645, 4038, 45512, 1072, 1994, 20881, 101, -3116, + 1079, 2642, -3116, -3116, 2712, 2309, 2205, 24025, 2206, -3116, + 2208, 65834, 45512, 2357, -3116, -3116, 2212, -3116, -3116, 20881, + -3116, 41867, 2213, 2216, 2674, 1855, 2247, 2247, -3116, -20, + -3116, -3116, 2646, 33266, 2602, 1187, 877, 2231, 1084, -3116, + -3116, -3116, -3116, -3116, 907, -3116, 41264, 2465, 645, 2451, + 2190, 20881, -3116, 2300, -3116, -3116, -3116, 2705, -3116, -3116, + 51407, 2229, 2089, 2079, 1882, 2089, 2454, -3116, 2456, -3116, + -3116, 2233, 41350, 65834, 65834, 1689, 33266, 65834, 2234, 2247, + -3116, 2235, -3116, -3116, -3116, 54893, -3116, 2238, -3116, -3116, + -3116, 20881, 166, -3116, -3116, 2289, 55889, 1108, 28, 2462, + 39742, -3116, 47921, 1455, -29, 2552, -3116, -3116, -3116, -3116, + 156, 2468, -3116, 2469, -3116, 45512, -3116, 4038, 51407, -3116, + -3116, -3116, -3116, -3116, -3116, 33266, 2642, -3116, 321, -3116, + 1544, -3116, 321, -3116, -3116, -3116, -3116, -3116, 1494, 24549, + 24549, 24549, 2242, 4038, -3116, 1544, -3116, 2379, 2451, -3116, + -3116, -3116, -3116, -3116, 478, 478, 2648, -3116, 2318, -3116, + 2089, 1122, 65834, 1800, -3116, 1800, 26121, 2403, 224, 44390, + 2625, -3116, 2625, 2625, -3116, -3116, -3116, 38745, -3116, -3116, + 2749, -3116, 247, -3116, -3116, -3116, 1689, 321, -3116, -3116, + 2740, -3116, -3116, -3116, -3116, -3116, 147, -3116, -3116, -3116, + 1544, 877, -3116, -3116, -3116, 1544, 1800, 25073, 2410, -3116, + 2481, -3116, -3116, -3116, -3116, -3116, -3116, -3116 +}; + +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int16 yydefact[] = +{ + 156, 265, 0, 1392, 1391, 1464, 265, 0, 1326, 0, + 265, 488, 403, 0, 1485, 1484, 0, 208, 265, 0, + 156, 0, 1425, 0, 0, 0, 551, 554, 552, 0, + 0, 0, 265, 591, 0, 1486, 265, 0, 0, 583, + 553, 0, 1442, 0, 0, 0, 0, 0, 2, 4, + 5, 6, 7, 8, 9, 23, 10, 11, 12, 13, + 19, 14, 15, 16, 17, 18, 20, 21, 22, 25, + 24, 26, 27, 1349, 28, 29, 30, 31, 0, 32, + 0, 33, 34, 35, 36, 527, 513, 596, 526, 0, + 0, 155, 695, 534, 37, 39, 38, 40, 41, 42, + 43, 44, 1487, 1483, 45, 264, 263, 257, 0, 0, + 0, 0, 0, 1463, 0, 0, 258, 112, 1511, 1512, + 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1888, + 1522, 1523, 1524, 1525, 1526, 1889, 1527, 1528, 1529, 1834, + 1835, 1890, 1836, 1837, 1530, 1531, 1532, 1533, 1534, 1535, + 1536, 1537, 1538, 1539, 1838, 1839, 1540, 1541, 1542, 1543, + 1544, 1840, 1891, 1841, 1545, 1546, 1547, 1548, 1549, 1892, + 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1893, + 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, + 1842, 1569, 1570, 1843, 1571, 1572, 1573, 1574, 1575, 1576, + 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, + 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, + 1597, 1844, 1598, 1599, 1600, 1601, 1602, 1603, 1845, 1604, + 1605, 1606, 1846, 1607, 1608, 1609, 1894, 1895, 1610, 1611, + 1847, 1897, 1612, 1613, 1848, 1849, 1614, 1615, 1616, 1617, + 1618, 1619, 1620, 1621, 1622, 1898, 1623, 1624, 1625, 1626, + 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1899, 1850, + 1635, 1636, 1637, 1638, 1639, 1851, 1852, 1853, 1640, 1900, + 1901, 1641, 1902, 1642, 1643, 1644, 1645, 1646, 1647, 1648, + 1903, 1649, 1904, 1650, 1651, 1652, 1653, 1654, 1655, 1656, + 1657, 1854, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, + 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, + 1676, 1677, 1855, 1906, 1856, 1678, 1679, 1680, 1857, 1681, + 1682, 1907, 1683, 1858, 1684, 1859, 1685, 1686, 1687, 1688, + 1689, 1690, 1691, 1692, 1693, 1694, 1860, 1908, 1695, 1909, + 1861, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, + 1705, 1706, 1707, 1708, 1862, 1910, 1709, 1710, 1863, 1711, + 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, + 1722, 1723, 1724, 1864, 1725, 1726, 1727, 1728, 1729, 1730, + 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, + 1741, 1742, 1743, 1911, 1744, 1745, 1746, 1865, 1747, 1748, + 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, + 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1866, 1766, 1767, + 1912, 1768, 1769, 1867, 1770, 1771, 1772, 1773, 1774, 1775, + 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1868, 1783, 1869, + 1784, 1785, 1786, 1914, 1787, 1788, 1789, 1790, 1791, 1792, + 1870, 1871, 1793, 1794, 1872, 1795, 1873, 1796, 1797, 1874, + 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807, + 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1875, 1876, 1815, + 1915, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, + 1825, 1826, 1827, 1828, 1829, 1877, 1878, 1879, 1880, 1881, + 1882, 1883, 1884, 1885, 1886, 1887, 1830, 1831, 1832, 1833, + 0, 113, 114, 1273, 1494, 0, 1251, 112, 1847, 1854, + 1868, 1324, 1325, 113, 0, 260, 487, 0, 0, 0, + 0, 0, 0, 210, 0, 397, 396, 0, 1315, 402, + 0, 0, 0, 116, 108, 1711, 115, 1250, 106, 122, + 2058, 2059, 2060, 2061, 1945, 2062, 2063, 2064, 2065, 1946, + 2066, 1947, 1948, 1949, 1950, 1951, 1952, 2067, 2068, 2069, + 1954, 1953, 2070, 1955, 2071, 1956, 2072, 1957, 1958, 2073, + 2074, 1959, 1565, 1960, 1961, 2075, 2076, 2077, 2078, 2079, + 2080, 2081, 2082, 2083, 1962, 1963, 2084, 2085, 1964, 2086, + 2087, 1965, 2088, 1966, 1967, 1968, 2089, 2090, 1969, 1970, + 2091, 1971, 2092, 2093, 1972, 1973, 1976, 1974, 2094, 1975, + 2095, 1977, 1978, 1979, 2096, 2097, 1980, 1981, 2098, 1982, + 1983, 1984, 1985, 1986, 2099, 1987, 2100, 1988, 1989, 2101, + 2102, 2103, 2104, 2105, 1991, 1990, 1992, 1993, 2106, 2107, + 2108, 2109, 1994, 1995, 1996, 2110, 2111, 1997, 2112, 2113, + 1998, 1999, 2114, 2000, 2001, 2115, 2002, 2003, 2116, 2004, + 2005, 2117, 2118, 2119, 2006, 2120, 2007, 2008, 2121, 2122, + 2009, 2010, 2123, 2011, 2124, 2125, 2126, 2127, 2012, 2013, + 2128, 2014, 2129, 2130, 2131, 2132, 2015, 2016, 2017, 2018, + 2019, 2020, 2021, 2022, 2023, 2024, 2025, 1460, 124, 123, + 125, 0, 421, 422, 0, 432, 0, 414, 419, 415, + 0, 441, 434, 442, 423, 413, 435, 424, 412, 209, + 0, 443, 429, 417, 0, 0, 0, 0, 261, 222, + 403, 0, 156, 0, 1353, 1354, 1355, 1356, 1357, 1358, + 1363, 1359, 1360, 1361, 1362, 1364, 1365, 1366, 1367, 1368, + 1344, 1349, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, + 1377, 1378, 1379, 1380, 1381, 1382, 1383, 0, 1326, 0, + 1840, 1891, 1845, 0, 1858, 0, 1861, 1862, 1747, 1869, + 1872, 1873, 1874, 1875, 0, 765, 115, 110, 749, 0, + 529, 699, 709, 749, 754, 1036, 777, 1037, 0, 117, + 1427, 1426, 1420, 195, 1288, 1472, 1612, 1652, 1764, 1870, + 1793, 1490, 1473, 1467, 1471, 262, 590, 588, 0, 1222, + 1612, 1652, 1751, 1764, 1870, 1400, 1404, 0, 259, 1492, + 1477, 0, 1478, 115, 535, 582, 0, 266, 1441, 0, + 1446, 0, 1727, 562, 565, 1282, 563, 527, 0, 0, + 1, 156, 1348, 1456, 0, 162, 0, 0, 586, 586, + 0, 586, 0, 519, 0, 0, 527, 522, 526, 696, + 1489, 1870, 1793, 1476, 1479, 1621, 0, 0, 1621, 0, + 1621, 0, 1621, 0, 0, 1466, 1206, 0, 1252, 118, + 0, 0, 1337, 1333, 1338, 1334, 1339, 1332, 1331, 1340, + 1336, 0, 0, 0, 368, 401, 400, 399, 398, 403, + 1621, 1299, 0, 450, 451, 0, 0, 0, 0, 0, + 206, 1310, 109, 107, 1621, 1461, 430, 431, 0, 420, + 416, 418, 0, 0, 1621, 1277, 440, 436, 1621, 440, + 1244, 1621, 0, 0, 214, 0, 396, 1346, 1384, 2012, + 1385, 1386, 1398, 0, 1399, 1389, 1352, 156, 0, 486, + 1323, 0, 0, 0, 1157, 749, 754, 0, 0, 767, + 0, 1177, 0, 1183, 0, 0, 0, 749, 534, 0, + 709, 766, 111, 0, 747, 748, 637, 637, 591, 0, + 572, 759, 0, 0, 762, 760, 0, 762, 0, 0, + 0, 762, 758, 717, 0, 637, 0, 747, 750, 637, + 0, 769, 1343, 0, 0, 0, 0, 1470, 1468, 1469, + 1474, 0, 0, 0, 1254, 1256, 1257, 1125, 1267, 1015, + 0, 1835, 1836, 1837, 1198, 1838, 1839, 1841, 1842, 1843, + 974, 1585, 1844, 1265, 1846, 1848, 1849, 1851, 1852, 1853, + 1854, 1855, 1856, 0, 1266, 1859, 1690, 1864, 1865, 1867, + 1870, 1871, 1264, 1876, 0, 0, 0, 1233, 1148, 0, + 1014, 0, 0, 0, 1199, 1207, 1007, 0, 0, 813, + 814, 835, 836, 815, 841, 842, 844, 816, 0, 1229, + 908, 1003, 1217, 1012, 1020, 1016, 1055, 1018, 1035, 1021, + 1092, 1013, 0, 1019, 1005, 1225, 572, 1223, 0, 1006, + 1253, 572, 1221, 1403, 1401, 1407, 1402, 0, 0, 0, + 0, 0, 111, 1448, 1449, 1440, 1438, 1439, 1437, 1436, + 1443, 0, 1445, 1349, 1143, 1145, 0, 564, 0, 0, + 0, 516, 515, 517, 3, 1282, 0, 0, 0, 1602, + 0, 1428, 584, 585, 0, 0, 0, 0, 0, 0, + 0, 0, 680, 611, 612, 614, 677, 681, 689, 0, + 0, 0, 0, 0, 523, 0, 1488, 1482, 1480, 0, + 0, 0, 140, 140, 0, 0, 0, 0, 0, 100, + 49, 93, 0, 0, 0, 0, 236, 249, 0, 0, + 0, 0, 0, 246, 0, 0, 229, 223, 225, 51, + 0, 140, 0, 47, 0, 0, 0, 53, 1464, 0, + 486, 1205, 0, 120, 121, 119, 112, 0, 2026, 1888, + 1889, 1890, 1891, 1841, 1892, 1893, 0, 1894, 1895, 1847, + 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1854, 1906, + 1907, 1908, 1909, 1910, 1911, 2052, 1912, 1868, 1914, 1874, + 0, 1915, 1028, 113, 1270, 1151, 596, 1149, 1283, 0, + 0, 1335, 0, 0, 0, 0, 484, 0, 0, 0, + 0, 1295, 0, 0, 1621, 202, 1621, 368, 0, 1621, + 368, 1621, 0, 1621, 207, 211, 1309, 1312, 0, 433, + 428, 426, 425, 427, 1621, 255, 0, 0, 1278, 438, + 439, 0, 407, 0, 0, 409, 0, 0, 219, 0, + 217, 0, 403, 156, 0, 230, 1394, 1395, 1393, 0, + 0, 1351, 233, 1388, 1397, 1387, 1396, 1350, 250, 1345, + 0, 0, 1341, 473, 0, 0, 0, 1158, 884, 883, + 865, 866, 881, 882, 867, 868, 875, 876, 886, 885, + 873, 874, 869, 870, 863, 864, 879, 880, 871, 872, + 877, 878, 861, 862, 1172, 1159, 1160, 1161, 1162, 1163, + 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 0, 0, + 708, 706, 0, 0, 0, 0, 0, 0, 1199, 0, + 978, 1013, 0, 0, 0, 1143, 1182, 0, 0, 0, + 0, 0, 0, 1143, 1188, 0, 0, 733, 745, 0, + 630, 636, 707, 705, 0, 1222, 700, 0, 779, 759, + 0, 758, 0, 0, 761, 755, 0, 756, 0, 0, + 0, 0, 757, 0, 0, 0, 0, 703, 0, 745, + 0, 704, 776, 1410, 1418, 196, 0, 1274, 1916, 1917, + 1918, 823, 1919, 852, 830, 852, 852, 1920, 1921, 1922, + 1923, 819, 819, 832, 1924, 1925, 1926, 1927, 1928, 820, + 821, 857, 1929, 1930, 1931, 1932, 1933, 0, 0, 1934, + 852, 1935, 819, 1936, 1937, 1938, 824, 1939, 787, 1940, + 0, 1941, 822, 788, 1942, 860, 860, 1943, 0, 847, + 1944, 1275, 1276, 0, 1154, 797, 805, 806, 807, 808, + 833, 834, 809, 839, 840, 810, 907, 0, 819, 156, + 1475, 1491, 0, 1148, 1022, 851, 838, 1197, 0, 846, + 845, 0, 1148, 828, 827, 826, 1009, 0, 825, 1105, + 852, 852, 850, 933, 829, 0, 0, 0, 0, 0, + 856, 0, 854, 934, 912, 913, 0, 1232, 1241, 1143, + 1147, 0, 1007, 1143, 0, 0, 1095, 1097, 0, 1024, + 1025, 0, 1200, 1255, 1008, 0, 1260, 0, 0, 907, + 907, 1228, 1125, 0, 1115, 1118, 0, 0, 1122, 1123, + 1124, 0, 0, 0, 1220, 0, 1133, 1135, 0, 0, + 949, 1131, 0, 952, 0, 0, 0, 0, 1119, 1120, + 1121, 1111, 1112, 1113, 1114, 1116, 1117, 1129, 1110, 930, + 0, 1004, 0, 1058, 0, 929, 1226, 698, 0, 1258, + 698, 1412, 1416, 1417, 1415, 1411, 0, 1406, 1405, 1408, + 1409, 1493, 0, 1450, 1434, 0, 1431, 1146, 693, 566, + 1246, 0, 570, 1457, 1455, 161, 160, 0, 213, 0, + 0, 0, 1421, 539, 538, 605, 597, 599, 605, 0, + 537, 0, 653, 654, 0, 0, 0, 0, 686, 684, + 1254, 1267, 641, 615, 640, 0, 0, 619, 0, 645, + 908, 679, 521, 609, 610, 613, 520, 0, 682, 0, + 692, 0, 558, 560, 543, 557, 555, 540, 548, 680, + 614, 0, 1481, 0, 0, 0, 0, 0, 1621, 0, + 0, 790, 84, 65, 320, 139, 0, 0, 0, 0, + 0, 0, 0, 92, 89, 90, 91, 0, 0, 0, + 0, 1274, 234, 235, 248, 0, 239, 240, 237, 241, + 242, 0, 0, 227, 228, 0, 0, 0, 0, 226, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1465, + 1458, 1201, 1206, 596, 596, 596, 0, 594, 595, 0, + 0, 0, 0, 0, 472, 366, 376, 0, 0, 0, + 1299, 0, 0, 0, 0, 0, 206, 0, 403, 1300, + 1298, 1302, 1301, 1303, 1591, 190, 0, 0, 201, 198, + 0, 365, 339, 0, 0, 1314, 0, 0, 0, 0, + 0, 0, 1621, 355, 1311, 0, 1462, 0, 0, 253, + 440, 1279, 0, 437, 440, 1245, 0, 440, 221, 0, + 0, 1347, 1390, 231, 251, 232, 252, 486, 481, 511, + 0, 489, 494, 470, 0, 470, 0, 491, 495, 470, + 490, 0, 470, 485, 0, 1051, 0, 1041, 0, 0, + 768, 0, 0, 1042, 980, 981, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 998, 997, 1043, 772, 0, 775, + 0, 0, 1180, 1181, 0, 1044, 0, 0, 1187, 0, + 0, 0, 1049, 0, 710, 0, 0, 0, 625, 629, + 632, 0, 635, 572, 528, 1612, 1652, 0, 583, 583, + 583, 581, 571, 0, 657, 0, 0, 734, 0, 0, + 736, 738, 0, 0, 741, 716, 715, 0, 0, 0, + 0, 780, 0, 1250, 0, 0, 197, 0, 0, 0, + 805, 0, 0, 0, 795, 791, 0, 887, 888, 889, + 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, + 811, 1287, 0, 817, 1292, 1293, 1290, 0, 1286, 1289, + 1291, 1294, 0, 0, 0, 0, 1196, 1192, 0, 0, + 0, 0, 1100, 1102, 1104, 0, 849, 848, 1109, 1115, + 1118, 1122, 1123, 1124, 1119, 1120, 1121, 1111, 1112, 1113, + 1114, 1116, 1117, 0, 1137, 0, 1091, 0, 0, 0, + 0, 0, 0, 1231, 0, 976, 0, 1026, 1011, 0, + 0, 1098, 1027, 1233, 1208, 0, 0, 0, 1263, 1262, + 909, 918, 921, 953, 954, 925, 926, 927, 931, 1285, + 1284, 1227, 0, 1219, 0, 0, 910, 935, 940, 0, + 1189, 970, 0, 958, 0, 948, 0, 956, 960, 936, + 951, 0, 932, 0, 1220, 1134, 1136, 0, 1132, 0, + 922, 923, 924, 914, 915, 916, 917, 919, 920, 928, + 1108, 1106, 1107, 0, 1206, 0, 1218, 0, 0, 1060, + 0, 0, 955, 1224, 0, 779, 596, 779, 0, 907, + 1451, 1282, 1444, 1433, 1282, 1144, 1247, 1281, 568, 0, + 0, 0, 1453, 147, 151, 0, 1207, 181, 183, 698, + 0, 1428, 1428, 1430, 1429, 603, 604, 608, 0, 0, + 608, 587, 536, 1865, 1747, 0, 0, 0, 0, 646, + 687, 0, 678, 643, 644, 0, 642, 1254, 647, 1253, + 648, 651, 652, 620, 1242, 688, 690, 0, 683, 0, + 1248, 542, 561, 0, 0, 0, 0, 0, 525, 524, + 694, 0, 50, 0, 1621, 67, 0, 0, 0, 0, + 0, 0, 270, 0, 370, 270, 105, 1621, 440, 1621, + 440, 1515, 1586, 1765, 0, 63, 344, 96, 0, 133, + 373, 0, 329, 86, 101, 126, 0, 0, 224, 52, + 238, 243, 129, 247, 244, 1319, 245, 140, 0, 48, + 0, 127, 0, 1317, 0, 0, 54, 131, 1321, 1466, + 0, 1205, 0, 594, 594, 594, 0, 1150, 0, 0, + 0, 1152, 1153, 948, 1328, 1329, 1330, 1327, 458, 471, + 0, 367, 0, 483, 461, 462, 472, 1297, 0, 202, + 368, 0, 368, 0, 211, 1299, 0, 0, 192, 188, + 0, 0, 0, 0, 366, 358, 356, 389, 0, 363, + 357, 0, 0, 315, 0, 1509, 0, 0, 0, 0, + 452, 0, 0, 206, 212, 0, 0, 0, 255, 256, + 406, 1280, 408, 0, 410, 220, 218, 1342, 478, 1148, + 0, 476, 482, 475, 477, 480, 474, 0, 469, 0, + 504, 0, 0, 0, 0, 0, 0, 0, 0, 1038, + 1156, 0, 1175, 1174, 979, 986, 989, 993, 994, 995, + 1176, 0, 0, 0, 990, 991, 992, 982, 983, 984, + 985, 987, 988, 996, 777, 0, 0, 771, 1185, 1184, + 1178, 1179, 0, 1046, 1047, 1048, 1186, 0, 0, 746, + 623, 621, 624, 626, 622, 0, 0, 779, 583, 583, + 583, 583, 580, 0, 0, 0, 778, 0, 674, 740, + 0, 764, 0, 737, 720, 0, 728, 0, 735, 784, + 751, 0, 0, 753, 1419, 801, 0, 796, 792, 0, + 0, 0, 802, 0, 0, 0, 0, 0, 0, 0, + 1155, 0, 589, 1023, 0, 0, 0, 1193, 0, 975, + 818, 831, 0, 1103, 1017, 0, 1126, 1090, 859, 858, + 860, 860, 0, 0, 0, 1240, 0, 1144, 1094, 1096, + 1241, 1010, 843, 907, 0, 0, 0, 0, 0, 0, + 0, 959, 950, 0, 957, 961, 0, 0, 0, 944, + 0, 0, 942, 971, 938, 0, 0, 972, 1205, 0, + 1209, 0, 0, 1059, 1068, 701, 697, 657, 594, 657, + 0, 1413, 1435, 1432, 569, 156, 1454, 0, 170, 0, + 0, 0, 0, 173, 187, 184, 1453, 0, 1422, 1423, + 0, 598, 600, 0, 1127, 608, 602, 650, 649, 0, + 618, 685, 616, 0, 691, 0, 559, 0, 545, 0, + 719, 0, 0, 0, 0, 0, 319, 0, 0, 0, + 270, 0, 378, 0, 385, 0, 0, 370, 351, 85, + 0, 0, 0, 59, 104, 77, 69, 55, 83, 0, + 0, 88, 0, 81, 98, 99, 97, 102, 0, 280, + 305, 0, 0, 316, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 486, 1206, 1202, 1206, 0, + 0, 0, 596, 592, 593, 1029, 0, 457, 510, 507, + 508, 506, 229, 377, 0, 0, 200, 365, 0, 1314, + 0, 0, 1296, 403, 0, 193, 0, 191, 0, 202, + 368, 0, 343, 339, 364, 337, 336, 338, 0, 1510, + 222, 0, 1504, 368, 1313, 0, 0, 453, 0, 447, + 211, 0, 0, 1308, 254, 440, 0, 465, 505, 512, + 492, 497, 0, 503, 499, 498, 493, 501, 500, 496, + 1039, 1050, 1173, 0, 0, 0, 0, 770, 773, 0, + 1045, 1040, 744, 0, 0, 657, 0, 0, 0, 0, + 574, 573, 579, 0, 0, 1062, 739, 0, 0, 0, + 726, 714, 721, 722, 0, 0, 0, 782, 781, 752, + 805, 0, 785, 805, 0, 805, 0, 803, 0, 812, + 900, 901, 902, 903, 904, 905, 906, 837, 0, 1195, + 1191, 1099, 1101, 1138, 855, 853, 1230, 1143, 1235, 1237, + 0, 0, 0, 1093, 977, 1261, 911, 0, 0, 941, + 1190, 962, 0, 0, 0, 937, 1126, 0, 0, 0, + 0, 0, 946, 0, 1213, 1206, 0, 1212, 0, 0, + 0, 0, 1034, 702, 674, 0, 674, 0, 0, 1452, + 0, 1447, 148, 149, 150, 0, 0, 0, 165, 142, + 0, 0, 182, 170, 158, 606, 607, 0, 601, 617, + 1243, 1249, 544, 0, 1007, 0, 0, 541, 0, 134, + 270, 0, 0, 66, 0, 387, 331, 379, 362, 346, + 0, 0, 0, 271, 0, 404, 0, 0, 352, 0, + 0, 0, 0, 332, 0, 0, 291, 0, 0, 362, + 0, 369, 287, 288, 0, 58, 78, 0, 74, 0, + 103, 0, 0, 0, 0, 0, 61, 73, 0, 56, + 0, 440, 440, 64, 1274, 1916, 1917, 1918, 1919, 1920, + 1921, 1922, 1923, 1924, 1925, 2036, 1926, 1927, 1928, 1929, + 1930, 1931, 1932, 1933, 2045, 1934, 277, 1935, 1690, 1936, + 1937, 1938, 1939, 1940, 0, 1941, 788, 1942, 1943, 2124, + 1944, 1111, 1112, 275, 276, 372, 272, 1275, 273, 380, + 274, 0, 375, 330, 130, 1320, 0, 128, 0, 1318, + 137, 135, 132, 1322, 1459, 0, 0, 1032, 1033, 1030, + 594, 0, 0, 0, 486, 464, 0, 0, 1509, 0, + 0, 0, 0, 1621, 0, 189, 0, 1314, 199, 365, + 0, 395, 315, 390, 0, 1509, 1507, 0, 1314, 1503, + 0, 444, 0, 203, 0, 0, 0, 411, 479, 0, + 502, 999, 0, 0, 0, 0, 633, 0, 639, 674, + 578, 577, 576, 575, 656, 1560, 1848, 1746, 0, 660, + 655, 658, 663, 665, 664, 666, 662, 673, 0, 676, + 763, 1139, 1141, 0, 0, 0, 0, 727, 729, 0, + 731, 0, 783, 799, 0, 800, 0, 798, 793, 804, + 1194, 1238, 1239, 1234, 0, 908, 968, 966, 963, 0, + 964, 945, 0, 0, 943, 939, 0, 973, 0, 0, + 1210, 0, 1054, 0, 1057, 1071, 1067, 1066, 1062, 1029, + 1062, 1414, 567, 169, 146, 172, 171, 0, 1207, 179, + 0, 0, 170, 0, 174, 454, 0, 0, 556, 718, + 549, 550, 0, 383, 68, 0, 362, 0, 270, 348, + 347, 350, 345, 349, 0, 405, 0, 0, 289, 0, + 296, 334, 335, 333, 290, 362, 368, 292, 0, 0, + 0, 70, 60, 57, 62, 71, 0, 0, 72, 75, + 784, 87, 80, 1274, 2045, 2054, 0, 0, 0, 0, + 0, 1204, 1203, 0, 460, 459, 509, 456, 467, 229, + 0, 0, 339, 1506, 0, 0, 449, 0, 0, 0, + 365, 194, 0, 0, 0, 1509, 0, 0, 267, 0, + 312, 0, 215, 1508, 0, 0, 1495, 0, 0, 0, + 1306, 1307, 0, 466, 1000, 0, 1001, 774, 0, 0, + 631, 1062, 0, 0, 0, 667, 661, 0, 1061, 1063, + 0, 628, 1142, 723, 0, 725, 0, 749, 0, 749, + 732, 794, 786, 1236, 1052, 0, 965, 969, 967, 947, + 1206, 1214, 1206, 1211, 1056, 1070, 1073, 676, 1259, 676, + 0, 0, 157, 0, 0, 154, 141, 159, 1128, 546, + 547, 0, 270, 0, 361, 384, 301, 279, 0, 0, + 0, 286, 293, 394, 295, 0, 79, 95, 0, 0, + 374, 138, 136, 1031, 486, 0, 1314, 315, 1503, 446, + 205, 0, 0, 0, 339, 222, 1505, 328, 321, 322, + 323, 324, 325, 326, 327, 342, 341, 313, 314, 0, + 0, 0, 0, 0, 448, 0, 1308, 0, 176, 185, + 0, 176, 1002, 634, 0, 676, 0, 0, 0, 659, + 0, 0, 675, 0, 532, 1140, 0, 713, 711, 0, + 712, 0, 0, 0, 0, 596, 628, 628, 143, 0, + 144, 180, 0, 0, 0, 368, 386, 360, 0, 353, + 299, 298, 300, 304, 0, 302, 0, 318, 0, 311, + 279, 0, 82, 0, 381, 455, 463, 0, 269, 1497, + 365, 0, 1503, 315, 1509, 1503, 0, 1500, 0, 445, + 204, 0, 0, 0, 178, 1314, 0, 178, 0, 628, + 669, 0, 668, 1065, 1064, 630, 724, 0, 1053, 1216, + 1215, 0, 1077, 531, 530, 0, 0, 0, 0, 394, + 0, 340, 0, 0, 301, 0, 294, 391, 392, 393, + 0, 307, 297, 308, 76, 94, 382, 0, 365, 1498, + 268, 216, 1496, 1501, 1502, 0, 176, 175, 605, 177, + 779, 186, 605, 638, 533, 670, 627, 730, 1072, 0, + 0, 0, 0, 0, 153, 779, 164, 0, 311, 359, + 354, 278, 303, 317, 0, 0, 0, 309, 0, 310, + 1503, 0, 178, 608, 1304, 608, 1834, 1561, 1800, 0, + 1089, 1078, 1089, 1089, 1069, 145, 152, 0, 270, 283, + 0, 282, 0, 371, 306, 1499, 1314, 605, 166, 167, + 0, 1082, 1081, 1080, 1084, 1083, 0, 1076, 1074, 1075, + 779, 388, 281, 285, 284, 779, 608, 0, 0, 1086, + 0, 1087, 163, 1305, 168, 1079, 1085, 1088 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -3059, -3059, -3059, 1865, 73, -3059, -3059, 139, -3059, 973, - -3059, 146, -787, 509, -3059, 77, 1252, 2549, 3668, 2713, - -515, -876, -1226, 1, 81, -1140, 3, -3059, -3059, -3059, - -3059, -3059, -502, 210, -3059, -3059, -634, -2561, -584, -3059, - -2881, -3004, -3059, -3059, -731, -2965, -2068, 86, -3059, -3059, - 88, 11, -2084, -3059, -1601, 36, -2072, 89, 898, -3059, - -2570, 90, -889, -1193, -933, -1200, -3059, -122, -3059, 425, - 96, 1228, -3059, 12, -2165, -2872, -594, -3059, -696, -3059, - -347, -3059, -641, -3059, -1047, -645, -679, -2818, -1139, -3059, - 1589, -396, -3059, 567, -3059, -2540, -3059, -3059, 558, -3059, - -1154, -3059, -2186, 140, -618, -2582, -2531, -2156, -912, 215, - -617, 193, -2122, -1331, -3059, 584, -3059, -600, -3059, -893, - -2019, 98, -3059, -3059, 1495, -909, -3059, 99, 1517, -2083, - 10, 22, -3059, -3059, -3059, -3059, -3059, -828, 513, -1206, - -3059, 454, -3059, -3059, -3059, -3059, -185, 171, -2234, 2, - 323, -43, -22, -3059, -16, -3059, -3059, -3059, 614, -3059, - -3059, 21, 32, 1665, -3059, -1020, -3059, -1587, 383, -3059, - 1814, 1841, -2144, -863, -66, -3059, 652, -1659, -2130, -629, - 1090, 1656, 1648, 407, -2525, -3059, -568, -3059, -88, -3059, - -3059, 647, 1132, -1544, -1559, -3059, -2203, -3059, -487, -375, - -3059, -3059, -3059, -3059, -3059, -2483, -2836, -620, 1103, -3059, - 1660, -3059, -3059, -3059, -3059, 61, -1497, 2814, 682, 41, - -3059, -3059, -3059, -3059, 108, -3059, 863, -195, -3059, 2054, - -675, -796, 1880, 34, 93, -1745, 31, 2068, 452, -3059, - -3059, 463, -2087, -1408, 408, -281, 872, -3059, -3059, -1246, - -3059, -1833, -1172, -3059, -3059, -806, 510, -3059, -3059, -3059, - 1645, 2152, -3059, -3059, 2178, 2764, -3059, -862, 2970, -781, - -1031, 1883, -924, 1887, -930, -946, -937, 1888, 1890, 1893, - 1896, 1897, 1898, -1534, 4692, 2325, 2519, -2179, -3059, -2178, - 993, 1003, 16, -3059, -1387, 128, -3059, -3059, -3059, -3059, - -2600, -3059, -442, -3059, -439, -3059, -3059, -3059, -1649, -3058, - -1674, -3059, 2641, 818, -3059, -3059, 410, -3059, -3059, -3059, - -3059, -1509, -3059, 5718, 712, -3059, -2024, -3059, -3059, -965, - -831, -638, -983, -1197, -1921, -3059, -3059, -3059, -3059, -3059, - -3059, -1488, -1772, -326, 777, -3059, -3059, 867, -3059, -3059, - -3059, -1703, -2098, -3059, -3059, -3059, 781, 1448, 84, -830, - -1621, -3059, 819, -2352, -3059, -3059, 399, -3059, -627, -1138, - -2428, 2164, 104, -3059, -925, -2536, -3059, -3059, -721, -2648, - -1131, -888, -3059, 100, -3059, 359, 105, -1650, -3059, 14, - -3059, -411, -3059, -3059, -2566, -3059, 106, 114, 2116, -3059, - 1094, -3059, -3059, -3059, -3059, -588, -3059, -635, -621, -3059, - -3059, 30, -898, 1564, -3059, 119, 372, -3059, 919, -3059, - 681, 120, 69, 1543, 121, 1231, -3059, -3059, -3059, 26, - -626, 363, -3059, 1240, -3059, -3059, 1694, 651, 124, -3059, - 43, 47, -3059, -3059, -3059, 72, 2816, 125, 15, -2904, - 129, -2759, -1672, -7, -3059, -3059, -3059, -713, -3059, -2530 + -3116, -3116, -3116, 1917, 80, 84, -898, -1172, -929, -1193, + -3116, -112, 86, -3116, -3116, 191, -3116, 1015, -3116, 173, + -728, 551, -3116, 1116, -3116, -3116, 1557, 521, 87, 95, + 2031, -3116, 989, -3116, 3790, 2554, 3581, 590, -513, -872, + -1226, 1, 10, -3116, -3116, -3116, -3116, -3116, -869, 497, + -1209, -3116, 437, -3116, -3116, -3116, -3116, -201, 157, -2260, + 5, -2158, -2878, -561, -3116, -665, -3116, -317, -3116, -610, + -3116, -961, -617, -650, -2783, -1132, -3116, 1622, -370, -3116, + 591, -3116, -2541, -3116, -3116, 579, -3116, -1149, -3116, -2218, + 159, -598, -2580, -2568, -2157, -882, 229, -603, 213, -2131, + -1285, -3116, 605, -3116, -587, -3116, -880, -2050, 99, -2758, + -1658, -7, -3116, -3116, -3116, -715, -3116, -2500, 102, 1541, + -2143, 106, -1656, -3116, -3116, -1664, 56, -2121, 6, -2115, + 107, -3116, -3116, 120, 18, -574, 287, -3116, 122, -3116, + -3116, 1527, -899, -3116, -3116, 487, 123, 971, -3116, -2561, + -3116, -588, -3116, -608, -638, -3116, -3116, 36, -888, 1502, + -3116, -3116, -3116, 8, -3116, -471, -3116, -3116, -2543, -3116, + 19, -3116, -3116, -3116, -3116, -1486, -407, 295, -3116, -3116, + -547, -2545, -497, -3116, -2974, -3006, -3116, -3116, -642, -2992, + -2051, 126, -3116, 1979, -349, 127, 128, -3116, 314, 133, + -1133, 14, 2, -43, -38, -3116, -34, -3116, -3116, -3116, + 648, -3116, -3116, 4, 52, 1704, -3116, -1023, -3116, -1495, + 533, -3116, 1853, 1860, -2135, -860, -67, -3116, 693, -1661, + -2113, -646, 1127, 1692, 1690, 446, -2940, -3116, -526, -3116, + 165, -3116, -3116, 687, 1179, -1548, -1557, -3116, -2202, -3116, + -438, -325, -3116, -3116, -3116, -3116, -3116, -2494, -2177, -599, + 1153, -3116, 1714, -3116, -3116, -3116, -3116, 35, -1480, 2871, + 734, -77, -3116, -3116, -3116, -3116, 161, -3116, 919, -154, + -3116, 2106, -671, -784, 1929, -228, 170, -1796, -15, 2114, + 494, -3116, -3116, 500, -2016, -1395, 458, -239, 921, -3116, + -3116, -1221, -3116, -1843, -1164, -3116, -3116, -733, -651, -3116, + -3116, -3116, 765, 969, -3116, -3116, 1846, 2049, -3116, -877, + 2073, -863, -1026, 1932, -916, 1934, -918, -920, -925, 1935, + 1936, 1937, 1938, 1939, 1945, 1946, -1531, 4923, 2344, 2886, + -2192, -3116, -2152, 1039, 1046, 21, -3116, -1384, 67, -3116, + -3116, -3116, -3116, -2387, -3116, -405, -3116, -402, -3116, -3116, + -3116, -1636, -3115, -1666, -3116, 2193, 861, -3116, -3116, 450, + -3116, -3116, -3116, -3116, -1514, -3116, 5936, 755, -3116, -2007, + -3116, -3116, -952, -829, -1153, -989, -1215, -1895, -3116, -3116, + -3116, -3116, -3116, -3116, -1485, -1729, -206, 818, -3116, -3116, + 910, -3116, -3116, -3116, -1730, -2095, -3116, -3116, -3116, 825, + 1499, 117, -817, -1594, -3116, 867, -2353, -3116, -3116, 441, + -3116, -604, -1116, -2426, 532, 23, -3116, 1263, -2503, -3116, + -3116, -712, -2657, -1096, -887, -3116, 134, 1644, 26, 135, + -3116, 136, 1267, -3116, -3116, -3116, 139, -3116, 338, 141, + 410, -3116, 958, -3116, 689, 15, -3116, -3116, -3116, 75, + 2843, 11, -2972 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -2046 +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + 0, 47, 48, 49, 754, 755, 1838, 1785, 2943, 1228, + 1775, 1352, 756, 2605, 2606, 2607, 2244, 1209, 3372, 2245, + 1210, 1211, 2609, 53, 54, 55, 115, 1240, 757, 758, + 531, 58, 2294, 921, 805, 1094, 807, 1095, 1604, 909, + 1243, 1244, 759, 2647, 2306, 3169, 2696, 3170, 2369, 2300, + 1362, 2362, 1879, 1819, 1363, 539, 1893, 2697, 2652, 1880, + 760, 2594, 2945, 3365, 2620, 3503, 2881, 2882, 3362, 3363, + 2597, 2247, 3431, 3432, 2679, 1766, 3426, 2325, 3305, 2251, + 2232, 2883, 2333, 3264, 2991, 2248, 2863, 2326, 3358, 1854, + 2327, 3359, 3118, 2328, 1816, 1842, 2598, 3433, 2252, 1817, + 2593, 2946, 1754, 2329, 3369, 2330, 550, 2867, 761, 2682, + 1308, 533, 522, 523, 1532, 719, 1284, 720, 762, 939, + 1848, 763, 1301, 1830, 64, 1315, 551, 1851, 764, 1839, + 765, 2666, 2667, 766, 767, 1170, 2548, 2162, 768, 745, + 746, 956, 1332, 747, 70, 1859, 769, 1338, 1339, 964, + 72, 873, 1354, 770, 1355, 1356, 973, 73, 2698, 975, + 976, 74, 75, 772, 3201, 3006, 1317, 1855, 2338, 552, + 773, 2828, 2164, 2551, 3354, 78, 3099, 2167, 1168, 3102, + 3319, 2821, 3097, 2552, 3394, 3448, 3100, 2168, 2169, 3320, + 2170, 774, 80, 822, 1692, 775, 776, 1036, 2018, 777, + 1757, 778, 1096, 86, 87, 1010, 88, 3112, 89, 90, + 1732, 1733, 1734, 851, 863, 864, 2160, 1448, 1962, 856, + 1174, 1701, 838, 839, 2290, 882, 1808, 1696, 1697, 2177, + 2561, 1725, 1726, 1183, 1184, 1950, 3334, 1951, 1952, 1441, + 1442, 3210, 1713, 1717, 1718, 2198, 2188, 1704, 2438, 3029, + 3030, 3031, 3032, 3033, 3034, 3035, 1097, 2735, 3221, 1721, + 1722, 1186, 1187, 1188, 1730, 2208, 92, 93, 2145, 2535, + 2536, 811, 3046, 1465, 1735, 2739, 2740, 2741, 3049, 3050, + 3051, 812, 1005, 1006, 1029, 1024, 1455, 1970, 813, 814, + 1927, 1928, 2407, 1031, 1964, 1980, 1981, 2747, 2460, 1533, + 2233, 1534, 1535, 1995, 1536, 1098, 1537, 1563, 1099, 1568, + 1539, 1100, 1101, 1102, 1542, 1103, 1104, 1105, 1106, 1556, + 1107, 1108, 1580, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004, 2005, 2006, 2007, 2008, 2009, 2010, 1154, 1736, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 816, 1118, 1119, + 1653, 2139, 2534, 3039, 3218, 3219, 2812, 3087, 3246, 3345, + 3462, 3490, 3491, 3517, 1120, 1121, 1596, 1597, 1598, 2032, + 2033, 2034, 2035, 2133, 1647, 1648, 1122, 2950, 1650, 2055, + 3042, 3043, 1155, 1434, 1591, 1286, 1287, 1547, 1408, 1409, + 1415, 1902, 1423, 1427, 1932, 1933, 1435, 2101, 1123, 2026, + 2027, 2478, 1558, 1124, 1242, 1603, 2807, 2136, 1651, 2095, + 1131, 1125, 1132, 1127, 1587, 1588, 2495, 2779, 2780, 2065, + 2205, 1680, 2210, 2211, 960, 1128, 1129, 1130, 1288, 526, + 1548, 3449, 1328, 1160, 1289, 2091, 779, 107, 780, 781, + 97, 782, 1150, 860, 1151, 1153, 783, 832, 833, 784, + 845, 846, 1474, 1667, 1475, 869, 102, 103, 1197, 834, + 852, 786, 3196 +}; + +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 520, 904, 70, 54, 865, 1124, 1224, 877, 1292, 714, - 68, 58, 65, 1022, 82, 102, 520, 713, 1188, 1680, - 953, 77, 69, 517, 1784, 1420, 93, 1154, 1241, 1783, - 1795, 1925, 1295, 2172, 2139, 1394, 972, 1348, 1767, 811, - 847, 77, 2557, 1748, 1395, 1350, 1331, 98, 1581, 1475, - 772, 1393, 1830, 740, 2530, 881, 2532, 1391, 1982, 1754, - 1736, 882, 2590, 1758, 2547, 2050, 2450, 778, 520, 520, - 851, 1337, 1354, 51, 2074, 2075, 2940, 52, 863, 1800, - 2660, 53, 2942, 2511, 805, 2971, 56, 1788, 57, 60, - 61, 811, 811, 2546, 2274, 819, 63, 1856, 66, 67, - 80, 2583, 889, 2988, 1656, 81, 83, 844, 1223, 1659, - 1229, 518, 1233, 963, 84, 955, 878, 879, 2969, 90, - 91, 92, 1593, 1241, 97, 101, 2985, 518, 966, 103, - 1004, 2630, 2631, 2632, 2769, 1025, 805, 805, 2644, -1893, - 2833, 897, -1324, -858, 2838, 1046, 1046, 2304, 1362, -1893, - -512, 813, -1265, 2195, -516, 2452, 2402, -2033, -2033, 3384, - -1262, -1262, 2143, -850, 1612, 2299, 2192, 3180, -1884, 1614, - -1265, -1246, 2089, 1325, -1901, -1884, -2024, -2024, -858, 518, - 518, 1609, -2042, -2042, 973, -855, 1404, -1266, -1901, -855, - 815, 1558, 1559, 2661, 1046, -1263, -1263, -2019, -2019, 1622, - -1266, -817, 1664, 813, 813, -830, -845, 815, 1571, 815, - 1350, 3165, -2044, -2044, 1210, 2300, 2431, 2432, 2648, 2469, - 1660, 1341, 815, 2652, 2089, 1902, 1046, 2438, 2646, 3184, - 1904, 2442, 3113, 1624, 1211, 1325, 532, 855, 1750, 2639, - 1143, 815, 3258, 2694, 2696, 1166, 2699, 1177, 1341, 1786, - -512, 1563, 1543, 1046, -516, 1589, 1180, 972, 2733, 2734, - 1798, 1739, 1136, 3096, 1241, -227, 1316, 1573, 1325, 1799, - -227, 3, 4, 1759, 2296, -466, 2668, 3271, 1768, 1612, - 1212, 1771, 1772, 1613, 1614, -649, 1350, 999, 3128, 1350, - 1350, 2205, 3148, 1902, 3418, 1942, 1699, 1903, 1904, 815, - 869, 944, 1612, 874, 1750, 1317, 1613, 1614, 1025, 3343, - 2414, 815, 1902, 2962, 1622, 2618, 1903, 1904, 3450, 874, - 1004, 2412, 3079, 71, 3081, -1104, 3457, 2805, 1942, 2807, - 3181, 3465, 2716, -1104, 1661, 1140, 872, 1622, 1355, 2989, - 3302, 1773, 1700, 71, 3514, 3182, 804, 1988, 1624, 783, - 3303, 1683, 533, 1005, 1665, 1742, 1731, 1732, 2586, 1735, - 2198, 71, 3124, 3204, 2415, 2110, 2076, 2425, 2426, 2427, - 864, 1624, 2705, 1173, 2126, 1213, 3370, -1125, 1174, 3408, - -2018, -2018, 2127, 1696, 3443, -1125, 1173, 2806, 833, 3147, - 870, 2167, 3110, -787, 1167, 2280, 2847, 1843, 804, 804, - 880, 1459, 3337, 3503, 3338, 1612, 873, 1144, 1701, 1145, - 2375, 2136, 1444, 2876, 3174, 2826, 2846, 1802, 3288, 3501, - 1869, 1871, 2856, 71, 1214, 3186, 2829, 2522, 1576, 1543, - 3419, 3388, 1868, 1576, 1215, 1500, 782, 1046, 2098, -512, - 1622, 2403, 1031, -516, 1778, 1295, 1216, 3519, 2857, 1175, - 1577, 3175, 1460, 1032, 2764, 1577, 2583, 1662, 2583, 1702, - 3526, 3369, 1175, 814, 1578, 2099, 3111, 1326, 1779, 3498, - 3430, 3472, 3451, 3433, 1624, 2199, 2168, 1760, 1217, 3238, - 3390, 3240, 2827, 1318, 874, 1774, 2877, 784, 2111, -669, - 834, 1697, 1006, 2587, 1581, 1775, 1168, 2995, 1176, 3269, - 2226, 3452, 3458, 1757, 2990, 2112, 3515, 2416, -512, 1575, - 2113, 1684, -516, 3010, 3420, 1744, 3304, 1543, 2413, 1137, - 3490, 1703, 3125, 3520, 2706, 3253, 1801, 3202, -787, 1326, - 1219, 2297, 3247, 980, 3344, 3183, 919, 1682, 1045, 3460, - 2090, 1902, 1985, 1757, 3263, 1903, 1904, 1011, 2114, 1905, - 1906, 1907, 2021, 2733, 2734, 1220, 3473, 3431, 2281, 1733, - 2137, 3504, 1326, 1675, 1750, 2206, 3259, 3496, 1734, 3114, - 2878, 3001, 2446, 2288, 1222, 1751, 2963, 1601, 2981, 856, - 2100, 714, 530, 1012, 1787, 2285, 2217, 2978, 2785, 941, - 2102, 902, 2513, 1934, 1138, 903, 2993, 1319, 2050, 1445, - 867, 953, 3316, 2703, 2279, 3159, 1858, 1040, 1949, 1014, - 945, 2534, 1862, 2940, 852, 3521, 1576, 3432, 2383, 2942, - 2560, 1554, 1558, 1559, 3279, 1970, -512, 972, 1327, 871, - -516, 2343, 1745, 875, 2192, 1750, 883, 1784, 1577, 2640, - 2641, 2026, 3137, 3138, 2370, 2664, 1753, 1571, -1893, 2748, - 2619, 1576, 1578, 2056, 1568, 2057, 2376, 2653, -1893, -1324, - 3466, -1265, 2555, 1645, 1568, -512, 2349, -512, 2549, -516, - 3250, -516, -850, 1577, 2142, 3251, 3104, -1884, 902, -1265, - -1246, 2072, 903, -1901, -1884, 1563, 2404, 1580, 2727, 3462, - 1330, -1104, 2644, 2409, -855, 534, -1266, -1901, 1560, 1607, - 3224, 1146, 1859, 2115, 1866, 1573, 865, 2032, 2033, -1266, - 1561, 2659, 3368, 993, 1566, -845, 1657, 3376, 2144, 966, - 2018, 1589, 1345, 1346, 1919, 1241, 2070, 1241, 1908, 3491, - 1589, 2443, 3351, 3162, 2154, 2443, 1018, 1778, 1543, 2010, - 2128, 2103, 971, -1125, 2053, 3122, 3375, 1173, -593, 1345, - 1346, 1909, 2104, -593, 3095, 1446, 1940, 865, 1612, 2155, - 2384, 1779, 2222, 2464, 3086, 112, -227, -227, 3522, 77, - 2385, 858, 2850, 2071, 2612, 1642, 1643, 1644, 1645, 968, - 868, 104, 520, 2814, 2191, 2191, 3005, 2613, 2279, 1916, - 1917, 1918, 1919, 520, 3352, 778, 1640, 1641, 1642, 1643, - 1644, 1645, 3087, 2410, 3097, 811, 1914, 1915, 1916, 1917, - 1918, 1919, 3404, 3405, 3492, 1189, 811, 3154, 3178, 3123, - 3441, 1910, 2223, 1175, -593, 2222, 881, 1624, 520, 520, - 105, 1543, 882, 2717, 2718, 2719, 2720, 2252, 2815, 2364, - 2969, 996, 2410, 3493, 2365, 1350, 3163, 2255, 113, 2628, - 2258, 520, 921, 977, 922, 1350, 3130, 71, 1350, 2851, - 2629, 995, 2336, 3060, 3135, 3445, 1035, 1036, 1037, 3179, - 70, 54, 1176, -593, 1759, 2940, 2251, 2594, 68, 58, - 65, 2942, 82, 102, 1141, 2580, 1147, 1759, 902, 77, - 69, 1155, 903, 518, 93, 520, 714, 1601, 3175, 1284, - 520, 2366, 1141, 2092, 518, 2523, 884, 2889, 3044, 844, - 844, 3046, 844, 3048, 2019, 98, 1437, 813, 1339, 900, - 2485, 1340, 3232, 2025, 2956, 2852, 2957, 2853, 813, 2419, - 2309, 3516, 1759, 3233, 1463, 2275, 2276, 2277, 1467, 3284, - 2353, 51, 1569, 1570, 3256, 52, 2342, 930, 1350, 53, - 2344, 2214, 1284, 2346, 56, 1870, 57, 60, 61, 1699, - 1046, 1294, 2776, 971, 63, 1543, 66, 67, 80, 2050, - 815, 520, 520, 81, 83, 2357, 1337, 520, 2250, 1576, - 520, 520, 84, 520, 520, 520, 520, 90, 91, 92, - 2098, 3243, 97, 101, 77, -1893, 930, 103, 2261, 520, - 1782, 1577, 2558, 2268, 2591, 1700, 520, 1046, 1379, 1380, - 1925, 2193, 2194, 1789, 1444, 1580, 2535, 2099, 2536, 931, - 778, 3270, 811, 2503, 520, 1284, 1546, 536, 1857, 811, - 906, 1911, 1912, 1913, 872, 1914, 1915, 1916, 1917, 1918, - 1919, 1943, 536, 1447, 865, 520, 1944, 1440, -594, 1454, - 2504, 1784, 2363, -594, 1451, 2253, 2367, 902, 1792, 2369, - 2256, 1600, 2130, 2566, 520, 918, 2131, 805, 931, 2459, - 925, 71, 864, 2226, 805, 520, 520, 520, 1760, 520, - 520, 2633, 3364, 3196, 714, 923, 1693, 924, 3347, 1857, - 537, 1760, 1599, 3070, 902, 2860, -1246, 1933, 903, 1935, - 1936, 2861, -208, 2555, 873, 537, 2408, 1452, 929, 1543, - 518, 1457, 982, 520, 2862, 2592, 932, 518, 937, 2620, - 2860, 1543, 1702, 994, -594, 1383, 1384, 1552, 942, 47, - 520, 520, 2100, 2420, 813, 2421, 1760, 2101, 2863, 943, - 2864, 813, 2102, 1673, 1757, 946, 1674, 1687, 1688, 1011, - 1694, 1543, 947, 882, 882, 933, 882, 1757, 1543, 1863, - 972, 948, 1864, 2863, 520, 1817, 949, 3289, 520, 520, - 2505, 880, 1593, -594, 2326, 2506, 2327, 1759, 520, 520, - 520, 959, 874, 520, 1703, 1012, 2605, 2669, 2607, 2467, - 934, 71, 1759, 2677, 1141, 2422, 1543, 2423, 23, 536, - 1543, 1453, 1757, 1546, 1818, 1984, 1543, 2743, 1985, 1131, - 1132, 1014, 1134, 1045, 2008, 2293, 1902, 2009, 2294, 2533, - 1903, 1904, 3290, 978, 1905, 1906, 1907, 2865, 1543, 2358, - 2396, 3291, 2359, 2397, 115, 1293, 1284, 979, 531, 1819, - 935, 2778, 980, 932, 1197, 1284, 744, 2843, 981, 2845, - 1198, 984, 2559, 2559, 107, 3292, 1170, 1785, 1172, 1759, - 907, 832, 537, 2444, 2501, 845, 2445, 987, 1197, 1284, - 541, 1200, 962, 2447, 1198, 2608, 2445, 2614, 2609, 2531, - 2615, 2680, 933, 988, 1985, 541, 908, 962, 989, 1820, - 990, 1546, 991, 2103, 854, 2866, 71, 2728, 545, 992, - 2867, 2735, 3006, 2617, 2104, -2015, -2015, 714, 1824, 1825, - 993, 1827, 1828, 545, 998, 1851, 714, 2655, 2621, 2050, - 3261, 2602, 1027, 2604, 3512, 2867, 2507, 3293, 1030, 804, - 1033, 875, 2593, 971, 2594, 539, 804, 2508, 1018, 1038, - 3294, 27, 28, 29, 3499, 2740, 3500, 1039, 2445, 2868, - 714, 909, -2016, -2016, 3475, 1199, 520, 1446, 1873, 892, - 77, 895, 1197, 899, 2595, 2869, 2938, 935, 1198, 3487, - 968, 1553, 2741, 1135, 2868, 2009, 2569, -2017, -2017, 1199, - 910, 1760, 1040, 1565, 1041, 2625, 778, 3525, 2744, 1150, - 2869, 2745, 1293, 2651, 2746, 2887, 1760, 2745, 1139, -207, - 1157, 2880, 1156, 520, 520, 2821, 34, 1159, 2822, 520, - 1591, 520, 2979, -2020, -2020, 2359, 520, 520, 520, 520, - 2955, 1160, 108, 911, 3523, 2844, 1909, 2980, 1161, 3524, - 2294, 520, 520, 109, 811, 1163, 520, 2999, 520, 1164, - 3000, 520, 541, 39, 542, 1171, 520, 1757, 520, 520, - 2965, 520, 2765, 2766, 2879, 520, 2888, 3007, 1190, 811, - 3008, 811, 1757, 1760, 811, 1192, 2870, 1195, 110, 811, - 545, 1194, 811, 1199, 811, 2871, 41, 3061, 811, 3197, - 2009, 1196, 2009, 1208, 1961, 3198, 1962, 44, 2445, 1964, - 1209, 2870, 880, 880, 1968, 880, 1910, 1971, 1226, 1972, - 2871, 1817, 3227, 1976, 805, 2009, 805, 1371, 1372, 805, - 3234, 1200, 1546, 1985, 805, 2753, 2755, 805, 111, 805, - 1589, 1593, 518, 805, 2754, 2756, 2757, 1230, 3333, 1757, - 3334, 2752, 2747, 2749, 1234, 1200, 2751, 23, 1543, 3295, - 1818, 47, 3296, 1535, 520, 520, 813, 518, 912, 518, - 2014, 2011, 518, 520, 520, -2021, -2021, 518, 2012, 913, - 518, 520, 518, 1235, 3244, 1287, 518, 3245, 520, 77, - 2013, 813, 1202, 813, 2016, 3169, 813, 1379, 1380, 3277, - 3278, 813, 2359, 2294, 813, 3313, 813, 1290, 2009, 1291, - 813, 1296, 1201, 714, 914, 2017, 1202, 520, 1298, 3373, - 520, 1210, 2359, 1312, 1203, 1546, 520, 520, 520, 520, - 520, 520, 520, 520, 714, -2022, -2022, 915, 520, 520, - 2139, 1211, 2086, 520, 2686, 1820, 1302, 520, 1203, 1200, - 520, 520, 520, 520, 520, 520, 520, 520, 520, 972, - 2555, 520, 1314, 3386, 916, 3141, 3387, 1315, 520, 1197, - 1284, 3412, 1322, 3456, 3413, 1198, 3387, 3497, -644, -644, - 3387, 1329, 71, -2023, -2023, -2025, -2025, 1212, 2881, 520, - 1323, 2070, 1543, 2174, 1332, 1204, -2026, -2026, 2882, 882, - 27, 28, 29, 815, -2027, -2027, 1227, 1350, 3105, 2887, - 1202, 520, -2028, -2028, 1383, 1384, -2029, -2029, 1333, 1204, - -2030, -2030, 520, 520, 1147, 1338, 1911, 1912, 1913, 1356, - 1914, 1915, 1916, 1917, 1918, 1919, -2031, -2031, -2032, -2032, - 1535, 1357, 1228, -2034, -2034, -2035, -2035, 1360, 1543, -2036, - -2036, -2037, -2037, -2038, -2038, 1363, 2883, -2039, -2039, 1546, - 2837, -2041, -2041, -2043, -2043, 34, -2045, -2045, 714, 1418, - 714, 1804, 1805, 1988, -648, -648, 2238, 1433, 2242, 3158, - 1199, 2973, 1213, 1431, 2991, 1434, 804, 1441, 804, 1448, - 2961, 804, -647, -647, 1381, 1382, 804, 2998, 1449, 804, - 3474, 804, 39, 1455, 3476, 804, 1456, 920, 1383, 1384, - 520, 1462, 927, 1204, 1284, 928, 1466, 520, 520, 3101, - 3102, 3223, 3483, 3484, 14, 15, 3312, 1197, 1535, 3509, - 3510, 1214, 1468, 1198, 3072, 41, 1548, 3045, 1668, 1669, - 1549, 1215, 1551, -821, -828, 1560, 44, 1564, 47, -669, - -670, 1543, -818, 1216, 1045, 2884, -819, 1902, 1284, 3517, - 1574, 1903, 1904, 2330, -822, 1905, 1906, 1907, 1575, 23, - 714, -820, 1585, 1598, 1651, 1604, 1045, 1284, 520, 1902, - 1653, 1655, 2779, 1903, 1904, 1217, 971, -2046, -2046, -2046, - 1606, 71, 1667, 1676, 1677, 1681, 1685, 1686, 1176, 1174, - 47, 1721, 1723, 1546, 1725, 1755, 1737, 520, 520, 1756, - 520, 1762, 1757, 1764, 1763, 1546, 520, 520, 520, 520, - 520, 520, 2555, 2938, 520, 520, 520, 520, 520, 520, - 520, 520, 520, 520, 1769, 1776, 1200, 1219, 1199, 520, - 520, 1777, 1791, 520, 1781, 1546, 1543, 1797, 112, 1807, - 520, 1813, 1546, 1808, 1809, 1822, 1823, 1816, 1831, 1832, - 1835, 1838, 1220, 1839, 1841, 1845, 1842, 3133, 1844, 1852, - 2096, 1853, 520, 1857, 1865, 1350, 520, 3312, 520, 1891, - 1350, 1222, 520, 2885, 1893, 1197, 2886, 3275, 1896, 1899, - 1546, 1198, 1894, 1231, 1546, 1922, 520, 1202, 1284, 811, - 1546, 1930, 1931, 3142, 3143, 811, 1938, 1941, 1959, 1963, - 1969, 1975, 27, 28, 29, 1973, 1980, 1554, 1974, 1983, - 3312, 1986, 1546, 1543, 2433, 1991, 1561, 1869, 1871, 1232, - 2436, 1566, 1987, 520, 520, 1989, 3043, 1992, 880, 2021, - 1046, 1990, 2020, 2054, 805, 2055, 1612, 2060, 2065, 1535, - 805, 2063, 2088, 2106, 2068, 2066, 2109, 2067, 2095, 2107, - 2133, 2134, 2140, 986, 2816, 2152, 2153, 1909, 2157, 3312, - 873, 2170, 865, 520, 1593, 2173, 2183, 34, 520, 520, - 2184, 2185, 2182, 2186, 2187, 2208, 2209, 518, 36, 3366, - 2204, 2219, 2212, 518, 1200, 1757, 1199, 2215, 2220, 3328, - 1204, 874, 2295, 520, 520, 2221, 2291, 2301, 520, 2310, - 38, 813, 2312, 2313, 39, 1197, 2314, 813, 23, 2316, - 2315, 1198, 520, 2317, 2331, 520, 2332, 520, 2334, 2341, - 1543, 1008, 2337, 2339, 2338, 2360, 1009, 1910, 2345, 2368, - 1927, 1902, 1535, 520, 714, 2398, 1926, 41, 2405, 2406, - 520, 2213, 2407, 520, 2411, 1202, 2417, 1191, 44, 1910, - 3119, 2418, 2429, 2435, 1543, 2437, 2449, 2451, 2456, 2457, - 520, 2458, 2311, 2460, 45, 2461, 811, 2462, 2465, 2463, - 2466, 2473, 2476, 520, 71, 2938, 2502, 1203, 2474, 1288, - 2477, 2478, 2509, 811, 2481, 1010, 2479, 554, 46, 2482, - 520, 520, 2519, 745, 2480, 1304, 1306, 1309, 1311, 2497, - 2518, 2483, 47, 2526, 2524, 821, 2484, 520, 2525, 520, - 2494, 805, 2537, 2495, 2538, 2540, 1199, 2542, 520, 862, - 862, 2548, 1869, 1871, 1784, 3264, 2543, 2564, 805, -650, - 2551, 2561, 2550, 1543, 1350, 2562, 714, 714, 714, 2565, - 2817, 2568, 1200, 2572, 2238, 2238, 2238, 1407, 1204, 2573, - 2574, 27, 28, 29, 518, 2576, 1011, 1045, 2578, 2579, - 1902, 2582, 2601, 536, 1903, 1904, 1535, 2603, 1905, 1906, - 1907, 518, 2616, 2634, 2635, 520, 1543, 865, 813, -525, - 2622, 1284, 893, 2636, 2637, 3063, 2650, 2623, -1310, 2624, - 2654, 2649, 1012, -525, 2666, 813, 804, 972, -525, 2259, - 2667, 2670, 804, 1202, 2671, 2678, 2683, 2674, 1013, 2693, - 2701, 2704, 2707, 2710, 2724, 2725, 34, 714, 1014, 2711, - 1824, 1825, 1546, 1827, 1828, 1873, 537, 2712, 2713, 2736, - 2737, 2742, 2750, 2758, 2761, 2260, 2767, 1911, 1912, 1913, - 520, 1914, 1915, 1916, 1917, 1918, 1919, 2773, 2781, -525, - 2783, 2796, 1015, 39, 520, 971, 2784, 2802, 2811, -2046, - -2046, -2046, 714, 1914, 1915, 1916, 1917, 1918, 1919, -525, - 1873, 2804, 1200, 1965, 2834, 2787, 2797, 2070, 1543, 2808, - 2308, 2828, 3317, 2830, 3319, 2842, 41, 2832, 2849, 2848, - 2855, 2875, 2891, 2958, 2959, 3327, 2964, 44, 1016, 2960, - 520, 2967, 2968, 2972, 2977, 1017, 1204, 2976, 2982, 2983, - 1535, 2987, 2996, 45, 2294, 3003, 3004, 3029, -525, 3009, - 3031, 3035, 1535, 811, 3039, 3049, 3050, -525, 1591, 2266, - 3053, 3073, 3329, 1202, 3331, 3052, 3080, 46, 3083, 3085, - 520, 3092, 3098, 3094, 3410, 1018, 2096, 3449, 3099, 3100, - 3106, 2818, 1535, 865, 3108, 3112, 1546, 3116, 1738, 1535, - 3107, 3117, 2520, 3126, 1019, 2267, 3118, 3129, 2799, 3131, - 1909, 1765, 520, 804, 3132, -1776, 3414, 3136, 520, 520, - -2014, -2015, 3150, 3403, -2016, -2017, 865, -2018, 3149, 520, - 804, -2019, 1790, -2020, 3151, 3155, 1350, 1535, -2021, -2022, - 520, 1535, -2023, 520, 3152, 520, 541, 1535, 962, 3156, - 3398, 518, 1546, 520, -2025, -2026, 520, 520, -2027, -2028, - -2029, 520, 520, -2030, -2031, -2032, -2034, -2035, 520, 1535, - 3153, 544, -2036, 1020, 545, 813, 1204, 2836, 1966, -2037, - 1910, 1611, -2038, 520, 1612, -2039, 3166, -2040, 1613, 1614, - 2014, 2011, -2041, 520, -2042, 1815, 2820, -2043, 2012, -2044, - -2045, -1263, 3164, 3170, 1834, 3171, 516, 527, 3185, 77, - 2013, 3189, 552, 520, 2016, -1776, -525, 3173, 552, 1622, - 3187, 3190, 802, 3193, 816, 816, -2046, 3199, 3203, 820, - 552, 828, 3200, 3207, 828, 2017, 3211, 846, 850, 3213, - 3217, 850, 3205, 3219, 552, 552, 3214, 3218, 3226, 3222, - 3242, 3246, 714, 1624, 3252, 2941, 714, 3241, 714, 3254, - 2238, 3249, -1776, 3266, 2943, 3267, 2242, -1262, 3274, 1876, - 520, 3276, 520, 3283, 802, 802, -1776, 3285, 3286, 3299, - 1543, -1776, 3300, 864, 902, 3301, -1776, 1159, 903, 3314, - 3315, 3318, 3321, 3322, 3324, -1776, 3330, 3335, 3355, 846, - -1776, 3125, 2970, 3359, 3361, 3362, 850, 552, 850, 850, - 850, 3365, 3371, 3438, 1824, 1825, 1877, 1827, 1828, 3379, - 3378, 3380, 3384, 3389, 3391, 3393, 3076, 3396, 1537, 3407, - 2992, 3397, -1776, 2994, 3400, 3402, 865, 1878, 3401, 3409, - 3411, 3416, 3421, 1957, 3428, 3427, 3429, 520, 3434, -2046, - 1546, 3435, -1776, 3436, 3464, 1879, 3444, 3446, 3448, 1880, - 3467, 3454, 3469, 3485, 3488, 939, -2046, 520, 520, 3502, - 3465, -2046, 520, 1008, 3466, 520, 3507, 3513, 1009, 3518, - 3527, 1881, 3528, 1162, 1882, 2890, 2246, 2599, 817, 817, - 1911, 1912, 1913, 3342, 1914, 1915, 1916, 1917, 1918, 1919, - 1883, -1776, 520, 3442, -1776, 2894, 3406, 3511, 2823, -2046, - -1776, 1611, 2347, 3139, 1612, 2685, 520, 3425, 1613, 1614, - 3495, 520, 520, 3262, 3463, 865, 520, 1546, 1210, 3470, - 3489, 520, -525, 3298, 520, 520, 1747, 1010, 2581, 520, - 1284, 23, 2606, 520, 904, 3461, -525, 520, 1211, 1622, - -1776, -525, 2577, 2859, 520, 3468, -2046, 2986, 2944, 1591, - 3459, 2645, 1821, 2690, 1633, 3194, 2966, 1855, 2567, 1438, - 811, 1678, 2553, -1776, 2211, 2715, 1717, 901, 3447, 1535, - 2179, 3392, 3320, 1624, 2563, 1718, 2210, 806, 2441, 2539, - 3038, 1722, 1591, 1884, 1212, 1440, 1439, 3221, 520, 2709, - 2329, 1885, -525, 2739, 997, 1537, 520, 983, 1011, 2708, - 3268, 71, 2455, 1405, 1390, 805, 2355, 71, 1392, 1396, - 23, 1397, -525, 1886, 1398, 520, 2356, 1399, 1400, 1401, - 3395, 852, 3394, 2556, 1546, 2492, 2763, 1950, 2493, 2470, - 2516, 2514, 2775, 2835, 1012, 3084, 3382, 2809, 2500, 976, - 1887, 2289, 2448, 1889, 1867, 2148, 1008, 958, 518, -1776, - 1013, 1009, 2824, 2883, -2046, 2150, 890, 0, 2941, -1776, - 1014, -525, 2626, 3340, 0, 2147, 0, 2149, 1793, -2046, - -525, 0, 813, 0, 27, 28, 29, 2159, -1776, 1213, - -1776, -1776, 0, 1537, 0, 0, -2046, 0, 0, 0, - 0, -2046, 1210, 0, 1015, 0, 0, 0, 0, 0, - 714, 0, 0, 1535, 0, 520, 0, 0, 1873, 0, - 1010, 0, 1211, 71, 0, 2196, 865, -1776, 0, 0, - -1776, -1776, -1776, 0, 0, 3177, 0, 0, 1214, -2046, - 0, 0, 0, 971, 0, 0, 520, 1546, 1215, 34, - 1016, 71, 0, 0, 71, 0, 0, 1017, 0, 0, - 1216, 0, 520, 27, 28, 29, 0, 0, 1212, 1535, - 0, -2046, 0, 862, 0, 0, 0, 0, 1640, 1641, - 1642, 1643, 1644, 1645, 0, 0, 39, 0, 0, 0, - 1546, 1011, 1217, 0, 1633, 520, 0, 1018, 0, 0, - 0, 0, 1591, 0, 0, 0, 520, 520, 0, 0, - 520, 0, 520, 0, 0, 0, 1019, 0, 0, 41, - 2302, 2303, 2305, 2306, 2307, 0, 0, 1012, 34, -525, - 44, 0, 0, 0, 850, 0, 0, 520, 0, 850, - 0, 0, 850, 1013, 1219, 0, 45, 0, 1611, 0, - 552, 1612, 0, 1014, 0, 1613, 1614, 0, 0, 0, - 0, 520, 0, 1213, 0, 39, 0, 0, 0, 1220, - 46, 0, 1535, 0, 0, 0, 0, 804, 0, 0, - 0, 0, 0, 0, 47, 1020, 1622, 1015, 1222, 0, - 0, 864, 2941, -2046, -2046, 0, 0, 902, 41, 0, - 0, 903, 0, 0, 0, 536, 0, 0, 1187, 44, - 0, 0, 1214, 0, 1537, 0, 714, 0, 3280, 3281, - 1624, 0, 1215, 0, 1873, 45, 0, 0, 0, 0, - -1310, 0, 520, 1016, 1216, 1538, 520, 0, 0, 0, - 1017, 0, 0, 0, 0, 0, 520, 0, 520, 46, - 520, 0, 0, 0, 520, 2424, 520, 0, 520, 811, - 0, 1540, 0, 47, 0, 0, 1217, 1535, 537, 520, - 0, 0, 0, 0, 520, 1045, 520, 0, 1902, 0, - 1018, 0, 1903, 1904, 520, 2510, 1905, 1906, 1907, 0, - 0, 0, 0, 0, 3339, 0, 3341, 714, 0, 1019, - 0, -2046, 520, 0, 0, 3348, 0, 1537, 1640, 1641, - 1642, 1643, 1644, 1645, 0, 0, -2046, 0, 1219, 0, - 0, 0, 961, 0, 0, 0, 3176, 0, 0, 0, - 536, 0, 0, -2046, 0, 0, 0, 3374, -2046, 0, - 951, 552, 552, 1220, 1535, 0, 23, 518, 0, 0, - 0, 520, 0, 3377, 0, -1310, 71, 3381, 0, 0, - 0, 520, 1222, 1413, 23, 0, 0, 0, 1020, 0, - 862, 813, 0, 520, 0, 0, -2046, 0, 0, 0, - 0, 974, 527, 816, 0, 0, 0, 520, 516, 0, - 850, 0, 1591, 537, 0, 0, 0, 0, 540, 802, - 0, 0, 0, 1001, 1001, 520, 0, 0, 1001, 1024, - 811, 0, 1538, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 828, 828, 828, 0, 0, 0, 0, 0, - 520, 1633, 0, 0, 0, 0, 828, 828, 1540, 828, - 0, 1537, 0, 0, 0, 520, 0, 538, 541, 0, - 962, 1535, 850, 811, 2941, 0, 714, 0, 552, 0, - 0, 0, 0, 0, 3348, 2207, 539, 543, 0, 0, - 850, 0, 0, 544, 0, 0, 545, 0, 0, 520, - 3471, 0, 0, 0, 850, 1535, 0, 0, 1909, 27, - 28, 29, 0, 520, 520, 520, 0, 0, 518, 0, - 1538, 0, 811, 0, 0, 0, 3486, 27, 28, 29, - 0, 0, 0, 0, 0, 0, 850, 1289, 0, 0, - 520, 0, 813, 540, 0, 0, 1540, 0, 1300, 0, - -207, -2046, 850, 850, 850, 850, 0, 0, 0, 71, - 71, 518, 0, 0, 1860, 975, 1861, 817, 1321, 0, - 0, 0, 0, 0, 34, 0, 0, 1414, 1910, 0, - 0, 520, 0, 0, 1535, 813, 0, 0, 0, 0, - 0, 0, 34, 541, 0, 542, 0, 1029, 0, 0, - 0, 1001, 1024, 0, 850, 1537, 0, 1412, 0, 0, - 518, 39, 543, 1001, 1001, 0, 0, 1537, 544, 552, - 0, 545, 1133, 2647, 0, 802, 0, 1535, 0, 39, - 0, 0, 802, 0, 813, 71, 0, 71, 2662, 2663, - 2665, 0, 552, 0, 41, 0, 0, 1537, 0, 1469, - 0, 0, 0, 2676, 1537, 44, 2679, 0, -2046, 1550, - 0, 2684, 41, 0, 0, 1640, 1641, 1642, 1643, 1644, - 1645, 45, 1611, 44, 0, 1612, 0, 0, 71, 1613, - 1614, 0, 0, -2046, -2046, -2046, 0, 0, 0, 45, - 0, 0, 1537, 0, 71, 46, 1537, 0, 71, 1415, - 0, 0, 1537, 0, 0, 0, 0, 0, 552, 47, - 1622, 0, 0, 46, 0, 0, 0, 1623, 0, 0, - 0, 0, 0, 0, 1537, 0, 0, 47, 0, 1535, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1538, 0, 0, 1624, 0, 0, 2721, 2722, 2723, - 0, 553, 0, 1347, 0, 0, 0, 553, 1670, 0, - 1672, 0, 0, 0, 1389, 1714, 0, 1540, 0, 553, - 0, 0, 0, 0, 1414, 552, 552, 0, 0, 0, - 0, 0, 850, 553, 553, 0, 0, 0, 1911, 1912, - 1913, 0, 1914, 1915, 1916, 1917, 1918, 1919, 0, 0, - 0, 0, 0, 0, 1412, 1900, 1901, 0, 0, 0, - 0, 1921, 0, 1470, 0, 850, 1746, 0, 0, 0, - 0, 71, 0, 0, 0, 0, 0, 0, 850, 0, - 0, 2034, 0, 0, 1538, 0, 0, 0, 2035, 2036, - 1625, 0, 2037, 2038, 2039, 850, 553, 71, 0, 850, - 0, 0, 0, 0, 1794, 0, 0, 1626, 0, 0, - 1540, 0, 1627, 0, 0, 0, 0, 1541, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1605, - 0, 0, 0, 0, 0, 0, 2831, 0, 0, 1608, - 0, 0, 0, 0, 0, 0, 1415, 0, 0, 0, - 1630, 0, 0, 0, 0, 0, 0, 0, 0, 1658, - 1810, 0, 850, 0, 0, 0, 0, 0, 1663, 0, - 0, 850, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1045, 1848, 0, 1902, 0, 0, 0, 1903, 1904, - 0, 951, 1905, 1906, 1907, 0, 951, 0, 552, 552, - 0, 552, 951, 0, 0, 1633, 0, 0, 0, 3064, - 0, 0, 0, 0, 0, 0, 0, 0, 1538, 0, - 0, 0, 0, 0, 0, 2218, 0, 2975, 0, 1469, - 0, 0, 0, 0, 0, 2227, 0, 2230, 0, 0, - 2241, 1535, 0, 0, 1540, 0, 2245, 0, 2247, 1414, - 1414, 0, 0, 0, 0, 1414, 0, 0, 0, 0, - 0, 2254, 0, 0, 0, 0, 2257, 0, 0, 0, - 2262, 2263, 2264, 2265, 0, 2269, 2270, 0, 0, 1412, - 1412, 0, 0, 0, 1537, 1412, 0, 516, 0, 3011, - 3012, 3013, 3014, 0, 1541, 0, 0, 0, 0, 0, - 1001, 0, 552, 1945, 0, 1635, 0, 0, 0, 0, - 850, 0, 802, 0, 802, 0, 0, 802, 0, 0, - 0, 0, 802, 1542, 0, 802, 0, 802, 0, 0, - 0, 802, 0, 552, 0, 552, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1538, 0, 2554, 0, 0, 0, 0, 0, - 0, 1415, 1415, 0, 1538, 0, 0, 1415, 0, 0, - 0, 0, 1541, 0, 0, 0, 0, 0, 1540, 1872, - 0, 0, 0, 1470, 1909, 0, 0, 0, 0, 0, - 1540, 0, 0, 0, 1538, 0, 0, 0, 0, 0, - 0, 1538, 1636, 0, 0, -2046, -2046, -2046, 1537, 1640, - 1641, 1642, 1643, 1644, 1645, 0, 0, 0, 0, 0, - 1540, 0, 0, 0, 0, 0, 0, 1540, 0, 0, - 0, 3127, 0, 2049, 0, 0, 0, 0, 0, 1538, - 0, 0, 0, 1538, 2059, 1045, 0, 0, 1902, 1538, - 0, 0, 1903, 1904, 1910, 0, 1905, 1906, 1907, 0, - 0, 0, 0, 0, 1537, 1540, 0, 0, 0, 1540, - 0, 1538, 0, 0, 0, 1540, 0, 0, 0, 0, - 0, 0, 0, 951, 0, 0, 0, 0, 0, 0, - 1542, 0, 0, 0, 0, 0, 0, 1540, 0, 0, + 521, 1227, 85, 868, 91, 60, 65, 908, 76, 718, + 59, 104, 884, 885, 84, 101, 521, 717, 68, 77, + 883, 1126, 85, 854, 91, 808, 95, 1193, 524, 1025, + 525, 1800, 1156, 957, 1789, 785, 1245, 2180, 971, 85, + 1929, 1426, 1296, 1681, 815, 1476, 525, 1351, 867, 1298, + 1772, 850, 1753, 887, 1788, 1582, 771, 888, 809, 1400, + 1335, 2054, 2143, 2017, 1399, 1805, 1398, 2566, 1396, 1683, + 1759, 2554, 2282, 744, 1763, 1984, 1341, 2599, 2078, 2079, + 50, 1835, 521, 521, 51, 2691, 52, 56, 1357, 2977, + 817, 808, 808, 886, 2456, 57, 901, 866, 1793, 61, + 2592, 1861, 62, 1657, 2518, 85, 63, 66, 1660, 847, + 815, 815, 525, 525, 2553, 972, 2979, 893, 2951, 2995, + 67, 2948, 69, 71, 809, 809, 79, 81, 82, 2537, + 1245, 2539, 2992, 83, 94, 96, 98, 1594, 1007, 99, + 2778, 100, 959, 1028, 967, 2653, -368, 2458, 2639, 2640, + 2641, 2842, -1330, 1365, 1048, 2847, 817, 817, -1905, -1905, + -514, 2203, 2314, -852, 2307, 2311, -2045, -2045, 2200, 2439, + 2660, 1229, 1546, 1233, 1329, 1237, 819, -518, 1559, 1560, + 2147, 3393, 2448, 977, -860, 536, -860, -857, 1329, 2668, + -1271, -857, 819, 2661, 2656, 1572, 1048, -1252, -1268, -1268, + -1271, 1410, -1896, 2410, -1913, -1896, -1272, -1913, 1664, 3188, + -2036, -2036, -2054, -2054, -1269, -1269, -1272, 2093, 1906, 948, + 3173, -2031, -2031, 1908, -819, -832, -847, 819, 819, 1744, + 1755, 2093, 3122, 1138, 3267, 2600, 1182, 3192, -2056, -2056, + -468, 1791, 2703, 2705, 1345, 2708, 1755, 2476, -1109, 1048, + 1613, 3528, 2742, 1329, 819, 1615, -1109, 2627, 1803, 1590, + -514, 971, 858, 1661, 1345, 819, -229, 1804, 2130, 1048, + 1245, -229, 874, -1130, 1666, 1048, 2131, -518, 3474, 1320, + 3280, -1130, 1143, 1185, 878, 1623, 1773, 1688, 3105, 1776, + 1777, -651, 2743, 1002, 3157, 2675, 874, 14, 15, 3137, + 1145, 1613, 537, 1690, 3466, 1614, 1615, 3352, 880, 1613, + 1764, 2422, 2971, 1614, 1615, 1028, 3379, 2996, 1321, 1625, + 3088, 1449, 3090, 1946, 1747, 2288, 1564, 1007, 3529, 2420, + 1008, 3, 4, 1764, 3133, 2814, 1623, 2816, 2391, 2595, + 1142, -789, 1574, 23, 1623, 108, 2601, 3397, 1906, 880, + 3459, 1546, 1907, 1908, 1946, 879, 1990, 1778, 2714, 2213, + 1685, 3417, 2175, 875, 3523, 2140, 1741, 2423, 3213, 1359, + 1625, 3510, 2114, 2856, 1737, 1738, 3119, 1662, 1625, 2648, + 3360, 819, 113, 2230, 1538, 3297, 2885, 875, 2206, 1463, + 3512, 3452, 2080, 2603, 2230, 1783, 836, 105, 3095, 1702, + 2023, 3189, 787, 2815, 2529, 3131, 3413, 3414, 2865, 2029, + 3439, 2725, 3535, 3442, 906, 1577, 3190, 2383, 907, 1784, + 3530, 3183, 2835, 2898, 2304, 1906, 1807, 3296, 1845, 1907, + 1908, 3156, 2855, 880, 2866, 3310, 3096, 1578, 1787, 1546, + 3298, 1464, 3361, 2231, 3182, 3311, 106, 2176, 2411, 3299, + -514, 3120, 2838, 3481, 2589, 3194, 2592, 1014, 2592, 3454, + 2886, 1794, 1298, 2433, 2434, 2435, 114, -518, 1146, 1009, + 1147, 1330, 3482, 3300, 3004, 2596, 3507, -789, 2773, 1501, + 3132, 2392, 3467, 2997, 1749, 1330, 26, 27, 28, 2836, + 2289, 2393, 1139, 1015, -671, 3134, 2115, 1322, 837, 3278, + 1582, 1663, 1779, 1204, 3378, 2207, 3460, 1703, 3505, 1450, + 2424, 2715, 1780, 2116, 2141, 109, 1765, 1576, 2117, 1017, + 1764, -514, 1686, 3019, 1762, 3211, 110, 3524, 2421, 2296, + 2234, 949, 1873, 1806, 3353, 3461, 3262, 1048, -518, 1765, + 85, 3499, 3469, 3000, 2887, 558, 3301, 1739, 3513, 2742, + 1330, 749, 923, 33, 2988, 3272, 2118, 3256, 534, 3302, + 3268, 111, 824, 1538, 35, 1676, 2602, 1140, 2603, 3002, + 3186, 3010, 3123, 3168, 1987, 3531, 865, 865, 2972, 1792, + 1042, 1602, 1762, 2025, 881, 718, 37, 2452, 2094, 2743, + 38, 2287, 1684, 945, 1740, 2628, 2225, 2054, 2604, 1691, + 3440, 1938, 2520, 1750, 876, 1762, 859, 3191, 1559, 1560, + 3475, 112, 3312, 1323, 957, 821, 906, -1109, 2541, 1863, + 907, 2794, 3187, 40, 1555, 1867, 3441, 1953, 2471, 971, + 2569, 3287, 1331, 1572, 43, 2214, 2351, 2132, 2200, -514, + 788, 897, -1130, 1973, 2736, 1789, 1334, 538, 1021, 1764, + 44, 1538, -2027, -2027, 2712, 2951, -518, 1546, 2948, 2662, + 1577, 2757, 1577, 1295, 2671, 2564, -368, 1451, 2357, 2146, + -1905, -1905, -1330, 2378, 45, -852, 1569, 1569, -514, 2690, + -514, 3259, 1578, 2305, 1578, 2384, 3260, 1343, 46, 2556, + 1344, 1172, 3113, 2036, 2037, -518, 1579, -518, 1581, -857, + 2653, 3247, -1271, 3249, 1608, 905, 972, 906, 3233, -1252, + 868, 907, -1271, 2119, -1896, 2412, -1913, -1896, -1272, -1913, + 1923, 3177, 2417, 2022, 1590, 1561, 1765, 999, -1272, 1864, + 1245, 2074, 1245, 1590, 3384, 1871, 1562, 1567, -847, 1658, + 2148, 1783, 996, 3377, 1382, 1383, 970, 2057, 1349, 1350, + 1546, 3500, 1646, 3383, 85, 867, 91, 1613, 2449, 1564, + 3303, 868, 2449, 3304, 1148, 1784, 1944, 785, 1349, 1350, + -229, -229, 2287, 2823, 3146, 3147, 2075, 1797, 1699, 1574, + 3104, 1178, 2649, 2650, 1452, 1755, 521, 1705, 818, 974, + 1459, 2470, 1762, 1173, 2158, 985, 1756, 521, 1641, 1642, + 1643, 1644, 1645, 1646, 935, 925, 997, 926, 1643, 1644, + 1645, 1646, 2977, 887, 815, 2013, 525, 888, 3427, 2159, + 1194, 3014, -2030, -2030, 3325, 815, 1625, 525, 2824, 2418, + 3106, 521, 521, 1706, 3139, 3163, -2028, -2028, 3501, 998, + 1033, 1144, 3144, 936, 2869, 3171, 2260, 1920, 1921, 1922, + 1923, 1034, 3450, 886, 521, 1765, 2263, 1180, 2341, 2266, + 817, 1144, 1674, 1388, 1389, 1675, 2418, 3502, 855, 1538, + 3183, 817, 2258, 85, 540, 91, 60, 65, 2664, 76, + 2621, 59, 104, 1178, 1613, 84, 101, 2872, 1546, 68, + 77, 23, 906, 2622, -1252, 1149, 907, 95, 3069, 521, + 718, 1707, 861, 1283, 521, 1602, 2965, 3053, 2966, 2530, + 3055, 870, 3057, 2096, 1157, 847, 847, 2951, 847, 1623, + 2948, 1762, 1918, 1919, 1920, 1921, 1922, 1923, 938, 1764, + 2427, 1755, 1446, 2726, 2727, 2728, 2729, 541, 3315, 1456, + 871, 819, 1758, 2283, 2284, 2285, 2492, 1214, 2317, 2361, + 872, 50, 1708, 1625, 3428, 51, 1283, 52, 56, 1180, + 3265, 2350, 1538, 3525, 877, 2352, 57, 1215, 2354, 970, + 61, 2054, 2785, 62, 521, 521, 983, 63, 66, 85, + 521, 91, 1341, 521, 521, 1299, 521, 521, 521, 521, + 2363, 67, 785, 69, 71, 1705, 2859, 79, 81, 82, + -2029, -2029, 521, 3252, 83, 94, 96, 98, 1181, 521, + 99, 808, 100, 1216, 1709, 2222, 2371, 1875, 808, 1178, + 2375, 1929, 1048, 2377, 1179, 889, 521, 1283, 1531, 1764, + 815, 1546, 525, 2825, 26, 27, 28, 815, 904, 525, + 3429, 1706, 2259, 1546, 809, 3270, 868, 521, 819, 2372, + 2876, 809, 1554, 23, 2373, 2542, 1449, 2626, 2543, 2017, + 1868, 2102, 2269, 1869, 1566, 1789, 521, 2276, 2102, 2261, + 3346, 2642, 3347, 1546, 2264, 3079, 817, 521, 521, 521, + 1546, 521, 521, 817, 2860, 2567, 718, 943, 23, 2103, + 1048, 1592, 1577, 2575, 1600, 1180, 2103, 2637, 933, 2877, + 1538, 33, -1905, 2234, 3356, 1947, 933, 2564, 2638, 1217, + 1948, 3241, 2416, 2374, 1578, 521, 1546, 2878, 3205, 545, + 1546, 966, 3242, 1577, 1764, 906, 1546, 2134, 1579, 1601, + 910, 2135, 521, 521, 2629, 1765, 1693, 1694, 38, 1700, + 888, 888, 922, 888, 1181, 1578, 3279, 549, 3399, 1546, + 2861, 1144, 2862, 1862, 927, 3373, 928, 2630, 1218, 1581, + 1708, 1201, 1862, 971, 1037, 1038, 1039, 1202, 1219, 521, + 934, 40, 1443, 521, 521, 929, 886, 886, 934, 886, + 1220, -209, 43, 521, 521, 521, 940, 1457, 521, 1594, + 1467, 1462, 1014, 941, 1471, 2474, 26, 27, 28, 2676, + 1986, 1762, 2510, 1987, 2104, 2684, 1553, 1531, 46, 2105, + 2011, 2104, 1221, 2012, 2106, 1790, 2293, 2428, 2879, 2429, + 2826, 2106, 1709, 1937, 946, 1939, 1940, 2880, 1015, 1821, + 2511, 26, 27, 28, 1047, 1765, 46, 1906, 2752, 947, + 1283, 1907, 1908, 1538, 1458, 1909, 1910, 1911, 950, 1283, + 1133, 1134, 2634, 1136, 1017, 1538, 2301, 2366, 1201, 2302, + 2367, 951, 2787, 33, 1202, 2331, 1223, 2332, 1822, 935, + 2508, 952, 1203, 1283, 1881, 2404, 2038, 1821, 2405, 962, + 2614, 953, 2616, 2039, 2040, 1538, 2538, 2041, 2042, 2043, + 2450, 1224, 1538, 2451, 2453, 1531, 2617, 2451, 33, 2618, + 38, 1762, 2852, 3178, 2854, 963, 1829, 1831, 936, 1832, + 1226, 718, 1833, 983, 2623, 2687, 1822, 2624, 1987, 1856, + 718, 1882, 2749, 2054, 3015, 2451, 2737, 981, 1538, 2744, + 1765, -595, 1538, 40, 982, 38, -595, 970, 1538, 2611, + 3521, 2613, 1883, 937, 43, 85, 2750, 91, 984, 2012, + 2512, 1823, 987, 1824, 718, 2513, 1570, 1571, 785, 521, + 1884, 1538, 1878, 2753, 1885, 990, 2754, 2107, 40, 1203, + 3508, 991, 3509, 1965, 2107, 992, 1967, 979, 2108, 43, + 974, 1971, 993, 1021, 1974, 2108, 994, 1886, 2755, 1978, + 1887, 2754, 995, 938, 865, 44, 1762, 2578, 46, 996, + 2949, 1824, 1451, 2430, 1035, 2431, 1888, -595, 1032, 521, + 521, 2896, 1175, 3534, 1177, 521, 1001, 521, 2830, 45, + 1030, 2831, 521, 521, 521, 521, 2964, 540, 1040, 1204, + 2659, 2889, 1135, 2827, 3484, -2032, -2032, 521, 521, 2853, + 1041, 2987, 1043, 521, 2302, 815, 521, 525, 1913, 3496, + 1042, 521, 808, 521, 521, 808, -595, -2033, -2033, 521, + 808, 1546, 1137, 808, 2774, 2775, 3003, 821, 808, 2367, + 2888, 815, 2897, 525, 815, 540, 525, -2034, -2034, 815, + 2974, 525, 815, 3008, 525, 809, 3009, 815, 809, 525, + 541, 817, 1206, 809, 3016, 1214, 809, 3017, 1141, 1889, + -1316, 809, 3070, 3206, 3532, 2012, 2012, 1890, 2514, 3533, + 3342, 3207, 3343, 1531, 2451, 1215, 1152, 817, 1914, 2515, + 817, -2035, -2035, 1158, 1207, 817, 1204, 1159, 817, 1891, + 1590, 1166, 3236, 817, 3243, 2012, 3253, 1987, 541, 3254, + 1161, 1594, 2763, 2765, 2766, 521, 521, 2762, 2764, 2761, + 2760, 85, 1167, 91, 521, 521, -2037, -2037, 1892, 2014, + 2563, 1216, 521, 2019, 2021, 1162, 1353, 2015, 2016, 521, + 3286, -2038, -2038, 2302, 1394, 2020, 3290, 1163, 3322, 2367, + 1612, 2012, 1176, 1613, 878, 1205, 1195, 1614, 1615, 1206, + 3390, 1196, 2316, 2367, 718, 1208, 1546, 3395, 521, -596, + 3396, 521, 3421, 1198, -596, 3422, 1531, 521, 521, 521, + 521, 521, 521, 521, 521, 718, -2039, -2039, 1623, 521, + 521, 1207, 1297, 2090, 521, -2058, 3465, 1199, 521, 3396, + 2100, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 3506, 2695, 521, 3396, 2564, 971, -2040, -2040, 1200, 521, + 116, 1283, 1625, 1546, 535, 879, 2143, 1217, -2041, -2041, + -2042, -2042, 748, 2182, -2043, -2043, 1212, 888, -2044, -2044, + 521, 1213, 545, 1538, 966, -596, 835, -2046, -2046, 3150, + 848, 1230, 2074, -2047, -2047, -2048, -2048, 1234, 1606, 1238, + 865, 1291, 1208, -2049, -2049, 1201, 1239, 521, 1609, 1294, + 549, 1202, 3114, 886, 1295, 2896, 1218, 1300, 521, 521, + 1303, 1149, -2050, -2050, -2051, -2051, 1219, 2507, 1659, 1302, + 545, 1316, 966, 1201, -596, -2053, -2053, 1665, 1220, 1202, + 1915, 1916, 1917, 880, 1918, 1919, 1920, 1921, 1922, 1923, + 1318, 1201, -2055, -2055, 1531, 548, 1326, 1202, 549, -2058, + 1374, 1375, 1319, 718, 1327, 718, -2057, -2057, 1546, 1333, + 1221, 2246, 2846, 2250, 1336, 3167, -2058, 1809, 1810, 1337, + 1990, -2058, 2044, 2045, 2046, 1360, 2047, 2048, 2049, 2050, + 2051, 2052, 2970, 2982, 2201, 2202, 1342, 3483, -646, -646, + 1361, 3485, -650, -650, 1366, 521, 3007, 540, 1424, 1283, + 1540, 2998, 521, 521, -649, -649, 1203, 1437, 1538, -2058, + 1384, 1385, 1388, 1389, 1223, 3110, 3111, 3081, 3321, 1439, + 1382, 1383, 2558, 2559, 3492, 3493, 3518, 3519, 1669, 1670, + 1440, 1447, 1454, 1453, 1203, 3232, 2319, 1460, 1461, 1224, + 1283, 1466, 1470, 1472, 1549, 85, 3526, 1552, -823, 1561, + 1550, 1565, 1203, 1546, -830, 718, 46, 2335, 1226, -671, + 541, -820, 1283, 521, 1634, 1538, 1865, -672, 1866, -821, + 1201, 970, 1575, -824, 1576, -822, 1202, 1201, 1586, 1605, + 1599, 1607, 1652, 1202, 881, 1654, 1656, 1531, 1668, 2440, + 1677, 521, 521, 1678, 521, 2443, 1687, 1682, 1689, 1531, + 521, 521, 521, 521, 521, 521, 2564, 1179, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 1181, 1727, + 1729, 1731, 1742, 521, 521, 1760, 1761, 521, 1762, 1531, + 1546, 14, 15, 543, 521, 1767, 1531, 2949, 1768, 1388, + 1389, 1769, 1774, 1781, 1782, 1796, 113, 1786, 1802, 1812, + 1877, 1813, 1814, 1818, 1826, 1827, 521, 1837, 1828, 521, + 3142, 521, 1840, 1204, 1841, 521, -2058, 1843, 808, 3321, + 1538, 1844, 1531, 3471, 808, 1846, 1531, 23, 521, 1540, + 1283, 1203, 1531, 1847, 1849, 1850, 1857, 815, 1203, 525, + 1858, 1204, 1297, 815, 1862, 525, 1870, 3284, 1895, -208, + 1897, 809, 3151, 3152, 1541, 1531, 1900, 809, 1898, 1204, + 1903, 1926, 3321, 1966, 1945, 1934, 1935, 521, 521, 1942, + 1963, 1972, 1231, 1975, 1976, 1985, 1206, 1994, 1977, 1982, + 1555, 2025, 1562, 817, 3052, 1988, 1993, 1546, 1048, 817, + 2064, 1567, 545, 1613, 546, 1989, 2058, 1991, 1992, 2059, + 1235, 2024, 2067, 2092, 1206, 2110, 868, 521, 1232, 2069, + 2070, 3321, 521, 521, 2072, 1538, 2071, 1540, 2221, 2099, + 549, 1546, 1206, -2058, 911, 3375, 1594, 2111, 2137, 2113, + 1641, 1642, 1643, 1644, 1645, 1646, 1236, 521, 521, 1011, + 2144, 2138, 521, 2161, 1012, 2157, 2156, 879, 2181, 2178, + 912, 1592, 2190, 2191, 1207, 1047, 521, 2192, 1906, 521, + 3337, 521, 1907, 1908, 2193, 2194, -2058, -2058, -2058, 2100, + 26, 27, 28, 2195, 2216, 2212, 2217, 521, 718, 1208, + 2227, 2229, 2299, 2220, 521, 2527, 1047, 521, 1204, 1906, + 2223, 2228, 1538, 1907, 1908, 1204, 808, 1909, 1910, 1911, + 1546, 880, 2308, 1013, 521, 2303, 2318, 1208, 3128, 2320, + 2321, 2322, 2336, 808, 2339, 815, 913, 525, 2337, 2342, + 2343, 521, 2344, 2346, 2345, 1208, 2347, 2349, 2353, 809, + 2368, 2376, 815, 1541, 525, 1931, 1906, 33, 521, 521, + 2406, 1930, 2413, 1546, 2425, 914, 809, 2267, 35, 2949, + 2437, 1206, 2414, 2444, 2274, 521, 2415, 521, 1206, 2419, + 2426, 817, 2442, 2455, 2462, 2457, 521, 2463, 2464, 2483, + 37, 2466, 2467, 2468, 38, 1014, 2469, 2485, 817, 2472, + 1789, 2480, 2473, 2268, 718, 718, 718, 2481, 915, 1358, + 2275, 2484, 2246, 2246, 2246, 2488, 2486, 540, 2489, 1538, + 2487, 2490, 2491, 2501, 3273, 2502, 2149, 40, 2504, 2509, + 2525, 1015, 1612, 2516, 2526, 1613, 2531, 2532, 43, 1614, + 1615, 1541, -1316, 521, 2533, 868, 2544, 1016, 2226, 1283, + 2172, 2174, 2545, 1538, 44, 1540, 2547, 1017, 2235, 2549, + 2238, 2550, 2555, 2249, 971, 1546, 1691, -652, 2570, 2253, + 1623, 2255, 2560, 2557, 1208, 2574, 2571, -2058, 45, 2577, + 541, 1208, 1829, 1831, 2262, 1832, 2581, 1531, 1833, 2265, + 867, 1018, 46, 2270, 2271, 2272, 2273, 1912, 2277, 2278, + 2573, 2582, 2583, 2585, 1625, 521, 2587, 2588, 718, 2591, + 2610, 2612, 1192, 2625, 2631, 2632, 1878, 2633, 2643, 2644, + 1913, 2645, 521, 970, 2646, 2658, 2657, 2663, 2673, 2677, + 718, 2681, 1538, 2685, 965, 916, 2674, 1019, 1878, 2678, + 2692, 1610, 2702, 2713, 1020, 2733, 917, 2710, 1540, 2720, + 2074, 2721, 2716, 3326, 2734, 3328, 2719, 2745, 2279, 1914, + 2722, 2746, 2751, 2759, 2770, 2782, 2767, 2792, 521, 2517, + 1358, 2295, 2295, 2776, 2793, 1538, 2806, 3336, 2790, 2796, + 2811, 918, 2817, 2837, 2813, 2820, 1021, 2839, 2841, 2805, + 1914, 2843, 2851, 2857, 2884, 2858, 815, 2864, 525, 2900, + 2973, -2058, 2980, 2967, 919, 1022, 2976, 521, 2968, 2969, + 2981, 2989, 544, 3338, 2985, 3340, 2986, 2990, -2058, 2994, + 868, 3005, 1531, -2058, 2302, 3012, 1144, 3013, 3038, 3458, + 3018, 920, 3040, 3044, 2808, 3048, 3423, 3058, 1353, 521, + 3059, 3061, 817, 3419, 2370, 521, 521, 3062, 1358, 3082, + 3089, 1358, 1358, 868, 3092, 3412, 521, 3101, 3094, 1541, + 3103, -2058, 545, 3107, 966, 1592, 3108, 521, 3121, 3109, + 521, 3117, 521, 3115, 1023, 3125, 3126, 1538, 3116, 1531, + 521, 547, 3127, 521, 521, 3135, 1540, 548, 521, 521, + 549, 3138, 3407, 3140, 3141, 521, 3145, 3158, 1592, 3159, + -2026, 3160, 3174, -2027, -2028, -2029, 2845, 3179, 3193, -2030, + 521, 3197, -2031, 3161, 3162, 3199, 1634, 85, 3164, 91, + 521, 3180, -2032, 85, -2033, 2014, -2034, 1546, -2035, 2019, + 2021, 520, 532, 2015, 2016, 2829, -2037, 556, 3195, -2038, + -2039, 2020, 521, 556, -2040, -2041, -2042, 806, -2043, 820, + 3165, 2844, 1541, 823, 556, 831, 3208, -2044, 831, -2046, + 3172, 849, 853, -2047, -2048, 853, -2049, -2050, 556, 556, + -2051, -2058, -2058, -2058, -2052, 1918, 1919, 1920, 1921, 1922, + 1923, 718, 1874, 1876, 2947, 718, 3216, 718, -2053, 2246, + -2054, -2055, -2056, 2952, -2057, 2250, -1269, 3198, 3202, 521, + 3209, 521, 1915, 1916, 1917, 3212, 1918, 1919, 1920, 1921, + 1922, 1923, 3214, 806, 806, 3220, 3226, 3228, -2058, 3223, + 3227, 3222, 3235, 1011, 3231, 3250, 3251, 849, 1012, 1540, + 85, 3255, 853, 556, 853, 853, 853, 1829, 1831, 11, + 1832, 1540, 2978, 1833, 3258, 3261, 3263, 3275, 3276, -1268, + 3283, 3447, 3285, 3292, 3293, 3294, 3307, 85, 1865, 3308, + 85, 3309, 3330, 3331, 3324, 868, 3323, 14, 15, 2999, + 3327, 1540, 3001, 3339, 3333, 3344, 521, 3364, 1540, 1531, + 3134, 3368, 3370, 3371, 3374, 3386, 3380, 1013, 3387, 3388, + 1541, 3398, 3393, 3400, 3402, 3085, 521, 521, 3405, 3409, + 3406, 521, 3410, 3411, 521, 3418, 1446, 3420, 3425, 3416, + 1592, 3430, 3436, 23, 1540, 3437, 3438, 3443, 1540, 3444, + 3445, 3463, 3453, 3455, 1540, -2058, 3457, 3473, 3476, 3478, + 3494, 521, 1641, 1642, 1643, 1644, 1645, 1646, 3497, 1538, + 3474, 3511, 3475, 3516, 3522, 521, 3527, 1540, 3536, 3537, + 521, 521, 3148, 2254, 868, 521, 1531, 2608, 1164, 1014, + 521, 2903, 2153, 521, 521, 1798, 2899, 1189, 521, 1283, + 2635, 2297, 521, 2654, 2699, 908, 521, -527, 3203, 3434, + 3504, 2975, 3271, 521, 3472, 808, 3479, 3306, 3498, 980, + 2590, 2615, -527, 1752, 3470, 1015, 2868, -527, 3477, 867, + 2030, 2586, 3468, 2993, 815, 2694, 525, 2953, 2619, 1825, + 2355, 1016, 2060, 2833, 2061, 3391, 1872, 3351, 809, 3451, + 2832, 1017, 3415, 1860, -527, 3520, 1171, 521, 2869, 2818, + 2576, 1444, 1679, 1541, 2870, 521, 2680, 2219, 1445, -527, + 2076, 2562, 2724, 1723, -527, 1541, 1724, 2871, -527, 3456, + 817, 1543, 2572, 2187, 521, 1018, 26, 27, 28, 3401, + 2651, 3329, 2218, 1531, 810, 2546, 2447, 3230, -527, 2718, + 1728, 2872, 3047, 2873, 2717, 1541, 1190, 986, 2665, 2748, + 1000, 3277, 1541, 2461, -1788, 1411, 1395, 2364, 1397, 1401, + 1402, 1403, 1404, 1405, 2365, -527, 3404, 2947, 3403, 1406, + 1407, 1019, 2499, 2772, 2565, 2523, 2477, 3093, 1020, 2521, + 2500, 2784, 2152, 2454, 1954, -527, 894, -527, 1541, 0, + 1353, 0, 1541, 33, 0, 0, -527, 0, 1541, 2700, + 0, 2701, 0, 0, 35, 2706, 0, 2709, 0, 0, + 0, 0, 0, 521, 718, 0, 0, 0, 2199, 2199, + 1021, 1541, 1878, 0, 0, 868, 37, 0, 0, 0, + 38, 2874, 85, 0, -527, 0, 0, 0, 0, 1022, + 0, 0, 970, -527, 3185, 521, 1531, 0, 0, 0, + 39, 0, 0, 0, -1788, 0, 0, 0, 0, 0, + 0, 521, 0, 40, 0, 0, 0, 0, 1047, 0, + 1592, 1906, 0, 0, 43, 1907, 1908, 0, 1358, 1909, + 1910, 1911, 0, 0, 0, 0, 0, 0, 1358, 1531, + 44, 1358, 0, 0, 521, 0, 0, 0, 0, 2875, + 1543, -1788, 0, 0, 2876, 521, 521, 0, 1023, 521, + 0, 521, 0, 1191, 45, 0, -1788, 0, 0, 0, + 0, -1788, 0, 0, 1544, 0, -1788, 0, 46, 1540, + 0, 0, 0, 853, 0, -1788, 521, 0, 853, 0, + -1788, 853, 0, 0, 0, 0, 0, -527, 1545, 556, + 0, 0, 0, 2877, 2848, 2849, 1047, 0, 0, 1906, + 521, 0, 0, 1907, 1908, 0, 0, 1909, 1910, 1911, + 0, 2878, -1788, 0, 0, 0, 0, 0, 0, 0, + 0, 1358, 2901, 0, 2788, 0, 0, 0, 1543, 0, + 0, 2947, -1788, 0, -527, 0, 0, 2954, 2955, 2956, + 2957, 2958, 2959, 2960, 2961, 2962, 2963, 0, 0, 0, + 0, 0, 0, 0, 0, 906, 85, 85, 1161, 907, + 0, 0, 0, 0, 1421, 0, 0, 0, 3288, 3289, + 521, 718, 0, 0, 0, 521, 0, 0, 0, 1878, + 0, -1788, 0, 0, -1788, 521, 0, 521, 0, 521, + -1788, 2944, 0, 521, 0, 521, 0, 521, 0, 2215, + 0, 0, 906, 815, 1540, 525, 907, 0, 521, 0, + 0, 0, 2879, 521, 0, 521, 0, 0, 0, 0, + 0, 2880, 1913, 521, 2651, 0, 0, 0, 0, 0, + -1788, 0, 0, 85, 0, 85, 718, 0, 0, 2465, + 0, 521, 0, 1544, 3357, 3348, 0, 3350, 0, 817, + 0, 1612, 0, 0, 1613, -1788, 0, 0, 1614, 1615, + 0, 1540, 0, 0, 0, 0, 0, 1545, 1214, 0, + 0, 0, 0, 1541, 0, 85, 0, 0, 0, 955, + 556, 556, 0, 0, 0, 0, 0, 3382, 1215, 1623, + 521, 85, 1914, 0, 0, 85, -2058, 0, 0, 0, + 521, 0, 0, 3385, 0, 0, 0, 3389, 0, 0, + 1913, 0, 521, 855, 0, 1419, 0, 0, 0, 0, + 0, 978, 532, 1625, 0, 0, 521, 520, 0, 853, + 1011, 1544, 0, 0, 1216, 1012, 0, 0, 806, 0, + 0, -1788, 1004, 1004, 521, 0, 1543, 1004, 1027, 0, + 0, -1788, 0, 0, 815, 1545, 525, 0, 0, 0, + 831, 831, 831, 1421, 0, 0, 1540, 0, 0, 521, + -1788, 0, -1788, -1788, 831, 831, 0, 831, 0, 0, + 1914, 0, 0, 3129, 521, 0, 0, 3091, 2797, 0, + 853, 2540, 0, 2947, 1013, 718, 556, 815, 0, 525, + 817, 0, 0, 3357, 2892, 0, 0, 853, 1541, -1788, + 853, 820, -1788, -1788, -1788, 0, 0, 0, 521, 85, + -2058, 0, 0, 0, 0, 0, 0, 0, 2568, 2568, + 1217, 3480, 521, 521, 521, 0, 0, -2058, 0, 1543, + 0, 0, -2058, 817, 0, 85, 815, 0, 525, 0, + 0, 0, 0, 0, 0, 853, 1293, 3495, 0, 521, + 0, 1540, 0, 0, 0, 1541, 1014, 0, 0, 0, + 853, 853, 853, 853, 1314, 0, 0, 0, 1214, 1218, + -2058, 0, 0, 0, 0, 0, 0, 1325, 0, 1219, + 0, 0, 817, 0, 0, 0, 0, 0, 1215, 0, + 521, 1220, 1015, 0, 1915, 1916, 1917, 0, 1918, 1919, + 1920, 1921, 1922, 1923, 0, 0, 0, 0, 1016, 1004, + 1027, 0, 853, 0, 0, 1418, 0, 0, 1017, 0, + 0, 1004, 1004, 1221, 0, 1634, 0, 556, 1540, 0, + 0, 0, 0, 806, 1216, 2890, 0, 0, 0, 1544, + 806, 0, 0, 0, 0, 2891, 3181, 0, 0, 0, + 556, 0, 1018, 0, 0, 23, 0, 0, 0, 0, + 1541, 0, 0, 1545, 557, 0, 1551, 1543, 0, 1353, + 557, 0, 0, 1968, 0, 0, 0, 1223, 0, 1421, + 1421, 557, 1915, 1916, 1917, 1421, 1918, 1919, 1920, 1921, + 1922, 1923, 0, 0, 0, 557, 557, 0, 1019, 0, + 0, 0, 1224, 0, 2892, 1020, 0, 0, 0, 0, + 0, 1047, 0, 0, 1906, 556, 0, 0, 1907, 1908, + 0, 1226, 1909, 1910, 1911, 0, 0, -2058, 0, 0, + 1217, 0, 1544, 0, 0, 1540, 0, 0, 0, 3072, + 3274, 0, 0, 0, 0, 0, 0, 1021, 0, 3248, + 0, 0, 0, 0, 0, 1541, 1545, 0, 0, 0, + 557, 3281, 3282, 0, 0, 1671, 1022, 0, 1673, 1540, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1218, + 0, 0, 556, 556, 0, 0, 3295, 3349, 0, 1219, + 853, 0, 0, 0, 0, 0, 2756, 2758, 26, 27, + 28, 1220, 0, 2893, 0, 0, 0, 0, 0, 0, + 1543, 0, 0, 0, 1418, 0, 0, 0, 2944, 0, + 0, 0, 1543, 0, 853, 1751, 0, 0, 0, -1790, + 1904, 1905, 1541, 1221, -2058, 1023, 1925, 853, 0, 0, + 1969, 1641, 1642, 1643, 1644, 1645, 1646, 0, 1540, 0, + 0, 0, 1543, 0, 853, 0, 0, 0, 853, 1543, + 0, 0, 0, 1799, 0, 33, 0, 0, 0, 0, + 1544, 0, 0, 0, 0, 0, 0, 0, 1011, 0, + 0, 0, 0, 1012, 0, 0, 0, 1223, 0, 0, + 0, 1540, 0, 0, 1545, 1543, 0, 0, 0, 1543, + 0, 857, 38, 0, 0, 1543, 0, 0, 0, 0, + 0, 0, 1224, 0, 0, 0, 0, 2142, 0, 1815, + 0, 853, 0, 0, 0, 1913, 0, 853, 1543, -1790, + 0, 1226, 0, 2894, 0, 40, 2895, 0, 0, 1541, + 0, 1853, 1013, 0, 0, 3376, 43, 1420, 0, 0, + 955, 0, 0, 0, 1358, 955, 0, 556, 556, 0, + 556, 955, 44, 0, 0, 0, 0, 1421, 896, 0, + 899, 0, 903, 1541, 0, 0, -1790, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, + 0, -1790, 0, 1540, 0, 1914, -1790, 0, 0, 0, + 46, -1790, 0, 0, 0, 0, 0, 0, 0, 0, + -1790, 0, 0, 1544, 1014, -1790, 0, 0, 3464, 1047, + 0, 0, 1906, 0, 0, 1544, 1907, 1908, 0, 0, + 1909, 1910, 1911, 0, 0, 0, 0, 1545, 0, 0, + 1418, 1418, 0, 0, 0, 1762, 1418, -1790, 520, 1545, + 1015, 0, 1541, 0, 0, 1544, 0, 0, 0, 0, + 0, 1004, 1544, 556, 1949, 0, 1016, -1790, 0, 0, + 0, 853, 0, 0, 806, 0, 1017, 806, 0, 1545, + 2944, 0, 806, 0, 3054, 806, 1545, 0, 0, 0, + 806, 0, 556, 0, 556, 1541, 0, 0, 1544, 0, + 0, 0, 1544, 0, 0, 0, 0, 0, 1544, 0, + 1018, 0, 0, 0, 0, 0, -1790, 0, 0, -1790, + 0, 0, 1545, 0, 0, -1790, 1545, 0, 0, 0, + 0, 1544, 1545, 0, 0, 0, 0, 1720, 0, 0, + 0, 0, 0, 0, 0, 0, 1420, 0, 0, 0, + 0, 0, 0, 0, 0, 1545, 1019, 0, 0, 0, + 0, 0, 0, 1020, 0, -1790, 0, 0, 0, 0, + 1421, 1421, 1421, 1421, 1421, 1421, 0, 0, 1421, 1421, + 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 0, 0, + -1790, 0, 0, 0, 0, 0, 0, 1541, 2334, 2053, + 0, 0, 0, 0, 0, 1021, 557, 1915, 1916, 1917, + 2063, 1918, 1919, 1920, 1921, 1922, 1923, 0, 0, 23, + 0, 0, 1358, 1612, 1022, 0, 1613, 1358, 0, 0, + 1614, 1615, 0, 1913, 0, 0, 0, 3184, 0, 0, + 1543, 0, 0, 0, 1612, 0, 0, 1613, 855, 955, + 0, 1614, 1615, 0, 0, 1540, 0, 0, 23, 0, + 0, 1623, 0, 0, 0, 0, 0, 0, -2058, 0, + 0, 0, 0, 0, 1874, 1876, -1790, 0, 0, 0, + 23, 0, 1623, 0, 0, 0, -1790, 0, 0, -2058, + 0, 0, 0, 1023, 0, 1625, 2150, 0, 853, 0, + 853, 0, 0, 1914, 0, -1790, 0, -1790, -1790, 0, + 0, 853, 0, 2166, 2171, 2173, 1625, 0, 0, 0, + 0, 2385, 2386, 2387, 2388, 2389, 2390, 0, 1418, 2394, + 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 0, + 0, 0, 0, 0, -1790, 0, 0, -1790, -1790, -1790, + 0, 0, 0, 853, 0, 556, 0, 1421, 1421, 0, + 2800, 0, 26, 27, 28, 0, 0, 0, 0, 1751, + 556, 0, 1420, 1420, 0, 1543, 0, 0, 1420, 0, + 556, 2236, 556, 2240, 0, 556, 0, 0, 0, 0, + 0, 556, -2058, 556, 0, 0, 0, 557, 557, 924, + 0, 26, 27, 28, 931, 955, 556, 932, 0, -2058, + 955, 556, 0, -2058, -2058, 556, 556, 556, 556, 0, + 556, 556, 0, 26, 27, 28, 0, 0, 0, 33, + -2058, 0, 1543, 0, 0, -2058, 0, 2298, 0, 0, + 0, 0, 0, 1544, 0, 0, 853, 853, 853, 853, + 1314, 853, -2058, 0, 0, 0, 0, 0, 0, 1541, + 0, 0, 0, 0, 0, 2324, 38, 1545, 33, 0, + 0, 0, 0, -2058, 0, 1421, -1805, 0, 0, 1874, + 1876, 2348, 0, 0, 0, 0, 0, 0, 0, 0, + 33, 1358, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 0, 38, 0, 1634, 2505, 2506, + 43, 0, 0, 557, 0, 1915, 1916, 1917, 0, 1918, + 1919, 1920, 1921, 1922, 1923, 0, 44, 38, 1634, 0, + 0, 1418, 1418, 1418, 1418, 1418, 1418, 1543, 40, 1418, + 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 43, + 45, 0, 0, 0, 0, 540, 0, 0, 0, 0, + 40, 0, 0, 0, 46, 44, 0, 0, 0, 556, + 0, 43, 0, 0, 0, 0, -1805, 0, 1544, 0, + -1316, 853, 0, 0, 0, 0, 0, 44, 0, 45, + 806, 0, 0, 0, 0, 0, 806, 0, 0, 0, + 0, 556, 1545, 46, 0, 0, 556, 0, 0, -2058, + 0, 45, 0, 0, 0, 2459, 2459, 0, 541, 0, + 0, 0, 0, -1805, 0, 46, 0, 0, 0, 0, + -2058, 0, 1543, 0, 0, 1544, 0, 0, -1805, 0, + 0, 0, 0, -1805, 0, 0, 0, 0, -1805, 0, + 0, 0, 0, 0, 1438, 989, 0, -1805, 0, 1545, + 2189, 0, -1805, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 542, 0, 0, 0, 0, 1469, 0, 0, + 0, 0, 0, 0, 0, 1047, 556, 0, 1906, 0, + 2496, 543, 1907, 1908, -1805, 556, 1909, 1910, 1911, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1543, + 0, 0, 0, 3073, -1805, 0, -2058, 0, 1418, 1418, + 0, 0, 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, + 0, 0, 0, 1165, 0, 2053, 0, -2058, 0, 0, + 1544, 0, 1595, 0, 1641, 1642, 1643, 1644, 1645, 1646, + 544, 0, 0, 1358, 0, 0, 0, -208, 0, 0, + 0, 0, 0, -1805, 1545, 0, -1805, 0, 806, 0, + 0, 0, -1805, 0, 0, 0, 0, 0, 0, 0, + 556, 1292, 0, 1421, 1421, 806, 0, 0, 0, 2166, + 0, 0, 0, 0, 0, 0, 1305, 1307, 1310, 1312, + 545, 0, 546, 0, 0, 0, 0, 0, 0, 557, + 557, 0, -1805, 0, 0, 0, 1543, 0, 0, 547, + 0, 0, 0, 0, 0, 548, 0, 0, 549, 0, + 0, 0, 0, 556, 0, 1544, 1418, -1805, 0, 556, + 0, 0, 0, 0, 0, 0, 0, 0, 1413, 0, + 1543, 0, 0, 0, 0, 1815, 0, 0, 0, 1545, + 0, 0, 0, 1420, 1420, 1420, 1420, 1420, 1420, 0, + 0, 1420, 1420, 1420, 1420, 1420, 1420, 1420, 1420, 1420, + 1420, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 855, 0, 0, 0, 1913, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1544, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -1805, 0, 0, 1815, 0, 0, 1543, + 0, 0, 853, -1805, 2798, 2799, 1545, 0, 0, 0, + 0, 0, 0, 0, 1815, 853, 853, 853, 0, 0, + 0, 0, -1805, 0, -1805, -1805, 0, 0, 556, 0, + 853, 0, 0, 853, 0, 0, 0, 1314, 0, 1914, + 0, 853, 1543, 0, 0, 0, 1421, 955, 0, 0, + 0, 0, 0, 0, 557, 557, 0, 557, 0, 0, + 0, -1805, 0, 0, -1805, -1805, -1805, 1815, 1815, 0, + 1815, 1421, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1544, + 0, 0, 0, 0, 1047, 0, 0, 1906, 0, 520, + 0, 1907, 1908, 0, 0, 1909, 1910, 1911, 0, 0, + 0, 0, 0, 1545, 0, 0, 0, 0, 0, 2723, + 1420, 1420, 0, 1544, 0, 0, 0, 853, 853, 853, + 1743, 0, 0, 0, 0, 0, 556, 0, 1418, 556, + 0, 0, 0, 1770, 1543, 556, 0, 1545, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2181, 0, 553, - 2146, 0, 850, 0, 850, 0, 0, 0, 2377, 2378, - 2379, 2380, 2381, 2382, 850, 2162, 2386, 2387, 2388, 2389, - 2390, 2391, 2392, 2393, 2394, 2395, 0, 1412, 0, 0, - 0, 0, 0, 0, 2040, 2041, 2042, 1537, 2043, 2044, - 2045, 2046, 2047, 2048, 0, 0, 0, 0, 1542, 0, - 0, 0, 850, 0, 552, 0, 0, 0, 0, 0, - 0, 0, 0, 1541, 0, 0, 0, 0, 0, 1746, - 552, 0, 0, 0, 2138, 0, 0, 0, 0, 0, - 552, 2228, 552, 2232, 0, 552, 0, 0, 0, 0, - 0, 552, 0, 552, 0, 0, 1860, 0, 0, 0, - 0, 1045, 0, 0, 1902, 951, 552, 0, 1903, 1904, - 951, 552, 1905, 1906, 1907, 552, 552, 552, 552, 1415, - 552, 552, 0, 0, 0, 0, 0, 0, 1909, 0, - 0, 0, 1537, 0, 1911, 1912, 1913, 2290, 1914, 1915, - 1916, 1917, 1918, 1919, 0, 1300, 0, 850, 850, 850, - 850, 850, 0, 0, 0, 0, 1541, 0, 2145, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2319, 0, + 557, 0, 0, 0, 1795, 853, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1612, 0, 0, 1613, 2053, + 0, 0, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1979, + 0, 1983, 0, 0, 0, 0, 0, 3011, 0, 0, + 0, 0, 1544, 1621, 0, 1421, 0, 0, 0, 0, + 0, 0, 0, 1623, 1418, 1418, 0, 0, 0, 0, + 1624, 0, 0, 0, 0, 0, 1545, 1820, 0, 0, + 0, 0, 0, 1836, 0, 0, 0, 0, 1420, 0, + 0, 0, 0, 2822, 0, 1544, 0, 1625, 0, 2166, + 0, 1915, 1916, 1917, 0, 1918, 1919, 1920, 1921, 1922, + 1923, 0, 0, 0, 0, 0, 0, 853, 0, 1545, + 0, 556, 0, 0, 0, 556, 556, 556, 0, 0, + 0, 1815, 1751, 1815, 0, 1853, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2340, 0, 0, 0, 0, 0, 0, 0, 0, - 553, 553, 0, 0, 0, 2498, 2499, 0, 1910, 0, - 0, 3282, 1414, 1414, 1414, 1414, 1414, 1414, 0, 1537, - 1414, 1414, 1414, 1414, 1414, 1414, 1414, 1414, 1414, 1414, - 0, 0, 3307, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1412, 1412, 1412, 1412, 1412, 1412, 0, 0, - 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, - 0, 1538, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1542, - 552, 0, 0, 2673, 0, 0, 0, 1540, 0, 0, - 0, 0, 850, 0, 3346, 0, 2271, 0, 0, 0, - 1541, 0, 802, 0, 0, 0, 0, 0, 802, 2286, - 2286, 0, 0, 0, 552, 0, 0, 553, 0, 552, - 0, 0, 0, 0, -2046, 3372, 1537, 0, 2453, 2453, - 0, 717, 0, 0, 1415, 1415, 1415, 1415, 1415, 1415, - 0, 0, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, - 1415, 1415, 0, 0, 0, 0, 0, 0, 0, 0, - 1537, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1542, 0, 0, 0, 1347, 0, 0, 0, - 0, 0, 2362, 0, 0, 0, 0, 0, 718, 0, - 0, 0, 0, 0, 1910, 1538, 0, 552, 0, 1414, - 1414, 2489, 0, 0, 719, 0, 552, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1911, 1912, - 1913, 1540, 1914, 1915, 1916, 1917, 1918, 1919, 0, 1412, - 1412, 0, 0, 0, 0, 0, 0, 0, 0, 1537, - 0, 0, 0, 0, 1541, 0, 2049, 0, 0, 0, - 0, 1538, 0, 720, 0, 0, 1541, 0, 1432, 0, - 0, 0, 0, 721, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 722, 0, 1540, 0, 802, - 723, 1465, 1537, 0, 0, 0, 1541, 0, 0, 0, - 0, 552, 0, 1541, 0, 0, 802, 0, 0, 0, - 2162, 0, 0, 0, 0, 0, 1542, 0, 0, 724, - 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, - 0, 1415, 1415, 0, 0, 0, 0, 2839, 2840, 0, - 0, 1541, 0, 0, 0, 1541, 0, 1008, 0, 0, - 552, 1541, 1009, 1412, 0, 0, 552, 1594, 0, 0, - 0, 0, 725, 0, 1538, 2892, 726, 0, 0, 0, - 0, 0, 1810, 1541, 0, 0, 0, 0, 0, 0, - 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, - 1540, 0, 0, 0, 1537, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 556, 0, 2902, 0, -2058, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 556, + 556, 556, 556, 556, 556, 556, 556, 556, 556, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1010, 0, 0, 1911, 1912, 1913, 0, 1914, 1915, - 1916, 1917, 1918, 1919, 553, 553, 0, 0, 0, 0, - 539, 0, 0, 0, 0, 0, 727, 0, 2789, 2790, - 0, 0, 0, 1810, 0, 1415, 0, 0, 0, 0, - 850, 728, 14, 15, 0, 0, 0, 0, 0, 1538, - 1542, 1300, 0, 0, 1810, 850, 850, 850, 0, 0, - 0, 0, 1542, 0, 0, 0, 0, 0, 552, 0, - 850, 0, 1011, 850, 729, 1540, 0, 730, 850, 0, - 1184, 0, 0, 0, 951, 0, 0, 23, 731, 0, - 0, 732, 1542, 0, 0, 0, 0, 0, 0, 1542, - 0, 0, 0, 0, 1810, 1810, 0, 1810, 1012, 733, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 734, 1013, 0, 1538, 0, 0, 735, - 736, 0, 0, 0, 1014, 0, 516, 1542, 0, 0, - 737, 1542, 0, 2610, 0, 0, 738, 1542, 0, 0, - 0, 0, 1540, 0, 0, 0, 2714, 0, 0, 0, - 0, 0, 0, 0, 850, 850, 850, 0, 1015, 1542, - 0, 0, 0, 739, 552, 0, 1412, 0, 552, 0, - 0, 0, 0, 0, 552, 0, 0, 553, 553, 1185, - 553, 0, 0, 0, 0, 2642, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2656, 1016, 0, 3120, 2049, 0, 3002, - 0, 1017, 1414, 1414, 0, 0, 0, 0, 0, 0, - 27, 28, 29, 1538, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1537, 0, 0, 0, - 0, 0, 1412, 1412, 0, 1347, 0, 0, 0, 1540, - 0, 1018, 0, 0, 2691, 0, 2692, 1538, 0, 0, - 2697, 0, 2700, 1541, 0, 0, 0, 0, 0, 0, - 1019, 2813, 0, 0, 0, 0, 0, 2162, 0, 0, - 0, 553, 0, 1540, 0, 34, 0, 0, 0, 0, - 0, 0, 0, 850, 0, 0, 36, 552, 0, 0, - 0, 552, 552, 552, 0, 0, 0, 1810, 1746, 1810, - 0, 1848, 1977, 0, 1981, 0, 0, 0, 38, 0, - 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, - 552, -1778, 2893, 0, 1415, 1415, 1538, 0, 0, 1020, - 0, 0, 0, 0, 1186, 552, 552, 552, 552, 552, - 552, 552, 552, 552, 552, 41, 0, 0, 0, 0, - 0, 0, 1540, 0, 0, 0, 44, 0, 3121, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2319, 1538, - 0, 0, 45, 0, 850, 1611, 0, 0, 1612, 0, - 0, 0, 1613, 1614, 0, 0, 1746, 1541, 0, 0, - 0, 0, 0, 1414, 0, 1540, 46, 0, 0, 0, - 0, 0, 1848, 0, 0, 0, 0, 0, 0, 0, - 47, 0, 1810, 1622, 0, 0, 0, 0, 3032, 0, - -2046, -1778, 0, 1412, 0, 0, 0, 0, 0, 552, - 0, 0, 0, 0, 0, 0, 850, 850, 850, 850, - 0, 0, 0, 1541, 0, 0, 0, 1624, 1412, 0, - 0, 1412, 0, 0, 0, 552, 951, 0, 0, 1542, - 0, 0, 3056, 3265, 3047, 0, 0, 0, -1778, 0, - 0, 1538, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -1778, 0, 3272, 3273, 0, -1778, 0, 0, - 0, 3054, -1778, 0, 0, 2934, 0, 1540, 3195, 0, - 0, -1778, 0, 0, 0, 0, -1778, 0, 0, 0, - 3287, 0, 2788, 0, 0, 1415, 0, 0, 0, 0, - 0, 3077, 0, 802, 0, 0, 0, 0, 2642, 0, - 0, 0, 0, 0, 0, 0, 0, 3089, -1778, 0, - 1415, 2162, 0, -2046, 0, 0, 1541, 2049, 0, 0, - 0, 0, 1414, 0, 0, 0, 1197, 0, -1778, 0, - -2046, 1746, 1198, 553, 0, -2046, 0, 1810, 0, 0, - 1210, 0, 0, 0, 0, 0, 0, 0, 0, 553, - 951, 552, 1412, 0, 0, 0, 0, 0, 850, 553, - 1211, 553, 0, 1542, 553, 0, 0, 0, 0, 0, - 553, 0, 553, -2046, 0, 3140, 0, -1778, 0, 0, - -1778, 0, 0, 0, 0, 553, -1778, 0, 0, 0, - 553, 0, 0, 0, 553, 553, 553, 553, 0, 553, - 553, 0, 0, 0, 0, 0, 1212, 0, 0, 0, - 0, 1541, 0, 0, 0, 0, 0, 0, 0, 1542, - 0, 0, 0, 0, 0, 0, -1778, 0, 1633, 0, - 0, 0, 0, 0, 0, 0, 0, 1199, 0, 0, - 0, 0, 0, 0, 1415, 0, 0, 0, 0, -1778, - 0, 0, 0, 3157, 0, 0, 0, 1810, 0, 0, - 0, 3082, 1414, 0, 0, 0, 0, 1107, 1107, 0, - 0, 2319, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 3191, 0, 0, 1541, 0, - 0, 0, 1412, 0, 0, 0, 0, 0, 0, 0, - 0, 1213, 0, 1538, 0, 0, 0, 852, 11, 0, - 0, 3455, 0, 0, 0, 0, 0, 0, 3208, 0, - 0, 0, 1542, 0, 552, 0, 0, 0, -2046, 1540, - 0, 552, 0, 0, 1237, -1778, 14, 15, 1279, 1286, - 0, 0, 0, 0, 0, -1778, 0, 0, 0, 553, - 1214, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1215, 0, 0, 0, -1778, 3236, -1778, -1778, 0, 0, - 0, 0, 1216, 0, 0, 0, -1793, 0, 0, 0, - 0, 23, 0, 2440, 1415, 0, 0, 552, 1981, 0, - 0, 1336, 552, 1200, 0, 1541, 0, 0, 0, 0, - 0, 0, 0, -1778, 1217, 0, -1778, -1778, -1778, 0, - 1361, 0, 0, 0, 0, 0, 1406, 1542, 552, 1408, - 0, 0, 1419, 1422, 1427, 1430, 0, 0, 0, 1541, - 3172, 0, 0, 0, 0, -2046, 0, 0, 0, 552, - 552, 0, 1640, 1641, 1642, 1643, 1644, 1645, 0, 0, - 1218, 0, 0, 1347, 1202, 0, 1219, 0, 850, 0, - 1746, 0, 0, 1472, 1279, 552, 553, 0, 0, 0, - 0, 0, 3326, 0, 0, 1594, -1793, 0, 0, 850, - 0, 1220, 3309, 0, 1556, 0, 1221, 0, 0, 0, - 0, 0, 0, 0, 1542, 0, 0, 0, 0, 0, - 1222, 0, 1412, 1572, 1365, 1366, 552, 1001, 1541, 1001, - 0, 0, 0, 0, 1582, 1583, 1584, 0, 1588, 1592, - 0, 0, 0, -1793, 27, 28, 29, 0, 0, 0, - 1364, 0, 815, 3239, 3089, 0, 0, -1793, 0, 0, - 0, 850, -1793, 0, 0, 1367, 1368, -1793, 0, 1369, - 1370, 1541, 1654, 0, 0, 0, -1793, 1204, 0, 0, - 553, -1793, 0, 0, 0, 0, 0, 0, 0, 1472, - 1472, 0, 850, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, - 0, 0, 0, -1793, 1415, 1365, 1366, 0, 0, 0, - 36, 1542, 2934, 1692, 0, 0, 0, 1708, 1713, 553, - 0, 3208, 0, -1793, 0, 2571, 0, 0, 1107, 1107, - 0, 0, 38, 0, 1371, 1372, 39, 0, 0, 0, - 0, 0, 0, 3309, 0, 1542, 1367, 1368, 0, 0, - 1369, 1370, 0, 0, 0, 0, 40, 0, 0, 0, - 0, 0, 0, 1541, 0, 0, 0, 0, 0, 41, - 1746, 0, -1793, 0, 0, -1793, 0, 0, 0, 0, - 44, -1793, 0, 951, 951, 1279, 3309, 951, 0, 0, - 0, 0, 0, 0, 1279, 1945, 45, 0, 1373, 1374, - 1375, 1376, 1377, 1378, 1379, 1380, 552, 0, 1381, 1382, - 0, 0, 0, 0, 0, 0, 0, 0, 1279, 0, - 46, -1793, 0, 0, 1542, 1371, 1372, 0, 1746, 0, - 0, 0, 0, 0, 47, 3309, 0, 0, 0, 3367, - 0, 0, 0, 0, -1793, 0, 0, 553, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1542, 0, 0, - 0, 0, 951, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2162, 0, 1373, - 1374, 1375, 1376, 1377, 1378, 1379, 1380, 0, 0, 1381, - 1382, 0, 852, 0, 0, 1892, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1383, 1384, 0, 0, 0, 0, 0, 0, 0, - -1793, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -1793, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 553, 0, 0, 0, 553, 0, -1793, - 0, -1793, -1793, 1977, 0, 1427, 0, 1427, 1427, 1542, - 0, 0, 0, 0, 2934, 0, 0, 0, 0, 0, - 1107, 1107, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1107, -1793, 0, - 0, -1793, -1793, -1793, 0, 0, 0, 0, 0, 0, - 0, 0, 1383, 1384, 0, 0, 1385, 1386, 0, 0, - 0, 1611, 0, 0, 1612, 1541, 0, 0, 1613, 1614, - 1615, 1616, 1617, 1618, 1619, 0, 0, 0, 0, 0, - 1387, 1388, 0, 0, 0, 0, 0, 0, 0, 1620, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1622, - 1994, 0, 0, 0, 0, 0, 1623, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 553, 0, 0, 0, - 553, 553, 553, 1624, 0, 0, 0, 0, 0, 0, - 0, 0, 2024, 0, 0, 0, 0, 1385, 1386, 0, - 2027, 0, 0, 0, 0, 0, 0, 0, 0, 553, + 0, 0, 0, 0, 1626, 1421, 0, 1544, 0, 0, + 0, 2324, 0, 0, 0, 0, 3130, 0, 853, 0, + 0, 1627, 0, 0, 0, 0, 1628, 0, 1751, 0, + 0, 1545, 0, 0, 0, 0, 0, 1961, 1914, 0, + 0, 0, 0, 0, 0, 0, 1853, 0, 0, 1629, + 1630, 0, 0, 0, 0, 0, 1815, 0, 0, 0, + 0, 0, 0, 0, 1631, 0, 1543, 1418, 0, 0, + 0, 0, 0, 556, 0, 0, 0, 0, 0, 0, + 853, 853, 853, 853, 0, 0, 0, 0, 0, 0, + 0, 0, 1418, 0, 0, 1418, 0, 0, 0, 556, + 955, 0, 1632, 0, 0, 1633, 0, 0, 3056, 1201, + 0, 0, 557, 0, 0, 1202, 0, 0, 0, 1634, + 0, 0, 1635, 1214, 0, 0, 0, 557, 0, 0, + 0, 0, 0, 0, 0, 3063, 0, 557, 0, 557, + 0, 0, 557, 1215, 0, 0, 0, 0, 557, 0, + 557, 0, 0, 0, 0, 0, 3204, 0, 0, 0, + 0, 0, 0, 557, 0, 3086, 0, 806, 557, 0, + 0, 0, 557, 557, 557, 557, 0, 557, 557, 0, + 0, 3098, 0, 0, 0, 2166, 0, 0, 0, 1216, + 0, 2053, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1751, 1420, 1420, 0, 0, + 0, 1815, 0, 0, 0, 1421, 0, 0, 0, 0, + 1203, 1636, 0, 0, 955, 556, 1418, 0, 0, 0, + 1611, 0, 853, 0, 0, 1612, 0, 0, 1613, 0, + 0, 0, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 3149, + 1915, 1916, 1917, 0, 1918, 1919, 1920, 1921, 1922, 1923, + 0, 0, 0, 1621, 2151, 0, 2154, 1622, 0, 1544, + 0, 0, 0, 1623, 0, 0, 0, 2163, 0, 0, + 1624, 0, 0, 0, 0, 1217, 0, 0, 0, 0, + 0, 0, 0, 1545, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1625, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2204, + 0, 0, 0, 0, 0, 0, 557, 3166, 1637, 0, + 1815, 1638, 1639, 1640, 1218, 1641, 1642, 1643, 1644, 1645, + 1646, 0, 0, 2324, 1219, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2482, 0, 1220, 0, 2446, 3200, + 0, 0, 0, 1983, 0, 0, 1418, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1204, 0, 0, + 0, 0, 1612, 0, 0, 1613, 0, 0, 1221, 1614, + 1615, 0, 3217, -2058, -2058, -2058, 0, 0, 556, 1420, + 0, 0, 0, 0, 1626, 556, 0, 0, 0, 0, + 0, 0, 2309, 2310, 2312, 2313, 0, 2315, 0, 0, + 1623, 1627, 0, 0, 3041, 0, 1628, 1624, 0, 0, + 0, 0, 0, 0, 0, 0, 1222, 0, 0, 3245, + 1206, 0, 1223, 557, 0, 0, 0, 0, 0, 1629, + 1630, 0, 1595, 0, 1625, 0, 0, 0, 0, 0, + 0, 556, 0, 0, 1631, 0, 556, 1224, 3065, 0, + 0, 0, 1225, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1612, 0, 0, 1613, 1226, 0, 0, 1614, + 1615, 0, 556, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1632, 0, 0, 1633, 0, 0, 0, 0, + 0, 0, 0, 556, 556, 0, 0, 0, 0, 1634, + 1623, 0, 1635, 0, 0, 0, 0, -2058, 0, 0, + 0, 0, 853, 0, 1751, 0, 0, 557, 556, 0, + 0, 0, 0, 1208, 0, 0, 0, 2432, 0, 0, + 0, 1626, 0, 853, 1625, 0, 3318, 0, 1420, 0, + 0, 1109, 1109, 0, 0, 0, 0, 0, 1627, 0, + 0, 0, 0, 1628, 0, 0, 1418, 0, 0, 0, + 556, 1004, 0, 1004, 0, 0, 0, 0, 0, 0, + 557, 0, 0, 0, 0, 0, 2580, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3098, 0, + 0, 1631, 0, 0, 0, 853, 0, 0, 0, 2801, + 0, 1636, 0, 0, 0, 0, 0, 0, 0, 1241, + 0, 0, 0, 1285, 1290, 0, 1612, 0, 0, 1613, + 0, 0, 0, 1614, 1615, 0, 853, 0, 0, 0, + 0, -2058, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1634, 0, -2058, 0, + 0, 0, 0, -2058, 1623, 0, 0, 0, 0, 0, + 0, -2058, 0, 0, 0, 3217, 1340, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1420, 0, + 0, 0, 0, 0, 1364, 0, 0, 3318, 1625, 0, + 1412, -2058, 0, 1414, 0, 557, 1425, 1428, 1433, 1436, + 0, 0, 0, 0, 0, 0, 0, 0, 1637, 0, + 0, 1638, 1639, 1640, 1751, 1641, 1642, 1643, 1644, 1645, + 1646, 0, 0, 0, 0, 0, 0, 955, 955, 0, + 3318, 955, 0, 0, 0, 0, 1473, 1285, 0, 1949, + 0, 0, 0, 0, 0, 0, 1634, 0, 1636, 0, + 556, 0, 0, 3076, 0, 1612, 0, 1557, 1613, 0, + 0, 0, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, + 0, 0, 1751, 0, 0, 0, 1573, 0, 0, 3318, + 0, 0, 0, 1621, 0, -2058, 0, 1583, 1584, 1585, + 0, 1589, 1593, 1623, 0, 0, 0, 0, 0, 0, + 1624, 0, -2058, 557, 0, 0, 557, -2058, 0, 0, + 0, 0, 1979, 0, 0, 0, 955, 0, 0, 0, + 0, 0, 0, 0, 0, 1655, 0, 1625, 0, 0, + 0, 2166, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1473, 1473, 0, -2058, 0, 0, -2058, 0, + 0, 0, 0, 0, 0, 1637, 0, 0, -2058, -2058, + -2058, 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2655, 1698, + 0, 0, 0, 1714, 1719, 0, 0, 0, 3335, 0, + 0, 2669, 2670, 2672, 1109, 1109, 0, 0, 0, 0, + 1634, 0, 0, 0, 0, 0, 2683, 0, 0, 2686, + 0, 0, 0, 0, 0, 0, 0, 2693, 0, 0, + 0, 0, 0, 0, 1626, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 557, 0, + 0, 1627, 557, 557, 557, 0, 1628, 0, 0, 0, + 1285, 0, 0, 0, 0, -2058, 0, 0, 0, 1285, + 0, 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, 1629, + 1630, 557, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1285, 1631, 0, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 0, 0, 0, 0, + 0, 0, -2058, 2730, 2731, 2732, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1368, 1369, 0, 0, 0, + 0, 0, 1632, 0, 0, 1633, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1634, + -46, 0, 1635, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1370, 1371, 0, 0, + 1372, 1373, 1, 0, 0, 0, 0, 0, 0, 1896, + 0, 0, 2, 0, 3, 4, 0, 0, 0, 0, + 1979, 0, 0, 0, 0, 0, 0, 5, 0, 0, + 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 0, 0, 0, 0, 2446, 0, 0, -2058, + 0, 0, 0, 0, 0, 8, 1641, 1642, 1643, 1644, + 1645, 1646, 0, 0, 9, 0, 10, 0, 0, 0, + 0, 0, 1433, 0, 1433, 1433, 1374, 1375, 11, 0, + 12, 1636, 0, 2840, 0, 0, 0, 1109, 1109, 0, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1109, 0, 0, 14, 15, 16, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, + 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, + 0, 19, 0, 20, 21, 0, 0, 0, 0, 0, + 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 22, 0, + 1384, 1385, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1387, 1388, 0, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 0, 0, 0, 0, 0, 2073, - 0, 0, 0, 0, 0, 2077, 2078, 2079, 2080, 2081, - 2082, 2083, 2084, 0, 0, 0, 0, 2093, 2094, 0, - 0, 0, 2105, 0, 0, 0, 2108, 0, 0, 2116, - 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 0, 1625, - 2125, 0, 0, 0, 0, 0, 0, 1107, 0, 1279, - 0, 0, 0, 0, 0, 0, 1626, 0, 0, 0, - 0, 1627, 0, 0, 0, 0, 0, 0, 2151, 0, - 0, 0, 0, 0, 0, -45, 0, 0, 1977, 0, - 0, 1542, 0, 0, 1628, 1629, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 1630, - 0, 1583, 1584, 0, 2440, 0, 0, 2, 0, 3, - 4, 1611, 0, 0, 1612, 0, 0, 0, 1613, 1614, - 0, 0, 5, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 0, 0, 0, 0, 7, 1631, 0, 0, - 1632, 0, 0, 0, 0, 0, 0, 0, 0, 1622, - 8, 0, 0, 0, 1633, 0, -2046, 1634, 0, 9, - 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 11, 0, 12, 0, 0, 0, 0, - 0, 0, 0, 1624, 0, 0, 13, 0, 0, 2273, - 0, 0, 0, 1279, 0, 0, 2283, 2284, 0, 0, - 0, 14, 15, 16, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 0, 0, 0, 18, 0, - 0, 0, 0, 0, 0, 0, 19, 0, 20, 21, - 553, 0, 0, 0, 0, 0, 0, 1279, 0, 0, - 0, 0, 22, 0, 0, 0, 23, 0, 2791, 0, - 0, 0, 0, 0, 1635, 0, 1336, 2348, 0, 0, + 0, 0, 557, 0, 2984, 0, 0, 0, 24, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1637, 0, + 0, 1638, 1639, 1640, -1424, 1641, 1642, 1643, 1644, 1645, + 1646, 0, 0, 0, 2028, 0, 0, 0, 1899, 0, + 0, 0, 2031, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 1386, 1387, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3020, 3021, 3022, 3023, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 24, 0, 0, 0, 0, 0, 0, -2046, - 0, 0, 0, 0, 0, 0, 2372, 2373, 25, 2374, - 0, 0, 0, 0, 0, 1611, -2046, 0, 1612, 0, - 0, -2046, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, - 0, 0, 0, 0, 26, 0, 0, 0, 2400, 2401, - 0, 0, 2151, 1620, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1622, 0, 0, 0, 0, 0, -2046, - 1623, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2428, 0, 0, 0, 0, 0, 2434, 0, 0, - 0, 1636, 0, 0, 1637, 1638, 1639, 1624, 1640, 1641, - 1642, 1643, 1644, 1645, 0, 1472, 0, 1279, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2475, 0, 27, - 28, 29, 0, 0, 1633, 0, 0, 30, 0, 0, - 31, 0, 0, 3216, 0, 0, 1416, 0, 0, 0, - 2440, 0, 0, 2468, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 2077, 0, 0, 0, 0, 0, 2081, 2082, 2083, + 2084, 2085, 2086, 2087, 2088, 1388, 1389, 0, 0, 2097, + 2098, 0, 0, 0, 2109, 0, 0, 0, 2112, 0, + 0, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, + 0, 0, 2129, 0, 0, 26, 27, 28, 0, 1109, + 0, 1285, 0, 29, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2487, 0, 34, 717, 0, 2490, 2491, 0, - 0, 35, 0, 1625, 0, 36, 553, 0, 0, 0, - 0, 553, 0, 0, 0, 37, 0, 0, 0, 0, - 1626, 0, 0, 0, 0, 1627, 0, 38, 0, 0, - 0, 39, 0, 0, -2046, 0, 0, 553, 0, 0, - 0, 2512, 0, 0, 2515, 0, 2517, 0, 1628, 1629, - 0, 40, 718, 0, 0, 0, 0, 0, 553, 553, - 0, 0, 2521, 1630, 41, 1648, 0, 42, 719, 0, - 43, 0, 0, 0, 0, 44, 0, 0, 0, 0, - 0, 0, 0, 0, 553, 0, 0, 0, 0, 0, - 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1631, 1692, 0, 1632, 0, 0, 0, 0, 0, - 1648, 0, 0, 0, 0, 46, 0, 720, 1633, 1713, - 2123, 1634, 0, 0, 0, 553, 0, 721, 0, 47, - 0, 0, -45, 0, 0, 0, 0, 0, 1107, 722, - 0, -2046, 0, 1416, 723, 0, 0, 2575, 1640, 1641, - 1642, 1643, 1644, 1645, 0, 0, 0, 0, 0, 0, + 2155, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, + 0, 0, 0, 0, 0, 3225, 32, 0, 0, 0, + 0, 0, 2446, 0, 0, 0, 0, 0, 1584, 1585, + 1390, 1391, 33, 0, 0, 0, 0, 0, 0, 34, + 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 1392, 1393, 0, 0, 3136, 0, + 0, 0, 0, 0, 0, 37, 0, 0, 0, 38, + 0, 0, 0, 0, 1996, 0, 0, 0, 557, 1612, + 0, 0, 1613, 557, 0, 0, 1614, 1615, 0, 39, + 1618, 1619, 1620, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 40, 0, 0, 41, 0, 1621, 42, 557, + 0, 0, 0, 43, 0, 2281, 0, 1623, 0, 1285, + 0, 0, 2291, 2292, 1624, 0, 0, 0, 0, 44, + 557, 557, 0, 1612, 0, 0, 1613, 0, 0, 0, + 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, 0, 0, + 0, 1625, 0, 45, 0, 557, 0, 0, 0, 0, + 1285, 1621, 0, 0, 0, 2781, 0, 46, 0, 0, + -46, 1623, 0, 0, 0, 0, 0, 0, 1624, 0, + 0, 0, 1340, 2356, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 557, 0, 0, + 0, 0, 0, 0, 0, 1625, 0, 0, 0, 0, + 0, 2380, 2381, 0, 2382, 0, 0, 0, 0, 0, + 0, 0, 0, 1612, 0, 0, 1613, 0, 0, 0, + 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, 0, 0, + 0, 0, 0, 2408, 2409, 0, 0, 2155, 1626, 0, + 0, 1621, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1623, 0, 0, 0, 1627, 0, 0, 1624, 0, + 1628, 0, 0, 0, 0, 0, 2436, 0, 0, 0, + 0, 2441, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1629, 1630, 1625, 0, 0, 1473, 0, + 1285, 0, 1626, 0, 0, 0, 0, 0, 1631, 0, + 0, 0, 0, 0, 0, 0, 0, 1422, 0, 1627, + 0, 1201, 0, 0, 1628, 0, 0, 1202, 0, 0, + 0, 0, 0, 0, 0, 1214, 0, 0, 2475, 0, + 0, 0, 0, 0, 0, 0, 1632, 1629, 1630, 1633, + 0, 0, 0, 0, 0, 1215, 0, 0, 3291, 0, + 0, 0, 1631, 1634, 0, 0, 1635, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 2494, 0, 3316, + 0, 0, 2497, 2498, 0, 0, 0, 557, 0, 0, + 0, 0, 1626, 0, 0, 0, 0, 0, 0, 0, + 1632, 1216, 0, 1633, 0, 0, 0, 0, 0, 1627, + 0, 0, 0, 0, 1628, 0, 0, 1634, 0, 0, + 1635, 0, 0, 0, 0, 0, 2519, 0, 0, 2522, + 0, 2524, 1203, 0, 0, 1649, 0, 1629, 1630, 0, + 0, 3355, 0, 0, 0, 0, 0, 2528, 0, 0, + 0, 0, 1631, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1636, 0, 0, 0, 0, + 0, 0, 3381, 0, 0, 0, 0, 0, 0, 0, + 1649, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1632, 1698, 0, 1633, 0, 0, 0, 1217, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1634, 1719, 2127, + 1635, 0, 0, 0, 0, 0, 1422, 0, 0, 1636, + 0, 0, 0, 0, 0, 0, 0, 1109, 0, 0, + 0, 0, 0, 0, 0, 0, 2584, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1219, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1649, 1220, 0, + 0, 0, 1637, 0, 0, 1638, 1639, 1640, 0, 1641, + 1642, 1643, 1644, 1645, 1646, 0, 0, 0, 0, 1204, + 0, 0, 0, 1585, 0, 0, 0, 0, 0, 1285, + 1221, 0, 0, 0, 0, 0, 0, 0, 0, 1636, + 0, 1649, 0, 0, 0, 0, 1649, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1637, 0, 0, 1638, + 1639, 1640, 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, + 0, 0, 0, 2068, 0, 0, 0, 0, 2256, 0, + 1612, 0, 1206, 1613, 1223, 2689, 0, 1614, 1615, 1616, + 1617, 1618, 1619, 1620, 0, 0, 1649, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1621, 1224, + 0, 0, 0, 0, 2257, 0, 0, 0, 1623, 0, + 1649, 0, 0, 0, 0, 1624, 0, 0, 1226, 0, + 0, 0, 0, 0, 1367, 0, 819, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1637, 0, 0, 1638, + 1639, 1640, 1625, 1641, 1642, 1643, 1644, 1645, 1646, 0, + 0, 0, 0, 2068, 0, 0, 0, 0, 1649, 0, + 1649, 0, 1422, 1422, 0, 1924, 0, 0, 1422, 0, + 0, 1649, 0, 0, 1649, 1208, 0, 0, 0, 1649, + 0, 0, 1649, 0, 0, 0, 0, 0, 0, 1368, + 1369, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1368, 1369, 0, 0, 0, 0, 0, 2769, + 0, 0, 0, 0, 0, 2771, 2031, 0, 0, 1649, + 0, 0, 0, 0, 0, 0, 2777, 0, 0, 0, + 1370, 1371, 0, 0, 1372, 1373, 0, 2786, 0, 1626, + 2789, 0, 2791, 1370, 1371, 0, 0, 1372, 1373, 0, + 2795, 0, 0, 0, 0, 0, 1627, 0, 2802, 2803, + 0, 1628, 0, 0, 0, 2810, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 724, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1611, 0, 0, 1612, 0, - 0, 0, 1613, 1614, 0, 1648, 1617, 1618, 1619, 0, - 0, 0, 0, 0, 1584, 0, 0, 0, 0, 0, - 1279, 0, 0, 0, 0, 0, 725, 0, 1635, 0, - 726, 0, 0, 1622, 0, 0, 0, 0, 0, 0, - 1623, 0, 0, 0, 0, 0, 0, 1648, 0, 0, - 0, 0, 0, 0, 1648, 0, 1610, 0, 0, 0, - 0, 1611, 0, 0, 1612, 0, 0, 1624, 1613, 1614, - 1615, 1616, 1617, 1618, 1619, 0, 0, 0, 0, 2682, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1620, - 0, 0, 0, 1621, 0, 0, 0, 0, 0, 1622, - 727, 0, 0, 0, 1648, 0, 1623, 0, 0, 0, - 0, 0, 0, 0, 0, 728, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 553, 0, 0, 0, 1648, - 0, 0, 0, 1624, 0, 1636, 0, 0, 1637, 1638, - 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, 729, 0, - 0, 730, 0, 0, 0, 1895, 0, 0, 0, 0, - 0, 0, 731, 1625, 0, 732, 0, 0, 0, 0, - 0, 0, 0, 0, 1648, 0, 1648, 0, 1416, 1416, - 1626, 1920, 0, 733, 1416, 1627, 0, 1648, 0, 0, - 1648, 0, 0, 0, 0, 1648, 0, 734, 1648, 0, - 0, 0, 0, 0, 736, 0, 0, 0, -2046, -2046, - 0, 2760, 0, 0, 737, 0, 0, 2762, 2027, 0, - 738, 0, 0, 1630, 0, 0, 0, 0, 2768, 1625, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2777, - 1648, 0, 2780, 0, 2782, 0, 1626, 739, 0, 0, - 0, 1627, 2786, 0, 0, 0, 0, 0, 0, 0, - 2793, 2794, 0, 0, -2046, 0, 0, 2801, 0, 0, - 0, 0, 0, 0, 1628, 1629, 0, 0, 1633, 0, - 0, 0, 2810, 0, 0, 0, 0, 0, 0, 1630, - 0, 0, 2825, 0, 0, 0, 0, 0, 0, 0, + 2819, 0, 0, 0, 1629, 1630, 0, 0, 0, 0, + 2834, 0, 0, 0, 0, 0, 0, 0, 0, 1631, + 0, 0, 0, 1649, 0, 0, 0, 0, 0, 0, + 1374, 1375, 1109, 0, 0, 0, 0, 0, 0, 1649, + 0, 0, 0, 1374, 1375, 0, 0, 0, 0, 1649, + 1649, 1649, 0, 0, 0, 1649, 0, 1632, 0, 1649, + 1633, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1634, 0, 0, 1635, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2281, + 0, 2281, 0, 0, 1376, 1377, 1378, 1379, 1380, 1381, + 1382, 1383, 0, 0, 1384, 1385, 0, 1376, 1377, 1378, + 1379, 1380, 1381, 1382, 1383, 0, 0, 1384, 1385, 0, + 0, 1649, 0, 0, 0, 0, 0, 1612, 0, 0, + 1613, 0, 0, 0, 1614, 1615, 1616, 1617, 1618, 1619, + 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1621, 0, 0, 0, 0, + 0, 0, 0, 0, 1649, 1623, 0, 0, 0, 0, + 0, 0, 1624, 0, 0, 0, 1636, 0, 1386, 1387, + 1649, 0, 0, 0, 0, 1649, 3036, 3037, 0, 0, + 0, 1386, 1387, 0, 0, 0, 0, 0, 0, 1625, + 0, 0, 1924, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1388, + 1389, 3060, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1612, 1388, 1389, 1613, 3064, 0, 0, 1614, 1615, + 3066, 3067, 1618, 1619, 1620, 3068, 0, 0, 0, 0, + 3071, 0, 0, 3074, 3075, 0, 0, 0, 2281, 1285, + 0, 0, 3083, 0, 0, 0, 0, 0, 0, 1623, + 0, 0, 0, 1109, 0, 0, 1624, 0, 0, 0, + 0, 0, 0, 1637, 0, 0, 1638, 1639, 1640, 0, + 1641, 1642, 1643, 1644, 1645, 1646, 1626, 0, 0, 0, + 2379, 0, 0, 1625, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1627, 1390, 1391, 0, 3124, 1628, 0, + 0, 0, 0, 0, 0, 0, 0, 1390, 1391, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1392, 1393, + 0, 1629, 1630, 0, 3143, 0, 0, 0, 0, 0, + 0, 1392, 1393, 0, 0, 0, 1631, 0, 0, 0, + 0, 0, 1649, 0, 0, 0, 0, 0, 0, 0, + 1924, 1924, 0, 1422, 1422, 1422, 1422, 1422, 1422, 0, + 0, 1422, 1422, 1422, 1422, 1422, 1422, 1422, 1422, 1422, + 1422, 1924, 0, 0, 1632, 0, 0, 1633, 0, 0, + 1626, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1634, 0, 0, 1635, 0, 0, 1627, 0, 0, + 0, 0, 1628, 0, 0, 0, 0, 1612, 0, 0, + 1613, 0, 0, 3176, 1614, 1615, 1616, 1617, 1618, 1619, + 1620, 0, 0, 0, 0, 1629, 1630, 0, 0, 0, + 0, 0, 0, 0, 0, 1621, 0, 0, 0, 0, + 1631, 0, 0, 0, 0, 1623, 0, 0, 0, 0, + 0, 0, 1624, 0, 0, 0, 0, 0, 0, 0, + 0, 1593, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1649, 0, 0, 1649, 1632, 1625, + 0, 1633, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1636, 2494, 1634, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3237, 3238, 0, 0, 3239, + 0, 1585, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1649, 0, 0, 0, 1649, 1649, 1649, + 1649, 1649, 1649, 1649, 1649, 0, 3257, 0, 0, 0, + 1422, 1422, 0, 1649, 1649, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1649, 0, 0, 1649, 0, + 3269, 0, 0, 0, 0, 0, 1649, 1649, 1649, 1649, + 1649, 1649, 1649, 1649, 1649, 1649, 1626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1107, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1648, 0, 0, 1631, 0, 0, - 1632, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1648, 0, 0, 0, 1633, 0, 0, 1634, 0, 0, - 1648, 1648, 1648, 0, 0, 0, 1648, 0, 0, 0, - 1648, 0, 0, 0, 0, 0, 0, 0, 0, 2273, - 0, 2273, 0, 0, 0, 0, 0, 0, 1635, 0, - 1611, 0, 0, 1612, 0, 0, 0, 1613, 1614, 0, + 0, 0, 0, 1627, 0, 0, 0, 1636, 1628, 0, + 1637, 1649, 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, + 1644, 1645, 1646, 0, 0, 0, 0, 2479, 0, 0, + 0, 1629, 1630, 0, 0, 0, 0, 0, 0, 0, + 3314, 0, 0, 0, 0, 0, 1631, 0, 0, 0, + 0, 0, 0, 0, 0, 721, 0, 0, 0, 3036, + 0, 0, 0, 3332, 0, 0, 0, 1109, 1422, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3341, 0, + 0, 0, 0, 2281, 1632, 2281, 0, 1633, 0, 0, + 0, 0, 0, 1109, 0, 0, 0, 0, 0, 0, + 0, 1634, 0, 0, 1635, 0, 0, 0, 0, 0, + 0, 3366, 722, 0, 1637, 0, 0, 1638, 1639, 1640, + 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, 723, 0, + 0, 0, 0, 0, 0, 0, 0, 1649, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1649, 1649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1611, 0, - 0, 1612, 0, 0, 0, 1613, 1614, 0, 1622, 0, - 0, 0, 1648, 0, 0, -2046, 0, 1611, 0, 0, - 1612, 0, 0, 0, 1613, 1614, 1615, 1616, 1617, 1618, - 1619, 0, 0, 0, 1635, 0, 1622, 0, 0, 0, - 0, 0, 1624, -2046, 0, 1620, 0, 0, 0, 2772, - 1648, 0, 0, 0, 0, 1622, 3027, 3028, 0, 0, - 0, 0, 1623, 0, 0, 0, 1648, 0, 0, 0, - 1624, 1648, 0, 0, 0, 1636, 0, 0, 1637, 1638, - 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, 1920, 1624, - 0, 3051, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 3055, 0, 2792, 0, 0, - 3057, 3058, 0, 0, 0, 3059, 0, 0, 0, 0, - 3062, 0, 0, 3065, 3066, 0, 0, 0, 2273, 1279, - 0, 0, 3074, 0, 0, 3067, 0, 0, -2046, 0, - 0, 1636, 0, 1107, 1637, 1638, 1639, 0, 1640, 1641, - 1642, 1643, 1644, 1645, 0, -2046, 0, 0, 0, 0, - -2046, 0, 0, 0, 0, 0, -2046, 0, 0, 0, + 3392, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 3036, 0, 0, 0, 0, 0, 0, 724, 0, 0, + 0, 0, 1109, 0, 0, 0, 0, 725, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -2046, 0, 1625, 0, 3115, -2046, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -2046, 0, - 0, 0, 1626, 0, 0, 0, 0, 1627, 0, 0, - 0, 0, 0, 0, 3134, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -2046, 0, 0, 0, - 1628, 1629, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1630, 0, 0, 0, 0, - 1648, 0, 0, 1633, 0, 0, 0, 0, 1920, 1920, - 0, 1416, 1416, 1416, 1416, 1416, 1416, 0, 0, 1416, - 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1920, - 0, 1633, 0, 1631, 0, 0, 1632, 0, 0, 0, + 726, 0, 0, 1636, 0, 727, 0, 0, 0, 0, + 0, 0, 1649, 0, 3435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1633, 0, 0, 1634, 3168, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1611, 0, - 0, 1612, 0, 0, 0, 1613, 1614, 1615, 1616, 1617, - 1618, 1619, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1620, 0, 0, 0, - 0, 1592, 0, -2046, 0, 0, 1622, 0, 0, 0, - 0, 0, 0, 1623, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 728, 0, 1649, 1649, 1649, 0, + 0, 1924, 1924, 1924, 1924, 1924, 1924, 0, 0, 0, + 1924, 1924, 1924, 1924, 1924, 1924, 1924, 1924, 1924, 1924, + 1612, 0, 0, 1613, 1649, 1649, 0, 1614, 1615, 1616, + 1617, 1618, 1619, 1620, 0, 0, 0, 729, 0, 0, + 0, 730, 0, 0, 0, 0, 0, 0, 1621, 0, + 0, 0, 1649, 0, 0, 0, 0, 1649, 1623, 0, + 0, 0, 3489, 3489, 3489, 1624, 0, 0, 0, 0, + 1637, 0, 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, + 1644, 1645, 1646, 0, 0, 0, 0, 2503, 0, 3489, + 0, 1649, 1625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -2046, 1648, 0, 2487, 1648, 0, 0, 0, 0, - 1624, 0, 0, 0, 0, 3228, 3229, 0, 0, 3230, - 1635, 1584, 0, 0, 0, 0, 0, 0, 0, 0, + 1649, 731, 0, 1649, 1649, 0, 0, 0, 0, 0, + 0, 1924, 1924, 0, 0, 0, 732, 0, 0, 0, + 3489, 0, 0, 0, 0, 1649, 1422, 1422, 1649, 0, + 1649, 0, 0, 0, 1649, 0, 1612, 0, 0, 1613, + 0, 0, 0, 1614, 1615, 1616, 1617, 1618, 1619, 1620, + 0, 733, 0, 0, 734, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1621, 735, 0, 0, 736, 0, + 0, 0, 0, 0, 1623, 0, 0, 0, 0, 1626, + 0, 1624, 0, 0, 0, 0, 737, 0, 0, 0, + 1649, 0, 0, 0, 0, 0, 1627, 0, 0, 0, + 738, 1628, 0, 1612, 0, 0, 1613, 740, 1625, 0, + 1614, 1615, 1616, 1617, 1618, 1619, 1620, 741, 0, 0, + 0, 0, 0, 742, 1629, 1630, 0, 0, 0, 0, + 0, 1621, 0, 0, 0, 0, 0, 0, 0, 1631, + 0, 1623, 0, 0, 0, 0, 0, 0, 1624, 0, + 743, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3248, 0, 0, 0, - 0, 1648, 0, 0, 0, 1648, 1648, 1648, 1648, 1648, - 1648, 1648, 1648, 0, 0, 0, 0, 0, 1416, 1416, - 3260, 1648, 1648, 0, 0, 0, 0, 0, 0, 0, - -2046, 0, 0, 1648, 0, 0, 1648, 1640, 1641, 1642, - 1643, 1644, 1645, 0, 1648, 1648, 1648, 1648, 1648, 1648, - 1648, 1648, 1648, 1648, 0, 0, 1625, 0, -2046, 0, - 0, 0, 0, 0, 0, 1640, 1641, 1642, 1643, 1644, - 1645, 0, 0, 1626, 0, 0, 0, 1636, 1627, 1648, - 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, - 0, 3306, 0, 0, 2064, 0, 0, 0, 0, 0, - 0, 1628, 1629, 0, 0, 0, 0, 0, 0, 3027, - 0, 0, 0, 3323, 0, 0, 1630, 1107, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 3332, 0, - 0, 0, 1416, 2273, 0, 2273, 0, 0, 0, 0, - 0, 0, 0, 1107, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1631, 0, 0, 1632, 0, 0, - 0, 3357, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1633, 0, 0, 1634, 0, 0, 0, 1611, 0, - 0, 1612, 0, 0, 0, 1613, 1614, 1615, 1616, 1617, - 1618, 1619, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1648, 0, 0, 0, 0, 1620, 0, 0, 0, - 3383, 1648, 1648, 0, 0, 0, 1622, 0, 0, 0, - 3027, 0, 0, 1623, 0, 0, 0, 0, 0, 0, - 0, 0, 1107, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1625, 0, 1632, 0, 0, + 1633, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1634, 1649, 0, 1635, 0, 0, + 0, 0, 0, 0, 0, 1626, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1422, + 0, 0, 1627, 0, 0, 0, 0, 1628, 0, 0, + 0, 0, 0, 0, 0, 1612, 0, 0, 1613, 0, + 0, 0, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, + 1629, 1630, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1621, 0, 1631, 0, 0, 2175, 0, + 0, 0, 1626, 1623, 0, 1649, 0, 1649, 0, 0, + 1624, 0, 0, 1649, 0, 0, 0, 0, 0, 1627, + 0, 0, 1649, 0, 1628, 1649, 1636, 1649, 0, 0, + 0, 1649, 0, 1632, 1924, 1924, 1633, 1625, 1649, 1649, + 0, 0, 0, 0, 0, 0, 1649, 1629, 1630, 0, + 1634, 0, 0, 1635, 0, 1649, 0, 0, 0, 0, + 0, 0, 1631, 0, 0, 0, 0, 0, 0, 0, + 1649, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 2176, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 721, 0, 0, 0, + 1632, 0, 0, 1633, 0, 0, 0, 0, 1422, 0, + 0, 0, 0, 0, 0, 0, 0, 1634, 0, 0, + 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1637, 1626, 0, 1638, 1639, 1640, 0, + 1641, 1642, 1643, 1644, 1645, 1646, 0, 0, 0, 0, + 2711, 1627, 1636, 722, 0, 0, 1628, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 723, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1629, + 1630, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1624, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3426, 0, 0, 0, 0, 0, - 0, 1635, 0, 0, 0, 0, 1648, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 724, 1636, + 0, 0, 0, 0, 0, 0, 0, 0, 725, 0, + 0, 0, 1632, 0, 0, 1633, 0, 0, 0, 0, + 0, 726, 0, 0, 0, 0, 727, 1924, 1422, 1634, + 0, 0, 1635, 0, 0, 0, 0, 0, 0, 1637, + 0, 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, 1644, + 1645, 1646, 1649, 1649, 0, 728, 2783, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1649, 0, 0, 0, + 1649, 0, 1649, 1649, 1649, 0, 0, 1649, 0, 0, + 1649, 1649, 0, 0, 0, 0, 0, 0, 729, 1649, + 0, 0, 730, 0, 0, 0, 1637, 0, 0, 1638, + 1639, 1640, 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, + 0, 0, 0, 2850, 0, 0, 0, 0, 0, 0, + 0, 1636, 0, 0, 0, 0, 0, 0, 0, 0, + 1649, 0, 0, 0, 0, 0, 1924, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1649, + 0, 0, 0, 0, 0, 0, 543, 0, 0, 0, + 0, 0, 731, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 732, 0, 0, + 0, 0, 1649, 0, 2179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1648, 1648, 1648, 0, 0, 1920, 1920, 1920, 1920, 1920, - 1920, 0, 0, 0, 1920, 1920, 1920, 1920, 1920, 1920, - 1920, 1920, 1920, 1920, 0, 0, 0, 0, 1648, 1648, - 0, 0, 1611, 0, 0, 1612, 0, 0, 0, 1613, - 1614, 1615, 1616, 1617, 1618, 1619, 1625, 0, 0, 0, - 0, 0, 3480, 3480, 3480, 0, 1648, 0, 0, 0, - 1620, 0, 1648, 1626, 0, 0, 0, 0, 1627, 0, - 1622, 0, 0, 0, 0, 0, 0, 1623, 1636, 3480, - 0, 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, 1644, - 1645, 1628, 1629, 0, 0, 2064, 1648, 0, 0, 0, - 0, 0, 0, 0, 1624, 0, 1630, 0, 0, 0, - 0, 0, 0, 0, 0, 1648, 0, 0, 1648, 1648, - 3480, 0, 0, 0, 0, 0, 1920, 1920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1648, 1416, 1416, 1648, 1631, 1648, 0, 1632, 0, 1648, + 1924, 0, 733, 0, 0, 734, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 735, 0, 1637, 736, + 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, 1644, 1645, + 1646, 0, 0, 1649, 1649, 1649, 0, 737, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1633, 0, 0, 1634, 0, 0, 0, 0, 0, + 0, 738, 0, 1649, 0, 0, 0, 739, 740, 0, + 0, 0, 0, 0, 0, 1649, 0, 0, 741, 0, + 0, 0, 0, 0, 742, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 743, 0, 0, 0, 0, 0, 0, 0, 0, + 1649, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1649, 0, + 0, 0, 0, 0, 0, 0, 0, 1649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1625, 0, 0, 1648, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1626, 0, 0, - 0, 1611, 1627, 0, 1612, 0, 0, 0, 1613, 1614, - 1615, 1616, 1617, 1618, 1619, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1628, 1629, 0, 0, 1620, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1622, - 1630, 1635, 0, 0, 0, 0, 1623, 0, 0, 0, - 0, 1611, 0, 0, 1612, 0, 0, 0, 1613, 1614, - 1615, 1616, 1617, 1618, 1619, 0, 0, 0, 0, 0, - 0, 0, 0, 1624, 0, 0, 0, 0, 1631, 1620, - 0, 1632, 0, 0, 0, 0, 0, 0, 0, 1622, - 1648, 0, 0, 0, 0, 1633, 1623, 1197, 1634, 0, - 0, 0, 0, 1198, 0, 0, 0, 0, 0, 0, - 0, 1210, 1416, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1624, 0, 0, 0, 0, 0, 0, - 0, 1211, 0, 1611, 0, 0, 1612, 0, 0, 0, - 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 1636, 0, - 0, 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, 1644, - 1645, 1620, 0, 0, 0, 2371, 0, 0, 1648, 1625, - 1648, 1622, 0, 0, 0, 0, 1648, 1212, 1623, 0, - 0, 0, 0, 0, 0, 1648, 1626, 0, 1648, 0, - 1648, 1627, 0, 0, 1648, 1635, 0, 1920, 1920, 0, - 0, 1648, 1648, 0, 0, 1624, 0, 0, 1199, 1648, - 0, 0, 0, 0, 1628, 1629, 0, 0, 1648, 1625, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1630, - 0, 0, 0, 1648, 0, 0, 1626, 0, 0, 0, - 0, 1627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1628, 1629, 0, 1631, 0, 0, - 1632, 1416, 1213, 0, 0, 0, 0, 0, 0, 1630, - 0, 0, 0, 0, 1633, 0, 0, 1634, 0, 0, + 0, 0, 1649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1625, 1636, 0, 0, 1637, 1638, 1639, 0, 1640, - 1641, 1642, 1643, 1644, 1645, 0, 0, 1631, 1626, 2472, - 1632, 1214, 0, 1627, 0, 0, 0, 0, 0, 0, - 0, 1215, 0, 0, 1633, 0, 0, 1634, 0, 0, - 0, 0, 0, 1216, 0, 0, 1628, 1629, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1630, 0, 0, 1200, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1217, 0, 0, 0, 0, - 0, 0, 0, 0, 1635, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1631, - 1365, 1366, 1632, 0, 0, 0, 0, 0, 0, 0, - 1920, 1416, 0, 0, 0, 0, 1633, 0, 0, 1634, - 0, 2248, 0, 0, 0, 1202, 0, 1219, 0, 0, - 0, 0, 0, 0, 1635, 1648, 1648, 0, 0, 0, - 0, 1367, 1368, 0, 0, 1369, 1370, 0, 0, 0, - 0, 0, 1220, 0, 0, 0, 0, 2249, 0, 1648, - 0, 0, 0, 1648, 0, 1648, 1648, 1648, 0, 0, - 1648, 1222, 0, 1648, 1648, 0, 0, 0, 0, 0, - 0, 0, 1648, 0, 0, 0, 0, 0, 0, 0, - 0, 1636, 0, 0, 1637, 1638, 1639, 0, 1640, 1641, - 1642, 1643, 1644, 1645, 0, 0, 0, 0, 2496, 0, - 0, 0, 0, 0, 0, 0, 1635, 0, 0, 0, - 1371, 1372, 0, 1648, 0, 0, 0, 0, 1204, 1920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1636, 1648, 0, 1637, 1638, 1639, 0, 1640, 1641, - 1642, 1643, 1644, 1645, 0, 0, 0, 0, 2702, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1648, 0, 0, 0, - 0, 0, 0, 0, 1373, 1374, 1375, 1376, 1377, 1378, - 1379, 1380, 0, 0, 1381, 1382, 0, 0, 0, 0, - 0, 0, 0, 1920, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1636, 0, 0, 1637, 1638, 1639, 0, - 1640, 1641, 1642, 1643, 1644, 1645, 1648, 1648, 1648, 0, - 2774, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1648, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1648, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1383, 1384, 0, - 0, 0, 0, 0, 1648, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1648, 0, 0, 0, 0, 0, 0, 0, 0, - 1648, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1648, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1648, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1385, 1386, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 116, 1042, 815, - 1043, 1044, 1045, 1046, 1047, 0, 1387, 1388, 0, 0, - 0, 0, 0, 0, 1648, 0, 117, 118, 119, 120, - 121, 122, 123, 124, 0, 125, 126, 127, 0, 0, - 0, 0, 0, 1048, 0, 0, 128, 129, 130, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 1049, 140, - 1050, 1051, 0, 143, 144, 145, 146, 147, 148, 1052, - 785, 149, 150, 151, 152, 1053, 1054, 155, 1648, 156, - 157, 158, 159, 786, 0, 787, 0, 1055, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 0, 172, 173, - 174, 175, 176, 177, 0, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 1056, 190, 191, 1057, - 193, 1058, 194, 0, 195, 196, 197, 198, 199, 200, - 0, 0, 201, 202, 203, 204, 0, 0, 205, 206, - 1059, 208, 209, 0, 210, 211, 212, 0, 213, 214, - 215, 0, 216, 217, 218, 219, 1060, 221, 222, 223, - 224, 225, 788, 1061, 227, 0, 228, 229, 1062, 231, - 0, 232, 0, 233, 234, 0, 235, 236, 237, 238, - 239, 240, 0, 241, 0, 1063, 1064, 244, 245, 0, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 0, 258, 259, 260, 261, 262, 263, 264, - 0, 265, 266, 267, 268, 269, 270, 271, 272, 1065, - 1066, 0, 1067, 0, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 0, 0, 287, 288, 289, - 290, 0, 291, 292, 293, 294, 295, 296, 297, 298, - 1068, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 0, 0, 0, 0, 117, 1044, 819, 1045, 1046, 1047, + 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1649, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 1050, 0, 0, 129, 130, 131, 0, 132, 133, 134, + 135, 136, 137, 138, 139, 1051, 141, 1052, 1053, 0, + 144, 145, 146, 147, 148, 149, 1054, 789, 150, 151, + 152, 153, 1055, 1056, 156, 1649, 157, 158, 159, 160, + 790, 0, 791, 0, 1057, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 1058, 191, 192, 1059, 194, 1060, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 1061, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 1062, 222, 223, 224, 225, 226, 227, + 792, 1063, 229, 0, 230, 231, 1064, 233, 0, 234, + 0, 235, 236, 0, 237, 238, 239, 240, 241, 242, + 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 1067, 1068, 0, + 1069, 0, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 290, 291, 292, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 1070, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 1071, + 323, 1072, 325, 326, 327, 328, 1073, 329, 330, 331, + 332, 1074, 794, 334, 1075, 336, 337, 338, 0, 339, + 340, 0, 0, 1076, 342, 343, 0, 0, 344, 345, + 346, 347, 348, 349, 796, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 797, 365, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 1077, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 403, 404, 405, 406, 1078, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 430, 431, 432, 1079, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 799, 0, 0, 450, 451, + 0, 452, 453, 454, 455, 456, 457, 458, 0, 459, + 1080, 1081, 0, 0, 462, 463, 800, 465, 801, 1082, + 467, 468, 802, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 1083, 0, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 1084, 0, 0, 0, 0, 0, 0, 1085, + 1086, 1087, 0, 0, 0, 0, 1088, 0, 1089, 0, + 0, 0, 0, 1090, 1091, 0, 1092, 1093, 2636, 117, + 1044, 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 118, 119, + 120, 121, 122, 123, 124, 125, 0, 126, 127, 128, + 0, 0, 0, 0, 0, 1050, 0, 0, 129, 130, + 131, 0, 132, 133, 134, 135, 136, 137, 138, 139, + 1051, 141, 1052, 1053, 0, 144, 145, 146, 147, 148, + 149, 1054, 789, 150, 151, 152, 153, 1055, 1056, 156, + 0, 157, 158, 159, 160, 790, 0, 791, 0, 1057, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 0, + 173, 174, 175, 176, 177, 178, 0, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 1058, 191, + 192, 1059, 194, 1060, 195, 0, 196, 197, 198, 199, + 200, 201, 0, 0, 202, 203, 204, 205, 0, 0, + 206, 207, 1061, 209, 210, 0, 211, 212, 213, 0, + 214, 215, 216, 0, 217, 218, 219, 220, 1062, 222, + 223, 224, 225, 226, 227, 792, 1063, 229, 0, 230, + 231, 1064, 233, 0, 234, 0, 235, 236, 0, 237, + 238, 239, 240, 241, 242, 0, 243, 0, 1065, 1066, + 246, 247, 0, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 0, 260, 261, 262, 263, + 264, 265, 266, 0, 267, 268, 269, 270, 271, 272, + 273, 274, 1067, 1068, 0, 1069, 0, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 0, 0, + 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, + 298, 299, 300, 1070, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 1071, 323, 1072, 325, 326, 327, + 328, 1073, 329, 330, 331, 332, 1074, 794, 334, 1075, + 336, 337, 338, 0, 339, 340, 0, 0, 1076, 342, + 343, 0, 0, 344, 345, 346, 347, 348, 349, 796, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 0, 0, 0, 0, 362, 363, 797, 365, 366, + 367, 368, 369, 370, 371, 0, 372, 373, 374, 375, + 376, 377, 0, 378, 379, 380, 381, 382, 1077, 384, + 385, 386, 387, 0, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, + 403, 404, 405, 406, 1078, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 0, 0, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 0, + 430, 431, 432, 1079, 434, 0, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 799, 0, 0, 450, 451, 0, 452, 453, 454, 455, + 456, 457, 458, 0, 459, 1080, 1081, 0, 0, 462, + 463, 800, 465, 801, 1082, 467, 468, 802, 470, 471, + 472, 473, 474, 0, 0, 475, 476, 477, 0, 478, + 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, + 1083, 0, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 1084, 0, 0, + 0, 0, 0, 0, 1085, 1086, 1087, 0, 0, 0, + 0, 1088, 0, 1089, 0, 0, 0, 0, 1090, 1091, + 0, 1092, 1093, 3240, 117, 1044, 819, 1045, 1046, 1047, + 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 1050, 0, 0, 129, 130, 131, 0, 132, 133, 134, + 135, 136, 137, 138, 139, 1051, 141, 1052, 1053, 0, + 144, 145, 146, 147, 148, 149, 1054, 789, 150, 151, + 152, 153, 1055, 1056, 156, 0, 157, 158, 159, 160, + 790, 0, 791, 0, 1057, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 1058, 191, 192, 1059, 194, 1060, 195, + 0, 196, 197, 198, 199, 200, 201, 14, 15, 202, + 203, 204, 205, 0, 0, 206, 207, 1061, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 1062, 222, 223, 224, 225, 226, 227, + 792, 1063, 229, 0, 230, 231, 1064, 233, 0, 234, + 0, 235, 236, 23, 237, 238, 239, 240, 241, 242, + 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 1067, 1068, 0, + 1069, 0, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 290, 291, 292, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 1070, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 1071, + 323, 1072, 325, 326, 327, 328, 1073, 329, 330, 331, + 332, 1074, 794, 334, 1075, 336, 337, 338, 0, 339, + 340, 0, 0, 1076, 342, 343, 0, 0, 344, 345, + 346, 347, 348, 349, 796, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 26, 27, 28, 0, + 362, 363, 797, 365, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 1077, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 403, 404, 405, 406, 1078, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 33, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 35, 430, 431, 432, 1079, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 799, 37, 0, 450, 451, + 38, 452, 453, 454, 455, 456, 457, 458, 0, 459, + 1080, 1081, 0, 0, 462, 463, 800, 465, 801, 1082, + 467, 468, 802, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 40, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 803, 1083, 0, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 44, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 1084, 0, 45, 0, 0, 0, 0, 1085, + 1086, 1087, 0, 0, 0, 0, 1088, 0, 1089, 3215, + 0, 0, 0, 1090, 1091, 0, 1092, 1093, 117, 1044, + 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 1050, 0, 0, 129, 130, 131, + 0, 132, 133, 134, 135, 136, 137, 138, 139, 1051, + 141, 1052, 1053, 0, 144, 145, 146, 147, 148, 149, + 1054, 789, 150, 151, 152, 153, 1055, 1056, 156, 0, + 157, 158, 159, 160, 790, 0, 791, 0, 1057, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 1058, 191, 192, + 1059, 194, 1060, 195, 0, 196, 197, 198, 199, 200, + 201, 14, 15, 202, 203, 204, 205, 0, 0, 206, + 207, 1061, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 1062, 222, 223, + 224, 225, 226, 227, 792, 1063, 229, 0, 230, 231, + 1064, 233, 0, 234, 0, 235, 236, 23, 237, 238, + 239, 240, 241, 242, 0, 243, 0, 1065, 1066, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 268, 269, 270, 271, 272, 273, + 274, 1067, 1068, 0, 1069, 0, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 1069, 321, 1070, 323, 324, 325, 326, 1071, 327, - 328, 329, 330, 1072, 790, 332, 1073, 334, 335, 336, - 0, 337, 338, 0, 0, 1074, 340, 341, 0, 0, - 342, 343, 344, 345, 346, 347, 792, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 0, 0, - 0, 0, 360, 361, 793, 363, 364, 365, 366, 367, - 368, 369, 0, 370, 371, 372, 373, 374, 375, 0, - 376, 377, 378, 1075, 380, 381, 382, 383, 0, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 0, 397, 398, 399, 400, 401, 402, 1076, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 0, 0, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 0, 426, 427, 428, 1077, 430, - 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 795, 0, 0, 446, 447, - 0, 448, 449, 450, 451, 452, 453, 454, 0, 455, - 1078, 1079, 0, 0, 458, 459, 796, 461, 797, 1080, - 463, 464, 798, 466, 467, 468, 469, 470, 0, 0, - 471, 472, 473, 0, 474, 475, 476, 477, 0, 478, - 479, 480, 481, 482, 483, 1081, 0, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 0, 0, 494, 0, - 0, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 319, 320, 321, 1071, 323, 1072, 325, 326, 327, 328, + 1073, 329, 330, 331, 332, 1074, 794, 334, 1075, 336, + 337, 338, 0, 339, 340, 0, 0, 1076, 342, 343, + 0, 0, 344, 345, 346, 347, 348, 349, 796, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 26, 27, 28, 0, 362, 363, 797, 365, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 1077, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, + 404, 405, 406, 1078, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 33, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 35, 430, + 431, 432, 1079, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 799, + 37, 0, 450, 451, 38, 452, 453, 454, 455, 456, + 457, 458, 0, 459, 1080, 1081, 0, 0, 462, 463, + 800, 465, 801, 1082, 467, 468, 802, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 40, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 803, 1083, + 0, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 44, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, - 514, 515, 1082, 0, 0, 0, 0, 0, 0, 1083, - 1084, 1085, 0, 0, 0, 0, 1086, 0, 1087, 0, - 0, 0, 0, 1088, 1089, 0, 1090, 1091, 2627, 116, - 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 1048, 0, 0, 128, 129, - 130, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 1049, 140, 1050, 1051, 0, 143, 144, 145, 146, 147, - 148, 1052, 785, 149, 150, 151, 152, 1053, 1054, 155, - 0, 156, 157, 158, 159, 786, 0, 787, 0, 1055, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 1056, 190, - 191, 1057, 193, 1058, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 1059, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 1060, 221, - 222, 223, 224, 225, 788, 1061, 227, 0, 228, 229, - 1062, 231, 0, 232, 0, 233, 234, 0, 235, 236, - 237, 238, 239, 240, 0, 241, 0, 1063, 1064, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 266, 267, 268, 269, 270, 271, - 272, 1065, 1066, 0, 1067, 0, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 288, 289, 290, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 1068, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 1069, 321, 1070, 323, 324, 325, 326, - 1071, 327, 328, 329, 330, 1072, 790, 332, 1073, 334, - 335, 336, 0, 337, 338, 0, 0, 1074, 340, 341, - 0, 0, 342, 343, 344, 345, 346, 347, 792, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 793, 363, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 1075, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 399, 400, 401, - 402, 1076, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 426, 427, 428, - 1077, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, 444, 795, 0, 0, - 446, 447, 0, 448, 449, 450, 451, 452, 453, 454, - 0, 455, 1078, 1079, 0, 0, 458, 459, 796, 461, - 797, 1080, 463, 464, 798, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 1081, 0, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 1082, 0, 0, 0, 0, 0, - 0, 1083, 1084, 1085, 0, 0, 0, 0, 1086, 0, - 1087, 0, 0, 0, 0, 1088, 1089, 0, 1090, 1091, - 3231, 116, 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, + 514, 515, 516, 517, 518, 519, 1084, 0, 45, 0, + 0, 0, 0, 1085, 1086, 1087, 0, 0, 0, 0, + 1088, 0, 1089, 0, 0, 0, 0, 1090, 1091, 0, + 1092, 1093, 117, 1044, 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 117, 118, 119, 120, 121, 122, 123, 124, 0, 125, - 126, 127, 0, 0, 0, 0, 0, 1048, 0, 0, - 128, 129, 130, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 1049, 140, 1050, 1051, 0, 143, 144, 145, - 146, 147, 148, 1052, 785, 149, 150, 151, 152, 1053, - 1054, 155, 0, 156, 157, 158, 159, 786, 0, 787, - 0, 1055, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 0, 172, 173, 174, 175, 176, 177, 0, 178, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 1050, 0, + 0, 129, 130, 131, 0, 132, 133, 134, 135, 136, + 137, 138, 139, 1051, 141, 1052, 1053, 0, 144, 145, + 146, 147, 148, 149, 1054, 789, 150, 151, 152, 153, + 1055, 1056, 156, 0, 157, 158, 159, 160, 790, 0, + 791, 0, 1057, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 1056, 190, 191, 1057, 193, 1058, 194, 0, 195, 196, - 197, 198, 199, 200, 14, 15, 201, 202, 203, 204, - 0, 0, 205, 206, 1059, 208, 209, 0, 210, 211, - 212, 0, 213, 214, 215, 0, 216, 217, 218, 219, - 1060, 221, 222, 223, 224, 225, 788, 1061, 227, 0, - 228, 229, 1062, 231, 0, 232, 0, 233, 234, 23, - 235, 236, 237, 238, 239, 240, 0, 241, 0, 1063, - 1064, 244, 245, 0, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 0, 258, 259, 260, - 261, 262, 263, 264, 0, 265, 266, 267, 268, 269, - 270, 271, 272, 1065, 1066, 0, 1067, 0, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 0, - 0, 287, 288, 289, 290, 0, 291, 292, 293, 294, - 295, 296, 297, 298, 1068, 300, 301, 302, 303, 304, + 189, 1058, 191, 192, 1059, 194, 1060, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 1061, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 1062, 222, 223, 224, 225, 226, 227, 792, 1063, + 229, 0, 230, 231, 1064, 233, 0, 234, 0, 235, + 236, 23, 237, 238, 239, 240, 241, 242, 0, 243, + 0, 1065, 1066, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 268, 269, + 270, 271, 272, 273, 274, 1067, 1068, 0, 1069, 0, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 290, 291, 292, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 1069, 321, 1070, 323, 324, - 325, 326, 1071, 327, 328, 329, 330, 1072, 790, 332, - 1073, 334, 335, 336, 0, 337, 338, 0, 0, 1074, - 340, 341, 0, 0, 342, 343, 344, 345, 346, 347, - 792, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 27, 28, 29, 0, 360, 361, 793, 363, - 364, 365, 366, 367, 368, 369, 0, 370, 371, 372, - 373, 374, 375, 0, 376, 377, 378, 1075, 380, 381, - 382, 383, 0, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 0, 397, 398, 399, - 400, 401, 402, 1076, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 34, 0, 417, - 418, 419, 420, 421, 422, 423, 424, 425, 36, 426, - 427, 428, 1077, 430, 0, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, 444, 795, - 38, 0, 446, 447, 39, 448, 449, 450, 451, 452, - 453, 454, 0, 455, 1078, 1079, 0, 0, 458, 459, - 796, 461, 797, 1080, 463, 464, 798, 466, 467, 468, - 469, 470, 0, 0, 471, 472, 473, 41, 474, 475, - 476, 477, 0, 478, 479, 480, 481, 482, 799, 1081, - 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 0, 0, 494, 0, 45, 495, 496, 497, 498, 499, + 315, 316, 317, 318, 319, 320, 321, 1071, 323, 1072, + 325, 326, 327, 328, 1073, 329, 330, 331, 332, 1074, + 794, 334, 1075, 336, 337, 338, 0, 339, 340, 0, + 0, 1076, 342, 343, 0, 0, 344, 345, 346, 347, + 348, 349, 796, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 26, 27, 28, 0, 362, 363, + 797, 365, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 1077, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 403, 404, 405, 406, 1078, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 33, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 430, 431, 432, 1079, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 799, 0, 0, 450, 451, 38, 452, + 453, 454, 455, 456, 457, 458, 0, 459, 1080, 1081, + 0, 0, 462, 463, 800, 465, 801, 1082, 467, 468, + 802, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 40, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 803, 1083, 0, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 44, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 1082, 0, 46, 0, - 0, 0, 0, 1083, 1084, 1085, 0, 0, 0, 0, - 1086, 0, 1087, 3206, 0, 0, 0, 1088, 1089, 0, - 1090, 1091, 116, 1042, 815, 1043, 1044, 1045, 1046, 1047, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 117, 118, 119, 120, 121, 122, 123, 124, 0, - 125, 126, 127, 0, 0, 0, 0, 0, 1048, 0, - 0, 128, 129, 130, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 1049, 140, 1050, 1051, 0, 143, 144, - 145, 146, 147, 148, 1052, 785, 149, 150, 151, 152, - 1053, 1054, 155, 0, 156, 157, 158, 159, 786, 0, - 787, 0, 1055, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 0, 172, 173, 174, 175, 176, 177, 0, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 1056, 190, 191, 1057, 193, 1058, 194, 0, 195, - 196, 197, 198, 199, 200, 14, 15, 201, 202, 203, - 204, 0, 0, 205, 206, 1059, 208, 209, 0, 210, - 211, 212, 0, 213, 214, 215, 0, 216, 217, 218, - 219, 1060, 221, 222, 223, 224, 225, 788, 1061, 227, - 0, 228, 229, 1062, 231, 0, 232, 0, 233, 234, - 23, 235, 236, 237, 238, 239, 240, 0, 241, 0, - 1063, 1064, 244, 245, 0, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 0, 258, 259, - 260, 261, 262, 263, 264, 0, 265, 266, 267, 268, - 269, 270, 271, 272, 1065, 1066, 0, 1067, 0, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 0, 0, 287, 288, 289, 290, 0, 291, 292, 293, - 294, 295, 296, 297, 298, 1068, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 1069, 321, 1070, 323, - 324, 325, 326, 1071, 327, 328, 329, 330, 1072, 790, - 332, 1073, 334, 335, 336, 0, 337, 338, 0, 0, - 1074, 340, 341, 0, 0, 342, 343, 344, 345, 346, - 347, 792, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 27, 28, 29, 0, 360, 361, 793, - 363, 364, 365, 366, 367, 368, 369, 0, 370, 371, - 372, 373, 374, 375, 0, 376, 377, 378, 1075, 380, - 381, 382, 383, 0, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 0, 397, 398, - 399, 400, 401, 402, 1076, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 34, 0, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 36, - 426, 427, 428, 1077, 430, 0, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 795, 38, 0, 446, 447, 39, 448, 449, 450, 451, - 452, 453, 454, 0, 455, 1078, 1079, 0, 0, 458, - 459, 796, 461, 797, 1080, 463, 464, 798, 466, 467, - 468, 469, 470, 0, 0, 471, 472, 473, 41, 474, - 475, 476, 477, 0, 478, 479, 480, 481, 482, 799, - 1081, 0, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 0, 0, 494, 0, 45, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, - 509, 510, 511, 512, 513, 514, 515, 1082, 0, 46, - 0, 0, 0, 0, 1083, 1084, 1085, 0, 0, 0, - 0, 1086, 0, 1087, 0, 0, 0, 0, 1088, 1089, - 0, 1090, 1091, 116, 1042, 815, 1043, 1044, 1045, 1046, - 1047, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, - 0, 125, 126, 127, 0, 0, 0, 0, 0, 1048, - 0, 0, 128, 129, 130, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 1049, 140, 1050, 1051, 0, 143, - 144, 145, 146, 147, 148, 1052, 785, 149, 150, 151, - 152, 1053, 1054, 155, 0, 156, 157, 158, 159, 786, - 0, 787, 0, 1055, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 0, 172, 173, 174, 175, 176, 177, - 0, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 1056, 190, 191, 1057, 193, 1058, 194, 0, - 195, 196, 197, 198, 199, 200, 0, 0, 201, 202, - 203, 204, 0, 0, 205, 206, 1059, 208, 209, 0, - 210, 211, 212, 0, 213, 214, 215, 0, 216, 217, - 218, 219, 1060, 221, 222, 223, 224, 225, 788, 1061, - 227, 0, 228, 229, 1062, 231, 0, 232, 0, 233, - 234, 23, 235, 236, 237, 238, 239, 240, 0, 241, - 0, 1063, 1064, 244, 245, 0, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 0, 258, - 259, 260, 261, 262, 263, 264, 0, 265, 266, 267, - 268, 269, 270, 271, 272, 1065, 1066, 0, 1067, 0, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 0, 0, 287, 288, 289, 290, 0, 291, 292, - 293, 294, 295, 296, 297, 298, 1068, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 1069, 321, 1070, - 323, 324, 325, 326, 1071, 327, 328, 329, 330, 1072, - 790, 332, 1073, 334, 335, 336, 0, 337, 338, 0, - 0, 1074, 340, 341, 0, 0, 342, 343, 344, 345, - 346, 347, 792, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 27, 28, 29, 0, 360, 361, - 793, 363, 364, 365, 366, 367, 368, 369, 0, 370, - 371, 372, 373, 374, 375, 0, 376, 377, 378, 1075, - 380, 381, 382, 383, 0, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 0, 397, - 398, 399, 400, 401, 402, 1076, 404, 405, 406, 407, - 408, 409, 410, 411, 412, 413, 414, 415, 416, 34, - 0, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 0, 426, 427, 428, 1077, 430, 0, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - 444, 795, 0, 0, 446, 447, 39, 448, 449, 450, - 451, 452, 453, 454, 0, 455, 1078, 1079, 0, 0, - 458, 459, 796, 461, 797, 1080, 463, 464, 798, 466, - 467, 468, 469, 470, 0, 0, 471, 472, 473, 41, - 474, 475, 476, 477, 0, 478, 479, 480, 481, 482, - 799, 1081, 0, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 0, 0, 494, 0, 45, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, - 508, 509, 510, 511, 512, 513, 514, 515, 1082, 0, - 46, 0, 0, 0, 0, 1083, 1084, 1085, 0, 0, - 0, 0, 1086, 0, 1087, 0, 0, 0, 0, 1088, - 1089, 0, 1090, 1091, 1242, 1042, 815, 1043, 1044, 1045, - 1046, 1047, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 1243, 125, 126, 127, 0, 0, 0, 1244, 0, - 1048, 0, 0, 1245, 129, 130, 0, 131, 132, 133, - 1246, 135, 136, 137, 138, 1049, 1247, 1050, 1051, 0, - 143, 144, 145, 146, 147, 148, 1052, 785, 149, 150, - 151, 152, 1053, 1054, 155, 0, 156, 157, 158, 159, - 786, 0, 1248, 0, 1249, 163, 164, 165, 166, 167, - 1250, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 1251, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 1056, 190, 191, 1057, 193, 1058, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 1252, 0, 205, 206, 1059, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 1060, 221, 222, 223, 224, 225, 788, - 1061, 227, 0, 228, 229, 1062, 231, 0, 232, 0, - 233, 1253, 0, 1254, 236, 237, 1255, 1256, 240, 0, - 241, 0, 1063, 1064, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 1257, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 1258, - 267, 268, 269, 270, 271, 272, 1065, 1066, 0, 1067, - 0, 276, 1259, 1260, 279, 1261, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 1262, 289, 1263, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 1264, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 1069, 1265, - 1070, 323, 324, 325, 326, 1071, 327, 328, 1266, 330, - 1072, 790, 332, 1073, 334, 335, 336, 0, 337, 338, - 0, 0, 1074, 340, 341, 0, 0, 342, 343, 344, - 1267, 346, 1268, 792, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 793, 1269, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 1075, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 1270, 400, 401, 402, 1076, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 1271, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 1272, 427, 428, 1077, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 1273, 444, 795, 0, 0, 446, 447, 0, 448, 1274, - 450, 451, 452, 453, 454, 0, 455, 1078, 1079, 0, - 0, 458, 459, 796, 461, 797, 1080, 463, 464, 1275, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 1081, 1276, 485, 1277, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 1082, - 0, 0, 0, 0, 0, 0, 1083, 1084, 1085, 0, - 0, 0, 0, 1086, 0, 1087, 1278, 0, 0, 0, - 1088, 1089, 0, 1090, 1091, 116, 1042, 815, 1043, 1044, - 0, 1046, 1047, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, - 123, 124, 0, 125, 126, 127, 0, 0, 0, 0, - 0, 1048, 0, 0, 128, 129, 130, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 1049, 140, 1050, 1051, - 0, 143, 144, 145, 146, 147, 148, 1052, 785, 149, - 150, 151, 152, 1053, 1054, 155, 0, 156, 157, 158, - 159, 786, 0, 787, 0, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 0, 172, 173, 174, 175, - 176, 177, 0, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 1056, 190, 191, 1057, 193, 0, - 194, 0, 195, 196, 197, 198, 199, 200, 14, 15, - 201, 202, 203, 204, 0, 0, 205, 206, 1059, 208, - 209, 0, 210, 211, 212, 0, 213, 214, 215, 0, - 216, 217, 218, 219, 1060, 221, 222, 223, 224, 225, - 788, 1061, 227, 0, 228, 229, 1062, 231, 0, 232, - 0, 233, 234, 23, 235, 236, 237, 238, 239, 240, - 0, 241, 0, 1063, 1064, 244, 245, 0, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 0, 258, 259, 260, 261, 262, 263, 264, 0, 265, - 266, 267, 268, 269, 270, 271, 272, 1065, 1066, 0, - 1067, 0, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 0, 0, 287, 288, 289, 290, 0, - 291, 292, 293, 294, 295, 296, 297, 298, 1068, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 1069, - 321, 1070, 323, 324, 325, 326, 0, 327, 328, 329, - 330, 1072, 790, 332, 1073, 334, 335, 336, 0, 337, - 338, 0, 0, 339, 340, 341, 0, 0, 342, 343, - 344, 345, 346, 347, 792, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 27, 28, 29, 0, - 360, 361, 793, 363, 364, 365, 366, 367, 368, 369, - 0, 370, 371, 372, 373, 374, 375, 0, 376, 377, - 378, 1075, 380, 381, 382, 383, 0, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 0, 397, 398, 399, 400, 401, 402, 1076, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 34, 0, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 36, 426, 427, 428, 1077, 430, 0, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, 444, 795, 38, 0, 446, 447, 39, 448, - 449, 450, 451, 452, 453, 454, 0, 455, 1078, 1079, - 0, 0, 458, 459, 796, 461, 797, 1080, 463, 464, - 798, 466, 467, 468, 469, 470, 0, 0, 471, 472, - 473, 41, 474, 475, 476, 477, 0, 478, 479, 480, - 481, 482, 799, 1081, 0, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 0, 0, 494, 0, 45, 495, - 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 1084, 0, 45, 0, 0, 0, 0, 1085, 1086, 1087, + 0, 0, 0, 0, 1088, 0, 1089, 0, 0, 0, + 0, 1090, 1091, 0, 1092, 1093, 1246, 1044, 819, 1045, + 1046, 1047, 1048, 1049, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 1247, 126, 127, 128, 0, 0, 0, + 1248, 0, 1050, 0, 0, 1249, 130, 131, 0, 132, + 133, 134, 1250, 136, 137, 138, 139, 1051, 1251, 1052, + 1053, 0, 144, 145, 146, 147, 148, 149, 1054, 789, + 150, 151, 152, 153, 1055, 1056, 156, 0, 157, 158, + 159, 160, 790, 0, 1252, 0, 1253, 164, 165, 166, + 167, 168, 1254, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 1255, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 1058, 191, 192, 1059, 194, + 1060, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 1256, 0, 206, 207, 1061, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 1062, 222, 223, 224, 225, + 226, 227, 792, 1063, 229, 0, 230, 231, 1064, 233, + 0, 234, 0, 235, 1257, 0, 1258, 238, 239, 1259, + 1260, 242, 0, 243, 0, 1065, 1066, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 1261, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 1262, 269, 270, 271, 272, 273, 274, 1067, + 1068, 0, 1069, 0, 278, 1263, 1264, 281, 1265, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 1266, 291, + 1267, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 1268, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 1071, 1269, 1072, 325, 326, 327, 328, 1073, 329, + 330, 1270, 332, 1074, 794, 334, 1075, 336, 337, 338, + 0, 339, 340, 0, 0, 1076, 342, 343, 0, 0, + 344, 345, 346, 1271, 348, 1272, 796, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 797, 1273, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 1077, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 1274, 404, 405, + 406, 1078, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 1275, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 1276, 431, 432, + 1079, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 1277, 448, 799, 0, 0, + 450, 451, 0, 452, 1278, 454, 455, 456, 457, 458, + 0, 459, 1080, 1081, 0, 0, 462, 463, 800, 465, + 801, 1082, 467, 468, 1279, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 1083, 1280, 489, + 1281, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, - 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1086, 0, 1087, 0, 0, 0, - 0, 1088, 1089, 0, 1090, 1091, 116, 1042, 815, 1043, - 1044, 1045, 1046, 1047, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 117, 118, 119, 120, 121, - 122, 123, 124, 0, 125, 126, 127, 0, 0, 0, - 0, 0, 1048, 0, 0, 128, 129, 130, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 1049, 140, 1050, - 1051, 1423, 143, 144, 145, 146, 147, 148, 1052, 785, - 149, 150, 151, 152, 1053, 1054, 155, 0, 156, 157, - 158, 159, 786, 0, 787, 0, 1055, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 0, 172, 173, 174, - 175, 176, 177, 0, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 1056, 190, 191, 1057, 193, - 1058, 194, 0, 195, 196, 197, 198, 199, 200, 0, - 0, 201, 202, 203, 204, 0, 0, 205, 206, 1059, - 208, 209, 0, 210, 211, 212, 0, 213, 214, 215, - 0, 216, 217, 218, 219, 1060, 221, 222, 223, 224, - 225, 788, 1061, 227, 0, 228, 229, 1062, 231, 0, - 232, 0, 233, 234, 1424, 235, 236, 237, 238, 239, - 240, 0, 241, 0, 1063, 1064, 244, 245, 0, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 0, 258, 259, 260, 261, 262, 263, 264, 0, - 265, 266, 267, 268, 269, 270, 271, 272, 1065, 1066, - 0, 1067, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 0, 1425, 287, 288, 289, 290, - 0, 291, 292, 293, 294, 295, 296, 297, 298, 1068, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 1069, 321, 1070, 323, 324, 325, 326, 1071, 327, 328, - 329, 330, 1072, 790, 332, 1073, 334, 335, 336, 0, - 337, 338, 0, 0, 1074, 340, 341, 0, 0, 342, - 343, 344, 345, 346, 347, 792, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 0, 0, 0, - 0, 360, 361, 793, 363, 364, 365, 366, 367, 368, - 369, 0, 370, 371, 372, 373, 374, 375, 0, 376, - 377, 378, 1075, 380, 381, 382, 383, 0, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 0, 397, 398, 399, 400, 401, 402, 1076, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 0, 0, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 0, 426, 427, 428, 1077, 430, 0, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 795, 0, 0, 446, 447, 0, - 448, 449, 450, 451, 452, 453, 454, 0, 455, 1078, - 1079, 0, 1426, 458, 459, 796, 461, 797, 1080, 463, - 464, 798, 466, 467, 468, 469, 470, 0, 0, 471, - 472, 473, 0, 474, 475, 476, 477, 0, 478, 479, - 480, 481, 482, 483, 1081, 0, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 0, 0, 494, 0, 0, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, - 515, 1082, 0, 0, 0, 0, 0, 0, 1083, 1084, - 1085, 0, 0, 0, 0, 1086, 0, 1087, 0, 0, - 0, 0, 1088, 1089, 0, 1090, 1091, 1242, 1042, 815, - 1043, 1044, 1045, 1046, 1047, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 117, 118, 119, 120, - 121, 122, 123, 124, 0, 125, 126, 127, 0, 0, - 0, 1244, 0, 1048, 0, 0, 1245, 129, 130, 0, - 131, 132, 133, 1246, 135, 136, 137, 138, 1049, 1247, - 1050, 1051, 0, 143, 144, 145, 146, 147, 148, 1052, - 785, 149, 150, 151, 152, 1053, 1054, 155, 0, 156, - 157, 158, 159, 786, 0, 1248, 0, 1249, 163, 164, - 165, 166, 167, 1250, 169, 170, 171, 0, 172, 173, - 174, 175, 176, 177, 0, 1251, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 1056, 190, 191, 1057, - 193, 1058, 194, 0, 195, 196, 197, 198, 199, 200, - 0, 0, 201, 202, 203, 204, 0, 0, 205, 206, - 1059, 208, 209, 0, 210, 211, 212, 0, 213, 214, - 215, 0, 216, 217, 218, 219, 1060, 221, 222, 223, - 224, 225, 788, 1061, 227, 0, 228, 229, 1062, 231, - 0, 232, 0, 233, 1253, 0, 1254, 236, 237, 1255, - 1256, 240, 0, 241, 0, 1063, 1064, 244, 245, 0, - 246, 247, 248, 249, 250, 251, 252, 1257, 254, 255, - 256, 257, 0, 258, 259, 260, 261, 262, 263, 264, - 0, 265, 1258, 267, 268, 269, 270, 271, 272, 1065, - 1066, 0, 1067, 0, 276, 1259, 1260, 279, 1261, 281, - 282, 283, 284, 285, 286, 0, 0, 287, 1262, 289, - 1263, 0, 291, 292, 293, 294, 295, 296, 297, 298, - 1264, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 516, 517, 518, 519, 1084, 0, 0, 0, 0, 0, + 0, 1085, 1086, 1087, 0, 0, 0, 0, 1088, 0, + 1089, 1282, 0, 0, 0, 1090, 1091, 0, 1092, 1093, + 117, 1044, 819, 1045, 1046, 0, 1048, 1049, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 1050, 0, 0, 129, + 130, 131, 0, 132, 133, 134, 135, 136, 137, 138, + 139, 1051, 141, 1052, 1053, 0, 144, 145, 146, 147, + 148, 149, 1054, 789, 150, 151, 152, 153, 1055, 1056, + 156, 0, 157, 158, 159, 160, 790, 0, 791, 0, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 1058, + 191, 192, 1059, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 14, 15, 202, 203, 204, 205, 0, + 0, 206, 207, 1061, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 1062, + 222, 223, 224, 225, 226, 227, 792, 1063, 229, 0, + 230, 231, 1064, 233, 0, 234, 0, 235, 236, 23, + 237, 238, 239, 240, 241, 242, 0, 243, 0, 1065, + 1066, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 1067, 1068, 0, 1069, 0, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 1071, 323, 1072, 325, 326, + 327, 328, 0, 329, 330, 331, 332, 1074, 794, 334, + 1075, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 346, 347, 348, 349, + 796, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 26, 27, 28, 0, 362, 363, 797, 365, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 1077, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 403, 404, 405, 406, 1078, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 33, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 35, 430, 431, 432, 1079, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 799, 37, 0, 450, 451, 38, 452, 453, 454, + 455, 456, 457, 458, 0, 459, 1080, 1081, 0, 0, + 462, 463, 800, 465, 801, 1082, 467, 468, 802, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 40, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 803, 1083, 0, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 44, 499, 500, 501, + 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, + 512, 513, 514, 515, 516, 517, 518, 519, 0, 0, + 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1088, 0, 1089, 0, 0, 0, 0, 1090, + 1091, 0, 1092, 1093, 117, 1044, 819, 1045, 1046, 1047, + 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 1050, 0, 0, 129, 130, 131, 0, 132, 133, 134, + 135, 136, 137, 138, 139, 1051, 141, 1052, 1053, 1429, + 144, 145, 146, 147, 148, 149, 1054, 789, 150, 151, + 152, 153, 1055, 1056, 156, 0, 157, 158, 159, 160, + 790, 0, 791, 0, 1057, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 1058, 191, 192, 1059, 194, 1060, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 1061, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 1062, 222, 223, 224, 225, 226, 227, + 792, 1063, 229, 0, 230, 231, 1064, 233, 0, 234, + 0, 235, 236, 1430, 237, 238, 239, 240, 241, 242, + 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 1067, 1068, 0, + 1069, 0, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 0, 1431, 289, 290, 291, 292, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 1070, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 1071, + 323, 1072, 325, 326, 327, 328, 1073, 329, 330, 331, + 332, 1074, 794, 334, 1075, 336, 337, 338, 0, 339, + 340, 0, 0, 1076, 342, 343, 0, 0, 344, 345, + 346, 347, 348, 349, 796, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 797, 365, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 1077, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 403, 404, 405, 406, 1078, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 430, 431, 432, 1079, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 799, 0, 0, 450, 451, + 0, 452, 453, 454, 455, 456, 457, 458, 0, 459, + 1080, 1081, 0, 1432, 462, 463, 800, 465, 801, 1082, + 467, 468, 802, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 1083, 0, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 1084, 0, 0, 0, 0, 0, 0, 1085, + 1086, 1087, 0, 0, 0, 0, 1088, 0, 1089, 0, + 0, 0, 0, 1090, 1091, 0, 1092, 1093, 1246, 1044, + 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 1248, 0, 1050, 0, 0, 1249, 130, 131, + 0, 132, 133, 134, 1250, 136, 137, 138, 139, 1051, + 1251, 1052, 1053, 0, 144, 145, 146, 147, 148, 149, + 1054, 789, 150, 151, 152, 153, 1055, 1056, 156, 0, + 157, 158, 159, 160, 790, 0, 1252, 0, 1253, 164, + 165, 166, 167, 168, 1254, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 1255, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 1058, 191, 192, + 1059, 194, 1060, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 1061, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 1062, 222, 223, + 224, 225, 226, 227, 792, 1063, 229, 0, 230, 231, + 1064, 233, 0, 234, 0, 235, 1257, 0, 1258, 238, + 239, 1259, 1260, 242, 0, 243, 0, 1065, 1066, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 1261, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 1262, 269, 270, 271, 272, 273, + 274, 1067, 1068, 0, 1069, 0, 278, 1263, 1264, 281, + 1265, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 1266, 291, 1267, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 1268, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 1069, 1265, 1070, 323, 324, 325, 326, 1071, 327, - 328, 1266, 330, 1072, 790, 332, 1073, 334, 335, 336, - 0, 337, 338, 0, 0, 1074, 340, 341, 0, 0, - 342, 343, 344, 1267, 346, 1268, 792, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 0, 0, - 0, 0, 360, 361, 793, 1269, 364, 365, 366, 367, - 368, 369, 0, 370, 371, 372, 373, 374, 375, 0, - 376, 377, 378, 1075, 380, 381, 382, 383, 0, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 0, 397, 398, 1270, 400, 401, 402, 1076, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 0, 1271, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 0, 1272, 427, 428, 1077, 430, - 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 1273, 444, 795, 0, 0, 446, 447, - 0, 448, 1274, 450, 451, 452, 453, 454, 0, 455, - 1078, 1079, 0, 0, 458, 459, 796, 461, 797, 1080, - 463, 464, 1275, 466, 467, 468, 469, 470, 0, 0, - 471, 472, 473, 0, 474, 475, 476, 477, 0, 478, - 479, 480, 481, 482, 483, 1081, 2278, 485, 1277, 487, - 488, 489, 490, 491, 492, 493, 0, 0, 494, 0, - 0, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 319, 320, 321, 1071, 1269, 1072, 325, 326, 327, 328, + 1073, 329, 330, 1270, 332, 1074, 794, 334, 1075, 336, + 337, 338, 0, 339, 340, 0, 0, 1076, 342, 343, + 0, 0, 344, 345, 346, 1271, 348, 1272, 796, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 797, 1273, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 1077, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 1274, + 404, 405, 406, 1078, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 1275, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 1276, + 431, 432, 1079, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 1277, 448, 799, + 0, 0, 450, 451, 0, 452, 1278, 454, 455, 456, + 457, 458, 0, 459, 1080, 1081, 0, 0, 462, 463, + 800, 465, 801, 1082, 467, 468, 1279, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 1083, + 2286, 489, 1281, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, - 514, 515, 1082, 0, 0, 0, 0, 0, 0, 1083, - 1084, 1085, 0, 0, 0, 0, 1086, 0, 1087, 0, - 0, 0, 0, 1088, 1089, 0, 1090, 1091, 1242, 1042, - 815, 1043, 1044, 1045, 1046, 1047, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 117, 118, 119, - 120, 121, 122, 123, 124, 0, 125, 126, 127, 0, - 0, 0, 1244, 0, 1048, 0, 0, 1245, 129, 130, - 0, 131, 132, 133, 1246, 135, 136, 137, 138, 1049, - 1247, 1050, 1051, 0, 143, 144, 145, 146, 147, 148, - 1052, 785, 149, 150, 151, 152, 1053, 1054, 155, 0, - 156, 157, 158, 159, 786, 0, 1248, 0, 1249, 163, - 164, 165, 166, 167, 1250, 169, 170, 171, 0, 172, - 173, 174, 175, 176, 177, 0, 1251, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 1056, 190, 191, - 1057, 193, 1058, 194, 0, 195, 196, 197, 198, 199, - 200, 0, 0, 201, 202, 203, 204, 0, 0, 205, - 206, 1059, 208, 209, 0, 210, 211, 212, 0, 213, - 214, 215, 0, 216, 217, 218, 219, 1060, 221, 222, - 223, 224, 225, 788, 1061, 227, 0, 228, 229, 1062, - 231, 0, 232, 0, 233, 1253, 0, 1254, 236, 237, - 1255, 1256, 240, 0, 241, 0, 1063, 1064, 244, 245, - 0, 246, 247, 248, 249, 250, 251, 252, 1257, 254, - 255, 256, 257, 0, 258, 259, 260, 261, 262, 263, - 264, 0, 265, 1258, 267, 268, 269, 270, 271, 272, - 1065, 1066, 0, 1067, 0, 276, 1259, 1260, 279, 1261, - 281, 282, 283, 284, 285, 286, 0, 0, 287, 1262, - 289, 1263, 0, 291, 292, 293, 294, 295, 296, 297, - 298, 1264, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 1069, 1265, 1070, 323, 324, 325, 326, 1071, - 327, 328, 1266, 330, 1072, 790, 332, 1073, 334, 335, - 336, 0, 337, 338, 0, 0, 1074, 340, 341, 0, - 0, 342, 343, 344, 1267, 346, 1268, 792, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 0, - 0, 0, 0, 360, 361, 793, 1269, 364, 365, 366, - 367, 368, 369, 0, 370, 371, 372, 373, 374, 375, - 0, 376, 377, 378, 1075, 380, 381, 382, 383, 0, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 0, 397, 398, 1270, 400, 401, 402, - 1076, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 0, 1271, 417, 418, 419, 420, - 421, 422, 423, 424, 425, 0, 1272, 427, 428, 1077, - 430, 0, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 1273, 444, 795, 0, 0, 446, - 447, 0, 448, 1274, 450, 451, 452, 453, 454, 0, - 455, 1078, 1079, 0, 0, 458, 459, 796, 461, 797, - 1080, 463, 464, 1275, 466, 467, 468, 469, 470, 0, - 0, 471, 472, 473, 0, 474, 475, 476, 477, 0, - 478, 479, 480, 481, 482, 483, 1081, 0, 485, 1277, - 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, - 0, 0, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 1082, 0, 0, 0, 0, 0, 0, - 1083, 1084, 1085, 0, 0, 0, 0, 1086, 0, 1087, - 2335, 0, 0, 0, 1088, 1089, 0, 1090, 1091, 116, - 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, -1111, 125, 126, 127, - 0, 0, 0, 0, -1111, 1048, 0, 0, 128, 129, - 130, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 1049, 140, 1050, 1051, 0, 143, 144, 145, 146, 147, - 148, 1052, 785, 149, 150, 151, 152, 1053, 1054, 155, - 0, 156, 157, 158, 159, 786, 0, 787, 0, 1055, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 1056, 190, - 191, 1057, 193, 1058, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 1059, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 1060, 221, - 222, 223, 224, 225, 788, 1061, 227, 0, 228, 229, - 1062, 231, 0, 232, 0, 233, 234, 0, 235, 236, - 237, 238, 239, 240, 0, 241, 0, 1063, 1064, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 266, 267, 268, 269, 270, 271, - 272, 1065, 1066, 0, 1067, 0, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 288, 289, 290, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 1068, 300, 301, 302, 303, 304, 305, 306, + 514, 515, 516, 517, 518, 519, 1084, 0, 0, 0, + 0, 0, 0, 1085, 1086, 1087, 0, 0, 0, 0, + 1088, 0, 1089, 0, 0, 0, 0, 1090, 1091, 0, + 1092, 1093, 1246, 1044, 819, 1045, 1046, 1047, 1048, 1049, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 1248, 0, 1050, 0, + 0, 1249, 130, 131, 0, 132, 133, 134, 1250, 136, + 137, 138, 139, 1051, 1251, 1052, 1053, 0, 144, 145, + 146, 147, 148, 149, 1054, 789, 150, 151, 152, 153, + 1055, 1056, 156, 0, 157, 158, 159, 160, 790, 0, + 1252, 0, 1253, 164, 165, 166, 167, 168, 1254, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 1255, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 1058, 191, 192, 1059, 194, 1060, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 1061, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 1062, 222, 223, 224, 225, 226, 227, 792, 1063, + 229, 0, 230, 231, 1064, 233, 0, 234, 0, 235, + 1257, 0, 1258, 238, 239, 1259, 1260, 242, 0, 243, + 0, 1065, 1066, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 1261, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 1262, 269, + 270, 271, 272, 273, 274, 1067, 1068, 0, 1069, 0, + 278, 1263, 1264, 281, 1265, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 1266, 291, 1267, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 1268, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 1071, 1269, 1072, + 325, 326, 327, 328, 1073, 329, 330, 1270, 332, 1074, + 794, 334, 1075, 336, 337, 338, 0, 339, 340, 0, + 0, 1076, 342, 343, 0, 0, 344, 345, 346, 1271, + 348, 1272, 796, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 797, 1273, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 1077, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 1274, 404, 405, 406, 1078, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 1275, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 1276, 431, 432, 1079, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 1277, 448, 799, 0, 0, 450, 451, 0, 452, + 1278, 454, 455, 456, 457, 458, 0, 459, 1080, 1081, + 0, 0, 462, 463, 800, 465, 801, 1082, 467, 468, + 1279, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 1083, 0, 489, 1281, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 1084, 0, 0, 0, 0, 0, 0, 1085, 1086, 1087, + 0, 0, 0, 0, 1088, 0, 1089, 2340, 0, 0, + 0, 1090, 1091, 0, 1092, 1093, 117, 1044, 819, 1045, + 1046, 1047, 1048, 1049, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, -1116, 126, 127, 128, 0, 0, 0, + 0, -1116, 1050, 0, 0, 129, 130, 131, 0, 132, + 133, 134, 135, 136, 137, 138, 139, 1051, 141, 1052, + 1053, 0, 144, 145, 146, 147, 148, 149, 1054, 789, + 150, 151, 152, 153, 1055, 1056, 156, 0, 157, 158, + 159, 160, 790, 0, 791, 0, 1057, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 1058, 191, 192, 1059, 194, + 1060, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 1061, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 1062, 222, 223, 224, 225, + 226, 227, 792, 1063, 229, 0, 230, 231, 1064, 233, + 0, 234, 0, 235, 236, 0, 237, 238, 239, 240, + 241, 242, 0, 243, 0, 1065, 1066, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 1067, + 1068, 0, 1069, 0, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 290, 291, + 292, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 1071, 323, 1072, 325, 326, 327, 328, 1073, 329, + 330, 331, 332, 1074, 794, 334, 1075, 336, 337, 338, + 0, 339, 340, 0, 0, 1076, 342, 343, 0, 0, + 344, 345, 346, 347, 348, 349, 796, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 797, 365, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 1077, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, + 406, 1078, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 430, 431, 432, + 1079, 434, -1116, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 799, 0, 0, + 450, 451, 0, 452, 453, 454, 455, 456, 457, 458, + 0, 459, 1080, 1081, 0, 0, 462, 463, 800, 465, + 801, 1082, 467, 468, 802, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 1083, 0, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 1084, 0, 0, 0, 0, 0, + 0, 1085, 1086, 1087, 0, 0, 0, 0, 1088, 0, + 1089, 0, 0, 0, 0, 1090, 1091, 0, 1092, 1093, + 1246, 1044, 819, 1045, 1046, 1047, 1048, 1049, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 1248, 0, 1050, 0, 0, 1249, + 130, 131, 0, 132, 133, 134, 1250, 136, 137, 138, + 139, 1051, 1251, 1052, 1053, 0, 144, 145, 146, 147, + 148, 149, 1054, 789, 150, 151, 152, 153, 1055, 1056, + 156, 0, 157, 158, 159, 160, 790, 0, 1252, 0, + 1253, 164, 165, 166, 167, 168, 1254, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 1255, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 1058, + 191, 192, 1059, 194, 1060, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 1061, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 1062, + 222, 223, 224, 225, 226, 227, 792, 1063, 229, 0, + 230, 231, 1064, 233, 0, 234, 0, 235, 1257, 0, + 1258, 238, 239, 1259, 1260, 242, 0, 243, 0, 1065, + 1066, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 1261, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 1262, 269, 270, 271, + 272, 273, 274, 1067, 1068, 0, 1069, 0, 278, 1263, + 1264, 281, 1265, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 1266, 291, 1267, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 1268, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 1069, 321, 1070, 323, 324, 325, 326, - 1071, 327, 328, 329, 330, 1072, 790, 332, 1073, 334, - 335, 336, 0, 337, 338, 0, 0, 1074, 340, 341, - 0, 0, 342, 343, 344, 345, 346, 347, 792, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 793, 363, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 1075, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 399, 400, 401, - 402, 1076, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 426, 427, 428, - 1077, 430, -1111, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, 444, 795, 0, 0, - 446, 447, 0, 448, 449, 450, 451, 452, 453, 454, - 0, 455, 1078, 1079, 0, 0, 458, 459, 796, 461, - 797, 1080, 463, 464, 798, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 1081, 0, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, + 317, 318, 319, 320, 321, 1071, 1269, 1072, 325, 326, + 327, 328, 1073, 329, 330, 1270, 332, 1074, 794, 334, + 1075, 336, 337, 338, 0, 339, 340, 0, 0, 1076, + 342, 343, 0, 0, 344, 345, 346, 1271, 348, 1272, + 796, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 0, 0, 0, 0, 362, 363, 797, 1273, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 1077, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 1274, 404, 405, 406, 1078, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 1275, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 1276, 431, 432, 1079, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 1277, + 448, 799, 0, 0, 450, 451, 0, 452, 1278, 454, + 455, 456, 457, 458, 0, 459, 1080, 1081, 0, 0, + 462, 463, 800, 465, 801, 1082, 467, 468, 1279, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 1083, 0, 489, 1281, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 1082, 0, 0, 0, 0, 0, - 0, 1083, 1084, 1085, 0, 0, 0, 0, 1086, 0, - 1087, 0, 0, 0, 0, 1088, 1089, 0, 1090, 1091, - 1242, 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, - 118, 119, 120, 121, 122, 123, 124, 0, 125, 126, - 127, 0, 0, 0, 1244, 0, 1048, 0, 0, 1245, - 129, 130, 0, 131, 132, 133, 1246, 135, 136, 137, - 138, 1049, 1247, 1050, 1051, 0, 143, 144, 145, 146, - 147, 148, 1052, 785, 149, 150, 151, 152, 1053, 1054, - 155, 0, 156, 157, 158, 159, 786, 0, 1248, 0, - 1249, 163, 164, 165, 166, 167, 1250, 169, 170, 171, - 0, 172, 173, 174, 175, 176, 177, 0, 1251, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 1056, - 190, 191, 1057, 193, 1058, 194, 0, 195, 196, 197, - 198, 199, 200, 0, 0, 201, 202, 203, 204, 0, - 0, 205, 206, 1059, 208, 209, 0, 210, 211, 212, - 0, 213, 214, 215, 0, 216, 217, 218, 219, 1060, - 221, 222, 223, 224, 225, 788, 1061, 227, 0, 228, - 229, 1062, 231, 0, 232, 0, 233, 1253, 0, 1254, - 236, 237, 1255, 1256, 240, 0, 241, 0, 1063, 1064, - 244, 245, 0, 246, 247, 248, 249, 250, 251, 252, - 1257, 254, 255, 256, 257, 0, 258, 259, 260, 261, - 262, 263, 264, 0, 265, 1258, 267, 268, 269, 270, - 271, 272, 1065, 1066, 0, 1067, 0, 276, 1259, 1260, - 279, 1261, 281, 282, 283, 284, 285, 286, 0, 0, - 287, 1262, 289, 1263, 0, 291, 292, 293, 294, 295, - 296, 297, 298, 1264, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 1069, 1265, 1070, 323, 324, 325, - 326, 1071, 327, 328, 1266, 330, 1072, 790, 332, 1073, - 334, 335, 336, 0, 337, 338, 0, 0, 1074, 340, - 341, 0, 0, 342, 343, 344, 1267, 346, 1268, 792, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 0, 0, 0, 0, 360, 361, 793, 1269, 364, - 365, 366, 367, 368, 369, 0, 370, 371, 372, 373, - 374, 375, 0, 376, 377, 378, 1075, 380, 381, 382, - 383, 0, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 0, 397, 398, 1270, 400, - 401, 402, 1076, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 0, 1271, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 0, 1272, 427, - 428, 1077, 430, 0, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 1273, 444, 795, 0, - 0, 446, 447, 0, 448, 1274, 450, 451, 452, 453, - 454, 0, 455, 1078, 1079, 0, 0, 458, 459, 796, - 461, 797, 1080, 463, 464, 1275, 466, 467, 468, 469, - 470, 0, 0, 471, 472, 473, 0, 474, 475, 476, - 477, 0, 478, 479, 480, 481, 482, 483, 1081, 0, - 485, 1277, 487, 488, 489, 490, 491, 492, 493, 0, - 0, 494, 0, 0, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 1082, 0, 0, 0, 0, - 0, 0, 1083, 1084, 1085, 0, 0, 0, 0, 1086, - 0, 1087, 3071, 0, 0, 0, 1088, 1089, 0, 1090, - 1091, 1242, 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 1084, 0, + 0, 0, 0, 0, 0, 1085, 1086, 1087, 0, 0, + 0, 0, 1088, 0, 1089, 3080, 0, 0, 0, 1090, + 1091, 0, 1092, 1093, 1246, 1044, 819, 1045, 1046, 1047, + 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 1248, 0, + 1050, 0, 0, 1249, 130, 131, 0, 132, 133, 134, + 1250, 136, 137, 138, 139, 1051, 1251, 1052, 1053, 0, + 144, 145, 146, 147, 148, 149, 1054, 789, 150, 151, + 152, 153, 1055, 1056, 156, 0, 157, 158, 159, 160, + 790, 0, 1252, 0, 1253, 164, 165, 166, 167, 168, + 1254, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 1255, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 1058, 191, 192, 1059, 194, 1060, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 1061, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 1062, 222, 223, 224, 225, 226, 227, + 792, 1063, 229, 0, 230, 231, 1064, 233, 0, 234, + 0, 235, 1257, 0, 1258, 238, 239, 1259, 1260, 242, + 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 1261, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 1262, 269, 270, 271, 272, 273, 274, 1067, 1068, 0, + 1069, 0, 278, 1263, 1264, 281, 1265, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 1266, 291, 1267, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 1268, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 1071, + 1269, 1072, 325, 326, 327, 328, 1073, 329, 330, 1270, + 332, 1074, 794, 334, 1075, 336, 337, 338, 0, 339, + 340, 0, 0, 1076, 342, 343, 0, 0, 344, 345, + 346, 1271, 348, 1272, 796, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 797, 1273, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 1077, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 1274, 404, 405, 406, 1078, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 1275, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 1276, 431, 432, 1079, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 1277, 448, 799, 0, 0, 450, 451, + 0, 452, 1278, 454, 455, 456, 457, 458, 0, 459, + 1080, 1081, 0, 0, 462, 463, 800, 465, 801, 1082, + 467, 468, 1279, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 1083, 0, 489, 1281, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 1084, 0, 0, 0, 0, 0, 0, 1085, + 1086, 1087, 0, 0, 0, 0, 1088, 0, 1089, 0, + 0, 0, 0, 1090, 1091, 0, 1092, 1093, 117, 1044, + 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 1695, 126, 127, 128, 0, + 0, 0, 0, 0, 1050, 0, 0, 129, 130, 131, + 0, 132, 133, 134, 135, 136, 137, 138, 139, 1051, + 141, 1052, 1053, 0, 144, 145, 146, 147, 148, 149, + 1054, 789, 150, 151, 152, 153, 1055, 1056, 156, 0, + 157, 158, 159, 160, 790, 0, 791, 0, 1057, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 1058, 191, 192, + 1059, 194, 1060, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 1061, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 1062, 222, 223, + 224, 225, 226, 227, 792, 1063, 229, 0, 230, 231, + 1064, 233, 0, 234, 0, 235, 236, 0, 237, 238, + 239, 240, 241, 242, 0, 243, 0, 1065, 1066, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 268, 269, 270, 271, 272, 273, + 274, 1067, 1068, 0, 1069, 0, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 1071, 323, 1072, 325, 326, 327, 328, + 1073, 329, 330, 331, 332, 1074, 794, 334, 1075, 336, + 337, 338, 0, 339, 340, 0, 0, 1076, 342, 343, + 0, 0, 344, 345, 346, 347, 348, 349, 796, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 797, 365, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 1077, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, + 404, 405, 406, 1078, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 430, + 431, 432, 1079, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 799, + 0, 0, 450, 451, 0, 452, 453, 454, 455, 456, + 457, 458, 0, 459, 1080, 1081, 0, 0, 462, 463, + 800, 465, 801, 1082, 467, 468, 802, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 1083, + 0, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 1084, 0, 0, 0, + 0, 0, 0, 1085, 1086, 1087, 0, 0, 0, 0, + 1088, 0, 1089, 0, 0, 0, 0, 1090, 1091, 0, + 1092, 1093, 117, 1710, 819, 1045, 1046, 1047, 1711, 1049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 117, 118, 119, 120, 121, 122, 123, 124, 0, 125, - 126, 127, 0, 0, 0, 1244, 0, 1048, 0, 0, - 1245, 129, 130, 0, 131, 132, 133, 1246, 135, 136, - 137, 138, 1049, 1247, 1050, 1051, 0, 143, 144, 145, - 146, 147, 148, 1052, 785, 149, 150, 151, 152, 1053, - 1054, 155, 0, 156, 157, 158, 159, 786, 0, 1248, - 0, 1249, 163, 164, 165, 166, 167, 1250, 169, 170, - 171, 0, 172, 173, 174, 175, 176, 177, 0, 1251, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 1712, + 126, 127, 128, 0, 0, 0, 0, 0, 1050, 0, + 0, 129, 130, 131, 0, 132, 133, 134, 135, 136, + 137, 138, 139, 1051, 141, 1052, 1053, 0, 144, 145, + 146, 147, 148, 149, 1054, 789, 150, 151, 152, 153, + 1055, 1056, 156, 0, 157, 158, 159, 160, 790, 0, + 791, 0, 1057, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 1056, 190, 191, 1057, 193, 1058, 194, 0, 195, 196, - 197, 198, 199, 200, 0, 0, 201, 202, 203, 204, - 0, 0, 205, 206, 1059, 208, 209, 0, 210, 211, - 212, 0, 213, 214, 215, 0, 216, 217, 218, 219, - 1060, 221, 222, 223, 224, 225, 788, 1061, 227, 0, - 228, 229, 1062, 231, 0, 232, 0, 233, 1253, 0, - 1254, 236, 237, 1255, 1256, 240, 0, 241, 0, 1063, - 1064, 244, 245, 0, 246, 247, 248, 249, 250, 251, - 252, 1257, 254, 255, 256, 257, 0, 258, 259, 260, - 261, 262, 263, 264, 0, 265, 1258, 267, 268, 269, - 270, 271, 272, 1065, 1066, 0, 1067, 0, 276, 1259, - 1260, 279, 1261, 281, 282, 283, 284, 285, 286, 0, - 0, 287, 1262, 289, 1263, 0, 291, 292, 293, 294, - 295, 296, 297, 298, 1264, 300, 301, 302, 303, 304, + 189, 1058, 191, 192, 1059, 194, 1060, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 1061, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 1062, 222, 223, 224, 225, 226, 227, 792, 1063, + 229, 0, 230, 231, 1064, 233, 0, 234, 0, 235, + 236, 0, 237, 238, 239, 240, 241, 242, 0, 243, + 0, 1065, 1066, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 268, 269, + 270, 271, 272, 273, 274, 1067, 1068, 0, 1069, 0, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 290, 291, 292, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 1069, 1265, 1070, 323, 324, - 325, 326, 1071, 327, 328, 1266, 330, 1072, 790, 332, - 1073, 334, 335, 336, 0, 337, 338, 0, 0, 1074, - 340, 341, 0, 0, 342, 343, 344, 1267, 346, 1268, - 792, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 0, 0, 0, 0, 360, 361, 793, 1269, - 364, 365, 366, 367, 368, 369, 0, 370, 371, 372, - 373, 374, 375, 0, 376, 377, 378, 1075, 380, 381, - 382, 383, 0, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 0, 397, 398, 1270, - 400, 401, 402, 1076, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 0, 1271, 417, - 418, 419, 420, 421, 422, 423, 424, 425, 0, 1272, - 427, 428, 1077, 430, 0, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 1273, 444, 795, - 0, 0, 446, 447, 0, 448, 1274, 450, 451, 452, - 453, 454, 0, 455, 1078, 1079, 0, 0, 458, 459, - 796, 461, 797, 1080, 463, 464, 1275, 466, 467, 468, - 469, 470, 0, 0, 471, 472, 473, 0, 474, 475, - 476, 477, 0, 478, 479, 480, 481, 482, 483, 1081, - 0, 485, 1277, 487, 488, 489, 490, 491, 492, 493, - 0, 0, 494, 0, 0, 495, 496, 497, 498, 499, + 315, 316, 317, 318, 319, 320, 321, 1071, 323, 1072, + 325, 326, 327, 328, 1073, 329, 330, 331, 332, 1074, + 794, 334, 1075, 336, 337, 338, 0, 339, 340, 0, + 0, 1076, 342, 343, 0, 0, 344, 345, 346, 347, + 348, 349, 796, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 797, 365, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 1077, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 403, 404, 405, 406, 1078, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 430, 431, 432, 1079, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 799, 0, 0, 450, 451, 0, 452, + 453, 454, 455, 456, 457, 458, 0, 459, 1080, 1081, + 0, 0, 462, 463, 800, 465, 801, 1082, 467, 468, + 802, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 1083, 0, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 1082, 0, 0, 0, - 0, 0, 0, 1083, 1084, 1085, 0, 0, 0, 0, - 1086, 0, 1087, 0, 0, 0, 0, 1088, 1089, 0, - 1090, 1091, 116, 1042, 815, 1043, 1044, 1045, 1046, 1047, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 117, 118, 119, 120, 121, 122, 123, 124, 1689, - 125, 126, 127, 0, 0, 0, 0, 0, 1048, 0, - 0, 128, 129, 130, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 1049, 140, 1050, 1051, 0, 143, 144, - 145, 146, 147, 148, 1052, 785, 149, 150, 151, 152, - 1053, 1054, 155, 0, 156, 157, 158, 159, 786, 0, - 787, 0, 1055, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 0, 172, 173, 174, 175, 176, 177, 0, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 1056, 190, 191, 1057, 193, 1058, 194, 0, 195, - 196, 197, 198, 199, 200, 0, 0, 201, 202, 203, - 204, 0, 0, 205, 206, 1059, 208, 209, 0, 210, - 211, 212, 0, 213, 214, 215, 0, 216, 217, 218, - 219, 1060, 221, 222, 223, 224, 225, 788, 1061, 227, - 0, 228, 229, 1062, 231, 0, 232, 0, 233, 234, - 0, 235, 236, 237, 238, 239, 240, 0, 241, 0, - 1063, 1064, 244, 245, 0, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 0, 258, 259, - 260, 261, 262, 263, 264, 0, 265, 266, 267, 268, - 269, 270, 271, 272, 1065, 1066, 0, 1067, 0, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 0, 0, 287, 288, 289, 290, 0, 291, 292, 293, - 294, 295, 296, 297, 298, 1068, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 1069, 321, 1070, 323, - 324, 325, 326, 1071, 327, 328, 329, 330, 1072, 790, - 332, 1073, 334, 335, 336, 0, 337, 338, 0, 0, - 1074, 340, 341, 0, 0, 342, 343, 344, 345, 346, - 347, 792, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 0, 0, 0, 0, 360, 361, 793, - 363, 364, 365, 366, 367, 368, 369, 0, 370, 371, - 372, 373, 374, 375, 0, 376, 377, 378, 1075, 380, - 381, 382, 383, 0, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 0, 397, 398, - 399, 400, 401, 402, 1076, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 0, 0, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 0, - 426, 427, 428, 1077, 430, 0, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 795, 0, 0, 446, 447, 0, 448, 449, 450, 451, - 452, 453, 454, 0, 455, 1078, 1079, 0, 0, 458, - 459, 796, 461, 797, 1080, 463, 464, 798, 466, 467, - 468, 469, 470, 0, 0, 471, 472, 473, 0, 474, - 475, 476, 477, 0, 478, 479, 480, 481, 482, 483, - 1081, 0, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 0, 0, 494, 0, 0, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, - 509, 510, 511, 512, 513, 514, 515, 1082, 0, 0, - 0, 0, 0, 0, 1083, 1084, 1085, 0, 0, 0, - 0, 1086, 0, 1087, 0, 0, 0, 0, 1088, 1089, - 0, 1090, 1091, 116, 1704, 815, 1043, 1044, 1045, 1705, - 1047, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, - 1706, 125, 126, 127, 0, 0, 0, 0, 0, 1048, - 0, 0, 128, 129, 130, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 1049, 140, 1050, 1051, 0, 143, - 144, 145, 146, 147, 148, 1052, 785, 149, 150, 151, - 152, 1053, 1054, 155, 0, 156, 157, 158, 159, 786, - 0, 787, 0, 1055, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 0, 172, 173, 174, 175, 176, 177, - 0, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 1056, 190, 191, 1057, 193, 1058, 194, 0, - 195, 196, 197, 198, 199, 200, 0, 0, 201, 202, - 203, 204, 0, 0, 205, 206, 1059, 208, 209, 0, - 210, 211, 212, 0, 213, 214, 215, 0, 216, 217, - 218, 219, 1060, 221, 222, 223, 224, 225, 788, 1061, - 227, 0, 228, 229, 1062, 231, 0, 232, 0, 233, - 234, 0, 235, 236, 237, 238, 239, 240, 0, 241, - 0, 1063, 1064, 244, 245, 0, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 0, 258, - 259, 260, 261, 262, 263, 264, 0, 265, 266, 267, - 268, 269, 270, 271, 272, 1065, 1066, 0, 1067, 0, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 0, 0, 287, 288, 289, 290, 0, 291, 292, - 293, 294, 295, 296, 297, 298, 1068, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 1069, 321, 1070, - 323, 324, 325, 326, 1071, 327, 328, 329, 330, 1072, - 790, 332, 1073, 334, 335, 336, 0, 337, 338, 0, - 0, 1074, 340, 341, 0, 0, 342, 343, 344, 345, - 346, 347, 792, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 0, 0, 0, 0, 360, 361, - 793, 363, 364, 365, 366, 367, 368, 369, 0, 370, - 371, 372, 373, 374, 375, 0, 376, 377, 378, 1075, - 380, 381, 382, 383, 0, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 0, 397, - 398, 399, 400, 401, 402, 1076, 404, 405, 406, 407, - 408, 409, 410, 411, 412, 413, 414, 415, 416, 0, - 0, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 0, 426, 427, 428, 1077, 430, 0, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - 444, 795, 0, 0, 446, 447, 0, 448, 449, 450, - 451, 452, 453, 454, 0, 455, 1078, 1079, 0, 0, - 458, 459, 796, 461, 797, 1080, 463, 464, 798, 466, - 467, 468, 469, 470, 0, 0, 471, 472, 473, 0, - 474, 475, 476, 477, 0, 478, 479, 480, 481, 482, - 483, 1081, 0, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 0, 0, 494, 0, 0, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, - 508, 509, 510, 511, 512, 513, 514, 515, 1082, 0, - 0, 0, 0, 0, 0, 1083, 1084, 1085, 0, 0, - 0, 0, 1086, 0, 1087, 0, 0, 0, 0, 1088, - 1089, 0, 1090, 1091, 116, 1042, 815, 1043, 1044, 1045, - 1046, 1047, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 1048, 0, 0, 128, 129, 130, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 1049, 140, 1050, 1051, 0, - 143, 144, 145, 146, 147, 148, 1052, 785, 149, 150, - 151, 152, 1053, 1054, 155, 0, 156, 157, 158, 159, - 786, 0, 787, 0, 1055, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 1056, 190, 191, 1057, 193, 1058, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 1059, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 1060, 221, 222, 223, 224, 225, 788, - 1061, 227, 0, 228, 229, 1062, 231, 0, 232, 0, - 233, 234, 1424, 235, 236, 237, 238, 239, 240, 0, - 241, 0, 1063, 1064, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 266, - 267, 268, 269, 270, 271, 272, 1065, 1066, 0, 1067, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 288, 289, 290, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 1068, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 1069, 321, - 1070, 323, 324, 325, 326, 1071, 327, 328, 329, 330, - 1072, 790, 332, 1073, 334, 335, 336, 0, 337, 338, - 0, 0, 1074, 340, 341, 0, 0, 342, 343, 344, - 345, 346, 347, 792, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 793, 363, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 1075, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 399, 400, 401, 402, 1076, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 426, 427, 428, 1077, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 795, 0, 0, 446, 447, 0, 448, 449, - 450, 451, 452, 453, 454, 0, 455, 1078, 1079, 0, - 0, 458, 459, 796, 461, 797, 1080, 463, 464, 798, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 1081, 0, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 1082, - 0, 0, 0, 0, 0, 0, 1083, 1084, 1085, 0, - 0, 0, 0, 1086, 0, 1087, 0, 0, 0, 0, - 1088, 1089, 0, 1090, 1091, 116, 1042, 815, 1043, 1044, - 1045, 1046, 1047, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, - 123, 124, 0, 125, 126, 127, 0, 0, 0, 0, - 0, 1048, 0, 0, 128, 129, 130, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 1049, 140, 1050, 1051, - 0, 143, 144, 145, 146, 147, 148, 1052, 785, 149, - 150, 151, 152, 1053, 1054, 155, 0, 156, 157, 158, - 159, 786, 0, 787, 0, 1055, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 0, 172, 173, 174, 175, - 176, 177, 0, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 1056, 190, 191, 1057, 193, 1058, - 194, 0, 195, 196, 197, 198, 199, 200, 0, 0, - 201, 202, 203, 204, 0, 0, 205, 206, 1059, 208, - 209, 0, 210, 211, 212, 0, 213, 214, 215, 0, - 216, 217, 218, 219, 1060, 221, 222, 223, 224, 225, - 788, 1061, 227, 0, 228, 229, 1062, 231, 0, 232, - 0, 233, 234, 0, 235, 236, 237, 238, 239, 240, - 0, 241, 0, 1063, 1064, 244, 245, 0, 246, 247, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 1084, 0, 0, 0, 0, 0, 0, 1085, 1086, 1087, + 0, 0, 0, 0, 1088, 0, 1089, 0, 0, 0, + 0, 1090, 1091, 0, 1092, 1093, 117, 1044, 819, 1045, + 1046, 1047, 1048, 1049, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 1050, 0, 0, 129, 130, 131, 0, 132, + 133, 134, 135, 136, 137, 138, 139, 1051, 141, 1052, + 1053, 0, 144, 145, 146, 147, 148, 149, 1054, 789, + 150, 151, 152, 153, 1055, 1056, 156, 0, 157, 158, + 159, 160, 790, 0, 791, 0, 1057, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 1058, 191, 192, 1059, 194, + 1060, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 1061, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 1062, 222, 223, 224, 225, + 226, 227, 792, 1063, 229, 0, 230, 231, 1064, 233, + 0, 234, 0, 235, 236, 1430, 237, 238, 239, 240, + 241, 242, 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 0, 258, 259, 260, 261, 262, 263, 264, 0, 265, - 266, 267, 268, 269, 270, 271, 272, 1065, 1066, 0, - 1067, 0, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 0, 0, 287, 288, 289, 290, 0, - 291, 292, 293, 294, 295, 296, 297, 298, 1068, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 1069, - 321, 1070, 323, 324, 325, 326, 1071, 327, 328, 329, - 330, 1072, 790, 332, 1073, 334, 335, 336, 0, 337, - 338, 0, 0, 1074, 340, 341, 0, 0, 342, 343, - 344, 345, 346, 347, 792, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 0, 0, 0, 0, - 360, 361, 793, 363, 364, 365, 366, 367, 368, 369, - 0, 370, 371, 372, 373, 374, 375, 0, 376, 377, - 378, 1075, 380, 381, 382, 383, 0, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 0, 397, 398, 399, 400, 401, 402, 1076, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 0, 0, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 0, 426, 427, 428, 1077, 430, 0, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, 444, 795, 0, 0, 446, 447, 0, 448, - 449, 450, 451, 452, 453, 454, 0, 455, 1078, 1079, - 0, 0, 458, 459, 796, 461, 797, 1080, 463, 464, - 798, 466, 467, 468, 469, 470, 0, 0, 471, 472, - 473, 0, 474, 475, 476, 477, 0, 478, 479, 480, - 481, 482, 483, 1081, 0, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 0, 0, 494, 0, 0, 495, - 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 1067, + 1068, 0, 1069, 0, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 290, 291, + 292, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 1071, 323, 1072, 325, 326, 327, 328, 1073, 329, + 330, 331, 332, 1074, 794, 334, 1075, 336, 337, 338, + 0, 339, 340, 0, 0, 1076, 342, 343, 0, 0, + 344, 345, 346, 347, 348, 349, 796, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 797, 365, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 1077, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, + 406, 1078, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 430, 431, 432, + 1079, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 799, 0, 0, + 450, 451, 0, 452, 453, 454, 455, 456, 457, 458, + 0, 459, 1080, 1081, 0, 0, 462, 463, 800, 465, + 801, 1082, 467, 468, 802, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 1083, 0, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, - 1082, 0, 0, 0, 0, 0, 0, 1083, 1084, 1085, - 0, 0, 0, 0, 1086, 0, 1087, 2052, 0, 0, - 0, 1088, 1089, 0, 1090, 1091, 116, 1042, 815, 1043, - 1044, 1045, 1046, 1047, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 117, 118, 119, 120, 121, - 122, 123, 124, 0, 125, 126, 127, 0, 0, 0, - 0, 0, 1048, 0, 0, 128, 129, 130, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 1049, 140, 1050, - 1051, 0, 143, 144, 145, 146, 147, 148, 1052, 785, - 149, 150, 151, 152, 1053, 1054, 155, 0, 156, 157, - 158, 159, 786, 0, 787, 0, 1055, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 0, 172, 173, 174, - 175, 176, 177, 0, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 1056, 190, 191, 1057, 193, - 1058, 194, 0, 195, 196, 197, 198, 199, 200, 0, - 0, 201, 202, 203, 204, 0, 0, 205, 206, 1059, - 208, 209, 0, 210, 211, 212, 0, 213, 214, 215, - 0, 216, 217, 218, 219, 1060, 221, 222, 223, 224, - 225, 788, 1061, 227, 0, 228, 229, 1062, 231, 0, - 232, 0, 233, 234, 0, 235, 236, 237, 238, 239, - 240, 0, 241, 0, 1063, 1064, 244, 245, 0, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 0, 258, 259, 260, 261, 262, 263, 264, 0, - 265, 266, 267, 268, 269, 270, 271, 272, 1065, 1066, - 0, 1067, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 0, 0, 287, 288, 289, 290, - 0, 291, 292, 293, 294, 295, 296, 297, 298, 1068, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 1069, 321, 1070, 323, 324, 325, 326, 1071, 327, 328, - 329, 330, 1072, 790, 332, 1073, 334, 335, 336, 0, - 337, 338, 0, 0, 1074, 340, 341, 0, 0, 342, - 343, 344, 345, 346, 347, 792, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 0, 0, 0, - 0, 360, 361, 793, 363, 364, 365, 366, 367, 368, - 369, 0, 370, 371, 372, 373, 374, 375, 0, 376, - 377, 378, 1075, 380, 381, 382, 383, 0, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 0, 397, 398, 399, 400, 401, 402, 1076, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 0, 0, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 0, 426, 427, 428, 1077, 430, 0, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 795, 0, 0, 446, 447, 2681, - 448, 449, 450, 451, 452, 453, 454, 0, 455, 1078, - 1079, 0, 0, 458, 459, 796, 461, 797, 1080, 463, - 464, 798, 466, 467, 468, 469, 470, 0, 0, 471, - 472, 473, 0, 474, 475, 476, 477, 0, 478, 479, - 480, 481, 482, 483, 1081, 0, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 0, 0, 494, 0, 0, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, - 515, 1082, 0, 0, 0, 0, 0, 0, 1083, 1084, - 1085, 0, 0, 0, 0, 1086, 0, 1087, 0, 0, - 0, 0, 1088, 1089, 0, 1090, 1091, 116, 1042, 815, - 1043, 1044, 1045, 1046, 1047, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 117, 118, 119, 120, - 121, 122, 123, 124, 0, 125, 126, 127, 0, 0, - 0, 0, 0, 1048, 0, 0, 128, 129, 130, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 1049, 140, - 1050, 1051, 0, 143, 144, 145, 146, 147, 148, 1052, - 785, 149, 150, 151, 152, 1053, 1054, 155, 0, 156, - 157, 158, 159, 786, 0, 787, 0, 1055, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 0, 172, 173, - 174, 175, 176, 177, 0, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 1056, 190, 191, 1057, - 193, 1058, 194, 0, 195, 196, 197, 198, 199, 200, - 0, 0, 201, 202, 203, 204, 0, 0, 205, 206, - 1059, 208, 209, 0, 210, 211, 212, 0, 213, 214, - 215, 0, 216, 217, 218, 219, 1060, 221, 222, 223, - 224, 225, 788, 1061, 227, 0, 228, 229, 1062, 231, - 0, 232, 0, 233, 234, 0, 235, 236, 237, 238, - 239, 240, 0, 241, 0, 1063, 1064, 244, 245, 0, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 0, 258, 259, 260, 261, 262, 263, 264, - 0, 265, 266, 267, 268, 269, 270, 271, 272, 1065, - 1066, 0, 1067, 0, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 0, 0, 287, 288, 289, - 290, 0, 291, 292, 293, 294, 295, 296, 297, 298, - 1068, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 516, 517, 518, 519, 1084, 0, 0, 0, 0, 0, + 0, 1085, 1086, 1087, 0, 0, 0, 0, 1088, 0, + 1089, 0, 0, 0, 0, 1090, 1091, 0, 1092, 1093, + 117, 1044, 819, 1045, 1046, 1047, 1048, 1049, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 1050, 0, 0, 129, + 130, 131, 0, 132, 133, 134, 135, 136, 137, 138, + 139, 1051, 141, 1052, 1053, 0, 144, 145, 146, 147, + 148, 149, 1054, 789, 150, 151, 152, 153, 1055, 1056, + 156, 0, 157, 158, 159, 160, 790, 0, 791, 0, + 1057, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 1058, + 191, 192, 1059, 194, 1060, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 1061, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 1062, + 222, 223, 224, 225, 226, 227, 792, 1063, 229, 0, + 230, 231, 1064, 233, 0, 234, 0, 235, 236, 0, + 237, 238, 239, 240, 241, 242, 0, 243, 0, 1065, + 1066, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 1067, 1068, 0, 1069, 0, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 1071, 323, 1072, 325, 326, + 327, 328, 1073, 329, 330, 331, 332, 1074, 794, 334, + 1075, 336, 337, 338, 0, 339, 340, 0, 0, 1076, + 342, 343, 0, 0, 344, 345, 346, 347, 348, 349, + 796, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 0, 0, 0, 0, 362, 363, 797, 365, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 1077, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 403, 404, 405, 406, 1078, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 430, 431, 432, 1079, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 799, 0, 0, 450, 451, 0, 452, 453, 454, + 455, 456, 457, 458, 0, 459, 1080, 1081, 0, 0, + 462, 463, 800, 465, 801, 1082, 467, 468, 802, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 1083, 0, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, + 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, + 512, 513, 514, 515, 516, 517, 518, 519, 1084, 0, + 0, 0, 0, 0, 0, 1085, 1086, 1087, 0, 0, + 0, 0, 1088, 0, 1089, 2056, 0, 0, 0, 1090, + 1091, 0, 1092, 1093, 117, 1044, 819, 1045, 1046, 1047, + 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 1050, 0, 0, 129, 130, 131, 0, 132, 133, 134, + 135, 136, 137, 138, 139, 1051, 141, 1052, 1053, 0, + 144, 145, 146, 147, 148, 149, 1054, 789, 150, 151, + 152, 153, 1055, 1056, 156, 0, 157, 158, 159, 160, + 790, 0, 791, 0, 1057, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 1058, 191, 192, 1059, 194, 1060, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 1061, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 1062, 222, 223, 224, 225, 226, 227, + 792, 1063, 229, 0, 230, 231, 1064, 233, 0, 234, + 0, 235, 236, 0, 237, 238, 239, 240, 241, 242, + 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 1067, 1068, 0, + 1069, 0, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 290, 291, 292, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 1070, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 1071, + 323, 1072, 325, 326, 327, 328, 1073, 329, 330, 331, + 332, 1074, 794, 334, 1075, 336, 337, 338, 0, 339, + 340, 0, 0, 1076, 342, 343, 0, 0, 344, 345, + 346, 347, 348, 349, 796, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 797, 365, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 1077, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 403, 404, 405, 406, 1078, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 430, 431, 432, 1079, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 799, 0, 0, 450, 451, + 2688, 452, 453, 454, 455, 456, 457, 458, 0, 459, + 1080, 1081, 0, 0, 462, 463, 800, 465, 801, 1082, + 467, 468, 802, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 1083, 0, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 1084, 0, 0, 0, 0, 0, 0, 1085, + 1086, 1087, 0, 0, 0, 0, 1088, 0, 1089, 0, + 0, 0, 0, 1090, 1091, 0, 1092, 1093, 117, 1044, + 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 1050, 0, 0, 129, 130, 131, + 0, 132, 133, 134, 135, 136, 137, 138, 139, 1051, + 141, 1052, 1053, 0, 144, 145, 146, 147, 148, 149, + 1054, 789, 150, 151, 152, 153, 1055, 1056, 156, 0, + 157, 158, 159, 160, 790, 0, 791, 0, 1057, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 1058, 191, 192, + 1059, 194, 1060, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 1061, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 1062, 222, 223, + 224, 225, 226, 227, 792, 1063, 229, 0, 230, 231, + 1064, 233, 0, 234, 0, 235, 236, 0, 237, 238, + 239, 240, 241, 242, 0, 243, 0, 1065, 1066, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 268, 269, 270, 271, 272, 273, + 274, 1067, 1068, 0, 1069, 0, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 1069, 321, 1070, 323, 324, 325, 326, 1071, 327, - 328, 329, 330, 1072, 790, 332, 1073, 334, 335, 336, - 0, 337, 338, 0, 0, 1074, 340, 341, 0, 0, - 342, 343, 344, 345, 346, 347, 792, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 0, 0, - 0, 0, 360, 361, 793, 363, 364, 365, 366, 367, - 368, 369, 0, 370, 371, 372, 373, 374, 375, 0, - 376, 377, 378, 1075, 380, 381, 382, 383, 0, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 0, 397, 398, 399, 400, 401, 402, 1076, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 0, 0, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 0, 426, 427, 428, 1077, 430, - 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 795, 0, 0, 446, 447, - 0, 448, 449, 450, 451, 452, 453, 454, 0, 455, - 1078, 1079, 0, 0, 458, 459, 796, 461, 797, 1080, - 463, 464, 798, 466, 467, 468, 469, 470, 0, 0, - 471, 472, 473, 0, 474, 475, 476, 477, 0, 478, - 479, 480, 481, 482, 483, 1081, 0, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 0, 2800, 494, 0, - 0, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 319, 320, 321, 1071, 323, 1072, 325, 326, 327, 328, + 1073, 329, 330, 331, 332, 1074, 794, 334, 1075, 336, + 337, 338, 0, 339, 340, 0, 0, 1076, 342, 343, + 0, 0, 344, 345, 346, 347, 348, 349, 796, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 797, 365, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 1077, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, + 404, 405, 406, 1078, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 430, + 431, 432, 1079, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 799, + 0, 0, 450, 451, 0, 452, 453, 454, 455, 456, + 457, 458, 0, 459, 1080, 1081, 0, 0, 462, 463, + 800, 465, 801, 1082, 467, 468, 802, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 1083, + 0, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 0, 2809, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, - 514, 515, 1082, 0, 0, 0, 0, 0, 0, 1083, - 1084, 1085, 0, 0, 0, 0, 1086, 0, 1087, 0, - 0, 0, 0, 1088, 1089, 0, 1090, 1091, 116, 1042, - 815, 1043, 1044, 1045, 1046, 1047, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 117, 118, 119, - 120, 121, 122, 123, 124, 3015, 125, 126, 127, 0, - 0, 0, 0, 0, 1048, 0, 0, 128, 129, 130, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 1049, - 140, 1050, 1051, 0, 143, 144, 145, 146, 147, 148, - 1052, 785, 149, 150, 151, 152, 1053, 1054, 155, 0, - 156, 157, 158, 159, 786, 0, 787, 0, 1055, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 0, 172, - 173, 174, 175, 176, 177, 0, 178, 179, 3016, 181, - 182, 183, 184, 185, 186, 187, 188, 1056, 190, 191, - 1057, 193, 1058, 194, 0, 195, 196, 197, 198, 199, - 200, 0, 0, 201, 202, 203, 204, 0, 0, 205, - 206, 1059, 208, 209, 0, 210, 211, 212, 0, 213, - 214, 215, 0, 216, 217, 218, 219, 1060, 221, 222, - 223, 224, 225, 788, 1061, 227, 0, 228, 229, 1062, - 231, 0, 232, 0, 233, 234, 0, 235, 236, 237, - 238, 239, 240, 0, 241, 0, 3017, 1064, 244, 245, - 0, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 0, 258, 259, 260, 261, 262, 263, - 264, 0, 265, 266, 267, 268, 269, 270, 271, 272, - 1065, 1066, 0, 1067, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 0, 0, 287, 288, - 289, 290, 0, 291, 292, 293, 294, 295, 296, 297, - 298, 1068, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 1069, 321, 1070, 323, 324, 325, 326, 1071, - 327, 328, 329, 330, 1072, 790, 332, 1073, 334, 335, - 336, 0, 337, 338, 0, 0, 1074, 340, 341, 0, - 0, 342, 343, 344, 345, 346, 347, 792, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 0, - 0, 0, 0, 360, 361, 793, 363, 364, 365, 366, - 367, 368, 369, 0, 370, 371, 372, 373, 374, 375, - 0, 376, 377, 378, 1075, 380, 381, 382, 383, 0, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 0, 397, 398, 399, 400, 401, 3018, - 1076, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 0, 0, 417, 418, 419, 420, - 421, 422, 423, 424, 425, 0, 426, 427, 428, 1077, - 430, 0, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 795, 0, 0, 446, - 447, 0, 448, 449, 450, 451, 452, 453, 454, 0, - 455, 1078, 1079, 0, 0, 458, 459, 796, 461, 797, - 1080, 463, 464, 798, 466, 467, 468, 469, 470, 0, - 0, 471, 472, 473, 0, 474, 475, 476, 477, 0, - 478, 479, 480, 481, 482, 483, 1081, 0, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, - 0, 0, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 1082, 0, 0, 0, 0, 0, 0, - 1083, 1084, 1085, 0, 0, 0, 0, 1086, 0, 3019, - 0, 0, 0, 0, 1088, 1089, 0, 1090, 1091, 116, - 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 1048, 0, 0, 128, 129, - 130, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 1049, 140, 1050, 1051, 0, 143, 144, 145, 146, 147, - 148, 1052, 785, 149, 150, 151, 152, 1053, 1054, 155, - 0, 156, 157, 158, 159, 786, 0, 787, 0, 1055, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 1056, 190, - 191, 1057, 193, 1058, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 1059, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 1060, 221, - 222, 223, 224, 225, 788, 1061, 227, 0, 228, 229, - 1062, 231, 0, 232, 0, 233, 234, 0, 235, 236, - 237, 238, 239, 240, 0, 241, 0, 1063, 1064, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 266, 267, 268, 269, 270, 271, - 272, 1065, 1066, 0, 1067, 0, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 288, 289, 290, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 1068, 300, 301, 302, 303, 304, 305, 306, + 514, 515, 516, 517, 518, 519, 1084, 0, 0, 0, + 0, 0, 0, 1085, 1086, 1087, 0, 0, 0, 0, + 1088, 0, 1089, 0, 0, 0, 0, 1090, 1091, 0, + 1092, 1093, 117, 1044, 819, 1045, 1046, 1047, 1048, 1049, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 3024, + 126, 127, 128, 0, 0, 0, 0, 0, 1050, 0, + 0, 129, 130, 131, 0, 132, 133, 134, 135, 136, + 137, 138, 139, 1051, 141, 1052, 1053, 0, 144, 145, + 146, 147, 148, 149, 1054, 789, 150, 151, 152, 153, + 1055, 1056, 156, 0, 157, 158, 159, 160, 790, 0, + 791, 0, 1057, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 179, 180, 3025, 182, 183, 184, 185, 186, 187, 188, + 189, 1058, 191, 192, 1059, 194, 1060, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 1061, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 1062, 222, 223, 224, 225, 226, 227, 792, 1063, + 229, 0, 230, 231, 1064, 233, 0, 234, 0, 235, + 236, 0, 237, 238, 239, 240, 241, 242, 0, 243, + 0, 3026, 1066, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 268, 269, + 270, 271, 272, 273, 274, 1067, 1068, 0, 1069, 0, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 290, 291, 292, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 1070, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 1071, 323, 1072, + 325, 326, 327, 328, 1073, 329, 330, 331, 332, 1074, + 794, 334, 1075, 336, 337, 338, 0, 339, 340, 0, + 0, 1076, 342, 343, 0, 0, 344, 345, 346, 347, + 348, 349, 796, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 797, 365, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 1077, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 403, 404, 405, 3027, 1078, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 430, 431, 432, 1079, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 799, 0, 0, 450, 451, 0, 452, + 453, 454, 455, 456, 457, 458, 0, 459, 1080, 1081, + 0, 0, 462, 463, 800, 465, 801, 1082, 467, 468, + 802, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 1083, 0, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 1084, 0, 0, 0, 0, 0, 0, 1085, 1086, 1087, + 0, 0, 0, 0, 1088, 0, 3028, 0, 0, 0, + 0, 1090, 1091, 0, 1092, 1093, 117, 1044, 819, 1045, + 1046, 1047, 1048, 1049, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 1050, 0, 0, 129, 130, 131, 0, 132, + 133, 134, 135, 136, 137, 138, 139, 1051, 141, 1052, + 1053, 0, 144, 145, 146, 147, 148, 149, 1054, 789, + 150, 151, 152, 153, 1055, 1056, 156, 0, 157, 158, + 159, 160, 790, 0, 791, 0, 1057, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 1058, 191, 192, 1059, 194, + 1060, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 1061, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 1062, 222, 223, 224, 225, + 226, 227, 792, 1063, 229, 0, 230, 231, 1064, 233, + 0, 234, 0, 235, 236, 0, 237, 238, 239, 240, + 241, 242, 0, 243, 0, 1065, 1066, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 1067, + 1068, 0, 1069, 0, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 290, 291, + 292, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 1071, 323, 1072, 325, 326, 327, 328, 1073, 329, + 330, 331, 332, 1074, 794, 334, 1075, 336, 337, 338, + 0, 339, 340, 0, 0, 1076, 342, 343, 0, 0, + 344, 345, 346, 347, 348, 349, 796, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 797, 365, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 1077, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, + 406, 1078, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 430, 431, 432, + 1079, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 799, 0, 0, + 450, 451, 3175, 452, 453, 454, 455, 456, 457, 458, + 0, 459, 1080, 1081, 0, 0, 462, 463, 800, 465, + 801, 1082, 467, 468, 802, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 1083, 0, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 1084, 0, 0, 0, 0, 0, + 0, 1085, 1086, 1087, 0, 0, 0, 0, 1088, 0, + 1089, 0, 0, 0, 0, 1090, 1091, 0, 1092, 1093, + 117, 1044, 819, 1045, 1046, 1047, 1048, 1049, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 1050, 0, 0, 129, + 130, 131, 0, 132, 133, 134, 135, 136, 137, 138, + 139, 1051, 141, 1052, 1053, 0, 144, 145, 146, 147, + 148, 149, 1054, 789, 150, 151, 152, 153, 1055, 1056, + 156, 0, 157, 158, 159, 160, 790, 0, 791, 0, + 1057, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 1058, + 191, 192, 1059, 194, 1060, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 1061, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 1062, + 222, 223, 224, 225, 226, 227, 792, 1063, 229, 0, + 230, 231, 1064, 233, 0, 234, 0, 235, 236, 0, + 237, 238, 239, 240, 241, 242, 0, 243, 0, 1065, + 1066, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 1067, 1068, 0, 1069, 0, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 1069, 321, 1070, 323, 324, 325, 326, - 1071, 327, 328, 329, 330, 1072, 790, 332, 1073, 334, - 335, 336, 0, 337, 338, 0, 0, 1074, 340, 341, - 0, 0, 342, 343, 344, 345, 346, 347, 792, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 793, 363, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 1075, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 399, 400, 401, - 402, 1076, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 426, 427, 428, - 1077, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, 444, 795, 0, 0, - 446, 447, 3167, 448, 449, 450, 451, 452, 453, 454, - 0, 455, 1078, 1079, 0, 0, 458, 459, 796, 461, - 797, 1080, 463, 464, 798, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 1081, 0, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, + 317, 318, 319, 320, 321, 1071, 323, 1072, 325, 326, + 327, 328, 1073, 329, 330, 331, 332, 1074, 794, 334, + 1075, 336, 337, 338, 0, 339, 340, 0, 0, 1076, + 342, 343, 0, 0, 344, 345, 346, 347, 348, 349, + 796, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 0, 0, 0, 0, 362, 363, 797, 365, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 1077, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 403, 404, 405, 406, 1078, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 430, 431, 432, 1079, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 799, 0, 0, 450, 451, 3313, 452, 453, 454, + 455, 456, 457, 458, 0, 459, 1080, 1081, 0, 0, + 462, 463, 800, 465, 801, 1082, 467, 468, 802, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 1083, 0, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 1082, 0, 0, 0, 0, 0, - 0, 1083, 1084, 1085, 0, 0, 0, 0, 1086, 0, - 1087, 0, 0, 0, 0, 1088, 1089, 0, 1090, 1091, - 116, 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, - 118, 119, 120, 121, 122, 123, 124, 0, 125, 126, - 127, 0, 0, 0, 0, 0, 1048, 0, 0, 128, - 129, 130, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 1049, 140, 1050, 1051, 0, 143, 144, 145, 146, - 147, 148, 1052, 785, 149, 150, 151, 152, 1053, 1054, - 155, 0, 156, 157, 158, 159, 786, 0, 787, 0, - 1055, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 0, 172, 173, 174, 175, 176, 177, 0, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 1056, - 190, 191, 1057, 193, 1058, 194, 0, 195, 196, 197, - 198, 199, 200, 0, 0, 201, 202, 203, 204, 0, - 0, 205, 206, 1059, 208, 209, 0, 210, 211, 212, - 0, 213, 214, 215, 0, 216, 217, 218, 219, 1060, - 221, 222, 223, 224, 225, 788, 1061, 227, 0, 228, - 229, 1062, 231, 0, 232, 0, 233, 234, 0, 235, - 236, 237, 238, 239, 240, 0, 241, 0, 1063, 1064, - 244, 245, 0, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 0, 258, 259, 260, 261, - 262, 263, 264, 0, 265, 266, 267, 268, 269, 270, - 271, 272, 1065, 1066, 0, 1067, 0, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 0, 0, - 287, 288, 289, 290, 0, 291, 292, 293, 294, 295, - 296, 297, 298, 1068, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 1069, 321, 1070, 323, 324, 325, - 326, 1071, 327, 328, 329, 330, 1072, 790, 332, 1073, - 334, 335, 336, 0, 337, 338, 0, 0, 1074, 340, - 341, 0, 0, 342, 343, 344, 345, 346, 347, 792, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 0, 0, 0, 0, 360, 361, 793, 363, 364, - 365, 366, 367, 368, 369, 0, 370, 371, 372, 373, - 374, 375, 0, 376, 377, 378, 1075, 380, 381, 382, - 383, 0, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 0, 397, 398, 399, 400, - 401, 402, 1076, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 0, 0, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 0, 426, 427, - 428, 1077, 430, 0, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, 444, 795, 0, - 0, 446, 447, 3305, 448, 449, 450, 451, 452, 453, - 454, 0, 455, 1078, 1079, 0, 0, 458, 459, 796, - 461, 797, 1080, 463, 464, 798, 466, 467, 468, 469, - 470, 0, 0, 471, 472, 473, 0, 474, 475, 476, - 477, 0, 478, 479, 480, 481, 482, 483, 1081, 0, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, - 0, 494, 0, 0, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 1082, 0, 0, 0, 0, - 0, 0, 1083, 1084, 1085, 0, 0, 0, 0, 1086, - 0, 1087, 0, 0, 0, 0, 1088, 1089, 0, 1090, - 1091, 116, 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 1084, 0, + 0, 0, 0, 0, 0, 1085, 1086, 1087, 0, 0, + 0, 0, 1088, 0, 1089, 0, 0, 0, 0, 1090, + 1091, 0, 1092, 1093, 117, 1044, 819, 1045, 1046, 1047, + 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 1050, 0, 0, 129, 130, 131, 0, 132, 133, 134, + 135, 136, 137, 138, 139, 1051, 141, 1052, 1053, 0, + 144, 145, 146, 147, 148, 149, 1054, 789, 150, 151, + 152, 153, 1055, 1056, 156, 0, 157, 158, 159, 160, + 790, 0, 791, 0, 1057, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 1058, 191, 192, 1059, 194, 1060, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 1061, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 1062, 222, 223, 224, 225, 226, 227, + 792, 1063, 229, 0, 230, 231, 1064, 233, 0, 234, + 0, 235, 236, 0, 237, 238, 239, 240, 241, 242, + 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 1067, 1068, 0, + 1069, 0, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 290, 291, 292, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 1070, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 1071, + 323, 1072, 325, 326, 327, 328, 1073, 329, 330, 331, + 332, 1074, 794, 334, 1075, 336, 337, 338, 0, 339, + 340, 0, 0, 1076, 342, 343, 0, 0, 344, 345, + 346, 347, 348, 349, 796, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 797, 365, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 1077, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 403, 404, 405, 406, 1078, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 430, 431, 432, 1079, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 799, 0, 0, 450, 451, + 0, 452, 453, 454, 455, 456, 457, 458, 0, 459, + 1080, 1081, 0, 0, 462, 463, 800, 465, 801, 1082, + 467, 468, 802, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 1083, 0, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 1084, 0, 0, 0, 0, 0, 0, 1085, + 1086, 1087, 0, 0, 0, 0, 1088, 0, 1089, 0, + 0, 0, 0, 1090, 1091, 0, 1092, 1093, 117, 1044, + 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 1050, 0, 0, 129, 130, 131, + 0, 132, 133, 134, 135, 136, 137, 138, 139, 1051, + 141, 1052, 1053, 0, 144, 145, 146, 147, 148, 149, + 1054, 789, 150, 151, 152, 153, 1055, 1056, 156, 0, + 157, 158, 159, 160, 790, 0, 791, 0, 1057, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 1058, 191, 192, + 1059, 194, 1060, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 1061, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 1062, 222, 223, + 224, 225, 226, 227, 792, 1063, 229, 0, 230, 231, + 1064, 233, 0, 234, 0, 235, 236, 0, 237, 238, + 239, 240, 241, 242, 0, 243, 0, 1065, 1066, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 268, 269, 270, 271, 272, 273, + 274, 1067, 1068, 0, 1069, 0, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 1071, 323, 1072, 325, 326, 327, 328, + 1073, 329, 330, 331, 332, 1074, 794, 334, 1075, 336, + 337, 338, 0, 339, 340, 0, 0, 1076, 342, 343, + 0, 0, 344, 345, 346, 347, 348, 349, 796, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 797, 365, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 1077, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, + 404, 405, 406, 1078, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 430, + 431, 432, 1079, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 799, + 0, 0, 450, 451, 0, 452, 453, 454, 455, 456, + 457, 458, 0, 459, 1080, 1081, 0, 0, 462, 463, + 800, 465, 801, 1082, 467, 468, 802, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 1083, + 0, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 1084, 0, 0, 0, + 0, 0, 0, 1715, 1716, 1087, 0, 0, 0, 0, + 1088, 0, 1089, 0, 0, 0, 0, 1090, 1091, 0, + 1092, 1093, 117, 2197, 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 117, 118, 119, 120, 121, 122, 123, 124, 0, 125, - 126, 127, 0, 0, 0, 0, 0, 1048, 0, 0, - 128, 129, 130, 0, 131, 132, 133, 134, 135, 136, - 137, 138, 1049, 140, 1050, 1051, 0, 143, 144, 145, - 146, 147, 148, 1052, 785, 149, 150, 151, 152, 1053, - 1054, 155, 0, 156, 157, 158, 159, 786, 0, 787, - 0, 1055, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 0, 172, 173, 174, 175, 176, 177, 0, 178, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 1050, 0, + 0, 129, 130, 131, 0, 132, 133, 134, 135, 136, + 137, 138, 139, 1051, 141, 1052, 1053, 0, 144, 145, + 146, 147, 148, 149, 1054, 789, 150, 151, 152, 153, + 1055, 1056, 156, 0, 157, 158, 159, 160, 790, 0, + 791, 0, 1057, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 1056, 190, 191, 1057, 193, 1058, 194, 0, 195, 196, - 197, 198, 199, 200, 0, 0, 201, 202, 203, 204, - 0, 0, 205, 206, 1059, 208, 209, 0, 210, 211, - 212, 0, 213, 214, 215, 0, 216, 217, 218, 219, - 1060, 221, 222, 223, 224, 225, 788, 1061, 227, 0, - 228, 229, 1062, 231, 0, 232, 0, 233, 234, 0, - 235, 236, 237, 238, 239, 240, 0, 241, 0, 1063, - 1064, 244, 245, 0, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 0, 258, 259, 260, - 261, 262, 263, 264, 0, 265, 266, 267, 268, 269, - 270, 271, 272, 1065, 1066, 0, 1067, 0, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 0, - 0, 287, 288, 289, 290, 0, 291, 292, 293, 294, - 295, 296, 297, 298, 1068, 300, 301, 302, 303, 304, + 189, 1058, 191, 192, 1059, 194, 1060, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 1061, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 1062, 222, 223, 224, 225, 226, 227, 792, 1063, + 229, 0, 230, 231, 1064, 233, 0, 234, 0, 235, + 236, 0, 237, 238, 239, 240, 241, 242, 0, 243, + 0, 1065, 1066, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 268, 269, + 270, 271, 272, 273, 274, 1067, 1068, 0, 1069, 0, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 290, 291, 292, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 1069, 321, 1070, 323, 324, - 325, 326, 1071, 327, 328, 329, 330, 1072, 790, 332, - 1073, 334, 335, 336, 0, 337, 338, 0, 0, 1074, - 340, 341, 0, 0, 342, 343, 344, 345, 346, 347, - 792, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 0, 0, 0, 0, 360, 361, 793, 363, - 364, 365, 366, 367, 368, 369, 0, 370, 371, 372, - 373, 374, 375, 0, 376, 377, 378, 1075, 380, 381, - 382, 383, 0, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 0, 397, 398, 399, - 400, 401, 402, 1076, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 0, 0, 417, - 418, 419, 420, 421, 422, 423, 424, 425, 0, 426, - 427, 428, 1077, 430, 0, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, 444, 795, - 0, 0, 446, 447, 0, 448, 449, 450, 451, 452, - 453, 454, 0, 455, 1078, 1079, 0, 0, 458, 459, - 796, 461, 797, 1080, 463, 464, 798, 466, 467, 468, - 469, 470, 0, 0, 471, 472, 473, 0, 474, 475, - 476, 477, 0, 478, 479, 480, 481, 482, 483, 1081, - 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 0, 0, 494, 0, 0, 495, 496, 497, 498, 499, + 315, 316, 317, 318, 319, 320, 321, 1071, 323, 1072, + 325, 326, 327, 328, 1073, 329, 330, 331, 332, 1074, + 794, 334, 1075, 336, 337, 338, 0, 339, 340, 0, + 0, 1076, 342, 343, 0, 0, 344, 345, 346, 347, + 348, 349, 796, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 797, 365, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 1077, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 403, 404, 405, 406, 1078, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 430, 431, 432, 1079, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 799, 0, 0, 450, 451, 0, 452, + 453, 454, 455, 456, 457, 458, 0, 459, 1080, 1081, + 0, 0, 462, 463, 800, 465, 801, 1082, 467, 468, + 802, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 1083, 0, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 1082, 0, 0, 0, - 0, 0, 0, 1083, 1084, 1085, 0, 0, 0, 0, - 1086, 0, 1087, 0, 0, 0, 0, 1088, 1089, 0, - 1090, 1091, 116, 1042, 815, 1043, 1044, 1045, 1046, 1047, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 117, 118, 119, 120, 121, 122, 123, 124, 0, - 125, 126, 127, 0, 0, 0, 0, 0, 1048, 0, - 0, 128, 129, 130, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 1049, 140, 1050, 1051, 0, 143, 144, - 145, 146, 147, 148, 1052, 785, 149, 150, 151, 152, - 1053, 1054, 155, 0, 156, 157, 158, 159, 786, 0, - 787, 0, 1055, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 0, 172, 173, 174, 175, 176, 177, 0, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 1056, 190, 191, 1057, 193, 1058, 194, 0, 195, - 196, 197, 198, 199, 200, 0, 0, 201, 202, 203, - 204, 0, 0, 205, 206, 1059, 208, 209, 0, 210, - 211, 212, 0, 213, 214, 215, 0, 216, 217, 218, - 219, 1060, 221, 222, 223, 224, 225, 788, 1061, 227, - 0, 228, 229, 1062, 231, 0, 232, 0, 233, 234, - 0, 235, 236, 237, 238, 239, 240, 0, 241, 0, - 1063, 1064, 244, 245, 0, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 0, 258, 259, - 260, 261, 262, 263, 264, 0, 265, 266, 267, 268, - 269, 270, 271, 272, 1065, 1066, 0, 1067, 0, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 0, 0, 287, 288, 289, 290, 0, 291, 292, 293, - 294, 295, 296, 297, 298, 1068, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 1069, 321, 1070, 323, - 324, 325, 326, 1071, 327, 328, 329, 330, 1072, 790, - 332, 1073, 334, 335, 336, 0, 337, 338, 0, 0, - 1074, 340, 341, 0, 0, 342, 343, 344, 345, 346, - 347, 792, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 0, 0, 0, 0, 360, 361, 793, - 363, 364, 365, 366, 367, 368, 369, 0, 370, 371, - 372, 373, 374, 375, 0, 376, 377, 378, 1075, 380, - 381, 382, 383, 0, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 0, 397, 398, - 399, 400, 401, 402, 1076, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 0, 0, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 0, - 426, 427, 428, 1077, 430, 0, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 795, 0, 0, 446, 447, 0, 448, 449, 450, 451, - 452, 453, 454, 0, 455, 1078, 1079, 0, 0, 458, - 459, 796, 461, 797, 1080, 463, 464, 798, 466, 467, - 468, 469, 470, 0, 0, 471, 472, 473, 0, 474, - 475, 476, 477, 0, 478, 479, 480, 481, 482, 483, - 1081, 0, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 0, 0, 494, 0, 0, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, - 509, 510, 511, 512, 513, 514, 515, 1082, 0, 0, - 0, 0, 0, 0, 1709, 1710, 1085, 0, 0, 0, - 0, 1086, 0, 1087, 0, 0, 0, 0, 1088, 1089, - 0, 1090, 1091, 116, 2189, 815, 1043, 1044, 1045, 1046, - 1047, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, - 0, 125, 126, 127, 0, 0, 0, 0, 0, 1048, - 0, 0, 128, 129, 130, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 1049, 140, 1050, 1051, 0, 143, - 144, 145, 146, 147, 148, 1052, 785, 149, 150, 151, - 152, 1053, 1054, 155, 0, 156, 157, 158, 159, 786, - 0, 787, 0, 1055, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 0, 172, 173, 174, 175, 176, 177, - 0, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 1056, 190, 191, 1057, 193, 1058, 194, 0, - 195, 196, 197, 198, 199, 200, 0, 0, 201, 202, - 203, 204, 0, 0, 205, 206, 1059, 208, 209, 0, - 210, 211, 212, 0, 213, 214, 215, 0, 216, 217, - 218, 219, 1060, 221, 222, 223, 224, 225, 788, 1061, - 227, 0, 228, 229, 1062, 231, 0, 232, 0, 233, - 234, 0, 235, 236, 237, 238, 239, 240, 0, 241, - 0, 1063, 1064, 244, 245, 0, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 0, 258, - 259, 260, 261, 262, 263, 264, 0, 265, 266, 267, - 268, 269, 270, 271, 272, 1065, 1066, 0, 1067, 0, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 0, 0, 287, 288, 289, 290, 0, 291, 292, - 293, 294, 295, 296, 297, 298, 1068, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 1069, 321, 1070, - 323, 324, 325, 326, 1071, 327, 328, 329, 330, 1072, - 790, 332, 1073, 334, 335, 336, 0, 337, 338, 0, - 0, 1074, 340, 341, 0, 0, 342, 343, 344, 345, - 346, 347, 792, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 0, 0, 0, 0, 360, 361, - 793, 363, 364, 365, 366, 367, 368, 369, 0, 370, - 371, 372, 373, 374, 375, 0, 376, 377, 378, 1075, - 380, 381, 382, 383, 0, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 0, 397, - 398, 399, 400, 401, 402, 1076, 404, 405, 406, 407, - 408, 409, 410, 411, 412, 413, 414, 415, 416, 0, - 0, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 0, 426, 427, 428, 1077, 430, 0, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - 444, 795, 0, 0, 446, 447, 0, 448, 449, 450, - 451, 452, 453, 454, 0, 455, 1078, 1079, 0, 0, - 458, 459, 796, 461, 797, 1080, 463, 464, 798, 466, - 467, 468, 469, 470, 0, 0, 471, 472, 473, 0, - 474, 475, 476, 477, 0, 478, 479, 480, 481, 482, - 483, 1081, 0, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 0, 0, 494, 0, 0, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, - 508, 509, 510, 511, 512, 513, 514, 515, 1082, 0, - 0, 0, 0, 0, 0, 1083, 1084, 1085, 0, 0, - 0, 0, 1086, 0, 1087, 0, 0, 0, 0, 1088, - 1089, 0, 1090, 1091, 116, 1042, 815, 1043, 1044, 1045, - 1046, 1047, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 1048, 0, 0, 128, 129, 130, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 1049, 140, 1050, 1051, 0, - 143, 144, 145, 146, 147, 148, 1052, 785, 149, 150, - 151, 152, 1053, 1054, 155, 0, 156, 157, 158, 159, - 786, 0, 787, 0, 1055, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 1056, 190, 191, 1057, 193, 1058, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 1059, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 1060, 221, 222, 223, 224, 225, 788, - 1061, 227, 0, 228, 229, 1062, 231, 0, 232, 0, - 233, 234, 0, 235, 236, 237, 238, 239, 240, 0, - 241, 0, 1063, 1064, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 266, - 267, 268, 269, 270, 271, 272, 1065, 1066, 0, 1067, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 288, 289, 290, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 1068, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 1069, 321, - 1070, 323, 324, 325, 326, 1071, 327, 328, 329, 330, - 1072, 790, 332, 1073, 334, 335, 336, 0, 337, 338, - 0, 0, 1074, 340, 341, 0, 0, 342, 343, 344, - 345, 346, 347, 792, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 793, 363, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 1075, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 399, 400, 401, 402, 1076, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 426, 427, 428, 1077, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 795, 0, 0, 446, 447, 0, 448, 449, - 450, 451, 452, 453, 454, 0, 455, 1078, 1079, 0, - 0, 458, 459, 796, 461, 797, 1080, 463, 464, 798, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 1081, 0, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 1082, - 0, 0, 0, 0, 0, 0, 1083, 2272, 1085, 0, - 0, 0, 0, 1086, 0, 1087, 0, 0, 0, 0, - 1088, 1089, 0, 1090, 1091, 116, 1042, 815, 1043, 1044, - 1045, 1046, 1047, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, - 123, 124, 0, 125, 126, 127, 0, 0, 0, 0, - 0, 1048, 0, 0, 128, 129, 130, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 1049, 140, 1050, 1051, - 0, 143, 144, 145, 146, 147, 148, 1052, 785, 149, - 150, 151, 152, 1053, 1054, 155, 0, 156, 157, 158, - 159, 786, 0, 787, 0, 1055, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 0, 172, 173, 174, 175, - 176, 177, 0, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 1056, 190, 191, 1057, 193, 1058, - 194, 0, 195, 196, 197, 198, 199, 200, 0, 0, - 201, 202, 203, 204, 0, 0, 205, 206, 1059, 208, - 209, 0, 210, 211, 212, 0, 213, 214, 215, 0, - 216, 217, 218, 219, 1060, 221, 222, 223, 224, 225, - 788, 1061, 227, 0, 228, 229, 1062, 231, 0, 232, - 0, 233, 234, 0, 235, 236, 237, 238, 239, 240, - 0, 241, 0, 1063, 1064, 244, 245, 0, 246, 247, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 1084, 0, 0, 0, 0, 0, 0, 1085, 1086, 1087, + 0, 0, 0, 0, 1088, 0, 1089, 0, 0, 0, + 0, 1090, 1091, 0, 1092, 1093, 117, 1044, 819, 1045, + 1046, 1047, 1048, 1049, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 1050, 0, 0, 129, 130, 131, 0, 132, + 133, 134, 135, 136, 137, 138, 139, 1051, 141, 1052, + 1053, 0, 144, 145, 146, 147, 148, 149, 1054, 789, + 150, 151, 152, 153, 1055, 1056, 156, 0, 157, 158, + 159, 160, 790, 0, 791, 0, 1057, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 1058, 191, 192, 1059, 194, + 1060, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 1061, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 1062, 222, 223, 224, 225, + 226, 227, 792, 1063, 229, 0, 230, 231, 1064, 233, + 0, 234, 0, 235, 236, 0, 237, 238, 239, 240, + 241, 242, 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 0, 258, 259, 260, 261, 262, 263, 264, 0, 265, - 266, 267, 268, 269, 270, 271, 272, 1065, 1066, 0, - 1067, 0, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 0, 0, 287, 288, 289, 290, 0, - 291, 292, 293, 294, 295, 296, 297, 298, 1068, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 1069, - 321, 1070, 323, 324, 325, 326, 1071, 327, 328, 329, - 330, 1072, 790, 332, 1073, 334, 335, 336, 0, 337, - 338, 0, 0, 1074, 340, 341, 0, 0, 342, 343, - 344, 345, 346, 347, 792, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 0, 0, 0, 0, - 360, 361, 793, 363, 364, 365, 366, 367, 368, 369, - 0, 370, 371, 372, 373, 374, 375, 0, 376, 377, - 378, 1075, 380, 381, 382, 383, 0, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 0, 397, 398, 399, 400, 401, 402, 1076, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 0, 0, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 0, 426, 427, 428, 1077, 430, 0, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, 444, 795, 0, 0, 446, 447, 0, 448, - 449, 450, 451, 452, 453, 454, 0, 455, 1078, 1079, - 0, 0, 458, 459, 796, 461, 797, 1080, 463, 464, - 798, 466, 467, 468, 469, 470, 0, 0, 471, 472, - 473, 0, 474, 475, 476, 477, 0, 478, 479, 480, - 481, 482, 483, 1081, 0, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 0, 0, 494, 0, 0, 495, - 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 1067, + 1068, 0, 1069, 0, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 290, 291, + 292, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 1071, 323, 1072, 325, 326, 327, 328, 1073, 329, + 330, 331, 332, 1074, 794, 334, 1075, 336, 337, 338, + 0, 339, 340, 0, 0, 1076, 342, 343, 0, 0, + 344, 345, 346, 347, 348, 349, 796, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 797, 365, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 1077, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, + 406, 1078, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 430, 431, 432, + 1079, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 799, 0, 0, + 450, 451, 0, 452, 453, 454, 455, 456, 457, 458, + 0, 459, 1080, 1081, 0, 0, 462, 463, 800, 465, + 801, 1082, 467, 468, 802, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 1083, 0, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, - 1082, 0, 0, 0, 0, 0, 0, 1083, 1084, 1085, - 0, 0, 0, 0, 1086, 0, 2486, 0, 0, 0, - 0, 1088, 1089, 0, 1090, 1091, 116, 1042, 815, 1043, - 1044, 1045, 1046, 1047, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 117, 118, 119, 120, 121, - 122, 123, 124, 0, 125, 126, 127, 0, 0, 0, - 0, 0, 1048, 0, 0, 128, 129, 130, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 1049, 140, 1050, - 1051, 0, 143, 144, 145, 146, 147, 148, 1052, 785, - 149, 150, 151, 152, 1053, 1054, 155, 0, 156, 157, - 158, 159, 786, 0, 787, 0, 1055, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 0, 172, 173, 174, - 175, 176, 177, 0, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 1056, 190, 191, 1057, 193, - 1058, 194, 0, 195, 196, 197, 198, 199, 200, 0, - 0, 201, 202, 203, 204, 0, 0, 205, 206, 1059, - 208, 209, 0, 210, 211, 212, 0, 213, 214, 215, - 0, 216, 217, 218, 219, 1060, 221, 222, 223, 224, - 225, 788, 1061, 227, 0, 228, 229, 1062, 231, 0, - 232, 0, 233, 234, 0, 235, 236, 237, 238, 239, - 240, 0, 241, 0, 1063, 1064, 244, 245, 0, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 0, 258, 259, 260, 261, 262, 263, 264, 0, - 265, 266, 267, 268, 269, 270, 271, 272, 1065, 1066, - 0, 1067, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 0, 0, 287, 288, 289, 290, - 0, 291, 292, 293, 294, 295, 296, 297, 298, 1068, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 1069, 321, 1070, 323, 324, 325, 326, 1071, 327, 328, - 329, 330, 1072, 790, 332, 1073, 334, 335, 336, 0, - 337, 338, 0, 0, 1074, 340, 341, 0, 0, 342, - 343, 344, 345, 346, 347, 792, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 0, 0, 0, - 0, 360, 361, 793, 363, 364, 365, 366, 367, 368, - 369, 0, 370, 371, 372, 373, 374, 375, 0, 376, - 377, 378, 1075, 380, 381, 382, 383, 0, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 0, 397, 398, 399, 400, 401, 402, 1076, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 0, 0, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 0, 426, 427, 428, 1077, 430, 0, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 795, 0, 0, 446, 447, 0, - 448, 449, 450, 451, 452, 453, 454, 0, 455, 1078, - 1079, 0, 0, 458, 459, 796, 461, 797, 1080, 463, - 464, 798, 466, 467, 468, 469, 470, 0, 0, 471, - 472, 473, 0, 474, 475, 476, 477, 0, 478, 479, - 480, 481, 482, 483, 1081, 0, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 0, 0, 494, 0, 0, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, - 515, 1082, 0, 0, 0, 0, 0, 0, 1083, 3069, - 1085, 0, 0, 0, 0, 1086, 0, 1087, 0, 0, - 0, 0, 1088, 1089, 0, 1090, 1091, 116, 1042, 815, - 1043, 1044, 1045, 1046, 1047, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 117, 118, 119, 120, - 121, 122, 123, 124, 0, 125, 126, 127, 0, 0, - 0, 0, 0, 1048, 0, 0, 128, 129, 130, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 1049, 140, - 1050, 1051, 0, 143, 144, 145, 146, 147, 148, 1052, - 785, 149, 150, 151, 152, 1053, 1054, 155, 0, 156, - 157, 158, 159, 786, 0, 787, 0, 1055, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 0, 172, 173, - 174, 175, 176, 177, 0, 178, 179, 3016, 181, 182, - 183, 184, 185, 186, 187, 188, 1056, 190, 191, 1057, - 193, 1058, 194, 0, 195, 196, 197, 198, 199, 200, - 0, 0, 201, 202, 203, 204, 0, 0, 205, 206, - 1059, 208, 209, 0, 210, 211, 212, 0, 213, 214, - 215, 0, 216, 217, 218, 219, 1060, 221, 222, 223, - 224, 225, 788, 1061, 227, 0, 228, 229, 1062, 231, - 0, 232, 0, 233, 234, 0, 235, 236, 237, 238, - 239, 240, 0, 241, 0, 3017, 1064, 244, 245, 0, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 0, 258, 259, 260, 261, 262, 263, 264, - 0, 265, 266, 267, 268, 269, 270, 271, 272, 1065, - 1066, 0, 1067, 0, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 0, 0, 287, 288, 289, - 290, 0, 291, 292, 293, 294, 295, 296, 297, 298, - 1068, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 1069, 321, 1070, 323, 324, 325, 326, 1071, 327, - 328, 329, 330, 1072, 790, 332, 1073, 334, 335, 336, - 0, 337, 338, 0, 0, 1074, 340, 341, 0, 0, - 342, 343, 344, 345, 346, 347, 792, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 0, 0, - 0, 0, 360, 361, 793, 363, 364, 365, 366, 367, - 368, 369, 0, 370, 371, 372, 373, 374, 375, 0, - 376, 377, 378, 1075, 380, 381, 382, 383, 0, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 0, 397, 398, 399, 400, 401, 3018, 1076, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 0, 0, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 0, 426, 427, 428, 1077, 430, - 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 795, 0, 0, 446, 447, - 0, 448, 449, 450, 451, 452, 453, 454, 0, 455, - 1078, 1079, 0, 0, 458, 459, 796, 461, 797, 1080, - 463, 464, 798, 466, 467, 468, 469, 470, 0, 0, - 471, 472, 473, 0, 474, 475, 476, 477, 0, 478, - 479, 480, 481, 482, 483, 1081, 0, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 0, 0, 494, 0, - 0, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, - 514, 515, 1082, 0, 0, 0, 0, 0, 0, 1083, - 1084, 1085, 0, 0, 0, 0, 1086, 0, 3019, 0, - 0, 0, 0, 1088, 1089, 0, 1090, 1091, 116, 1042, - 815, 1043, 1044, 1045, 1046, 1047, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 117, 118, 119, - 120, 121, 122, 123, 124, 0, 125, 126, 127, 0, - 0, 0, 0, 0, 1048, 0, 0, 128, 129, 130, - 0, 131, 132, 133, 134, 135, 136, 137, 3477, 1049, - 140, 1050, 1051, 0, 143, 144, 145, 146, 147, 148, - 1052, 785, 149, 150, 151, 152, 1053, 1054, 155, 0, - 156, 157, 158, 159, 786, 0, 787, 0, 1055, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 0, 172, - 173, 174, 175, 176, 177, 0, 178, 179, 180, 3478, - 182, 183, 184, 185, 186, 187, 188, 1056, 190, 191, - 1057, 193, 1058, 194, 0, 195, 196, 197, 198, 199, - 200, 0, 0, 201, 202, 203, 204, 0, 0, 205, - 206, 1059, 208, 209, 0, 210, 211, 212, 0, 213, - 214, 215, 0, 216, 217, 218, 219, 1060, 221, 222, - 223, 224, 225, 788, 1061, 227, 0, 228, 229, 1062, - 231, 0, 232, 0, 233, 234, 0, 235, 236, 237, - 238, 239, 240, 0, 241, 0, 1063, 1064, 244, 245, - 0, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 0, 258, 259, 260, 261, 262, 263, - 264, 0, 265, 266, 267, 268, 269, 270, 271, 272, - 1065, 1066, 0, 1067, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 0, 0, 287, 288, - 289, 290, 0, 291, 292, 293, 294, 295, 296, 297, - 298, 1068, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 1069, 321, 1070, 323, 324, 325, 326, 1071, - 327, 328, 329, 330, 1072, 790, 332, 1073, 334, 335, - 336, 0, 337, 338, 0, 0, 1074, 340, 341, 0, - 0, 342, 343, 344, 345, 346, 347, 792, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 0, - 0, 0, 0, 360, 361, 793, 363, 364, 365, 366, - 367, 368, 369, 0, 370, 371, 372, 373, 374, 375, - 0, 376, 377, 378, 1075, 380, 381, 382, 383, 0, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 0, 397, 398, 399, 400, 401, 402, - 1076, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 0, 0, 417, 418, 419, 420, - 421, 422, 423, 424, 425, 0, 426, 427, 428, 1077, - 430, 0, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 795, 0, 0, 446, - 447, 0, 448, 449, 450, 451, 452, 453, 454, 0, - 455, 1078, 1079, 0, 0, 458, 459, 796, 461, 797, - 1080, 463, 464, 798, 466, 467, 3479, 469, 470, 0, - 0, 471, 472, 473, 0, 474, 475, 476, 477, 0, - 478, 479, 480, 481, 482, 483, 1081, 0, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, - 0, 0, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 1082, 0, 0, 0, 0, 0, 0, - 1083, 1084, 1085, 0, 0, 0, 0, 1086, 0, 1087, - 0, 0, 0, 0, 1088, 1089, 0, 1090, 1091, 116, - 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 1048, 0, 0, 128, 129, - 130, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 1049, 140, 1050, 1051, 0, 143, 144, 145, 146, 147, - 148, 1052, 785, 149, 150, 151, 152, 1053, 1054, 155, - 0, 156, 157, 158, 159, 786, 0, 787, 0, 1055, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 178, 179, 180, - 3478, 182, 183, 184, 185, 186, 187, 188, 1056, 190, - 191, 1057, 193, 1058, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 1059, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 1060, 221, - 222, 223, 224, 225, 788, 1061, 227, 0, 228, 229, - 1062, 231, 0, 232, 0, 233, 234, 0, 235, 236, - 237, 238, 239, 240, 0, 241, 0, 1063, 1064, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 266, 267, 268, 269, 270, 271, - 272, 1065, 1066, 0, 1067, 0, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 288, 289, 290, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 1068, 300, 301, 302, 303, 304, 305, 306, + 516, 517, 518, 519, 1084, 0, 0, 0, 0, 0, + 0, 1085, 2280, 1087, 0, 0, 0, 0, 1088, 0, + 1089, 0, 0, 0, 0, 1090, 1091, 0, 1092, 1093, + 117, 1044, 819, 1045, 1046, 1047, 1048, 1049, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 1050, 0, 0, 129, + 130, 131, 0, 132, 133, 134, 135, 136, 137, 138, + 139, 1051, 141, 1052, 1053, 0, 144, 145, 146, 147, + 148, 149, 1054, 789, 150, 151, 152, 153, 1055, 1056, + 156, 0, 157, 158, 159, 160, 790, 0, 791, 0, + 1057, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 1058, + 191, 192, 1059, 194, 1060, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 1061, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 1062, + 222, 223, 224, 225, 226, 227, 792, 1063, 229, 0, + 230, 231, 1064, 233, 0, 234, 0, 235, 236, 0, + 237, 238, 239, 240, 241, 242, 0, 243, 0, 1065, + 1066, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 1067, 1068, 0, 1069, 0, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 1069, 321, 1070, 323, 324, 325, 326, - 1071, 327, 328, 329, 330, 1072, 790, 332, 1073, 334, - 335, 336, 0, 337, 338, 0, 0, 1074, 340, 341, - 0, 0, 342, 343, 344, 345, 346, 347, 792, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 793, 363, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 1075, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 399, 400, 401, - 402, 1076, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 426, 427, 428, - 1077, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, 444, 795, 0, 0, - 446, 447, 0, 448, 449, 450, 451, 452, 453, 454, - 0, 455, 1078, 1079, 0, 0, 458, 459, 796, 461, - 797, 1080, 463, 464, 798, 466, 467, 3479, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 1081, 0, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, + 317, 318, 319, 320, 321, 1071, 323, 1072, 325, 326, + 327, 328, 1073, 329, 330, 331, 332, 1074, 794, 334, + 1075, 336, 337, 338, 0, 339, 340, 0, 0, 1076, + 342, 343, 0, 0, 344, 345, 346, 347, 348, 349, + 796, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 0, 0, 0, 0, 362, 363, 797, 365, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 1077, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 403, 404, 405, 406, 1078, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 430, 431, 432, 1079, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 799, 0, 0, 450, 451, 0, 452, 453, 454, + 455, 456, 457, 458, 0, 459, 1080, 1081, 0, 0, + 462, 463, 800, 465, 801, 1082, 467, 468, 802, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 1083, 0, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 1082, 0, 0, 0, 0, 0, - 0, 1083, 1084, 1085, 0, 0, 0, 0, 1086, 0, - 1087, 0, 0, 0, 0, 1088, 1089, 0, 1090, 1091, - 116, 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, - 118, 119, 120, 121, 122, 123, 124, 0, 125, 126, - 127, 0, 0, 0, 0, 0, 1048, 0, 0, 128, - 129, 130, 0, 131, 132, 133, 134, 135, 136, 137, - 138, 1049, 140, 1050, 1051, 0, 143, 144, 145, 146, - 147, 148, 1052, 785, 149, 150, 151, 152, 1053, 1054, - 155, 0, 156, 157, 158, 159, 786, 0, 787, 0, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 0, 172, 173, 174, 175, 176, 177, 0, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 1056, - 190, 191, 1057, 193, 0, 194, 0, 195, 196, 197, - 198, 199, 200, 0, 0, 201, 202, 203, 204, 0, - 0, 205, 206, 1059, 208, 209, 0, 210, 211, 212, - 0, 213, 214, 215, 0, 216, 217, 218, 219, 1060, - 221, 222, 223, 224, 225, 788, 1061, 227, 0, 228, - 229, 1062, 231, 0, 232, 0, 233, 234, 0, 235, - 236, 237, 238, 239, 240, 0, 241, 0, 1063, 1064, - 244, 245, 0, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 0, 258, 259, 260, 261, - 262, 263, 264, 0, 265, 266, 267, 268, 269, 270, - 271, 272, 1065, 1066, 0, 1067, 0, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 0, 0, - 287, 288, 289, 290, 0, 291, 292, 293, 294, 295, - 296, 297, 298, 1068, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 1069, 321, 1070, 323, 324, 325, - 326, 0, 327, 328, 329, 330, 1072, 790, 332, 1073, - 334, 335, 336, 0, 337, 338, 0, 0, 1074, 340, - 341, 0, 0, 342, 343, 344, 345, 346, 347, 792, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 0, 0, 0, 0, 360, 361, 793, 363, 364, - 365, 366, 367, 368, 369, 0, 370, 371, 372, 373, - 374, 375, 0, 376, 377, 378, 1075, 380, 381, 382, - 383, 0, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 0, 397, 398, 399, 400, - 401, 402, 1076, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 0, 0, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 0, 426, 427, - 428, 1077, 430, 0, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, 444, 795, 0, - 0, 446, 447, 0, 448, 449, 450, 451, 452, 453, - 454, 0, 455, 1078, 1079, 0, 0, 458, 459, 796, - 461, 797, 1080, 463, 464, 798, 466, 467, 468, 469, - 470, 0, 0, 471, 472, 473, 0, 474, 475, 476, - 477, 0, 478, 479, 480, 481, 482, 483, 1081, 0, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 0, - 0, 494, 0, 0, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 0, 0, 0, 0, 0, - 0, 0, 1410, 1411, 0, 0, 0, 0, 0, 1086, - 0, 1087, 0, 0, 0, 0, 1088, 1089, 0, 1090, - 1091, 116, 1042, 815, 1043, 1044, 1045, 1046, 1047, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 1084, 0, + 0, 0, 0, 0, 0, 1085, 1086, 1087, 0, 0, + 0, 0, 1088, 0, 2493, 0, 0, 0, 0, 1090, + 1091, 0, 1092, 1093, 117, 1044, 819, 1045, 1046, 1047, + 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 1050, 0, 0, 129, 130, 131, 0, 132, 133, 134, + 135, 136, 137, 138, 139, 1051, 141, 1052, 1053, 0, + 144, 145, 146, 147, 148, 149, 1054, 789, 150, 151, + 152, 153, 1055, 1056, 156, 0, 157, 158, 159, 160, + 790, 0, 791, 0, 1057, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 1058, 191, 192, 1059, 194, 1060, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 1061, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 1062, 222, 223, 224, 225, 226, 227, + 792, 1063, 229, 0, 230, 231, 1064, 233, 0, 234, + 0, 235, 236, 0, 237, 238, 239, 240, 241, 242, + 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 1067, 1068, 0, + 1069, 0, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 290, 291, 292, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 1070, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 1071, + 323, 1072, 325, 326, 327, 328, 1073, 329, 330, 331, + 332, 1074, 794, 334, 1075, 336, 337, 338, 0, 339, + 340, 0, 0, 1076, 342, 343, 0, 0, 344, 345, + 346, 347, 348, 349, 796, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 797, 365, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 1077, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 403, 404, 405, 406, 1078, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 430, 431, 432, 1079, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 799, 0, 0, 450, 451, + 0, 452, 453, 454, 455, 456, 457, 458, 0, 459, + 1080, 1081, 0, 0, 462, 463, 800, 465, 801, 1082, + 467, 468, 802, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 1083, 0, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 1084, 0, 0, 0, 0, 0, 0, 1085, + 3078, 1087, 0, 0, 0, 0, 1088, 0, 1089, 0, + 0, 0, 0, 1090, 1091, 0, 1092, 1093, 117, 1044, + 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 1050, 0, 0, 129, 130, 131, + 0, 132, 133, 134, 135, 136, 137, 138, 139, 1051, + 141, 1052, 1053, 0, 144, 145, 146, 147, 148, 149, + 1054, 789, 150, 151, 152, 153, 1055, 1056, 156, 0, + 157, 158, 159, 160, 790, 0, 791, 0, 1057, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 179, 180, 3025, 182, + 183, 184, 185, 186, 187, 188, 189, 1058, 191, 192, + 1059, 194, 1060, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 1061, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 1062, 222, 223, + 224, 225, 226, 227, 792, 1063, 229, 0, 230, 231, + 1064, 233, 0, 234, 0, 235, 236, 0, 237, 238, + 239, 240, 241, 242, 0, 243, 0, 3026, 1066, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 268, 269, 270, 271, 272, 273, + 274, 1067, 1068, 0, 1069, 0, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 1071, 323, 1072, 325, 326, 327, 328, + 1073, 329, 330, 331, 332, 1074, 794, 334, 1075, 336, + 337, 338, 0, 339, 340, 0, 0, 1076, 342, 343, + 0, 0, 344, 345, 346, 347, 348, 349, 796, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 797, 365, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 1077, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, + 404, 405, 3027, 1078, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 430, + 431, 432, 1079, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 799, + 0, 0, 450, 451, 0, 452, 453, 454, 455, 456, + 457, 458, 0, 459, 1080, 1081, 0, 0, 462, 463, + 800, 465, 801, 1082, 467, 468, 802, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 1083, + 0, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 1084, 0, 0, 0, + 0, 0, 0, 1085, 1086, 1087, 0, 0, 0, 0, + 1088, 0, 3028, 0, 0, 0, 0, 1090, 1091, 0, + 1092, 1093, 117, 1044, 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 117, 118, 119, 120, 121, 122, 123, 124, 0, 125, - 126, 127, 0, 0, 0, 0, 0, 1048, 0, 0, - 128, 129, 130, 0, 131, 132, 133, 134, 135, 136, - 137, -2046, 1049, 140, 1050, 1051, 0, 143, 144, 145, - 146, 147, 148, 1052, 785, 149, 150, 151, 152, 1053, - 1054, 155, 0, 156, 157, 158, 159, 786, 0, 787, - 0, 1055, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 0, 172, 173, 174, 175, 176, 177, 0, 178, - 179, 180, 3478, 182, 183, 184, 185, 186, 187, 188, - 1056, 190, 191, 1057, 193, 1058, 194, 0, 195, 196, - 197, 198, 199, 200, 0, 0, 201, 202, 203, 204, - 0, 0, 205, 206, 1059, 208, 209, 0, 210, 211, - 212, 0, 213, 214, 215, 0, 216, 217, 218, 219, - 1060, 221, 222, 223, 224, 225, 788, 1061, 227, 0, - 228, 229, 1062, 231, 0, 232, 0, 233, 234, 0, - 235, 236, 237, 238, -2046, 240, 0, 241, 0, 1063, - 1064, 244, 245, 0, 246, 247, 248, 249, 250, 251, - 252, -2046, 254, 255, 256, 257, 0, 258, 259, 260, - 261, 262, 263, 264, 0, 265, 266, 267, 268, 269, - 270, 271, 272, 1065, 1066, 0, 1067, 0, 276, 0, - 0, 279, 280, 281, 282, 283, 284, 285, 286, 0, - 0, 287, 288, 289, -2046, 0, 291, 292, 293, 294, - 295, 296, 297, 298, 1068, 300, 301, 302, 303, 304, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 1050, 0, + 0, 129, 130, 131, 0, 132, 133, 134, 135, 136, + 137, 138, 3486, 1051, 141, 1052, 1053, 0, 144, 145, + 146, 147, 148, 149, 1054, 789, 150, 151, 152, 153, + 1055, 1056, 156, 0, 157, 158, 159, 160, 790, 0, + 791, 0, 1057, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 179, 180, 181, 3487, 183, 184, 185, 186, 187, 188, + 189, 1058, 191, 192, 1059, 194, 1060, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 1061, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 1062, 222, 223, 224, 225, 226, 227, 792, 1063, + 229, 0, 230, 231, 1064, 233, 0, 234, 0, 235, + 236, 0, 237, 238, 239, 240, 241, 242, 0, 243, + 0, 1065, 1066, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 268, 269, + 270, 271, 272, 273, 274, 1067, 1068, 0, 1069, 0, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 290, 291, 292, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 1069, 321, 1070, 323, 324, - 325, 326, 0, 327, 328, 0, 330, 1072, 790, 332, - 1073, 334, 335, 336, 0, 337, 338, 0, 0, 1074, - 340, 341, 0, 0, 342, 343, 344, 345, 346, 347, - 792, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 0, 0, 0, 0, 360, 361, 793, 363, - 364, 365, 366, 367, 368, 369, 0, 370, 371, 372, - 373, 374, 375, 0, 376, 377, 378, 1075, 380, 381, - 382, 383, 0, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 0, 397, 398, 399, - 400, 401, 402, 1076, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 0, 0, 417, - 418, 419, 420, 421, 422, 423, 424, 425, 0, -2046, - 427, 428, 1077, 430, 0, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, 444, 795, - 0, 0, 446, 447, 0, 448, 449, 450, 451, 452, - 453, 454, 0, 455, 1078, 1079, 0, 0, 458, 459, - 796, 461, 797, 1080, 463, 464, 798, 466, 467, 3479, - 469, 470, 0, 0, 471, 472, 473, 0, 474, 475, - 476, 477, 0, 478, 479, 480, 481, 482, 483, 1081, - 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 0, 0, 494, 0, 0, 495, 496, 497, 498, 499, + 315, 316, 317, 318, 319, 320, 321, 1071, 323, 1072, + 325, 326, 327, 328, 1073, 329, 330, 331, 332, 1074, + 794, 334, 1075, 336, 337, 338, 0, 339, 340, 0, + 0, 1076, 342, 343, 0, 0, 344, 345, 346, 347, + 348, 349, 796, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 797, 365, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 1077, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 403, 404, 405, 406, 1078, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 430, 431, 432, 1079, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 799, 0, 0, 450, 451, 0, 452, + 453, 454, 455, 456, 457, 458, 0, 459, 1080, 1081, + 0, 0, 462, 463, 800, 465, 801, 1082, 467, 468, + 802, 470, 471, 3488, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 1083, 0, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, -2046, 0, 0, 0, - 0, 0, 0, 1083, 1084, 1085, 0, 0, 0, 0, - 1086, 0, 1087, 0, 0, 0, 0, 1088, 1089, 0, - 1090, 1091, 116, 1042, 815, 1043, 1044, 0, 1046, 1047, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 117, 118, 119, 120, 121, 122, 123, 124, 0, - 125, 126, 127, 0, 0, 0, 0, 0, 1048, 0, - 0, 128, 129, 130, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 1049, 140, 1050, 1051, 0, 143, 144, - 145, 146, 147, 148, 1052, 785, 149, 150, 151, 152, - 1053, 1054, 155, 0, 156, 157, 158, 159, 786, 0, - 787, 0, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 0, 172, 173, 174, 175, 176, 177, 0, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 1056, 190, 191, 1057, 193, 0, 194, 0, 195, - 196, 197, 198, 199, 200, 0, 0, 201, 202, 203, - 204, 0, 0, 205, 206, 1059, 208, 209, 0, 210, - 211, 212, 0, 213, 214, 215, 0, 216, 217, 218, - 219, 1060, 221, 222, 223, 224, 225, 788, 1061, 227, - 0, 228, 229, 1062, 231, 0, 232, 0, 233, 234, - 0, 235, 236, 237, 238, 239, 240, 0, 241, 0, - 1063, 1064, 244, 245, 0, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 0, 258, 259, - 260, 261, 262, 263, 264, 0, 265, 266, 267, 268, - 269, 270, 271, 272, 1065, 1066, 0, 1067, 0, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 0, 0, 287, 288, 289, 290, 0, 291, 292, 293, - 294, 295, 296, 297, 298, 1068, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 1069, 321, 1070, 323, - 324, 325, 326, 0, 327, 328, 329, 330, 1072, 790, - 332, 1073, 334, 335, 336, 0, 337, 338, 0, 0, - 339, 340, 341, 0, 0, 342, 343, 344, 345, 346, - 347, 792, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 0, 0, 0, 0, 360, 361, 793, - 363, 364, 365, 366, 367, 368, 369, 0, 370, 371, - 372, 373, 374, 375, 0, 376, 377, 378, 1075, 380, - 381, 382, 383, 0, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 0, 397, 398, - 399, 400, 401, 402, 2175, 2176, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 0, 0, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 0, - 426, 427, 428, 1077, 430, 0, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 795, 0, 0, 446, 447, 0, 448, 449, 450, 451, - 452, 453, 454, 0, 455, 1078, 1079, 0, 0, 458, - 459, 796, 461, 797, 1080, 463, 464, 798, 466, 467, - 468, 469, 470, 0, 0, 471, 472, 473, 0, 474, - 475, 476, 477, 0, 478, 479, 480, 481, 482, 483, - 1081, 0, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 0, 0, 494, 0, 0, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, - 509, 510, 511, 512, 513, 514, 515, 0, 0, 0, - 0, 0, 0, 0, 2177, 2178, 0, 0, 0, 0, - 0, 1086, 0, 1087, 0, 0, 0, 0, 1088, 1089, - 0, 1090, 1091, 116, 1042, 815, 1043, 1044, 1045, 1046, - 1047, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, - 0, 125, 126, 127, 0, 0, 0, 0, 0, 1048, - 0, 0, 128, 129, 130, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 1049, 140, 1050, 1051, 0, 143, - 144, 145, 146, 147, 148, 1052, 785, 149, 150, 151, - 152, 1053, 1054, 155, 0, 156, 157, 158, 159, 786, - 0, 787, 0, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 0, 172, 173, 174, 175, 176, 177, - 0, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 1056, 190, 191, 1057, 193, 0, 194, 0, - 195, 196, 197, 198, 199, 200, 0, 0, 201, 202, - 203, 204, 0, 0, 205, 206, 1059, 208, 209, 0, - 210, 211, 212, 0, 213, 214, 215, 0, 216, 217, - 218, 219, 1060, 221, 222, 223, 224, 225, 788, 1061, - 227, 0, 228, 229, 1062, 231, 0, 232, 0, 233, - 234, 0, 235, 236, 237, 238, 239, 240, 0, 241, - 0, 1063, 1064, 244, 245, 0, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 0, 258, - 259, 260, 261, 262, 263, 264, 0, 265, 266, 267, - 268, 269, 270, 271, 272, 1065, 1066, 0, 1067, 0, - 276, 0, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 0, 0, 287, 288, 289, 290, 0, 291, 292, - 293, 294, 295, 296, 297, 298, 1068, 300, 301, 302, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 1084, 0, 0, 0, 0, 0, 0, 1085, 1086, 1087, + 0, 0, 0, 0, 1088, 0, 1089, 0, 0, 0, + 0, 1090, 1091, 0, 1092, 1093, 117, 1044, 819, 1045, + 1046, 1047, 1048, 1049, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 1050, 0, 0, 129, 130, 131, 0, 132, + 133, 134, 135, 136, 137, 138, 139, 1051, 141, 1052, + 1053, 0, 144, 145, 146, 147, 148, 149, 1054, 789, + 150, 151, 152, 153, 1055, 1056, 156, 0, 157, 158, + 159, 160, 790, 0, 791, 0, 1057, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 179, 180, 181, 3487, 183, 184, + 185, 186, 187, 188, 189, 1058, 191, 192, 1059, 194, + 1060, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 1061, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 1062, 222, 223, 224, 225, + 226, 227, 792, 1063, 229, 0, 230, 231, 1064, 233, + 0, 234, 0, 235, 236, 0, 237, 238, 239, 240, + 241, 242, 0, 243, 0, 1065, 1066, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 1067, + 1068, 0, 1069, 0, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 290, 291, + 292, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 1071, 323, 1072, 325, 326, 327, 328, 1073, 329, + 330, 331, 332, 1074, 794, 334, 1075, 336, 337, 338, + 0, 339, 340, 0, 0, 1076, 342, 343, 0, 0, + 344, 345, 346, 347, 348, 349, 796, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 797, 365, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 1077, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, + 406, 1078, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 430, 431, 432, + 1079, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 799, 0, 0, + 450, 451, 0, 452, 453, 454, 455, 456, 457, 458, + 0, 459, 1080, 1081, 0, 0, 462, 463, 800, 465, + 801, 1082, 467, 468, 802, 470, 471, 3488, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 1083, 0, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 1084, 0, 0, 0, 0, 0, + 0, 1085, 1086, 1087, 0, 0, 0, 0, 1088, 0, + 1089, 0, 0, 0, 0, 1090, 1091, 0, 1092, 1093, + 117, 1044, 819, 1045, 1046, 1047, 1048, 1049, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 1050, 0, 0, 129, + 130, 131, 0, 132, 133, 134, 135, 136, 137, 138, + 139, 1051, 141, 1052, 1053, 0, 144, 145, 146, 147, + 148, 149, 1054, 789, 150, 151, 152, 153, 1055, 1056, + 156, 0, 157, 158, 159, 160, 790, 0, 791, 0, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 1058, + 191, 192, 1059, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 1061, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 1062, + 222, 223, 224, 225, 226, 227, 792, 1063, 229, 0, + 230, 231, 1064, 233, 0, 234, 0, 235, 236, 0, + 237, 238, 239, 240, 241, 242, 0, 243, 0, 1065, + 1066, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 1067, 1068, 0, 1069, 0, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 1071, 323, 1072, 325, 326, + 327, 328, 0, 329, 330, 331, 332, 1074, 794, 334, + 1075, 336, 337, 338, 0, 339, 340, 0, 0, 1076, + 342, 343, 0, 0, 344, 345, 346, 347, 348, 349, + 796, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 0, 0, 0, 0, 362, 363, 797, 365, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 1077, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 403, 404, 405, 406, 1078, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 430, 431, 432, 1079, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 799, 0, 0, 450, 451, 0, 452, 453, 454, + 455, 456, 457, 458, 0, 459, 1080, 1081, 0, 0, + 462, 463, 800, 465, 801, 1082, 467, 468, 802, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 1083, 0, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, + 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, + 512, 513, 514, 515, 516, 517, 518, 519, 0, 0, + 0, 0, 0, 0, 0, 1416, 1417, 0, 0, 0, + 0, 0, 1088, 0, 1089, 0, 0, 0, 0, 1090, + 1091, 0, 1092, 1093, 117, 1044, 819, 1045, 1046, 1047, + 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 1050, 0, 0, 129, 130, 131, 0, 132, 133, 134, + 135, 136, 137, 138, -2058, 1051, 141, 1052, 1053, 0, + 144, 145, 146, 147, 148, 149, 1054, 789, 150, 151, + 152, 153, 1055, 1056, 156, 0, 157, 158, 159, 160, + 790, 0, 791, 0, 1057, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 179, 180, 181, 3487, 183, 184, 185, 186, + 187, 188, 189, 1058, 191, 192, 1059, 194, 1060, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 1061, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 1062, 222, 223, 224, 225, 226, 227, + 792, 1063, 229, 0, 230, 231, 1064, 233, 0, 234, + 0, 235, 236, 0, 237, 238, 239, 240, -2058, 242, + 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, -2058, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 1067, 1068, 0, + 1069, 0, 278, 0, 0, 281, 282, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 290, 291, -2058, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 1069, 321, 1070, - 323, 324, 325, 326, 0, 327, 328, 329, 330, 1072, - 790, 332, 1073, 334, 335, 336, 0, 337, 338, 0, - 0, 1074, 340, 341, 0, 0, 342, 343, 344, 345, - 346, 347, 792, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 0, 0, 0, 0, 360, 361, - 793, 363, 364, 365, 366, 367, 368, 369, 0, 370, - 371, 372, 373, 374, 375, 0, 376, 377, 378, 1075, - 380, 381, 382, 383, 0, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 0, 397, - 398, 399, 400, 401, 402, 1076, 404, 405, 406, 407, - 408, 409, 410, 411, 412, 413, 414, 415, 416, 0, - 0, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 0, 426, 427, 428, 1077, 430, 0, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - 444, 795, 0, 0, 446, 447, 0, 448, 449, 450, - 451, 452, 453, 454, 0, 455, 1078, 1079, 0, 0, - 458, 459, 796, 461, 797, 1080, 463, 464, 798, 466, - 467, 468, 469, 470, 0, 0, 471, 472, 473, 0, - 474, 475, 476, 477, 0, 478, 479, 480, 481, 482, - 483, 1081, 0, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 0, 0, 494, 0, 0, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, - 508, 509, 510, 511, 512, 513, 514, 515, 0, 0, - 0, 0, 0, 0, 0, 1410, 1411, 0, 0, 0, - 0, 0, 1086, 0, 1087, 0, 0, 0, 0, 1088, - 1089, 0, 1090, 1091, 116, 1042, 815, 1043, 1044, 0, - 1046, 1047, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 1048, 0, 0, 128, 129, 130, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 1049, 140, 1050, 1051, 0, - 143, 144, 145, 146, 147, 148, 1052, 785, 149, 150, - 151, 152, 1053, 1054, 155, 0, 156, 157, 158, 159, - 786, 0, 787, 0, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 1056, 190, 191, 1057, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 1059, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 1060, 221, 222, 223, 224, 225, 788, - 1061, 227, 0, 228, 229, 1062, 231, 0, 232, 0, - 233, 234, 0, 235, 236, 237, 238, 239, 240, 0, - 241, 3036, 1063, 1064, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, -718, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 266, - 267, 268, 269, 270, 271, 272, 1065, 1066, 0, 1067, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 288, 289, 290, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 1068, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 1069, 321, - 1070, 323, 324, 325, 326, 0, 327, 328, 329, 330, - 1072, 790, 332, 1073, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 345, 346, 347, 792, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 793, 363, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 1075, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 426, 427, 428, 1077, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 795, 0, 0, 446, 447, 0, 448, 449, - 450, 451, 452, 453, 454, 0, 455, 1078, 1079, 0, - 0, 458, 459, 796, 461, 797, 1080, 463, 464, 798, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 1081, 0, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 0, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 1071, + 323, 1072, 325, 326, 327, 328, 0, 329, 330, 0, + 332, 1074, 794, 334, 1075, 336, 337, 338, 0, 339, + 340, 0, 0, 1076, 342, 343, 0, 0, 344, 345, + 346, 347, 348, 349, 796, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 797, 365, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 1077, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 403, 404, 405, 406, 1078, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, -2058, 431, 432, 1079, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 799, 0, 0, 450, 451, + 0, 452, 453, 454, 455, 456, 457, 458, 0, 459, + 1080, 1081, 0, 0, 462, 463, 800, 465, 801, 1082, + 467, 468, 802, 470, 471, 3488, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 1083, 0, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, -2058, 0, 0, 0, 0, 0, 0, 1085, + 1086, 1087, 0, 0, 0, 0, 1088, 0, 1089, 0, + 0, 0, 0, 1090, 1091, 0, 1092, 1093, 117, 1044, + 819, 1045, 1046, 0, 1048, 1049, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 1050, 0, 0, 129, 130, 131, + 0, 132, 133, 134, 135, 136, 137, 138, 139, 1051, + 141, 1052, 1053, 0, 144, 145, 146, 147, 148, 149, + 1054, 789, 150, 151, 152, 153, 1055, 1056, 156, 0, + 157, 158, 159, 160, 790, 0, 791, 0, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 1058, 191, 192, + 1059, 194, 0, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 1061, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 1062, 222, 223, + 224, 225, 226, 227, 792, 1063, 229, 0, 230, 231, + 1064, 233, 0, 234, 0, 235, 236, 0, 237, 238, + 239, 240, 241, 242, 0, 243, 0, 1065, 1066, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 268, 269, 270, 271, 272, 273, + 274, 1067, 1068, 0, 1069, 0, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 1071, 323, 1072, 325, 326, 327, 328, + 0, 329, 330, 331, 332, 1074, 794, 334, 1075, 336, + 337, 338, 0, 339, 340, 0, 0, 341, 342, 343, + 0, 0, 344, 345, 346, 347, 348, 349, 796, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 797, 365, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 1077, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, + 404, 405, 406, 2183, 2184, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 430, + 431, 432, 1079, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 799, + 0, 0, 450, 451, 0, 452, 453, 454, 455, 456, + 457, 458, 0, 459, 1080, 1081, 0, 0, 462, 463, + 800, 465, 801, 1082, 467, 468, 802, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 1083, + 0, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 0, 0, 0, 0, + 0, 0, 0, 2185, 2186, 0, 0, 0, 0, 0, + 1088, 0, 1089, 0, 0, 0, 0, 1090, 1091, 0, + 1092, 1093, 117, 1044, 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1086, 0, 2729, 0, 0, 0, 0, - 1088, 1089, 0, 1090, 1091, 116, 1042, 815, 1043, 1044, - 0, 1046, 1047, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, - 123, 124, 0, 125, 126, 127, 0, 0, 0, 0, - 0, 1048, 0, 0, 128, 129, 130, 0, 131, 132, - 133, 134, 135, 136, 137, 138, 1049, 140, 1050, 1051, - 0, 143, 144, 145, 146, 147, 148, 1052, 785, 149, - 150, 151, 152, 1053, 1054, 155, 0, 156, 157, 158, - 159, 786, 0, 787, 0, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 0, 172, 173, 174, 175, - 176, 177, 0, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 1056, 190, 191, 1057, 193, 0, - 194, 0, 195, 196, 197, 198, 199, 200, 0, 0, - 201, 202, 203, 204, 0, 0, 205, 206, 1059, 208, - 209, 0, 210, 211, 212, 0, 213, 214, 215, 0, - 216, 217, 218, 219, 1060, 221, 222, 223, 224, 225, - 788, 1061, 227, 0, 228, 229, 1062, 231, 0, 232, - 0, 233, 234, 0, 235, 236, 237, 238, 239, 240, - 0, 241, 0, 1063, 1064, 244, 245, 0, 246, 247, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 1050, 0, + 0, 129, 130, 131, 0, 132, 133, 134, 135, 136, + 137, 138, 139, 1051, 141, 1052, 1053, 0, 144, 145, + 146, 147, 148, 149, 1054, 789, 150, 151, 152, 153, + 1055, 1056, 156, 0, 157, 158, 159, 160, 790, 0, + 791, 0, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 1058, 191, 192, 1059, 194, 0, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 1061, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 1062, 222, 223, 224, 225, 226, 227, 792, 1063, + 229, 0, 230, 231, 1064, 233, 0, 234, 0, 235, + 236, 0, 237, 238, 239, 240, 241, 242, 0, 243, + 0, 1065, 1066, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 268, 269, + 270, 271, 272, 273, 274, 1067, 1068, 0, 1069, 0, + 278, 0, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 290, 291, 292, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 1070, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 1071, 323, 1072, + 325, 326, 327, 328, 0, 329, 330, 331, 332, 1074, + 794, 334, 1075, 336, 337, 338, 0, 339, 340, 0, + 0, 1076, 342, 343, 0, 0, 344, 345, 346, 347, + 348, 349, 796, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 797, 365, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 1077, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 403, 404, 405, 406, 1078, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 430, 431, 432, 1079, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 799, 0, 0, 450, 451, 0, 452, + 453, 454, 455, 456, 457, 458, 0, 459, 1080, 1081, + 0, 0, 462, 463, 800, 465, 801, 1082, 467, 468, + 802, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 1083, 0, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 0, 0, 0, 0, 0, 0, 0, 1416, 1417, 0, + 0, 0, 0, 0, 1088, 0, 1089, 0, 0, 0, + 0, 1090, 1091, 0, 1092, 1093, 117, 1044, 819, 1045, + 1046, 0, 1048, 1049, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 1050, 0, 0, 129, 130, 131, 0, 132, + 133, 134, 135, 136, 137, 138, 139, 1051, 141, 1052, + 1053, 0, 144, 145, 146, 147, 148, 149, 1054, 789, + 150, 151, 152, 153, 1055, 1056, 156, 0, 157, 158, + 159, 160, 790, 0, 791, 0, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 1058, 191, 192, 1059, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 1061, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 1062, 222, 223, 224, 225, + 226, 227, 792, 1063, 229, 0, 230, 231, 1064, 233, + 0, 234, 0, 235, 236, 0, 237, 238, 239, 240, + 241, 242, 0, 243, 3045, 1065, 1066, 246, 247, 0, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 0, 258, 259, 260, 261, 262, 263, 264, 0, 265, - 266, 267, 268, 269, 270, 271, 272, 1065, 1066, 0, - 1067, 0, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 0, 0, 287, 288, 289, 290, 0, - 291, 292, 293, 294, 295, 296, 297, 298, 1068, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 1069, - 321, 1070, 323, 324, 325, 326, 0, 327, 328, 329, - 330, 1072, 790, 332, 1073, 334, 335, 336, 0, 337, - 338, 0, 0, 339, 340, 341, 0, 0, 342, 343, - 344, 345, 346, 347, 792, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 0, 0, 0, 0, - 360, 361, 793, 363, 364, 365, 366, 367, 368, 369, - 0, 370, 371, 372, 373, 374, 375, 0, 376, 377, - 378, 1075, 380, 381, 382, 383, 0, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 0, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 258, 259, -720, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 1067, + 1068, 0, 1069, 0, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 290, 291, + 292, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 1070, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 1071, 323, 1072, 325, 326, 327, 328, 0, 329, + 330, 331, 332, 1074, 794, 334, 1075, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 346, 347, 348, 349, 796, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 797, 365, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 1077, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 0, 0, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 0, 426, 427, 428, 1077, 430, 0, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, 444, 795, 0, 0, 446, 447, 0, 448, - 449, 450, 451, 452, 453, 454, 0, 455, 1078, 1079, - 0, 0, 458, 459, 796, 461, 797, 1080, 463, 464, - 798, 466, 467, 468, 469, 470, 0, 0, 471, 472, - 473, 0, 474, 475, 476, 477, 0, 478, 479, 480, - 481, 482, 483, 1081, 0, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 0, 0, 494, 0, 0, 495, - 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 430, 431, 432, + 1079, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 799, 0, 0, + 450, 451, 0, 452, 453, 454, 455, 456, 457, 458, + 0, 459, 1080, 1081, 0, 0, 462, 463, 800, 465, + 801, 1082, 467, 468, 802, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 1083, 0, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1088, 0, + 2738, 0, 0, 0, 0, 1090, 1091, 0, 1092, 1093, + 117, 1044, 819, 1045, 1046, 0, 1048, 1049, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 1050, 0, 0, 129, + 130, 131, 0, 132, 133, 134, 135, 136, 137, 138, + 139, 1051, 141, 1052, 1053, 0, 144, 145, 146, 147, + 148, 149, 1054, 789, 150, 151, 152, 153, 1055, 1056, + 156, 0, 157, 158, 159, 160, 790, 0, 791, 0, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 1058, + 191, 192, 1059, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 1061, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 1062, + 222, 223, 224, 225, 226, 227, 792, 1063, 229, 0, + 230, 231, 1064, 233, 0, 234, 0, 235, 236, 0, + 237, 238, 239, 240, 241, 242, 0, 243, 0, 1065, + 1066, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 268, 269, 270, 271, + 272, 273, 274, 1067, 1068, 0, 1069, 0, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 290, 291, 292, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 1070, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 1071, 323, 1072, 325, 326, + 327, 328, 0, 329, 330, 331, 332, 1074, 794, 334, + 1075, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 346, 347, 348, 349, + 796, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 0, 0, 0, 0, 362, 363, 797, 365, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 1077, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 430, 431, 432, 1079, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 799, 0, 0, 450, 451, 0, 452, 453, 454, + 455, 456, 457, 458, 0, 459, 1080, 1081, 0, 0, + 462, 463, 800, 465, 801, 1082, 467, 468, 802, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 1083, 0, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, + 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, + 512, 513, 514, 515, 516, 517, 518, 519, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1086, 0, 2729, 0, 0, 0, - 0, 1088, 1089, 0, 1090, 1091, 116, 1042, 815, 1043, - 1044, 0, 1046, 1047, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 117, 118, 119, 120, 121, - 122, 123, 124, 0, 125, 126, 127, 0, 0, 0, - 0, 0, 1048, 0, 0, 128, 129, 130, 0, 131, - 132, 133, 134, 135, 136, 137, 138, 1049, 140, 1050, - 1051, 0, 143, 144, 145, 146, 147, 148, 1052, 785, - 149, 150, 151, 152, 1053, 1054, 155, 0, 156, 157, - 158, 159, 786, 0, 787, 0, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 0, 172, 173, 174, - 175, 176, 177, 0, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 1056, 190, 191, 1057, 193, - 0, 194, 0, 195, 196, 197, 198, 199, 200, 0, - 0, 201, 202, 203, 204, 0, 0, 205, 206, 1059, - 208, 209, 0, 210, 211, 212, 0, 213, 214, 215, - 0, 216, 217, 218, 219, 1060, 221, 222, 223, 224, - 225, 788, 1061, 227, 0, 228, 229, 1062, 231, 0, - 232, 0, 233, 234, 0, 235, 236, 237, 238, 239, - 240, 0, 241, 0, 1063, 1064, 244, 245, 0, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 0, 258, 259, 260, 261, 262, 263, 264, 0, - 265, 266, 267, 268, 269, 270, 271, 272, 1065, 1066, - 0, 1067, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 0, 0, 287, 288, 289, 290, - 0, 291, 292, 293, 294, 295, 296, 297, 298, 1068, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 0, 0, 1088, 0, 2738, 0, 0, 0, 0, 1090, + 1091, 0, 1092, 1093, 117, 1044, 819, 1045, 1046, 0, + 1048, 1049, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 1050, 0, 0, 129, 130, 131, 0, 132, 133, 134, + 135, 136, 137, 138, 139, 1051, 141, 1052, 1053, 0, + 144, 145, 146, 147, 148, 149, 1054, 789, 150, 151, + 152, 153, 1055, 1056, 156, 0, 157, 158, 159, 160, + 790, 0, 791, 0, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 1058, 191, 192, 1059, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 1061, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 1062, 222, 223, 224, 225, 226, 227, + 792, 1063, 229, 0, 230, 231, 1064, 233, 0, 234, + 0, 235, 236, 0, 237, 238, 239, 240, 241, 242, + 0, 243, 0, 1065, 1066, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 1067, 1068, 0, + 1069, 0, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 290, 291, 292, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 1070, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 1071, + 323, 1072, 325, 326, 327, 328, 0, 329, 330, 331, + 332, 1074, 794, 334, 1075, 336, 337, 338, 0, 339, + 340, 0, 0, 341, 342, 343, 0, 0, 344, 345, + 346, 347, 348, 349, 796, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 797, 365, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 1077, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 403, 404, 405, 406, 1078, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 430, 431, 432, 1079, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 799, 0, 0, 450, 451, + 0, 452, 453, 454, 455, 456, 457, 458, 0, 459, + 1080, 1081, 0, 0, 462, 463, 800, 465, 801, 1082, + 467, 468, 802, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 1083, 0, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1088, 0, 1089, 0, + 0, 0, 0, 1090, 1091, 0, 1092, 1093, 117, 1044, + 819, 1045, 1046, 1047, 1048, 1049, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 1050, 0, 0, 129, 130, 131, + 0, 132, 133, 134, 135, 136, 137, 138, 0, 1051, + 141, 1052, 1053, 0, 144, 145, 146, 147, 148, 149, + 1054, 789, 150, 151, 152, 153, 1055, 1056, 156, 0, + 157, 158, 159, 160, 790, 0, 791, 0, 1057, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 1058, 191, 192, + 1059, 194, 1060, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 1061, 209, 210, 0, 211, 212, 213, 0, 214, + 0, 216, 0, 217, 218, 219, 220, 1062, 222, 223, + 224, 225, 226, 227, 792, 1063, 229, 0, 230, 231, + 1064, 233, 0, 234, 0, 235, 236, 0, 237, 238, + 239, 240, 0, 242, 0, 243, 0, 1065, 1066, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 0, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 268, 269, 270, 271, 272, 273, + 274, 1067, 1068, 0, 1069, 0, 278, 0, 0, 281, + 282, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 290, 291, 0, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 1070, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 1071, 323, 1072, 325, 326, 327, 328, + 0, 329, 330, 0, 332, 1074, 794, 334, 1075, 336, + 337, 338, 0, 339, 340, 0, 0, 1076, 342, 343, + 0, 0, 344, 345, 346, 347, 348, 349, 796, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 797, 365, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 1077, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 403, + 404, 405, 406, 1078, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 0, + 431, 432, 1079, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 799, + 0, 0, 450, 451, 0, 452, 453, 454, 455, 456, + 457, 458, 0, 459, 1080, 1081, 0, 0, 462, 463, + 800, 465, 801, 1082, 467, 468, 802, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 1083, + 0, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 0, 0, 0, 0, + 0, 0, 0, 1085, 1086, 1087, 0, 968, 1345, 819, + 1088, 0, 1089, 1048, 0, 0, 0, 1090, 1091, 0, + 1092, 1093, 0, 0, 0, 0, 118, 119, 120, 121, + 122, 123, 124, 125, 0, 126, 127, 128, 0, 0, + 0, 564, 0, 0, 0, 0, 569, 130, 131, 0, + 132, 133, 134, 571, 136, 137, 138, 572, 573, 574, + 575, 576, 0, 144, 145, 146, 147, 148, 149, 0, + 0, 150, 151, 152, 153, 580, 581, 156, 0, 157, + 158, 159, 160, 583, 0, 585, 0, 587, 164, 165, + 166, 167, 168, 588, 170, 171, 172, 0, 173, 174, + 175, 176, 177, 178, 0, 591, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 593, 191, 192, 594, + 194, 0, 195, 0, 196, 197, 198, 199, 200, 201, + 0, 0, 202, 203, 204, 205, 0, 0, 206, 207, + 208, 209, 210, 0, 211, 212, 213, 0, 214, 215, + 216, 0, 217, 218, 219, 220, 604, 222, 223, 224, + 225, 226, 227, 605, 1346, 229, 0, 230, 231, 608, + 233, 0, 234, 0, 235, 611, 0, 613, 238, 239, + 614, 615, 242, 0, 243, 0, 618, 619, 246, 247, + 0, 248, 249, 250, 251, 252, 253, 254, 621, 256, + 257, 258, 259, 0, 260, 261, 262, 263, 264, 265, + 266, 0, 267, 624, 625, 270, 271, 272, 273, 274, + 626, 627, 0, 629, 0, 278, 631, 632, 281, 633, + 283, 284, 285, 286, 287, 288, 0, 0, 289, 636, + 291, 637, 0, 293, 294, 295, 296, 297, 298, 299, + 300, 639, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 640, 641, 642, 325, 326, 327, 643, 0, + 329, 330, 645, 332, 0, 647, 334, 648, 336, 337, + 338, 0, 339, 340, 1347, 0, 341, 342, 343, 0, + 0, 344, 345, 654, 655, 348, 656, 657, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 0, + 0, 0, 0, 362, 363, 662, 663, 366, 367, 664, + 369, 370, 371, 0, 372, 373, 374, 375, 376, 377, + 0, 378, 379, 380, 381, 382, 667, 384, 385, 386, + 387, 0, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 0, 401, 402, 670, 404, + 405, 406, 671, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 0, 673, 421, 422, + 423, 424, 425, 426, 674, 428, 429, 0, 676, 431, + 432, 677, 434, 0, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 679, 448, 680, 0, + 0, 450, 451, 0, 452, 684, 454, 455, 456, 457, + 458, 0, 459, 686, 687, 0, 0, 462, 463, 690, + 465, 691, 1348, 467, 468, 693, 470, 471, 472, 473, + 474, 0, 0, 475, 476, 477, 0, 478, 479, 480, + 481, 0, 482, 483, 484, 485, 486, 698, 699, 0, + 489, 701, 491, 492, 493, 494, 495, 496, 497, 0, + 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, + 716, 516, 517, 518, 519, 0, 0, 0, 0, 527, + 0, 0, 1349, 1350, 2358, 0, 0, 0, 0, 2359, + 0, 2360, 0, 0, 0, 0, 0, 1091, 118, 119, + 120, 121, 122, 123, 124, 125, 0, 126, 127, 128, + 0, 0, 0, 0, 0, 0, 1003, 0, 0, 130, + 131, 0, 132, 133, 134, 0, 136, 137, 138, 139, + 140, 0, 142, 143, 0, 144, 145, 146, 147, 148, + 149, 0, 0, 150, 151, 152, 153, 154, 155, 156, + 0, 157, 158, 159, 160, 161, 0, 0, 0, 163, + 164, 165, 166, 167, 168, 0, 170, 171, 172, 0, + 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 0, 195, 0, 196, 197, 198, 199, + 200, 201, 0, 0, 202, 203, 204, 205, 0, 0, + 206, 207, 208, 209, 210, 0, 211, 212, 213, 0, + 214, 215, 216, -527, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 0, 229, -527, 230, + 231, 232, 233, -527, 234, 0, 235, 0, 0, 0, + 238, 239, 528, 0, 242, 0, 243, 0, 244, 245, + 246, 247, 0, 248, 249, 250, 251, 252, 253, 254, + 0, 256, 257, 258, 259, 0, 260, 261, 262, 263, + 264, 265, 266, 0, 267, 0, 269, 270, 271, 272, + 273, 274, 275, 276, -527, 277, 0, 278, 0, 0, + 281, 0, 283, 284, 285, 286, 287, 288, 0, 0, + 289, 0, 291, 0, -527, 293, 294, 295, 296, 297, + 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 0, 324, 325, 326, 327, + 328, 0, 329, 330, 0, 332, 0, 333, 334, 335, + 336, 337, 338, -527, 339, 340, 0, 0, 341, 342, + 343, 0, -527, 344, 345, 346, 0, 348, 0, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 0, 0, 0, 0, 362, 363, 364, 0, 366, + 367, 368, 369, 370, 371, 0, 372, 373, 374, 375, + 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 0, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, + 0, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 0, 0, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 0, + 0, 431, 432, 433, 434, 0, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 530, 448, + 449, 0, 0, 450, 451, 0, 452, 0, 454, 455, + 456, 457, 458, 0, 459, 460, 461, 0, 0, 462, + 463, 464, 465, 466, 0, 467, 468, 469, 470, 471, + 472, 473, 474, -527, 0, 475, 476, 477, 0, 478, + 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, + 488, 0, 489, 0, 491, 492, 493, 494, 495, 496, + 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 527, 0, 553, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1161, 0, 118, 119, 120, 121, + 122, 123, 124, 125, 0, 126, 127, 128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 130, 131, 0, + 132, 133, 134, 0, 136, 137, 138, 139, 140, 0, + 142, 143, 0, 144, 145, 146, 147, 148, 149, 0, + 0, 150, 151, 152, 153, 154, 155, 156, 0, 157, + 158, 159, 160, 161, 0, 0, 0, 163, 164, 165, + 166, 167, 168, 0, 170, 171, 172, 0, 173, 174, + 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 0, 195, 0, 196, 197, 198, 199, 200, 201, + 0, 0, 202, 203, 204, 205, 0, 0, 206, 207, + 208, 209, 210, 0, 211, 212, 213, 0, 214, 215, + 216, 0, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 0, 229, 0, 230, 231, 232, + 233, 0, 234, 0, 235, 0, 0, 0, 238, 239, + 528, 0, 242, 0, 243, 0, 244, 245, 246, 247, + 0, 248, 249, 250, 251, 252, 253, 254, 0, 256, + 257, 258, 259, 0, 260, 261, 262, 263, 264, 265, + 266, 0, 267, 0, 269, 270, 271, 272, 273, 274, + 275, 276, 0, 277, 0, 278, 0, 0, 281, 0, + 283, 284, 285, 286, 287, 288, 0, 0, 289, 0, + 291, 0, 0, 293, 294, 295, 296, 297, 298, 299, + 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 1069, 321, 1070, 323, 324, 325, 326, 0, 327, 328, - 329, 330, 1072, 790, 332, 1073, 334, 335, 336, 0, - 337, 338, 0, 0, 339, 340, 341, 0, 0, 342, - 343, 344, 345, 346, 347, 792, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 0, 0, 0, - 0, 360, 361, 793, 363, 364, 365, 366, 367, 368, - 369, 0, 370, 371, 372, 373, 374, 375, 0, 376, - 377, 378, 1075, 380, 381, 382, 383, 0, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 0, 397, 398, 399, 400, 401, 402, 1076, 404, + 320, 321, 322, 0, 324, 325, 326, 327, 328, 0, + 329, 330, 0, 332, 0, 333, 334, 335, 336, 337, + 338, 0, 339, 340, 0, 0, 341, 342, 343, 0, + 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 0, + 0, 0, 0, 362, 363, 364, 0, 366, 367, 368, + 369, 370, 371, 0, 372, 373, 374, 375, 376, 377, + 0, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 0, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 0, 0, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 0, 426, 427, 428, 1077, 430, 0, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 795, 0, 0, 446, 447, 0, - 448, 449, 450, 451, 452, 453, 454, 0, 455, 1078, - 1079, 0, 0, 458, 459, 796, 461, 797, 1080, 463, - 464, 798, 466, 467, 468, 469, 470, 0, 0, 471, - 472, 473, 0, 474, 475, 476, 477, 0, 478, 479, - 480, 481, 482, 483, 1081, 0, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 0, 0, 494, 0, 0, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, + 415, 416, 417, 418, 419, 420, 0, 0, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 0, 0, 431, + 432, 433, 434, 0, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 530, 448, 449, 0, + 0, 450, 451, 0, 452, 0, 454, 455, 456, 457, + 458, 0, 459, 460, 461, 0, 0, 462, 463, 464, + 465, 466, 0, 467, 468, 469, 470, 471, 472, 473, + 474, 0, 0, 475, 476, 477, 0, 478, 479, 480, + 481, 0, 482, 483, 484, 485, 486, 487, 488, 0, + 489, 0, 491, 492, 493, 494, 495, 496, 497, 0, + 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, - 515, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1086, 0, 1087, 0, 0, - 0, 0, 1088, 1089, 0, 1090, 1091, 116, 1042, 815, - 1043, 1044, 1045, 1046, 1047, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 117, 118, 119, 120, - 121, 122, 123, 124, 0, 125, 126, 127, 0, 0, - 0, 0, 0, 1048, 0, 0, 128, 129, 130, 0, - 131, 132, 133, 134, 135, 136, 137, 0, 1049, 140, - 1050, 1051, 0, 143, 144, 145, 146, 147, 148, 1052, - 785, 149, 150, 151, 152, 1053, 1054, 155, 0, 156, - 157, 158, 159, 786, 0, 787, 0, 1055, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 0, 172, 173, - 174, 175, 176, 177, 0, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 1056, 190, 191, 1057, - 193, 1058, 194, 0, 195, 196, 197, 198, 199, 200, - 0, 0, 201, 202, 203, 204, 0, 0, 205, 206, - 1059, 208, 209, 0, 210, 211, 212, 0, 213, 0, - 215, 0, 216, 217, 218, 219, 1060, 221, 222, 223, - 224, 225, 788, 1061, 227, 0, 228, 229, 1062, 231, - 0, 232, 0, 233, 234, 0, 235, 236, 237, 238, - 0, 240, 0, 241, 0, 1063, 1064, 244, 245, 0, - 246, 247, 248, 249, 250, 251, 252, 0, 254, 255, - 256, 257, 0, 258, 259, 260, 261, 262, 263, 264, - 0, 265, 266, 267, 268, 269, 270, 271, 272, 1065, - 1066, 0, 1067, 0, 276, 0, 0, 279, 280, 281, - 282, 283, 284, 285, 286, 0, 0, 287, 288, 289, - 0, 0, 291, 292, 293, 294, 295, 296, 297, 298, - 1068, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 1069, 321, 1070, 323, 324, 325, 326, 0, 327, - 328, 0, 330, 1072, 790, 332, 1073, 334, 335, 336, - 0, 337, 338, 0, 0, 1074, 340, 341, 0, 0, - 342, 343, 344, 345, 346, 347, 792, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 0, 0, - 0, 0, 360, 361, 793, 363, 364, 365, 366, 367, - 368, 369, 0, 370, 371, 372, 373, 374, 375, 0, - 376, 377, 378, 1075, 380, 381, 382, 383, 0, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 0, 397, 398, 399, 400, 401, 402, 1076, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 0, 0, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 0, 0, 427, 428, 1077, 430, - 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 795, 0, 0, 446, 447, - 0, 448, 449, 450, 451, 452, 453, 454, 0, 455, - 1078, 1079, 0, 0, 458, 459, 796, 461, 797, 1080, - 463, 464, 798, 466, 467, 468, 469, 470, 0, 0, - 471, 472, 473, 0, 474, 475, 476, 477, 0, 478, - 479, 480, 481, 482, 483, 1081, 0, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 0, 0, 494, 0, - 0, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, - 514, 515, 0, 0, 0, 0, 0, 0, 0, 1083, - 1084, 1085, 0, 964, 1341, 815, 1086, 0, 1087, 1046, - 0, 0, 0, 1088, 1089, 0, 1090, 1091, 0, 0, - 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, - 0, 125, 126, 127, 0, 0, 0, 560, 0, 0, - 0, 0, 565, 129, 130, 0, 131, 132, 133, 567, - 135, 136, 137, 568, 569, 570, 571, 572, 0, 143, - 144, 145, 146, 147, 148, 0, 0, 149, 150, 151, - 152, 576, 577, 155, 0, 156, 157, 158, 159, 579, - 0, 581, 0, 583, 163, 164, 165, 166, 167, 584, - 169, 170, 171, 0, 172, 173, 174, 175, 176, 177, - 0, 587, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 589, 190, 191, 590, 193, 0, 194, 0, - 195, 196, 197, 198, 199, 200, 0, 0, 201, 202, - 203, 204, 0, 0, 205, 206, 207, 208, 209, 0, - 210, 211, 212, 0, 213, 214, 215, 0, 216, 217, - 218, 219, 600, 221, 222, 223, 224, 225, 601, 1342, - 227, 0, 228, 229, 604, 231, 0, 232, 0, 233, - 607, 0, 609, 236, 237, 610, 611, 240, 0, 241, - 0, 614, 615, 244, 245, 0, 246, 247, 248, 249, - 250, 251, 252, 617, 254, 255, 256, 257, 0, 258, - 259, 260, 261, 262, 263, 264, 0, 265, 620, 621, - 268, 269, 270, 271, 272, 622, 623, 0, 625, 0, - 276, 627, 628, 279, 629, 281, 282, 283, 284, 285, - 286, 0, 0, 287, 632, 289, 633, 0, 291, 292, - 293, 294, 295, 296, 297, 298, 635, 300, 301, 302, + 515, 516, 517, 518, 519, 968, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2445, 3229, 0, 118, 119, 120, 121, 122, 123, + 124, 125, 0, 126, 127, 128, 3, 4, 0, 564, + 0, 0, 0, 0, 569, 130, 131, 0, 132, 133, + 134, 571, 136, 137, 138, 572, 573, 574, 575, 576, + 0, 144, 145, 146, 147, 148, 149, 0, 0, 150, + 151, 152, 153, 580, 581, 156, 0, 157, 158, 159, + 160, 583, 0, 585, 0, 587, 164, 165, 166, 167, + 168, 588, 170, 171, 172, 0, 173, 174, 175, 176, + 177, 178, 0, 591, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 593, 191, 192, 594, 194, 0, + 195, 0, 196, 197, 198, 199, 200, 201, 14, 15, + 202, 203, 204, 205, 0, 0, 206, 207, 208, 209, + 210, 0, 211, 212, 213, 0, 214, 215, 216, 0, + 217, 218, 219, 220, 604, 222, 223, 224, 225, 226, + 227, 605, 0, 229, 0, 230, 231, 608, 233, 0, + 234, 0, 235, 611, 23, 613, 238, 239, 614, 615, + 242, 0, 243, 0, 618, 619, 246, 247, 0, 248, + 249, 250, 251, 252, 253, 254, 621, 256, 257, 258, + 259, 0, 260, 261, 262, 263, 264, 265, 266, 0, + 267, 624, 625, 270, 271, 272, 273, 274, 626, 627, + 0, 629, 0, 278, 631, 632, 281, 633, 283, 284, + 285, 286, 287, 288, 0, 0, 289, 636, 291, 637, + 0, 293, 294, 295, 296, 297, 298, 299, 300, 639, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 640, 641, 642, 325, 326, 327, 643, 0, 329, 330, + 645, 332, 0, 647, 334, 648, 336, 337, 338, 0, + 339, 340, 0, 0, 341, 342, 343, 0, 0, 344, + 345, 654, 655, 348, 656, 657, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 26, 27, 28, + 0, 362, 363, 662, 663, 366, 367, 664, 369, 370, + 371, 0, 372, 373, 374, 375, 376, 377, 0, 378, + 379, 380, 381, 382, 667, 384, 385, 386, 387, 0, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 0, 401, 402, 670, 404, 405, 406, + 671, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 33, 673, 421, 422, 423, 424, + 425, 426, 674, 428, 429, 35, 676, 431, 432, 677, + 434, 0, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 679, 448, 680, 37, 0, 450, + 451, 38, 452, 684, 454, 455, 456, 457, 458, 0, + 459, 686, 687, 0, 0, 462, 463, 690, 465, 691, + 0, 467, 468, 693, 470, 471, 472, 473, 474, 0, + 0, 475, 476, 477, 40, 478, 479, 480, 481, 0, + 482, 483, 484, 485, 486, 969, 699, 0, 489, 701, + 491, 492, 493, 494, 495, 496, 497, 0, 0, 498, + 0, 44, 499, 500, 501, 502, 503, 504, 706, 707, + 708, 709, 710, 711, 712, 713, 714, 715, 716, 516, + 517, 518, 519, 0, 117, 45, 553, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 129, 130, 131, 0, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 0, + 144, 145, 146, 147, 148, 149, 0, 789, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 159, 160, + 790, 0, 791, 0, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 14, 15, 202, + 203, 204, 205, 0, 0, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 792, 0, 229, 0, 230, 231, 232, 233, 0, 234, + 0, 235, 236, 23, 237, 238, 239, 240, 241, 242, + 0, 243, 0, 244, 245, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 277, 0, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 793, 0, 289, 290, 291, 292, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 636, 637, 638, - 323, 324, 325, 639, 0, 327, 328, 641, 330, 0, - 643, 332, 644, 334, 335, 336, 0, 337, 338, 1343, - 0, 339, 340, 341, 0, 0, 342, 343, 650, 651, - 346, 652, 653, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 0, 0, 0, 0, 360, 361, - 658, 659, 364, 365, 660, 367, 368, 369, 0, 370, - 371, 372, 373, 374, 375, 0, 376, 377, 378, 663, - 380, 381, 382, 383, 0, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 0, 397, - 398, 666, 400, 401, 402, 667, 404, 405, 406, 407, - 408, 409, 410, 411, 412, 413, 414, 415, 416, 0, - 669, 417, 418, 419, 420, 421, 422, 670, 424, 425, - 0, 672, 427, 428, 673, 430, 0, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 675, - 444, 676, 0, 0, 446, 447, 0, 448, 680, 450, - 451, 452, 453, 454, 0, 455, 682, 683, 0, 0, - 458, 459, 686, 461, 687, 1344, 463, 464, 689, 466, - 467, 468, 469, 470, 0, 0, 471, 472, 473, 0, - 474, 475, 476, 477, 0, 478, 479, 480, 481, 482, - 694, 695, 0, 485, 697, 487, 488, 489, 490, 491, - 492, 493, 0, 0, 494, 0, 0, 495, 496, 497, - 498, 499, 500, 702, 703, 704, 705, 706, 707, 708, - 709, 710, 711, 712, 512, 513, 514, 515, 0, 0, - 0, 0, 523, 0, 0, 1345, 1346, 2350, 0, 0, - 0, 0, 2351, 0, 2352, 0, 0, 0, 0, 0, - 1089, 117, 118, 119, 120, 121, 122, 123, 124, 0, - 125, 126, 127, 0, 0, 0, 0, 0, 0, 1000, - 0, 0, 129, 130, 0, 131, 132, 133, 0, 135, - 136, 137, 138, 139, 0, 141, 142, 0, 143, 144, - 145, 146, 147, 148, 0, 0, 149, 150, 151, 152, - 153, 154, 155, 0, 156, 157, 158, 159, 160, 0, - 0, 0, 162, 163, 164, 165, 166, 167, 0, 169, - 170, 171, 0, 172, 173, 174, 175, 176, 177, 0, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 0, 329, 330, 331, + 332, 0, 794, 334, 335, 336, 337, 338, 0, 339, + 340, 0, 795, 341, 342, 343, 0, 0, 344, 345, + 346, 347, 348, 349, 796, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 26, 27, 28, 0, + 362, 363, 797, 365, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, + 798, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 33, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 35, 430, 431, 432, 433, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 799, 37, 0, 450, 451, + 38, 452, 453, 454, 455, 456, 457, 458, 0, 459, + 460, 461, 0, 0, 462, 463, 800, 465, 801, 0, + 467, 468, 802, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 40, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 803, 488, 0, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 44, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 0, 117, 45, 553, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 804, 0, + 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, + 0, 126, 127, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 129, 130, 131, 0, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 0, 144, + 145, 146, 147, 148, 149, 0, 789, 150, 151, 152, + 153, 154, 155, 156, 0, 157, 158, 159, 160, 790, + 0, 791, 0, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 0, 194, 0, 195, - 196, 197, 198, 199, 200, 0, 0, 201, 202, 203, - 204, 0, 0, 205, 206, 207, 208, 209, 0, 210, - 211, 212, 0, 213, 214, 215, -525, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 0, 227, - -525, 228, 229, 230, 231, -525, 232, 0, 233, 0, - 0, 0, 236, 237, 524, 0, 240, 0, 241, 0, - 242, 243, 244, 245, 0, 246, 247, 248, 249, 250, - 251, 252, 0, 254, 255, 256, 257, 0, 258, 259, - 260, 261, 262, 263, 264, 0, 265, 0, 267, 268, - 269, 270, 271, 272, 273, 274, -525, 275, 0, 276, - 0, 0, 279, 0, 281, 282, 283, 284, 285, 286, - 0, 0, 287, 0, 289, 0, -525, 291, 292, 293, - 294, 295, 296, 297, 298, 525, 300, 301, 302, 303, + 188, 189, 190, 191, 192, 193, 194, 0, 195, 0, + 196, 197, 198, 199, 200, 201, 0, 0, 202, 203, + 204, 205, 0, 0, 206, 207, 208, 209, 210, 0, + 211, 212, 213, 0, 214, 215, 216, 0, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 792, + 0, 229, 0, 230, 231, 232, 233, 0, 234, 0, + 235, 236, 0, 237, 238, 239, 240, 241, 242, 0, + 243, 0, 244, 245, 246, 247, 0, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 0, + 260, 261, 262, 263, 264, 265, 266, 0, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 0, 277, + 0, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 793, 0, 289, 290, 291, 292, 0, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 0, 322, 323, - 324, 325, 326, 0, 327, 328, 0, 330, 0, 331, - 332, 333, 334, 335, 336, -525, 337, 338, 0, 0, - 339, 340, 341, 0, -525, 342, 343, 344, 0, 346, - 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 0, 0, 0, 0, 360, 361, 362, - 0, 364, 365, 366, 367, 368, 369, 0, 370, 371, - 372, 373, 374, 375, 0, 376, 377, 378, 379, 380, - 381, 382, 383, 0, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 0, 397, 398, - 0, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 0, 0, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 0, - 0, 427, 428, 429, 430, 0, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 526, 444, - 445, 0, 0, 446, 447, 0, 448, 0, 450, 451, - 452, 453, 454, 0, 455, 456, 457, 0, 0, 458, - 459, 460, 461, 462, 0, 463, 464, 465, 466, 467, - 468, 469, 470, -525, 0, 471, 472, 473, 0, 474, - 475, 476, 477, 0, 478, 479, 480, 481, 482, 483, - 484, 0, 485, 0, 487, 488, 489, 490, 491, 492, - 493, 0, 0, 494, 0, 0, 495, 496, 497, 498, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 0, 329, 330, 331, 332, + 0, 794, 334, 335, 336, 337, 338, 0, 339, 340, + 0, 795, 341, 342, 343, 0, 0, 344, 345, 346, + 347, 348, 349, 796, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 0, 0, 0, 0, 362, + 363, 797, 365, 366, 367, 368, 369, 370, 371, 0, + 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 0, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 0, 401, 402, 403, 404, 405, 406, 407, 798, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 0, 0, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 0, 430, 431, 432, 433, 434, 0, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 799, 0, 0, 450, 451, 0, + 452, 453, 454, 455, 456, 457, 458, 0, 459, 460, + 461, 0, 0, 462, 463, 800, 465, 801, 0, 467, + 468, 802, 470, 471, 472, 473, 474, 0, 0, 475, + 476, 477, 0, 478, 479, 480, 481, 0, 482, 483, + 484, 485, 486, 803, 488, 0, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, - 509, 510, 511, 512, 513, 514, 515, 523, 0, 549, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, + 519, 117, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 804, 0, 0, + 118, 119, 120, 121, 122, 123, 124, 125, 0, 126, + 127, 128, 0, 0, 0, 0, 0, 0, 0, 0, + 129, 130, 131, 0, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 0, 144, 145, 146, + 147, 148, 149, 0, 789, 150, 151, 152, 153, 154, + 155, 156, 0, 157, 158, 159, 160, 790, 0, 791, + 0, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 0, 173, 174, 175, 176, 177, 178, 0, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 0, 195, 0, 196, 197, + 198, 199, 200, 201, 0, 0, 202, 203, 204, 205, + 0, 0, 206, 207, 208, 209, 210, 0, 211, 212, + 213, 0, 214, 215, 216, 0, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 792, 0, 229, + 0, 230, 231, 232, 233, 0, 234, 0, 235, 236, + 0, 237, 238, 239, 240, 241, 242, 0, 243, 0, + 244, 245, 246, 247, 0, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 0, 260, 261, + 262, 263, 264, 265, 266, 0, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 0, 277, 0, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 0, 0, 289, 290, 291, 292, 0, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 0, 329, 330, 331, 332, 0, 794, + 334, 335, 336, 337, 338, 0, 339, 340, 0, 0, + 341, 342, 343, 0, 0, 344, 345, 346, 347, 348, + 349, 796, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 0, 0, 0, 0, 362, 363, 797, + 365, 366, 367, 368, 369, 370, 371, 0, 372, 373, + 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 0, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 0, + 401, 402, 403, 404, 405, 406, 407, 798, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 0, 0, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 0, 430, 431, 432, 433, 434, 0, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 799, 0, 0, 450, 451, 0, 452, 453, + 454, 455, 456, 457, 458, 0, 459, 460, 461, 0, + 0, 462, 463, 800, 465, 801, 0, 467, 468, 802, + 470, 471, 472, 473, 474, 0, 0, 475, 476, 477, + 0, 478, 479, 480, 481, 0, 482, 483, 484, 485, + 486, 487, 488, 0, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 0, 0, 498, 0, 0, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1159, 0, 117, 118, 119, 120, - 121, 122, 123, 124, 0, 125, 126, 127, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 129, 130, 0, - 131, 132, 133, 0, 135, 136, 137, 138, 139, 0, - 141, 142, 0, 143, 144, 145, 146, 147, 148, 0, - 0, 149, 150, 151, 152, 153, 154, 155, 0, 156, - 157, 158, 159, 160, 0, 0, 0, 162, 163, 164, - 165, 166, 167, 0, 169, 170, 171, 0, 172, 173, - 174, 175, 176, 177, 0, 0, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 0, 194, 0, 195, 196, 197, 198, 199, 200, - 0, 0, 201, 202, 203, 204, 0, 0, 205, 206, - 207, 208, 209, 0, 210, 211, 212, 0, 213, 214, - 215, 0, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 0, 227, 0, 228, 229, 230, 231, - 0, 232, 0, 233, 0, 0, 0, 236, 237, 524, - 0, 240, 0, 241, 0, 242, 243, 244, 245, 0, - 246, 247, 248, 249, 250, 251, 252, 0, 254, 255, - 256, 257, 0, 258, 259, 260, 261, 262, 263, 264, - 0, 265, 0, 267, 268, 269, 270, 271, 272, 273, - 274, 0, 275, 0, 276, 0, 0, 279, 0, 281, - 282, 283, 284, 285, 286, 0, 0, 287, 0, 289, - 0, 0, 291, 292, 293, 294, 295, 296, 297, 298, - 525, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 0, 322, 323, 324, 325, 326, 0, 327, - 328, 0, 330, 0, 331, 332, 333, 334, 335, 336, - 0, 337, 338, 0, 0, 339, 340, 341, 0, 0, - 342, 343, 344, 0, 346, 0, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 0, 0, - 0, 0, 360, 361, 362, 0, 364, 365, 366, 367, - 368, 369, 0, 370, 371, 372, 373, 374, 375, 0, - 376, 377, 378, 379, 380, 381, 382, 383, 0, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 0, 397, 398, 0, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 0, 0, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 0, 0, 427, 428, 429, 430, - 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 526, 444, 445, 0, 0, 446, 447, - 0, 448, 0, 450, 451, 452, 453, 454, 0, 455, - 456, 457, 0, 0, 458, 459, 460, 461, 462, 0, - 463, 464, 465, 466, 467, 468, 469, 470, 0, 0, - 471, 472, 473, 0, 474, 475, 476, 477, 0, 478, - 479, 480, 481, 482, 483, 484, 0, 485, 0, 487, - 488, 489, 490, 491, 492, 493, 0, 0, 494, 0, - 0, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, - 514, 515, 964, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2439, 3220, - 0, 117, 118, 119, 120, 121, 122, 123, 124, 0, - 125, 126, 127, 3, 4, 0, 560, 0, 0, 0, - 0, 565, 129, 130, 0, 131, 132, 133, 567, 135, - 136, 137, 568, 569, 570, 571, 572, 0, 143, 144, - 145, 146, 147, 148, 0, 0, 149, 150, 151, 152, - 576, 577, 155, 0, 156, 157, 158, 159, 579, 0, - 581, 0, 583, 163, 164, 165, 166, 167, 584, 169, - 170, 171, 0, 172, 173, 174, 175, 176, 177, 0, - 587, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 589, 190, 191, 590, 193, 0, 194, 0, 195, - 196, 197, 198, 199, 200, 14, 15, 201, 202, 203, - 204, 0, 0, 205, 206, 207, 208, 209, 0, 210, - 211, 212, 0, 213, 214, 215, 0, 216, 217, 218, - 219, 600, 221, 222, 223, 224, 225, 601, 0, 227, - 0, 228, 229, 604, 231, 0, 232, 0, 233, 607, - 23, 609, 236, 237, 610, 611, 240, 0, 241, 0, - 614, 615, 244, 245, 0, 246, 247, 248, 249, 250, - 251, 252, 617, 254, 255, 256, 257, 0, 258, 259, - 260, 261, 262, 263, 264, 0, 265, 620, 621, 268, - 269, 270, 271, 272, 622, 623, 0, 625, 0, 276, - 627, 628, 279, 629, 281, 282, 283, 284, 285, 286, - 0, 0, 287, 632, 289, 633, 0, 291, 292, 293, - 294, 295, 296, 297, 298, 635, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 636, 637, 638, 323, - 324, 325, 639, 0, 327, 328, 641, 330, 0, 643, - 332, 644, 334, 335, 336, 0, 337, 338, 0, 0, - 339, 340, 341, 0, 0, 342, 343, 650, 651, 346, - 652, 653, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 27, 28, 29, 0, 360, 361, 658, - 659, 364, 365, 660, 367, 368, 369, 0, 370, 371, - 372, 373, 374, 375, 0, 376, 377, 378, 663, 380, - 381, 382, 383, 0, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 0, 397, 398, - 666, 400, 401, 402, 667, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 34, 669, - 417, 418, 419, 420, 421, 422, 670, 424, 425, 36, - 672, 427, 428, 673, 430, 0, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 675, 444, - 676, 38, 0, 446, 447, 39, 448, 680, 450, 451, - 452, 453, 454, 0, 455, 682, 683, 0, 0, 458, - 459, 686, 461, 687, 0, 463, 464, 689, 466, 467, - 468, 469, 470, 0, 0, 471, 472, 473, 41, 474, - 475, 476, 477, 0, 478, 479, 480, 481, 482, 965, - 695, 0, 485, 697, 487, 488, 489, 490, 491, 492, - 493, 0, 0, 494, 0, 45, 495, 496, 497, 498, - 499, 500, 702, 703, 704, 705, 706, 707, 708, 709, - 710, 711, 712, 512, 513, 514, 515, 0, 116, 46, - 549, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 47, 0, 0, 0, 117, 118, 119, - 120, 121, 122, 123, 124, 0, 125, 126, 127, 0, - 0, 0, 0, 0, 0, 0, 0, 128, 129, 130, - 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 0, 143, 144, 145, 146, 147, 148, - 0, 785, 149, 150, 151, 152, 153, 154, 155, 0, - 156, 157, 158, 159, 786, 0, 787, 0, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 0, 172, - 173, 174, 175, 176, 177, 0, 178, 179, 180, 181, + 0, 0, 0, 0, 0, 46, 0, 0, 118, 119, + 120, 121, 122, 123, 124, 125, 0, 126, 127, 128, + 0, 0, 0, 0, 0, 0, 0, 0, 129, 130, + 131, 0, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 0, 144, 145, 146, 147, 148, + 149, 0, 789, 150, 151, 152, 153, 154, 155, 156, + 0, 157, 158, 159, 160, 790, 0, 791, 0, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 0, + 173, 174, 175, 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 0, 194, 0, 195, 196, 197, 198, 199, - 200, 14, 15, 201, 202, 203, 204, 0, 0, 205, - 206, 207, 208, 209, 0, 210, 211, 212, 0, 213, - 214, 215, 0, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 788, 0, 227, 0, 228, 229, 230, - 231, 0, 232, 0, 233, 234, 23, 235, 236, 237, - 238, 239, 240, 0, 241, 0, 242, 243, 244, 245, - 0, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 0, 258, 259, 260, 261, 262, 263, - 264, 0, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 0, 275, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 789, 0, 287, 288, - 289, 290, 0, 291, 292, 293, 294, 295, 296, 297, + 192, 193, 194, 0, 195, 0, 196, 197, 198, 199, + 200, 201, 0, 0, 202, 203, 204, 205, 0, 0, + 206, 207, 208, 209, 210, 0, 211, 212, 213, 0, + 214, 215, 216, 0, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 792, 0, 229, 0, 230, + 231, 232, 233, 0, 234, 0, 235, 236, 0, 237, + 238, 239, 240, 241, 242, 0, 243, 0, 244, 245, + 246, 247, 0, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 0, 260, 261, 262, 263, + 264, 265, 266, 0, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 0, 277, 0, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 0, 0, + 289, 290, 291, 292, 0, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 0, - 327, 328, 329, 330, 0, 790, 332, 333, 334, 335, - 336, 0, 337, 338, 0, 791, 339, 340, 341, 0, - 0, 342, 343, 344, 345, 346, 347, 792, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 27, - 28, 29, 0, 360, 361, 793, 363, 364, 365, 366, - 367, 368, 369, 0, 370, 371, 372, 373, 374, 375, - 0, 376, 377, 378, 379, 380, 381, 382, 383, 0, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 0, 397, 398, 399, 400, 401, 402, - 403, 794, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 34, 0, 417, 418, 419, 420, - 421, 422, 423, 424, 425, 36, 426, 427, 428, 429, - 430, 0, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 795, 38, 0, 446, - 447, 39, 448, 449, 450, 451, 452, 453, 454, 0, - 455, 456, 457, 0, 0, 458, 459, 796, 461, 797, - 0, 463, 464, 798, 466, 467, 468, 469, 470, 0, - 0, 471, 472, 473, 41, 474, 475, 476, 477, 0, - 478, 479, 480, 481, 482, 799, 484, 0, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 0, 0, 494, - 0, 45, 495, 496, 497, 498, 499, 500, 501, 502, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 0, 329, 330, 331, 332, 0, 794, 334, 335, + 336, 337, 338, 0, 339, 340, 0, 0, 341, 342, + 343, 0, 0, 344, 345, 346, 347, 348, 349, 796, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 0, 0, 0, 0, 362, 363, 797, 365, 366, + 367, 368, 369, 370, 371, 0, 372, 373, 374, 375, + 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 0, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 0, 0, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 0, + 430, 431, 432, 433, 434, 0, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 799, 0, 0, 450, 451, 0, 452, 453, 454, 455, + 456, 457, 458, 0, 459, 460, 461, 0, 0, 462, + 463, 800, 465, 801, 0, 467, 468, 802, 470, 471, + 472, 473, 474, 0, 0, 475, 476, 477, 0, 478, + 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, + 488, 0, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 0, 116, 46, 549, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 800, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 128, 129, 130, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 785, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 786, 0, 787, 0, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 788, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 234, 0, 235, 236, 237, 238, 239, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 789, 0, 287, 288, 289, 290, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 0, 327, 328, 329, 330, - 0, 790, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 791, 339, 340, 341, 0, 0, 342, 343, 344, - 345, 346, 347, 792, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 793, 363, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 399, 400, 401, 402, 403, 794, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 426, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 795, 0, 0, 446, 447, 0, 448, 449, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 796, 461, 797, 0, 463, 464, 798, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 799, 484, 0, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 116, + 513, 514, 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 800, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 128, 129, - 130, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 785, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 786, 0, 787, 0, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 788, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 234, 0, 235, 236, - 237, 238, 239, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 288, 289, 290, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 0, 327, 328, 329, 330, 0, 790, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 345, 346, 347, 792, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 793, 363, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 399, 400, 401, - 402, 403, 794, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 426, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, 444, 795, 0, 0, - 446, 447, 0, 448, 449, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 796, 461, - 797, 0, 463, 464, 798, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 116, 0, 0, 0, 0, 0, + 0, 0, 0, 3317, 0, 0, 118, 119, 120, 121, + 122, 123, 124, 125, 0, 126, 127, 128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 130, 131, 0, + 132, 133, 134, 0, 136, 137, 138, 139, 140, 0, + 142, 143, 0, 144, 145, 146, 147, 148, 149, 0, + 0, 150, 151, 152, 153, 154, 155, 156, 0, 157, + 158, 159, 160, 161, 0, 0, 0, 163, 164, 165, + 166, 167, 168, 0, 170, 171, 172, 0, 173, 174, + 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 0, 195, 0, 196, 197, 198, 199, 200, 201, + 14, 15, 202, 203, 204, 205, 0, 0, 206, 207, + 208, 209, 210, 0, 211, 212, 213, 0, 214, 215, + 216, 0, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 0, 229, 0, 230, 231, 232, + 233, 0, 234, 0, 235, 0, 23, 0, 238, 239, + 528, 0, 242, 0, 243, 0, 244, 245, 246, 247, + 0, 248, 249, 250, 251, 252, 253, 254, 0, 256, + 257, 258, 259, 0, 260, 261, 262, 263, 264, 265, + 266, 0, 267, 0, 269, 270, 271, 272, 273, 274, + 275, 276, 0, 277, 0, 278, 0, 0, 281, 0, + 283, 284, 285, 286, 287, 288, 0, 0, 289, 0, + 291, 0, 0, 293, 294, 295, 296, 297, 298, 299, + 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 0, 324, 325, 326, 327, 328, 0, + 329, 330, 0, 332, 0, 333, 334, 335, 336, 337, + 338, 0, 339, 340, 0, 0, 341, 342, 343, 0, + 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 26, + 27, 28, 0, 362, 363, 364, 0, 366, 367, 368, + 369, 370, 371, 0, 372, 373, 374, 375, 376, 377, + 0, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 0, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 0, 401, 402, 0, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 33, 0, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 35, 0, 431, + 432, 433, 434, 0, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 530, 448, 449, 37, + 0, 450, 451, 38, 452, 0, 454, 455, 456, 457, + 458, 0, 459, 460, 461, 0, 0, 462, 463, 464, + 465, 466, 0, 467, 468, 469, 470, 471, 472, 473, + 474, 0, 0, 475, 476, 477, 40, 478, 479, 480, + 481, 0, 482, 483, 484, 485, 486, 803, 488, 0, + 489, 0, 491, 492, 493, 494, 495, 496, 497, 0, + 0, 498, 0, 44, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, + 515, 516, 517, 518, 519, 527, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 128, 129, 130, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 785, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 786, 0, 787, 0, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 788, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 234, 0, 235, 236, 237, 238, 239, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 288, 289, 290, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 0, 46, 0, 0, 118, 119, 120, 121, 122, 123, + 124, 125, 890, 126, 127, 128, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 130, 131, 0, 132, 133, + 134, 0, 136, 137, 138, 139, 140, 0, 142, 143, + 0, 144, 145, 146, 147, 148, 149, 0, 0, 150, + 151, 152, 153, 154, 155, 156, 0, 157, 158, 159, + 160, 161, 0, 0, 0, 163, 164, 165, 166, 167, + 168, 0, 170, 171, 172, 0, 173, 174, 175, 176, + 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 0, + 195, 0, 196, 197, 198, 199, 200, 201, 0, 0, + 202, 203, 204, 205, 0, 0, 206, 207, 208, 209, + 210, 0, 211, 212, 213, 0, 214, 215, 216, 0, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 0, 229, 0, 230, 231, 232, 233, 0, + 234, 0, 235, 0, 23, 0, 238, 239, 528, 0, + 242, 0, 243, 0, 244, 245, 246, 247, 0, 248, + 249, 250, 251, 252, 253, 254, 0, 256, 257, 258, + 259, 0, 260, 261, 262, 263, 264, 265, 266, 0, + 267, 0, 269, 270, 271, 272, 273, 274, 275, 276, + 0, 277, 0, 278, 0, 0, 281, 0, 283, 284, + 285, 286, 287, 288, 0, 0, 289, 0, 291, 0, + 0, 293, 294, 295, 296, 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 0, 327, 328, 329, 330, - 0, 790, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 345, 346, 347, 792, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 793, 363, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 322, 0, 324, 325, 326, 327, 328, 0, 329, 330, + 0, 332, 0, 333, 334, 335, 336, 337, 338, 0, + 339, 340, 0, 0, 341, 342, 343, 0, 0, 344, + 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 26, 27, 28, + 0, 362, 363, 364, 0, 366, 367, 368, 369, 370, + 371, 0, 372, 373, 374, 375, 376, 377, 0, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 0, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 426, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 795, 0, 0, 446, 447, 0, 448, 449, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 796, 461, 797, 0, 463, 464, 798, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 3308, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, + 417, 418, 419, 420, 33, 0, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 0, 0, 431, 432, 433, + 434, 0, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 530, 448, 449, 0, 0, 450, + 451, 38, 452, 0, 454, 455, 456, 457, 458, 0, + 459, 891, 461, 0, 0, 892, 463, 464, 465, 466, + 0, 467, 468, 469, 470, 471, 472, 473, 474, 0, + 0, 475, 476, 477, 40, 478, 479, 480, 481, 0, + 482, 483, 484, 485, 486, 803, 488, 0, 489, 0, + 491, 492, 493, 494, 495, 496, 497, 0, 0, 498, + 0, 44, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 527, 0, 45, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, + 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, + 0, 126, 127, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 130, 131, 0, 132, 133, 134, 0, + 136, 137, 138, 139, 140, 0, 142, 143, 0, 144, + 145, 146, 147, 148, 149, 0, 0, 150, 151, 152, + 153, 154, 155, 156, 0, 157, 158, 159, 160, 161, + 0, 0, 0, 163, 164, 165, 166, 167, 168, 0, + 170, 171, 172, 0, 173, 174, 175, 176, 177, 178, + 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 0, 195, 0, + 196, 197, 198, 199, 200, 201, 0, 0, 202, 203, + 204, 205, 0, 0, 206, 207, 208, 209, 210, 0, + 211, 212, 213, 0, 214, 215, 216, 0, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 0, 229, 0, 230, 231, 232, 233, 0, 234, 0, + 235, 0, 23, 0, 238, 239, 528, 0, 242, 0, + 243, 0, 244, 245, 246, 247, 0, 248, 249, 250, + 251, 252, 253, 254, 0, 256, 257, 258, 259, 0, + 260, 261, 262, 263, 264, 265, 266, 0, 267, 0, + 269, 270, 271, 272, 273, 274, 275, 276, 0, 277, + 0, 278, 0, 0, 281, 0, 283, 284, 285, 286, + 287, 288, 0, 0, 289, 0, 291, 0, 0, 293, + 294, 295, 296, 297, 298, 299, 300, 529, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 0, + 324, 325, 326, 327, 328, 0, 329, 330, 0, 332, + 0, 333, 334, 335, 336, 337, 338, 0, 339, 340, + 0, 0, 341, 342, 343, 0, 0, 344, 345, 346, + 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 26, 27, 28, 0, 362, + 363, 364, 0, 366, 367, 368, 369, 370, 371, 0, + 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 0, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 0, 401, 402, 0, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 33, 0, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 0, 0, 431, 432, 433, 434, 0, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 530, 448, 449, 0, 0, 450, 451, 38, + 452, 0, 454, 455, 456, 457, 458, 0, 459, 460, + 461, 0, 0, 462, 463, 464, 465, 466, 0, 467, + 468, 469, 470, 471, 472, 473, 474, 0, 0, 475, + 476, 477, 40, 478, 479, 480, 481, 0, 482, 483, + 484, 485, 486, 803, 488, 0, 489, 0, 491, 492, + 493, 494, 495, 496, 497, 0, 0, 498, 0, 44, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, + 519, 0, 527, 45, 553, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 130, 131, 0, 132, 133, 134, 0, 136, + 137, 138, 139, 140, 0, 142, 143, 0, 144, 145, + 146, 147, 148, 149, 0, 0, 150, 151, 152, 153, + 154, 155, 156, 0, 157, 158, 159, 160, 161, 0, + 0, 0, 163, 164, 165, 166, 167, 168, 0, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 0, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 208, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 0, + 229, 0, 230, 231, 232, 233, 0, 234, 0, 235, + 0, 0, 0, 238, 239, 528, 0, 242, 0, 243, + 0, 244, 245, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 0, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 277, 0, + 278, 0, 0, 281, 0, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 0, 291, 0, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 529, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 0, 324, + 325, 326, 327, 328, 0, 329, 330, 0, 332, 0, + 333, 334, 335, 336, 337, 338, 0, 339, 340, 0, + 0, 341, 342, 343, 0, 0, 344, 345, 346, 0, + 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 364, 0, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 0, 431, 432, 433, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 530, 448, 449, 0, 0, 450, 451, 0, 452, + 0, 454, 455, 456, 457, 458, 0, 459, 460, 461, + 0, 0, 462, 463, 464, 465, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 488, 0, 489, 0, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 988, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 130, 131, 0, 132, 133, 134, 0, 136, 137, 138, + 139, 140, 0, 142, 143, 0, 144, 145, 146, 147, + 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, + 156, 0, 157, 158, 159, 160, 161, 0, 0, 0, + 163, 164, 165, 166, 167, 168, 0, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 14, 15, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 23, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, + 191, 192, 193, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 208, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 0, 229, 0, + 230, 231, 232, 233, 0, 234, 0, 235, 0, 0, + 0, 238, 239, 528, 0, 242, 0, 243, 0, 244, + 245, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 0, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 277, 0, 278, 0, + 0, 281, 0, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 0, 291, 0, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, + 317, 318, 319, 320, 321, 322, 0, 324, 325, 326, + 327, 328, 0, 329, 330, 0, 332, 0, 333, 334, + 335, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 27, 28, 29, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 34, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 36, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 38, 0, - 446, 447, 39, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 41, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 799, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 45, 495, 496, 497, 498, 499, 500, 501, + 360, 361, 0, 0, 0, 0, 362, 363, 364, 0, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 0, 431, 432, 433, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 530, + 448, 449, 0, 0, 450, 451, 0, 452, 0, 454, + 455, 456, 457, 458, 0, 459, 460, 461, 0, 0, + 462, 463, 464, 465, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 488, 0, 489, 0, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 46, 0, 0, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 527, 0, + 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1468, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 130, 131, + 0, 132, 133, 134, 0, 136, 137, 138, 139, 140, + 0, 142, 143, 0, 144, 145, 146, 147, 148, 149, + 0, 0, 150, 151, 152, 153, 154, 155, 156, 0, + 157, 158, 159, 160, 161, 0, 0, 0, 163, 164, + 165, 166, 167, 168, 0, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 0, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 208, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 0, 229, 0, 230, 231, + 232, 233, 0, 234, 0, 235, 0, 0, 0, 238, + 239, 528, 0, 242, 0, 243, 0, 244, 245, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 0, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 277, 0, 278, 0, 0, 281, + 0, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 0, 291, 0, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 0, 324, 325, 326, 327, 328, + 0, 329, 330, 0, 332, 0, 333, 334, 335, 336, + 337, 338, 0, 339, 340, 0, 0, 341, 342, 343, + 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 364, 0, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 0, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 0, + 431, 432, 433, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 530, 448, 449, + 0, 0, 450, 451, 0, 452, 0, 454, 455, 456, + 457, 458, 0, 459, 460, 461, 0, 0, 462, 463, + 464, 465, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, + 0, 489, 0, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 886, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 23, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 27, 28, 29, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 34, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 39, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 887, 457, 0, - 0, 888, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 41, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 799, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 45, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 47, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, + 0, 0, 2209, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 131, 0, 132, + 133, 134, 0, 136, 137, 138, 139, 140, 0, 142, + 143, 0, 144, 145, 146, 147, 148, 149, 0, 0, + 150, 151, 152, 153, 154, 155, 156, 0, 157, 158, + 159, 160, 161, 0, 0, 0, 163, 164, 165, 166, + 167, 168, 0, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 208, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 0, 229, 0, 230, 231, 232, 233, + 0, 234, 0, 235, 0, 0, 0, 238, 239, 528, + 0, 242, 0, 243, 0, 244, 245, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 0, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 277, 0, 278, 0, 0, 281, 0, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 0, 291, + 0, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 324, 325, 326, 327, 328, 0, 329, + 330, 0, 332, 0, 333, 334, 335, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 364, 0, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 0, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 0, 431, 432, + 433, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 530, 448, 449, 0, 0, + 450, 451, 0, 452, 0, 454, 455, 456, 457, 458, + 0, 459, 460, 461, 0, 0, 462, 463, 464, 465, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 488, 0, 489, + 0, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2445, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 130, 131, 0, 132, 133, 134, + 0, 136, 137, 138, 139, 140, 0, 142, 143, 0, + 144, 145, 146, 147, 148, 149, 0, 0, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 159, 160, + 161, 0, 0, 0, 163, 164, 165, 166, 167, 168, + 0, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 0, 229, 0, 230, 231, 232, 233, 0, 234, + 0, 235, 0, 0, 0, 238, 239, 528, 0, 242, + 0, 243, 0, 244, 245, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 0, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 277, 0, 278, 0, 0, 281, 0, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 0, 291, 0, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 529, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 0, 324, 325, 326, 327, 328, 0, 329, 330, 0, + 332, 0, 333, 334, 335, 336, 337, 338, 0, 339, + 340, 0, 0, 341, 342, 343, 0, 0, 344, 345, + 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 364, 0, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 0, 431, 432, 433, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 530, 448, 449, 0, 0, 450, 451, + 0, 452, 0, 454, 455, 456, 457, 458, 0, 459, + 460, 461, 0, 0, 462, 463, 464, 465, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 488, 0, 489, 0, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2579, 0, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 130, 131, 0, 132, 133, 134, 0, 136, + 137, 138, 139, 140, 0, 142, 143, 0, 144, 145, + 146, 147, 148, 149, 0, 0, 150, 151, 152, 153, + 154, 155, 156, 0, 157, 158, 159, 160, 161, 0, + 0, 0, 163, 164, 165, 166, 167, 168, 0, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 0, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 208, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 0, + 229, 0, 230, 231, 232, 233, 0, 234, 0, 235, + 0, 0, 0, 238, 239, 528, 0, 242, 0, 243, + 0, 244, 245, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 0, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 277, 0, + 278, 0, 0, 281, 0, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 0, 291, 0, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 529, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 0, 324, + 325, 326, 327, 328, 0, 329, 330, 0, 332, 0, + 333, 334, 335, 336, 337, 338, 0, 339, 340, 0, + 0, 341, 342, 343, 0, 0, 344, 345, 346, 0, + 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 364, 0, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 0, 431, 432, 433, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 530, 448, 449, 0, 0, 450, 451, 0, 452, + 0, 454, 455, 456, 457, 458, 0, 459, 460, 461, + 0, 0, 462, 463, 464, 465, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 488, 0, 489, 0, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3224, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 130, 131, 0, 132, 133, 134, 0, 136, 137, 138, + 139, 140, 0, 142, 143, 0, 144, 145, 146, 147, + 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, + 156, 0, 157, 158, 159, 160, 161, 0, 0, 0, + 163, 164, 165, 166, 167, 168, 0, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 23, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, + 191, 192, 193, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 208, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 0, 229, 0, + 230, 231, 232, 233, 0, 234, 0, 235, 0, 0, + 0, 238, 239, 528, 0, 242, 0, 243, 0, 244, + 245, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 0, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 277, 0, 278, 0, + 0, 281, 0, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 0, 291, 0, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, + 317, 318, 319, 320, 321, 322, 0, 324, 325, 326, + 327, 328, 0, 329, 330, 0, 332, 0, 333, 334, + 335, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 27, 28, 29, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 34, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 39, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 41, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 799, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 45, 495, 496, 497, 498, 499, 500, 501, + 360, 361, 0, 0, 0, 0, 362, 363, 364, 0, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 0, 431, 432, 433, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 530, + 448, 449, 0, 0, 450, 451, 0, 452, 0, 454, + 455, 456, 457, 458, 0, 459, 460, 461, 0, 0, + 462, 463, 464, 465, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 488, 0, 489, 0, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 0, 523, 46, 549, 0, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 0, 0, 0, 117, 118, 119, 120, 121, 122, - 123, 124, 0, 125, 126, 127, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 129, 130, 0, 131, 132, - 133, 0, 135, 136, 137, 138, 139, 0, 141, 142, - 0, 143, 144, 145, 146, 147, 148, 0, 0, 149, - 150, 151, 152, 153, 154, 155, 0, 156, 157, 158, - 159, 160, 0, 0, 0, 162, 163, 164, 165, 166, - 167, 0, 169, 170, 171, 0, 172, 173, 174, 175, - 176, 177, 0, 0, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 0, - 194, 0, 195, 196, 197, 198, 199, 200, 0, 0, - 201, 202, 203, 204, 0, 0, 205, 206, 207, 208, - 209, 0, 210, 211, 212, 0, 213, 214, 215, 0, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 0, 227, 0, 228, 229, 230, 231, 0, 232, - 0, 233, 0, 0, 0, 236, 237, 524, 0, 240, - 0, 241, 0, 242, 243, 244, 245, 0, 246, 247, - 248, 249, 250, 251, 252, 0, 254, 255, 256, 257, - 0, 258, 259, 260, 261, 262, 263, 264, 0, 265, - 0, 267, 268, 269, 270, 271, 272, 273, 274, 0, - 275, 0, 276, 0, 0, 279, 0, 281, 282, 283, - 284, 285, 286, 0, 0, 287, 0, 289, 0, 0, - 291, 292, 293, 294, 295, 296, 297, 298, 525, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 0, 322, 323, 324, 325, 326, 0, 327, 328, 0, - 330, 0, 331, 332, 333, 334, 335, 336, 0, 337, - 338, 0, 0, 339, 340, 341, 0, 0, 342, 343, - 344, 0, 346, 0, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 0, 0, 0, 0, - 360, 361, 362, 0, 364, 365, 366, 367, 368, 369, - 0, 370, 371, 372, 373, 374, 375, 0, 376, 377, - 378, 379, 380, 381, 382, 383, 0, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 0, 397, 398, 0, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 0, 0, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 0, 0, 427, 428, 429, 430, 0, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 526, 444, 445, 0, 0, 446, 447, 0, 448, - 0, 450, 451, 452, 453, 454, 0, 455, 456, 457, - 0, 0, 458, 459, 460, 461, 462, 0, 463, 464, - 465, 466, 467, 468, 469, 470, 0, 0, 471, 472, - 473, 0, 474, 475, 476, 477, 0, 478, 479, 480, - 481, 482, 483, 484, 0, 485, 0, 487, 488, 489, - 490, 491, 492, 493, 0, 0, 494, 0, 0, 495, - 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, - 523, 0, 549, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 985, 0, 0, 117, - 118, 119, 120, 121, 122, 123, 124, 0, 125, 126, - 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 129, 130, 0, 131, 132, 133, 0, 135, 136, 137, - 138, 139, 0, 141, 142, 0, 143, 144, 145, 146, - 147, 148, 0, 0, 149, 150, 151, 152, 153, 154, - 155, 0, 156, 157, 158, 159, 160, 0, 0, 0, - 162, 163, 164, 165, 166, 167, 0, 169, 170, 171, - 0, 172, 173, 174, 175, 176, 177, 0, 0, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 0, 194, 0, 195, 196, 197, - 198, 199, 200, 0, 0, 201, 202, 203, 204, 0, - 0, 205, 206, 207, 208, 209, 0, 210, 211, 212, - 0, 213, 214, 215, 0, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 0, 227, 0, 228, - 229, 230, 231, 0, 232, 0, 233, 0, 0, 0, - 236, 237, 524, 0, 240, 0, 241, 0, 242, 243, - 244, 245, 0, 246, 247, 248, 249, 250, 251, 252, - 0, 254, 255, 256, 257, 0, 258, 259, 260, 261, - 262, 263, 264, 0, 265, 0, 267, 268, 269, 270, - 271, 272, 273, 274, 0, 275, 0, 276, 0, 0, - 279, 0, 281, 282, 283, 284, 285, 286, 0, 0, - 287, 0, 289, 0, 0, 291, 292, 293, 294, 295, - 296, 297, 298, 525, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 0, 322, 323, 324, 325, - 326, 0, 327, 328, 0, 330, 0, 331, 332, 333, - 334, 335, 336, 0, 337, 338, 0, 0, 339, 340, - 341, 0, 0, 342, 343, 344, 0, 346, 0, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 0, 0, 0, 0, 360, 361, 362, 0, 364, - 365, 366, 367, 368, 369, 0, 370, 371, 372, 373, - 374, 375, 0, 376, 377, 378, 379, 380, 381, 382, - 383, 0, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 0, 397, 398, 0, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 0, 0, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 0, 0, 427, - 428, 429, 430, 0, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 526, 444, 445, 0, - 0, 446, 447, 0, 448, 0, 450, 451, 452, 453, - 454, 0, 455, 456, 457, 0, 0, 458, 459, 460, - 461, 462, 0, 463, 464, 465, 466, 467, 468, 469, - 470, 0, 0, 471, 472, 473, 0, 474, 475, 476, - 477, 0, 478, 479, 480, 481, 482, 483, 484, 0, - 485, 0, 487, 488, 489, 490, 491, 492, 493, 0, - 0, 494, 0, 0, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 523, 0, 549, 0, 0, + 0, 0, 0, 0, 2062, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 130, 131, + 0, 132, 133, 134, 0, 136, 137, 138, 139, 140, + 0, 142, 143, 0, 144, 145, 146, 147, 148, 149, + 0, 0, 150, 151, 152, 153, 154, 155, 156, 0, + 157, 158, 159, 160, 161, 0, 0, 0, 163, 164, + 165, 166, 167, 168, 0, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 0, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 208, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 0, 229, 0, 230, 231, + 232, 233, 0, 234, 0, 235, 0, 0, 0, 238, + 239, 528, 0, 242, 0, 243, 0, 244, 245, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 0, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 277, 0, 278, 0, 0, 281, + 0, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 0, 291, 0, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 0, 324, 325, 326, 327, 328, + 0, 329, 330, 0, 332, 0, 333, 334, 335, 336, + 337, 338, 0, 339, 340, 0, 0, 341, 342, 343, + 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 364, 0, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 0, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 0, + 431, 432, 433, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 530, 448, 449, + 0, 0, 450, 451, 0, 452, 0, 454, 455, 456, + 457, 458, 0, 459, 460, 461, 0, 0, 462, 463, + 464, 465, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, + 0, 489, 0, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1464, 0, 0, 117, 118, 119, 120, 121, 122, - 123, 124, 0, 125, 126, 127, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 129, 130, 0, 131, 132, - 133, 0, 135, 136, 137, 138, 139, 0, 141, 142, - 0, 143, 144, 145, 146, 147, 148, 0, 0, 149, - 150, 151, 152, 153, 154, 155, 0, 156, 157, 158, - 159, 160, 0, 0, 0, 162, 163, 164, 165, 166, - 167, 0, 169, 170, 171, 0, 172, 173, 174, 175, - 176, 177, 0, 0, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 0, - 194, 0, 195, 196, 197, 198, 199, 200, 0, 0, - 201, 202, 203, 204, 0, 0, 205, 206, 207, 208, - 209, 0, 210, 211, 212, 0, 213, 214, 215, 0, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 0, 227, 0, 228, 229, 230, 231, 0, 232, - 0, 233, 0, 0, 0, 236, 237, 524, 0, 240, - 0, 241, 0, 242, 243, 244, 245, 0, 246, 247, - 248, 249, 250, 251, 252, 0, 254, 255, 256, 257, - 0, 258, 259, 260, 261, 262, 263, 264, 0, 265, - 0, 267, 268, 269, 270, 271, 272, 273, 274, 0, - 275, 0, 276, 0, 0, 279, 0, 281, 282, 283, - 284, 285, 286, 0, 0, 287, 0, 289, 0, 0, - 291, 292, 293, 294, 295, 296, 297, 298, 525, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 0, 0, 2165, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 131, 0, 132, + 133, 134, 0, 136, 137, 138, 139, 140, 0, 142, + 143, 0, 144, 145, 146, 147, 148, 149, 0, 0, + 150, 151, 152, 153, 154, 155, 156, 0, 157, 158, + 159, 160, 161, 0, 0, 0, 163, 164, 165, 166, + 167, 168, 0, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 208, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 0, 229, 0, 230, 231, 232, 233, + 0, 234, 0, 235, 0, 0, 0, 238, 239, 528, + 0, 242, 0, 243, 0, 244, 245, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 0, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 277, 0, 278, 0, 0, 281, 0, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 0, 291, + 0, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 0, 322, 323, 324, 325, 326, 0, 327, 328, 0, - 330, 0, 331, 332, 333, 334, 335, 336, 0, 337, - 338, 0, 0, 339, 340, 341, 0, 0, 342, 343, - 344, 0, 346, 0, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 0, 0, 0, 0, - 360, 361, 362, 0, 364, 365, 366, 367, 368, 369, - 0, 370, 371, 372, 373, 374, 375, 0, 376, 377, - 378, 379, 380, 381, 382, 383, 0, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 0, 397, 398, 0, 400, 401, 402, 403, 404, 405, + 321, 322, 0, 324, 325, 326, 327, 328, 0, 329, + 330, 0, 332, 0, 333, 334, 335, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 364, 0, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 0, 0, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 0, 0, 427, 428, 429, 430, 0, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 526, 444, 445, 0, 0, 446, 447, 0, 448, - 0, 450, 451, 452, 453, 454, 0, 455, 456, 457, - 0, 0, 458, 459, 460, 461, 462, 0, 463, 464, - 465, 466, 467, 468, 469, 470, 0, 0, 471, 472, - 473, 0, 474, 475, 476, 477, 0, 478, 479, 480, - 481, 482, 483, 484, 0, 485, 0, 487, 488, 489, - 490, 491, 492, 493, 0, 0, 494, 0, 0, 495, - 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 0, 431, 432, + 433, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 530, 448, 449, 0, 0, + 450, 451, 0, 452, 0, 454, 455, 456, 457, 458, + 0, 459, 460, 461, 0, 0, 462, 463, 464, 465, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 488, 0, 489, + 0, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, - 523, 0, 549, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2201, 0, 0, 117, - 118, 119, 120, 121, 122, 123, 124, 0, 125, 126, - 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 129, 130, 0, 131, 132, 133, 0, 135, 136, 137, - 138, 139, 0, 141, 142, 0, 143, 144, 145, 146, - 147, 148, 0, 0, 149, 150, 151, 152, 153, 154, - 155, 0, 156, 157, 158, 159, 160, 0, 0, 0, - 162, 163, 164, 165, 166, 167, 0, 169, 170, 171, - 0, 172, 173, 174, 175, 176, 177, 0, 0, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 0, 194, 0, 195, 196, 197, - 198, 199, 200, 0, 0, 201, 202, 203, 204, 0, - 0, 205, 206, 207, 208, 209, 0, 210, 211, 212, - 0, 213, 214, 215, 0, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 0, 227, 0, 228, - 229, 230, 231, 0, 232, 0, 233, 0, 0, 0, - 236, 237, 524, 0, 240, 0, 241, 0, 242, 243, - 244, 245, 0, 246, 247, 248, 249, 250, 251, 252, - 0, 254, 255, 256, 257, 0, 258, 259, 260, 261, - 262, 263, 264, 0, 265, 0, 267, 268, 269, 270, - 271, 272, 273, 274, 0, 275, 0, 276, 0, 0, - 279, 0, 281, 282, 283, 284, 285, 286, 0, 0, - 287, 0, 289, 0, 0, 291, 292, 293, 294, 295, - 296, 297, 298, 525, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 0, 322, 323, 324, 325, - 326, 0, 327, 328, 0, 330, 0, 331, 332, 333, - 334, 335, 336, 0, 337, 338, 0, 0, 339, 340, - 341, 0, 0, 342, 343, 344, 0, 346, 0, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 0, 0, 0, 0, 360, 361, 362, 0, 364, - 365, 366, 367, 368, 369, 0, 370, 371, 372, 373, - 374, 375, 0, 376, 377, 378, 379, 380, 381, 382, - 383, 0, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 0, 397, 398, 0, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 0, 0, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 0, 0, 427, - 428, 429, 430, 0, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 526, 444, 445, 0, - 0, 446, 447, 0, 448, 0, 450, 451, 452, 453, - 454, 0, 455, 456, 457, 0, 0, 458, 459, 460, - 461, 462, 0, 463, 464, 465, 466, 467, 468, 469, - 470, 0, 0, 471, 472, 473, 0, 474, 475, 476, - 477, 0, 478, 479, 480, 481, 482, 483, 484, 0, - 485, 0, 487, 488, 489, 490, 491, 492, 493, 0, - 0, 494, 0, 0, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 523, 0, 549, 0, 0, + 516, 517, 518, 519, 0, 2904, 1345, 819, 0, 0, + 2038, 1048, 0, 0, 0, 0, 0, 2039, 2040, 0, + 3085, 2041, 2042, 2043, 118, 119, 120, 121, 122, 123, + 124, 125, 560, 126, 127, 128, 561, 562, 563, 2905, + 565, 566, 567, 568, 2906, 130, 131, 570, 132, 133, + 134, 2907, 136, 137, 138, 0, 1481, 2908, 1483, 1484, + 577, 144, 145, 146, 147, 148, 149, 578, 579, 150, + 151, 152, 153, 1485, 1486, 156, 582, 157, 158, 159, + 160, 0, 584, 2909, 586, 2910, 164, 165, 166, 167, + 168, 2911, 170, 171, 172, 589, 173, 174, 175, 176, + 177, 178, 590, 2912, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 1491, 191, 192, 1492, 194, 595, + 195, 596, 196, 197, 198, 199, 200, 201, 597, 598, + 202, 203, 204, 205, 599, 600, 206, 207, 1061, 209, + 210, 601, 211, 212, 213, 602, 214, 215, 216, 603, + 217, 218, 219, 220, 0, 222, 223, 224, 225, 226, + 227, 0, 606, 229, 607, 230, 231, 1493, 233, 609, + 234, 610, 235, 2913, 612, 2914, 238, 239, 2915, 2916, + 242, 616, 243, 617, 0, 0, 246, 247, 620, 248, + 249, 250, 251, 252, 253, 254, 2917, 256, 257, 258, + 259, 622, 260, 261, 262, 263, 264, 265, 266, 623, + 267, 2918, 0, 270, 271, 272, 273, 274, 1499, 1500, + 628, 1501, 630, 278, 2919, 2920, 281, 2921, 283, 284, + 285, 286, 287, 288, 634, 635, 289, 2922, 291, 2923, + 638, 293, 294, 295, 296, 297, 298, 299, 300, 2924, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 1508, 2925, 1510, 325, 326, 327, 2926, 644, 329, 330, + 2927, 332, 646, 0, 334, 1512, 336, 337, 338, 649, + 339, 340, 650, 651, 2928, 342, 343, 652, 653, 344, + 345, 0, 2929, 348, 2930, 0, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 658, 659, 660, + 661, 362, 363, 0, 2931, 366, 367, 0, 369, 370, + 371, 665, 372, 373, 374, 375, 376, 377, 666, 378, + 379, 380, 381, 382, 1516, 384, 385, 386, 387, 668, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 669, 401, 402, 2932, 404, 405, 406, + 1518, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 672, 2933, 421, 422, 423, 424, + 425, 426, 2934, 428, 429, 675, 2935, 431, 432, 1522, + 434, 678, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 2936, 448, 0, 681, 682, 450, + 451, 683, 452, 2937, 454, 455, 456, 457, 458, 685, + 459, 1525, 1526, 688, 689, 462, 463, 0, 465, 0, + 692, 467, 468, 2938, 470, 471, 472, 473, 474, 2939, + 695, 475, 476, 477, 696, 478, 479, 480, 481, 697, + 482, 483, 484, 485, 486, 0, 1529, 700, 489, 2940, + 491, 492, 493, 494, 495, 496, 497, 702, 703, 498, + 704, 705, 499, 500, 501, 502, 503, 504, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 516, + 517, 518, 519, 0, 527, 0, 2044, 2045, 2046, 2038, + 2941, 2942, 2049, 2050, 2051, 2052, 2039, 2040, 0, 0, + 2041, 2042, 2043, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 130, 131, 0, 132, 133, 134, + 0, 136, 137, 138, 139, 140, 0, 142, 143, 0, + 144, 145, 146, 147, 148, 149, 0, 0, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 159, 160, + 161, 0, 0, 0, 163, 164, 165, 166, 167, 168, + 0, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 0, 229, 0, 230, 231, 232, 233, 0, 234, + 0, 235, 0, 0, 0, 238, 239, 528, 0, 242, + 0, 243, 0, 244, 245, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 0, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 277, 0, 278, 0, 0, 281, 0, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 0, 291, 0, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 529, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 0, 324, 325, 326, 327, 328, 0, 329, 330, 0, + 332, 0, 333, 334, 335, 336, 337, 338, 0, 339, + 340, 0, 0, 341, 342, 343, 0, 0, 344, 345, + 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 364, 0, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 0, 431, 432, 433, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 530, 448, 449, 0, 0, 450, 451, + 0, 452, 0, 454, 455, 456, 457, 458, 0, 459, + 460, 461, 0, 0, 462, 463, 464, 465, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 488, 0, 489, 0, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 0, 0, 0, 2044, 2045, 2046, 0, 2047, + 2048, 2049, 2050, 2051, 2052, 1612, 0, 0, 1613, 0, + 0, 0, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2439, 0, 0, 117, 118, 119, 120, 121, 122, - 123, 124, 0, 125, 126, 127, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 129, 130, 0, 131, 132, - 133, 0, 135, 136, 137, 138, 139, 0, 141, 142, - 0, 143, 144, 145, 146, 147, 148, 0, 0, 149, - 150, 151, 152, 153, 154, 155, 0, 156, 157, 158, - 159, 160, 0, 0, 0, 162, 163, 164, 165, 166, - 167, 0, 169, 170, 171, 0, 172, 173, 174, 175, - 176, 177, 0, 0, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 0, - 194, 0, 195, 196, 197, 198, 199, 200, 0, 0, - 201, 202, 203, 204, 0, 0, 205, 206, 207, 208, - 209, 0, 210, 211, 212, 0, 213, 214, 215, 0, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 0, 227, 0, 228, 229, 230, 231, 0, 232, - 0, 233, 0, 0, 0, 236, 237, 524, 0, 240, - 0, 241, 0, 242, 243, 244, 245, 0, 246, 247, - 248, 249, 250, 251, 252, 0, 254, 255, 256, 257, - 0, 258, 259, 260, 261, 262, 263, 264, 0, 265, - 0, 267, 268, 269, 270, 271, 272, 273, 274, 0, - 275, 0, 276, 0, 0, 279, 0, 281, 282, 283, - 284, 285, 286, 0, 0, 287, 0, 289, 0, 0, - 291, 292, 293, 294, 295, 296, 297, 298, 525, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 0, 322, 323, 324, 325, 326, 0, 327, 328, 0, - 330, 0, 331, 332, 333, 334, 335, 336, 0, 337, - 338, 0, 0, 339, 340, 341, 0, 0, 342, 343, - 344, 0, 346, 0, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 0, 0, 0, 0, - 360, 361, 362, 0, 364, 365, 366, 367, 368, 369, - 0, 370, 371, 372, 373, 374, 375, 0, 376, 377, - 378, 379, 380, 381, 382, 383, 0, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 0, 397, 398, 0, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 0, 0, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 0, 0, 427, 428, 429, 430, 0, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 526, 444, 445, 0, 0, 446, 447, 0, 448, - 0, 450, 451, 452, 453, 454, 0, 455, 456, 457, - 0, 0, 458, 459, 460, 461, 462, 0, 463, 464, - 465, 466, 467, 468, 469, 470, 0, 0, 471, 472, - 473, 0, 474, 475, 476, 477, 0, 478, 479, 480, - 481, 482, 483, 484, 0, 485, 0, 487, 488, 489, - 490, 491, 492, 493, 0, 0, 494, 0, 0, 495, - 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, - 523, 0, 549, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2570, 0, 0, 117, - 118, 119, 120, 121, 122, 123, 124, 0, 125, 126, - 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 129, 130, 0, 131, 132, 133, 0, 135, 136, 137, - 138, 139, 0, 141, 142, 0, 143, 144, 145, 146, - 147, 148, 0, 0, 149, 150, 151, 152, 153, 154, - 155, 0, 156, 157, 158, 159, 160, 0, 0, 0, - 162, 163, 164, 165, 166, 167, 0, 169, 170, 171, - 0, 172, 173, 174, 175, 176, 177, 0, 0, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 0, 194, 0, 195, 196, 197, - 198, 199, 200, 0, 0, 201, 202, 203, 204, 0, - 0, 205, 206, 207, 208, 209, 0, 210, 211, 212, - 0, 213, 214, 215, 0, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 0, 227, 0, 228, - 229, 230, 231, 0, 232, 0, 233, 0, 0, 0, - 236, 237, 524, 0, 240, 0, 241, 0, 242, 243, - 244, 245, 0, 246, 247, 248, 249, 250, 251, 252, - 0, 254, 255, 256, 257, 0, 258, 259, 260, 261, - 262, 263, 264, 0, 265, 0, 267, 268, 269, 270, - 271, 272, 273, 274, 0, 275, 0, 276, 0, 0, - 279, 0, 281, 282, 283, 284, 285, 286, 0, 0, - 287, 0, 289, 0, 0, 291, 292, 293, 294, 295, - 296, 297, 298, 525, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 0, 322, 323, 324, 325, - 326, 0, 327, 328, 0, 330, 0, 331, 332, 333, - 334, 335, 336, 0, 337, 338, 0, 0, 339, 340, - 341, 0, 0, 342, 343, 344, 0, 346, 0, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 0, 0, 0, 0, 360, 361, 362, 0, 364, - 365, 366, 367, 368, 369, 0, 370, 371, 372, 373, - 374, 375, 0, 376, 377, 378, 379, 380, 381, 382, - 383, 0, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 0, 397, 398, 0, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 0, 0, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 0, 0, 427, - 428, 429, 430, 0, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 526, 444, 445, 0, - 0, 446, 447, 0, 448, 0, 450, 451, 452, 453, - 454, 0, 455, 456, 457, 0, 0, 458, 459, 460, - 461, 462, 0, 463, 464, 465, 466, 467, 468, 469, - 470, 0, 0, 471, 472, 473, 0, 474, 475, 476, - 477, 0, 478, 479, 480, 481, 482, 483, 484, 0, - 485, 0, 487, 488, 489, 490, 491, 492, 493, 0, - 0, 494, 0, 0, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 523, 0, 0, 0, 0, + 0, 0, 0, 1621, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1623, 1612, 0, 0, 1613, 0, 0, + 1624, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3215, 0, 0, 117, 118, 119, 120, 121, 122, - 123, 124, 0, 125, 126, 127, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 129, 130, 0, 131, 132, - 133, 0, 135, 136, 137, 138, 139, 0, 141, 142, - 0, 143, 144, 145, 146, 147, 148, 0, 0, 149, - 150, 151, 152, 153, 154, 155, 0, 156, 157, 158, - 159, 160, 0, 0, 0, 162, 163, 164, 165, 166, - 167, 0, 169, 170, 171, 0, 172, 173, 174, 175, - 176, 177, 0, 0, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 0, - 194, 0, 195, 196, 197, 198, 199, 200, 0, 0, - 201, 202, 203, 204, 0, 0, 205, 206, 207, 208, - 209, 0, 210, 211, 212, 0, 213, 214, 215, 0, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 0, 227, 0, 228, 229, 230, 231, 0, 232, - 0, 233, 0, 0, 0, 236, 237, 524, 0, 240, - 0, 241, 0, 242, 243, 244, 245, 0, 246, 247, - 248, 249, 250, 251, 252, 0, 254, 255, 256, 257, - 0, 258, 259, 260, 261, 262, 263, 264, 0, 265, - 0, 267, 268, 269, 270, 271, 272, 273, 274, 0, - 275, 0, 276, 0, 0, 279, 0, 281, 282, 283, - 284, 285, 286, 0, 0, 287, 0, 289, 0, 0, - 291, 292, 293, 294, 295, 296, 297, 298, 525, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 0, 322, 323, 324, 325, 326, 0, 327, 328, 0, - 330, 0, 331, 332, 333, 334, 335, 336, 0, 337, - 338, 0, 0, 339, 340, 341, 0, 0, 342, 343, - 344, 0, 346, 0, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 0, 0, 0, 0, - 360, 361, 362, 0, 364, 365, 366, 367, 368, 369, - 0, 370, 371, 372, 373, 374, 375, 0, 376, 377, - 378, 379, 380, 381, 382, 383, 0, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 0, 397, 398, 0, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 0, 0, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 0, 0, 427, 428, 429, 430, 0, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 526, 444, 445, 0, 0, 446, 447, 0, 448, - 0, 450, 451, 452, 453, 454, 0, 455, 456, 457, - 0, 0, 458, 459, 460, 461, 462, 0, 463, 464, - 465, 466, 467, 468, 469, 470, 0, 0, 471, 472, - 473, 0, 474, 475, 476, 477, 0, 478, 479, 480, - 481, 482, 483, 484, 0, 485, 0, 487, 488, 489, - 490, 491, 492, 493, 0, 0, 494, 0, 0, 495, - 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, - 523, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2058, 0, 0, 117, - 118, 119, 120, 121, 122, 123, 124, 0, 125, 126, - 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 129, 130, 0, 131, 132, 133, 0, 135, 136, 137, - 138, 139, 0, 141, 142, 0, 143, 144, 145, 146, - 147, 148, 0, 0, 149, 150, 151, 152, 153, 154, - 155, 0, 156, 157, 158, 159, 160, 0, 0, 0, - 162, 163, 164, 165, 166, 167, 0, 169, 170, 171, - 0, 172, 173, 174, 175, 176, 177, 0, 0, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 0, 194, 0, 195, 196, 197, - 198, 199, 200, 0, 0, 201, 202, 203, 204, 0, - 0, 205, 206, 207, 208, 209, 0, 210, 211, 212, - 0, 213, 214, 215, 0, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 0, 227, 0, 228, - 229, 230, 231, 0, 232, 0, 233, 0, 0, 0, - 236, 237, 524, 0, 240, 0, 241, 0, 242, 243, - 244, 245, 0, 246, 247, 248, 249, 250, 251, 252, - 0, 254, 255, 256, 257, 0, 258, 259, 260, 261, - 262, 263, 264, 0, 265, 0, 267, 268, 269, 270, - 271, 272, 273, 274, 0, 275, 0, 276, 0, 0, - 279, 0, 281, 282, 283, 284, 285, 286, 0, 0, - 287, 0, 289, 0, 0, 291, 292, 293, 294, 295, - 296, 297, 298, 525, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 0, 322, 323, 324, 325, - 326, 0, 327, 328, 0, 330, 0, 331, 332, 333, - 334, 335, 336, 0, 337, 338, 0, 0, 339, 340, - 341, 0, 0, 342, 343, 344, 0, 346, 0, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 0, 0, 0, 0, 360, 361, 362, 0, 364, - 365, 366, 367, 368, 369, 0, 370, 371, 372, 373, - 374, 375, 0, 376, 377, 378, 379, 380, 381, 382, - 383, 0, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 0, 397, 398, 0, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 0, 0, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 0, 0, 427, - 428, 429, 430, 0, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 526, 444, 445, 0, - 0, 446, 447, 0, 448, 0, 450, 451, 452, 453, - 454, 0, 455, 456, 457, 0, 0, 458, 459, 460, - 461, 462, 0, 463, 464, 465, 466, 467, 468, 469, - 470, 0, 0, 471, 472, 473, 0, 474, 475, 476, - 477, 0, 478, 479, 480, 481, 482, 483, 484, 0, - 485, 0, 487, 488, 489, 490, 491, 492, 493, 0, - 0, 494, 0, 0, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 523, 0, 0, 0, 0, + 0, 0, 1621, 0, 0, 0, 0, 1625, 0, 0, + 0, 0, 1623, 1612, 0, 0, 1613, 0, 0, 1624, + 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2161, 0, 0, 117, 118, 119, 120, 121, 122, - 123, 124, 0, 125, 126, 127, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 129, 130, 0, 131, 132, - 133, 0, 135, 136, 137, 138, 139, 0, 141, 142, - 0, 143, 144, 145, 146, 147, 148, 0, 0, 149, - 150, 151, 152, 153, 154, 155, 0, 156, 157, 158, - 159, 160, 0, 0, 0, 162, 163, 164, 165, 166, - 167, 0, 169, 170, 171, 0, 172, 173, 174, 175, - 176, 177, 0, 0, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 0, - 194, 0, 195, 196, 197, 198, 199, 200, 0, 0, - 201, 202, 203, 204, 0, 0, 205, 206, 207, 208, - 209, 0, 210, 211, 212, 0, 213, 214, 215, 0, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 0, 227, 0, 228, 229, 230, 231, 0, 232, - 0, 233, 0, 0, 0, 236, 237, 524, 0, 240, - 0, 241, 0, 242, 243, 244, 245, 0, 246, 247, - 248, 249, 250, 251, 252, 0, 254, 255, 256, 257, - 0, 258, 259, 260, 261, 262, 263, 264, 0, 265, - 0, 267, 268, 269, 270, 271, 272, 273, 274, 0, - 275, 0, 276, 0, 0, 279, 0, 281, 282, 283, - 284, 285, 286, 0, 0, 287, 0, 289, 0, 0, - 291, 292, 293, 294, 295, 296, 297, 298, 525, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 0, 322, 323, 324, 325, 326, 0, 327, 328, 0, - 330, 0, 331, 332, 333, 334, 335, 336, 0, 337, - 338, 0, 0, 339, 340, 341, 0, 0, 342, 343, - 344, 0, 346, 0, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 0, 0, 0, 0, - 360, 361, 362, 0, 364, 365, 366, 367, 368, 369, - 0, 370, 371, 372, 373, 374, 375, 0, 376, 377, - 378, 379, 380, 381, 382, 383, 0, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 0, 397, 398, 0, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 0, 0, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 0, 0, 427, 428, 429, 430, 0, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 526, 444, 445, 0, 0, 446, 447, 0, 448, - 0, 450, 451, 452, 453, 454, 0, 455, 456, 457, - 0, 0, 458, 459, 460, 461, 462, 0, 463, 464, - 465, 466, 467, 468, 469, 470, 0, 0, 471, 472, - 473, 0, 474, 475, 476, 477, 0, 478, 479, 480, - 481, 482, 483, 484, 0, 485, 0, 487, 488, 489, - 490, 491, 492, 493, 0, 0, 494, 0, 0, 495, - 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, - 0, 2895, 1341, 815, 0, 0, 2034, 1046, 0, 0, - 0, 0, 0, 2035, 2036, 0, 3076, 2037, 2038, 2039, - 117, 118, 119, 120, 121, 122, 123, 124, 556, 125, - 126, 127, 557, 558, 559, 2896, 561, 562, 563, 564, - 2897, 129, 130, 566, 131, 132, 133, 2898, 135, 136, - 137, 0, 1480, 2899, 1482, 1483, 573, 143, 144, 145, - 146, 147, 148, 574, 575, 149, 150, 151, 152, 1484, - 1485, 155, 578, 156, 157, 158, 159, 0, 580, 2900, - 582, 2901, 163, 164, 165, 166, 167, 2902, 169, 170, - 171, 585, 172, 173, 174, 175, 176, 177, 586, 2903, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 1490, 190, 191, 1491, 193, 591, 194, 592, 195, 196, - 197, 198, 199, 200, 593, 594, 201, 202, 203, 204, - 595, 596, 205, 206, 1059, 208, 209, 597, 210, 211, - 212, 598, 213, 214, 215, 599, 216, 217, 218, 219, - 0, 221, 222, 223, 224, 225, 0, 602, 227, 603, - 228, 229, 1492, 231, 605, 232, 606, 233, 2904, 608, - 2905, 236, 237, 2906, 2907, 240, 612, 241, 613, 0, - 0, 244, 245, 616, 246, 247, 248, 249, 250, 251, - 252, 2908, 254, 255, 256, 257, 618, 258, 259, 260, - 261, 262, 263, 264, 619, 265, 2909, 0, 268, 269, - 270, 271, 272, 1498, 1499, 624, 1500, 626, 276, 2910, - 2911, 279, 2912, 281, 282, 283, 284, 285, 286, 630, - 631, 287, 2913, 289, 2914, 634, 291, 292, 293, 294, - 295, 296, 297, 298, 2915, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 1507, 2916, 1509, 323, 324, - 325, 2917, 640, 327, 328, 2918, 330, 642, 0, 332, - 1511, 334, 335, 336, 645, 337, 338, 646, 647, 2919, - 340, 341, 648, 649, 342, 343, 0, 2920, 346, 2921, - 0, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 654, 655, 656, 657, 360, 361, 0, 2922, - 364, 365, 0, 367, 368, 369, 661, 370, 371, 372, - 373, 374, 375, 662, 376, 377, 378, 1515, 380, 381, - 382, 383, 664, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 665, 397, 398, 2923, - 400, 401, 402, 1517, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 668, 2924, 417, - 418, 419, 420, 421, 422, 2925, 424, 425, 671, 2926, - 427, 428, 1521, 430, 674, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 2927, 444, 0, - 677, 678, 446, 447, 679, 448, 2928, 450, 451, 452, - 453, 454, 681, 455, 1524, 1525, 684, 685, 458, 459, - 0, 461, 0, 688, 463, 464, 2929, 466, 467, 468, - 469, 470, 2930, 691, 471, 472, 473, 692, 474, 475, - 476, 477, 693, 478, 479, 480, 481, 482, 0, 1528, - 696, 485, 2931, 487, 488, 489, 490, 491, 492, 493, - 698, 699, 494, 700, 701, 495, 496, 497, 498, 499, - 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 512, 513, 514, 515, 0, 523, 0, 2040, - 2041, 2042, 2034, 2932, 2933, 2045, 2046, 2047, 2048, 2035, - 2036, 0, 0, 2037, 2038, 2039, 117, 118, 119, 120, - 121, 122, 123, 124, 0, 125, 126, 127, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 129, 130, 0, - 131, 132, 133, 0, 135, 136, 137, 138, 139, 0, - 141, 142, 0, 143, 144, 145, 146, 147, 148, 0, - 0, 149, 150, 151, 152, 153, 154, 155, 0, 156, - 157, 158, 159, 160, 0, 0, 0, 162, 163, 164, - 165, 166, 167, 0, 169, 170, 171, 0, 172, 173, - 174, 175, 176, 177, 0, 0, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 0, 194, 0, 195, 196, 197, 198, 199, 200, - 0, 0, 201, 202, 203, 204, 0, 0, 205, 206, - 207, 208, 209, 0, 210, 211, 212, 0, 213, 214, - 215, 0, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 0, 227, 0, 228, 229, 230, 231, - 0, 232, 0, 233, 0, 0, 0, 236, 237, 524, - 0, 240, 0, 241, 0, 242, 243, 244, 245, 0, - 246, 247, 248, 249, 250, 251, 252, 0, 254, 255, - 256, 257, 0, 258, 259, 260, 261, 262, 263, 264, - 0, 265, 0, 267, 268, 269, 270, 271, 272, 273, - 274, 0, 275, 0, 276, 0, 0, 279, 0, 281, - 282, 283, 284, 285, 286, 0, 0, 287, 0, 289, - 0, 0, 291, 292, 293, 294, 295, 296, 297, 298, - 525, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 0, 322, 323, 324, 325, 326, 0, 327, - 328, 0, 330, 0, 331, 332, 333, 334, 335, 336, - 0, 337, 338, 0, 0, 339, 340, 341, 0, 0, - 342, 343, 344, 0, 346, 0, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 0, 0, - 0, 0, 360, 361, 362, 0, 364, 365, 366, 367, - 368, 369, 0, 370, 371, 372, 373, 374, 375, 0, - 376, 377, 378, 379, 380, 381, 382, 383, 0, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 0, 397, 398, 0, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 0, 0, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 0, 0, 427, 428, 429, 430, - 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 526, 444, 445, 0, 0, 446, 447, - 0, 448, 0, 450, 451, 452, 453, 454, 0, 455, - 456, 457, 0, 0, 458, 459, 460, 461, 462, 0, - 463, 464, 465, 466, 467, 468, 469, 470, 0, 0, - 471, 472, 473, 0, 474, 475, 476, 477, 0, 478, - 479, 480, 481, 482, 483, 484, 0, 485, 0, 487, - 488, 489, 490, 491, 492, 493, 0, 0, 494, 0, - 0, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, - 514, 515, 0, 0, 0, 2040, 2041, 2042, 0, 2043, - 2044, 2045, 2046, 2047, 2048, 1611, 0, 0, 1612, 0, - 0, 0, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, + 0, 1621, 0, 0, 0, 0, 1625, 0, 0, 0, + 0, 1623, 0, 0, 0, 0, 0, 0, 1624, 0, + 1612, 0, 0, 1613, 0, 0, 0, 1614, 1615, 1616, + 1617, 1618, 1619, 1620, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1625, 0, 0, 1621, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1623, 1612, + 0, 0, 1613, 0, 1626, 1624, 1614, 1615, 1616, 1617, + 1618, 1619, 1620, 0, 0, 0, 0, 0, 0, 0, + 0, 1627, 0, 0, 0, 0, 1628, 1621, 0, 0, + 0, 0, 1625, 0, 0, 0, 0, 1623, 0, 0, + 0, 0, 0, 1626, 1624, 0, 0, 0, 0, 1629, + 1630, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1627, 0, 0, 0, 1631, 1628, 0, 0, 0, 0, + 0, 1625, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1626, 0, 0, 0, 0, 0, 1629, 1630, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1627, + 0, 0, 1632, 1631, 1628, 1633, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1634, + 0, 0, 1635, 0, 0, 0, 0, 1629, 1630, 1626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1620, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1622, 1611, 0, 0, 1612, 0, 0, - 1623, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 0, + 0, 1632, 1631, 0, 1633, 0, 1627, 0, 0, 0, + 0, 1628, 0, 0, 0, 0, 0, 0, 1634, 0, + 0, 1635, 0, 0, 0, 0, 0, 0, 1626, 0, + 0, 0, 0, 0, 1629, 1630, 0, 0, 0, 0, + 1632, 0, 0, 1633, 0, 1627, 0, 0, 0, 1631, + 1628, 0, 0, 0, 0, 0, 0, 1634, 0, 0, + 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1629, 1630, 0, 0, 0, 0, 0, + 0, 1636, 0, 0, 0, 0, 0, 1632, 1631, 0, + 1633, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1634, 0, 0, 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1620, 0, 0, 0, 0, 1624, 0, 0, - 0, 0, 1622, 1611, 0, 0, 1612, 0, 0, 1623, - 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 0, 0, + 1636, 0, 0, 0, 0, 0, 1632, 0, 0, 1633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1620, 0, 0, 0, 0, 1624, 0, 0, 0, - 0, 1622, 0, 0, 0, 0, 0, 0, 1623, 0, - 1611, 0, 0, 1612, 0, 0, 0, 1613, 1614, 1615, - 1616, 1617, 1618, 1619, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1624, 0, 0, 1620, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1622, 1611, - 0, 0, 1612, 1625, 0, 1623, 1613, 1614, 1615, 1616, - 1617, 1618, 1619, 0, 0, 0, 0, 0, 0, 0, - 1626, 0, 0, 0, 0, 1627, 0, 1620, 0, 0, - 0, 0, 1624, 0, 0, 0, 0, 1622, 0, 0, - 0, 0, 1625, 0, 1623, 0, 0, 0, 1628, 1629, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1626, - 0, 0, 0, 1630, 1627, 0, 0, 0, 0, 0, - 0, 1624, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1625, 0, 0, 0, 0, 0, 1628, 1629, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1626, 0, - 0, 1631, 1630, 1627, 1632, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1633, 0, - 0, 1634, 0, 0, 0, 0, 1628, 1629, 1625, 0, + 0, 0, 0, 1634, 0, 0, 1635, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1631, 1630, 0, 1632, 0, 1626, 0, 0, 0, 0, - 1627, 0, 0, 0, 0, 0, 0, 1633, 0, 0, - 1634, 0, 0, 0, 0, 0, 0, 1625, 0, 0, - 0, 0, 0, 1628, 1629, 0, 0, 0, 0, 1631, - 0, 0, 1632, 0, 1626, 0, 0, 0, 1630, 1627, - 0, 0, 0, 0, 0, 0, 1633, 0, 0, 1634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1628, 1629, 0, 0, 0, 0, 1635, 0, - 0, 0, 0, 0, 0, 0, 1631, 1630, 0, 1632, + 0, 0, 0, 0, 0, 0, 0, 0, 1637, 0, + 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, 1644, 1645, + 1646, 0, 0, 0, 0, 3077, 1636, 0, 0, 0, + 0, 0, 1612, 0, 0, 1613, 0, 0, 0, 1614, + 1615, 1616, 1617, 1618, 1619, 1620, 0, 1637, 0, 0, + 1638, 1639, 1640, 0, 1641, 1642, 1643, 1644, 1645, 1646, + 1621, 0, 0, 0, 3084, 1636, 0, 0, 0, 0, + 1623, 0, 0, 0, 0, 0, 0, 1624, 0, 0, + 0, 0, 0, 0, 0, 0, 1637, 0, 0, 1638, + 1639, 1640, 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, + 0, 0, 0, 3244, 1625, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1612, 0, + 0, 1613, 0, 0, 0, 1614, 1615, 1616, 1617, 1618, + 1619, 1620, 0, 1637, 0, 0, 1638, 1639, 1640, 0, + 1641, 1642, 1643, 1644, 1645, 1646, 1621, 0, 0, 0, + 3266, 0, 0, 0, 0, 0, 1623, 1612, 0, 0, + 1613, 0, 0, 1624, 1614, 1615, 1616, 1617, 1618, 1619, + 1620, 0, 1637, 0, 0, 1638, 1639, 1640, 0, 1641, + 1642, 1643, 1644, 1645, 1646, 1621, 0, 0, 0, 3367, + 1625, 0, 0, 0, 0, 1623, 1612, 0, 0, 1613, + 0, 1626, 1624, 1614, 1615, 1616, 1617, 1618, 1619, 1620, + 0, 0, 0, 0, 0, 0, 0, 0, 1627, 0, + 0, 0, 0, 1628, 1621, 0, 0, 0, 0, 1625, + 0, 0, 0, 0, 1623, 0, 0, 0, 0, 0, + 0, 1624, 0, 0, 0, 0, 1629, 1630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1633, 0, 0, 1634, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1635, 0, 0, - 0, 0, 0, 0, 0, 1631, 0, 0, 1632, 0, + 0, 1631, 0, 0, 0, 0, 0, 0, 1625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1633, 0, 0, 1634, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1635, 0, 0, 0, + 0, 0, 1612, 0, 0, 1613, 0, 1626, 0, 1614, + 1615, 1616, 1617, 1618, 1619, 1620, 0, 0, 0, 1632, + 0, 0, 1633, 0, 1627, 0, 0, 0, 0, 1628, + 1621, 0, 0, 0, 0, 0, 1634, 0, 0, 1635, + 1623, 0, 0, 0, 0, 0, 1626, 1624, 0, 0, + 0, 0, 1629, 1630, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1627, 0, 0, 0, 1631, 1628, 0, + 0, 0, 0, 0, 1625, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1626, 0, 0, 0, 0, + 0, 1629, 1630, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1627, 0, 0, 1632, 1631, 1628, 1633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1634, 0, 0, 1635, 0, 0, 0, 0, + 1629, 1630, 0, 0, 0, 0, 0, 0, 1636, 0, + 0, 0, 0, 0, 1632, 1631, 0, 1633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1636, 0, 0, 1637, 1638, - 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, 0, 0, - 0, 0, 2841, 1635, 0, 0, 0, 0, 0, 1611, - 0, 0, 1612, 0, 0, 0, 1613, 1614, 1615, 1616, - 1617, 1618, 1619, 0, 1636, 0, 0, 1637, 1638, 1639, - 0, 1640, 1641, 1642, 1643, 1644, 1645, 1620, 0, 0, - 0, 3068, 1635, 0, 0, 0, 0, 1622, 0, 0, - 0, 0, 0, 0, 1623, 0, 0, 0, 0, 0, - 0, 0, 0, 1636, 0, 0, 1637, 1638, 1639, 0, - 1640, 1641, 1642, 1643, 1644, 1645, 0, 0, 0, 0, - 3075, 1624, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1611, 0, 0, 1612, 0, - 0, 0, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, - 1636, 0, 0, 1637, 1638, 1639, 0, 1640, 1641, 1642, - 1643, 1644, 1645, 1620, 0, 0, 0, 3235, 0, 0, - 0, 0, 0, 1622, 1611, 0, 0, 1612, 0, 0, - 1623, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 1636, - 0, 0, 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, - 1644, 1645, 1620, 0, 0, 0, 3257, 1624, 0, 0, - 0, 0, 1622, 1611, 0, 0, 1612, 1625, 0, 1623, - 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 0, 0, - 0, 0, 0, 0, 1626, 0, 0, 0, 0, 1627, - 0, 1620, 0, 0, 0, 0, 1624, 0, 0, 0, - 0, 1622, 0, 0, 0, 0, 0, 0, 1623, 0, - 0, 0, 1628, 1629, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1630, 0, 0, - 0, 0, 0, 0, 0, 1624, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1611, - 0, 0, 1612, 1625, 0, 0, 1613, 1614, 1615, 1616, - 1617, 1618, 1619, 0, 0, 1631, 0, 0, 1632, 0, - 1626, 0, 0, 0, 0, 1627, 0, 1620, 0, 0, - 0, 0, 1633, 0, 0, 1634, 0, 1622, 0, 0, - 0, 0, 1625, 0, 1623, 0, 0, 0, 1628, 1629, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1626, - 0, 0, 0, 1630, 1627, 0, 0, 0, 0, 0, - 0, 1624, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1625, 0, 0, 0, 0, 0, 1628, 1629, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1626, 0, - 0, 1631, 1630, 1627, 1632, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1633, 0, - 0, 1634, 0, 0, 0, 0, 1628, 1629, 0, 0, - 0, 0, 1635, 0, 0, 0, 0, 0, 0, 0, - 1631, 1630, 0, 1632, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1633, 0, 0, - 1634, 0, 0, 0, 0, 0, 0, 1625, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1631, - 0, 0, 1632, 0, 1626, 0, 0, 0, 0, 1627, - 0, 0, 0, 0, 0, 0, 1633, 0, 0, 1634, + 0, 1634, 0, 0, 1635, 0, 0, 0, 0, 0, + 0, 1626, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1632, 0, 0, 1633, 0, 1627, 0, + 0, 0, 0, 1628, 0, 0, 0, 0, 0, 0, + 1634, 0, 0, 1635, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1629, 1630, 0, 0, + 0, 0, 0, 0, 1636, 0, 0, 0, 0, 0, + 0, 1631, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1637, 0, 0, 1638, 1639, + 1640, 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, 0, + 0, 0, 3424, 1636, 0, 0, 0, 0, 0, 1632, + 0, 0, 1633, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1634, 0, 0, 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1628, 1629, 0, 0, 0, 0, 1635, 0, - 0, 0, 0, 0, 0, 0, 0, 1630, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1636, - 0, 0, 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, - 1644, 1645, 0, 0, 0, 0, 3358, 1635, 0, 0, - 0, 0, 0, 0, 0, 1631, 0, 1611, 1632, 0, - 1612, 0, 0, 0, 1613, 1614, 1615, 1616, 1617, 1618, - 1619, 0, 1633, 0, 0, 1634, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1620, 1635, 0, 0, 0, - 0, 0, 0, 0, 0, 1622, 0, 0, 0, 0, - 0, 0, 1623, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1636, 0, 0, 1637, 1638, - 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, 0, 1624, - 0, 0, 3415, 0, 0, 0, 0, 0, 0, 1611, - 0, 0, 1612, 0, 0, 0, 1613, 1614, 1615, 1616, - 1617, 1618, 1619, 0, 1636, 0, 0, 1637, 1638, 1639, - 0, 1640, 1641, 1642, 1643, 1644, 1645, 1620, 0, 0, - 0, 3437, 1635, 0, 0, 0, 0, 1622, 0, 0, - 0, 0, 0, 0, 1623, 0, 0, 0, 0, 0, - 0, 0, 0, 1636, 0, 0, 1637, 1638, 1639, 0, - 1640, 1641, 1642, 1643, 1644, 1645, 0, 0, 1796, 0, - 0, 1624, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1625, 0, 0, 0, 0, + 0, 0, 1636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1626, 0, 0, 0, 0, 1627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1637, 0, 0, 1638, 1639, 1640, 0, 1641, 1642, + 1643, 1644, 1645, 1646, 0, 0, 0, 0, 3446, 0, + 0, 0, 0, 0, 0, 1612, 0, 0, 1613, 0, + 0, 0, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, + 1637, 0, 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, + 1644, 1645, 1646, 1621, 0, 1801, 0, 0, 1636, 0, + 0, 0, 0, 1623, 0, 0, 0, 0, 0, 0, + 1624, 0, 0, 0, 0, 0, 0, 0, 0, 1637, + 0, 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, 1644, + 1645, 1646, 0, 0, 2804, 0, 0, 1625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1628, 1629, 0, 0, 0, 0, 0, 0, 0, 1636, - 0, 0, 1637, 1638, 1639, 1630, 1640, 1641, 1642, 1643, - 1644, 1645, 0, 0, 2795, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1631, 1626, 0, 1632, 0, 0, 1627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1633, 0, 0, 1634, 0, 0, 0, 0, 0, 0, - 0, 0, 1628, 1629, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1631, 0, 0, 1632, 0, + 0, 0, 0, 0, 0, 1637, 0, 0, 1638, 1639, + 1640, 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, 0, + 3234, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1633, 0, 0, 1634, 0, 0, 0, 0, + 0, 1627, 0, 0, 0, 0, 1628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1629, + 1630, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1632, 0, 0, 1633, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1634, + 0, 0, 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1636, 0, 0, - 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, - 0, 0, 3225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 555, 0, 0, 1636, - 0, 0, 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, - 1644, 1645, 0, 0, 3399, 117, 118, 119, 120, 121, - 122, 123, 124, 556, 125, 126, 127, 557, 558, 559, - 560, 561, 562, 563, 564, 565, 129, 130, 566, 131, - 132, 133, 567, 135, 136, 137, 568, 569, 570, 571, - 572, 573, 143, 144, 145, 146, 147, 148, 574, 575, - 149, 150, 151, 152, 576, 577, 155, 578, 156, 157, - 158, 159, 579, 580, 581, 582, 583, 163, 164, 165, - 166, 167, 584, 169, 170, 171, 585, 172, 173, 174, - 175, 176, 177, 586, 587, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 589, 190, 191, 590, 193, - 591, 194, 592, 195, 196, 197, 198, 199, 200, 593, - 594, 201, 202, 203, 204, 595, 596, 205, 206, 207, - 208, 209, 597, 210, 211, 212, 598, 213, 214, 215, - 599, 216, 217, 218, 219, 600, 221, 222, 223, 224, - 225, 601, 602, 227, 603, 228, 229, 604, 231, 605, - 232, 606, 233, 607, 608, 609, 236, 237, 610, 611, - 240, 612, 241, 613, 614, 615, 244, 245, 616, 246, - 247, 248, 249, 250, 251, 252, 617, 254, 255, 256, - 257, 618, 258, 259, 260, 261, 262, 263, 264, 619, - 265, 620, 621, 268, 269, 270, 271, 272, 622, 623, - 624, 625, 626, 276, 627, 628, 279, 629, 281, 282, - 283, 284, 285, 286, 630, 631, 287, 632, 289, 633, - 634, 291, 292, 293, 294, 295, 296, 297, 298, 635, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 636, 637, 638, 323, 324, 325, 639, 640, 327, 328, - 641, 330, 642, 643, 332, 644, 334, 335, 336, 645, - 337, 338, 646, 647, 339, 340, 341, 648, 649, 342, - 343, 650, 651, 346, 652, 653, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 654, 655, 656, - 657, 360, 361, 658, 659, 364, 365, 660, 367, 368, - 369, 661, 370, 371, 372, 373, 374, 375, 662, 376, - 377, 378, 663, 380, 381, 382, 383, 664, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 665, 397, 398, 666, 400, 401, 402, 667, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 668, 669, 417, 418, 419, 420, 421, 422, - 670, 424, 425, 671, 672, 427, 428, 673, 430, 674, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 675, 444, 676, 677, 678, 446, 447, 679, - 448, 680, 450, 451, 452, 453, 454, 681, 455, 682, - 683, 684, 685, 458, 459, 686, 461, 687, 688, 463, - 464, 689, 466, 467, 468, 469, 470, 690, 691, 471, - 472, 473, 692, 474, 475, 476, 477, 693, 478, 479, - 480, 481, 482, 694, 695, 696, 485, 697, 487, 488, - 489, 490, 491, 492, 493, 698, 699, 494, 700, 701, - 495, 496, 497, 498, 499, 500, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 512, 513, 514, - 515, 523, 0, 0, 0, 0, 0, 0, 0, 0, - 2069, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 117, 118, 119, 120, 121, 122, 123, 124, 0, 125, - 126, 127, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 129, 130, 0, 131, 132, 133, 0, 135, 136, - 137, 138, 139, 0, 141, 142, 0, 143, 144, 145, - 146, 147, 148, 0, 0, 149, 150, 151, 152, 153, - 154, 155, 0, 156, 157, 158, 159, 160, 0, 0, - 0, 162, 163, 164, 165, 166, 167, 0, 169, 170, - 171, 0, 172, 173, 174, 175, 176, 177, 0, 0, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 0, 194, 0, 195, 196, - 197, 198, 199, 200, 0, 0, 201, 202, 203, 204, - 0, 0, 205, 206, 207, 208, 209, 0, 210, 211, - 212, 0, 213, 214, 215, 0, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 0, 227, 0, - 228, 229, 230, 231, 0, 232, 0, 233, 0, 0, - 0, 236, 237, 524, 0, 240, 0, 241, 0, 242, - 243, 244, 245, 0, 246, 247, 248, 249, 250, 251, - 252, 0, 254, 255, 256, 257, 0, 258, 259, 260, - 261, 262, 263, 264, 0, 265, 0, 267, 268, 269, - 270, 271, 272, 273, 274, 0, 275, 0, 276, 0, - 0, 279, 0, 281, 282, 283, 284, 285, 286, 0, - 0, 287, 0, 289, 0, 0, 291, 292, 293, 294, - 295, 296, 297, 298, 525, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 0, 322, 323, 324, - 325, 326, 0, 327, 328, 0, 330, 0, 331, 332, - 333, 334, 335, 336, 0, 337, 338, 0, 0, 339, - 340, 341, 0, 0, 342, 343, 344, 0, 346, 0, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 0, 0, 0, 0, 360, 361, 362, 0, - 364, 365, 366, 367, 368, 369, 0, 370, 371, 372, - 373, 374, 375, 0, 376, 377, 378, 379, 380, 381, - 382, 383, 0, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 0, 397, 398, 0, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 0, 0, 417, - 418, 419, 420, 421, 422, 423, 424, 425, 0, 0, - 427, 428, 429, 430, 0, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 526, 444, 445, - 0, 0, 446, 447, 0, 448, 0, 450, 451, 452, - 453, 454, 0, 455, 456, 457, 0, 0, 458, 459, - 460, 461, 462, 0, 463, 464, 465, 466, 467, 468, - 469, 470, 0, 0, 471, 472, 473, 0, 474, 475, - 476, 477, 0, 478, 479, 480, 481, 482, 483, 484, - 0, 485, 0, 487, 488, 489, 490, 491, 492, 493, - 0, 0, 494, 0, 0, 495, 496, 497, 498, 499, - 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 523, 0, 0, 0, - 0, 0, 0, 0, 0, 2695, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 117, 118, 119, 120, 121, - 122, 123, 124, 0, 125, 126, 127, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 129, 130, 0, 131, - 132, 133, 0, 135, 136, 137, 138, 139, 0, 141, - 142, 0, 143, 144, 145, 146, 147, 148, 0, 0, - 149, 150, 151, 152, 153, 154, 155, 0, 156, 157, - 158, 159, 160, 0, 0, 0, 162, 163, 164, 165, - 166, 167, 0, 169, 170, 171, 0, 172, 173, 174, - 175, 176, 177, 0, 0, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 0, 194, 0, 195, 196, 197, 198, 199, 200, 0, - 0, 201, 202, 203, 204, 0, 0, 205, 206, 207, - 208, 209, 0, 210, 211, 212, 0, 213, 214, 215, - 0, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 0, 227, 0, 228, 229, 230, 231, 0, - 232, 0, 233, 0, 0, 0, 236, 237, 524, 0, - 240, 0, 241, 0, 242, 243, 244, 245, 0, 246, - 247, 248, 249, 250, 251, 252, 0, 254, 255, 256, - 257, 0, 258, 259, 260, 261, 262, 263, 264, 0, - 265, 0, 267, 268, 269, 270, 271, 272, 273, 274, - 0, 275, 0, 276, 0, 0, 279, 0, 281, 282, - 283, 284, 285, 286, 0, 0, 287, 0, 289, 0, - 0, 291, 292, 293, 294, 295, 296, 297, 298, 525, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 0, 322, 323, 324, 325, 326, 0, 327, 328, - 0, 330, 0, 331, 332, 333, 334, 335, 336, 0, - 337, 338, 0, 0, 339, 340, 341, 0, 0, 342, - 343, 344, 0, 346, 0, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 0, 0, 0, - 0, 360, 361, 362, 0, 364, 365, 366, 367, 368, - 369, 0, 370, 371, 372, 373, 374, 375, 0, 376, - 377, 378, 379, 380, 381, 382, 383, 0, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 0, 397, 398, 0, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 0, 0, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 0, 0, 427, 428, 429, 430, 0, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 526, 444, 445, 0, 0, 446, 447, 0, - 448, 0, 450, 451, 452, 453, 454, 0, 455, 456, - 457, 0, 0, 458, 459, 460, 461, 462, 0, 463, - 464, 465, 466, 467, 468, 469, 470, 0, 0, 471, - 472, 473, 0, 474, 475, 476, 477, 0, 478, 479, - 480, 481, 482, 483, 484, 0, 485, 0, 487, 488, - 489, 490, 491, 492, 493, 0, 0, 494, 0, 0, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, - 515, 964, 1341, 815, 0, 0, 0, 1046, 0, 0, - 2698, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 117, 118, 119, 120, 121, 122, 123, 124, 0, 125, - 126, 127, 0, 0, 0, 560, 0, 0, 0, 0, - 565, 129, 130, 0, 131, 132, 133, 567, 135, 136, - 137, 568, 569, 570, 571, 572, 0, 143, 144, 145, - 146, 147, 148, 0, 0, 149, 150, 151, 152, 576, - 577, 155, 0, 156, 157, 158, 159, 579, 0, 581, - 0, 583, 163, 164, 165, 166, 167, 584, 169, 170, - 171, 0, 172, 173, 174, 175, 176, 177, 0, 587, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 589, 190, 191, 590, 193, 0, 194, 0, 195, 196, - 197, 198, 199, 200, 0, 0, 201, 202, 203, 204, - 0, 0, 205, 206, 207, 208, 209, 0, 210, 211, - 212, 0, 213, 214, 215, 0, 216, 217, 218, 219, - 600, 221, 222, 223, 224, 225, 601, 1342, 227, 0, - 228, 229, 604, 231, 0, 232, 0, 233, 607, 0, - 609, 236, 237, 610, 611, 240, 0, 241, 0, 614, - 615, 244, 245, 0, 246, 247, 248, 249, 250, 251, - 252, 617, 254, 255, 256, 257, 0, 258, 259, 260, - 261, 262, 263, 264, 0, 265, 620, 621, 268, 269, - 270, 271, 272, 622, 623, 0, 625, 0, 276, 627, - 628, 279, 629, 281, 282, 283, 284, 285, 286, 0, - 0, 287, 632, 289, 633, 0, 291, 292, 293, 294, - 295, 296, 297, 298, 635, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 636, 637, 638, 323, 324, - 325, 639, 0, 327, 328, 641, 330, 0, 643, 332, - 644, 334, 335, 336, 0, 337, 338, 1343, 0, 339, - 340, 341, 0, 0, 342, 343, 650, 651, 346, 652, - 653, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 0, 0, 0, 0, 360, 361, 658, 659, - 364, 365, 660, 367, 368, 369, 0, 370, 371, 372, - 373, 374, 375, 0, 376, 377, 378, 663, 380, 381, - 382, 383, 0, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 0, 397, 398, 666, - 400, 401, 402, 667, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 0, 669, 417, - 418, 419, 420, 421, 422, 670, 424, 425, 0, 672, - 427, 428, 673, 430, 0, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 675, 444, 676, - 0, 0, 446, 447, 0, 448, 680, 450, 451, 452, - 453, 454, 0, 455, 682, 683, 0, 0, 458, 459, - 686, 461, 687, 1344, 463, 464, 689, 466, 467, 468, - 469, 470, 0, 0, 471, 472, 473, 0, 474, 475, - 476, 477, 0, 478, 479, 480, 481, 482, 694, 695, - 0, 485, 697, 487, 488, 489, 490, 491, 492, 493, - 0, 0, 494, 0, 0, 495, 496, 497, 498, 499, - 500, 702, 703, 704, 705, 706, 707, 708, 709, 710, - 711, 712, 512, 513, 514, 515, 0, 0, 1611, 0, - 0, 1612, 0, 1345, 1346, 1613, 1614, 1615, 1616, 1617, - 1618, 1619, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1620, 0, 0, 0, - 0, 2167, 0, 0, 0, 0, 1622, 1611, 0, 0, - 1612, 0, 0, 1623, 1613, 1614, 1615, 1616, 1617, 1618, - 1619, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1620, 0, 0, 0, 0, - 1624, 0, 0, 0, 0, 1622, 1611, 0, 0, 1612, - 0, 0, 1623, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1620, 0, 0, 0, 0, 1624, - 0, 0, 0, 0, 1622, 0, 2168, 0, 0, 0, - 0, 1623, 0, 0, 1611, 0, 0, 1612, 0, 0, - 0, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1624, 0, - 0, 0, 1620, 0, 0, 0, 1890, 0, 0, 0, - 0, 0, 1622, 0, 1611, 0, 1625, 1612, 0, 1623, - 0, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 0, - 0, 0, 0, 1626, 0, 0, 0, 0, 1627, 0, - 0, 0, 1620, 0, 0, 1926, 1624, 0, 0, 0, - 1927, 0, 1622, 0, 0, 1625, 0, 0, 0, 1623, - 0, 1628, 1629, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1626, 0, 0, 0, 1630, 1627, 0, 0, - 0, 0, 0, 3505, 0, 0, 1624, 0, 0, 0, - 0, 0, 0, 0, 1625, 0, 0, 0, 0, 0, - 1628, 1629, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1626, 0, 0, 1631, 1630, 1627, 1632, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1633, 0, 0, 1634, 0, 0, 0, 0, 1628, - 1629, 0, 1625, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1631, 1630, 0, 1632, 0, 0, 1626, - 0, 0, 0, 0, 1627, 0, 0, 0, 0, 0, - 1633, 0, 0, 1634, 0, 0, 0, 0, 0, 0, - 0, 0, 1625, 0, 0, 0, 0, 1628, 1629, 0, - 0, 0, 1631, 0, 0, 1632, 0, 0, 0, 1626, - 0, 0, 1630, 0, 1627, 0, 0, 0, 0, 1633, - 0, 0, 1634, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1628, 1629, 0, - 0, 1635, 0, 0, 0, 0, 0, 0, 0, 0, - 1631, 3506, 1630, 1632, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1633, 0, 0, - 1634, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1631, 0, 0, 1632, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 2171, 0, 0, 1633, 0, 0, - 1634, 0, 0, 0, 0, 0, 0, 0, 0, 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1897, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1636, 0, - 0, 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, 1644, - 1645, 0, 0, 0, 0, 0, 0, 1635, 0, 0, - 0, 0, 1611, 0, 0, 1612, 0, 0, 0, 1613, - 1614, 1615, 1616, 1617, 1618, 1619, 0, 1636, 0, 0, - 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, - 1620, 0, 0, 0, 1932, 0, 0, 1635, 0, 0, - 1622, 0, 0, 0, 0, 0, 0, 1623, 0, 0, - 0, 0, 0, 0, 0, 0, 1636, 0, 0, 1637, - 1638, 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, 0, - 0, 0, 0, 0, 1624, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1611, - 0, 0, 1612, 0, 0, 0, 1613, 1614, 1615, 1616, - 1617, 1618, 1619, 0, 1636, 0, 0, 1637, 1638, 1639, - 0, 1640, 1641, 1642, 1643, 1644, 1645, 1620, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1622, 0, 0, - 0, 0, 0, 0, 1623, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1636, 0, 0, 1637, 1638, 1639, - 0, 1640, 1641, 1642, 1643, 1644, 1645, 0, 0, 0, - 0, 1624, 0, 0, 0, 0, 1611, 0, 0, 1612, - 1625, 0, 0, 1613, 1614, 1615, 1616, 1617, 1618, 1619, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 559, 0, 0, 1637, 0, + 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, 1644, 1645, + 1646, 0, 0, 3408, 118, 119, 120, 121, 122, 123, + 124, 125, 560, 126, 127, 128, 561, 562, 563, 564, + 565, 566, 567, 568, 569, 130, 131, 570, 132, 133, + 134, 571, 136, 137, 138, 572, 573, 574, 575, 576, + 577, 144, 145, 146, 147, 148, 149, 578, 579, 150, + 151, 152, 153, 580, 581, 156, 582, 157, 158, 159, + 160, 583, 584, 585, 586, 587, 164, 165, 166, 167, + 168, 588, 170, 171, 172, 589, 173, 174, 175, 176, + 177, 178, 590, 591, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 593, 191, 192, 594, 194, 595, + 195, 596, 196, 197, 198, 199, 200, 201, 597, 598, + 202, 203, 204, 205, 599, 600, 206, 207, 208, 209, + 210, 601, 211, 212, 213, 602, 214, 215, 216, 603, + 217, 218, 219, 220, 604, 222, 223, 224, 225, 226, + 227, 605, 606, 229, 607, 230, 231, 608, 233, 609, + 234, 610, 235, 611, 612, 613, 238, 239, 614, 615, + 242, 616, 243, 617, 618, 619, 246, 247, 620, 248, + 249, 250, 251, 252, 253, 254, 621, 256, 257, 258, + 259, 622, 260, 261, 262, 263, 264, 265, 266, 623, + 267, 624, 625, 270, 271, 272, 273, 274, 626, 627, + 628, 629, 630, 278, 631, 632, 281, 633, 283, 284, + 285, 286, 287, 288, 634, 635, 289, 636, 291, 637, + 638, 293, 294, 295, 296, 297, 298, 299, 300, 639, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 640, 641, 642, 325, 326, 327, 643, 644, 329, 330, + 645, 332, 646, 647, 334, 648, 336, 337, 338, 649, + 339, 340, 650, 651, 341, 342, 343, 652, 653, 344, + 345, 654, 655, 348, 656, 657, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 658, 659, 660, + 661, 362, 363, 662, 663, 366, 367, 664, 369, 370, + 371, 665, 372, 373, 374, 375, 376, 377, 666, 378, + 379, 380, 381, 382, 667, 384, 385, 386, 387, 668, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 669, 401, 402, 670, 404, 405, 406, + 671, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 672, 673, 421, 422, 423, 424, + 425, 426, 674, 428, 429, 675, 676, 431, 432, 677, + 434, 678, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 679, 448, 680, 681, 682, 450, + 451, 683, 452, 684, 454, 455, 456, 457, 458, 685, + 459, 686, 687, 688, 689, 462, 463, 690, 465, 691, + 692, 467, 468, 693, 470, 471, 472, 473, 474, 694, + 695, 475, 476, 477, 696, 478, 479, 480, 481, 697, + 482, 483, 484, 485, 486, 698, 699, 700, 489, 701, + 491, 492, 493, 494, 495, 496, 497, 702, 703, 498, + 704, 705, 499, 500, 501, 502, 503, 504, 706, 707, + 708, 709, 710, 711, 712, 713, 714, 715, 716, 516, + 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, + 0, 0, 2073, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, + 0, 126, 127, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 130, 131, 0, 132, 133, 134, 0, + 136, 137, 138, 139, 140, 0, 142, 143, 0, 144, + 145, 146, 147, 148, 149, 0, 0, 150, 151, 152, + 153, 154, 155, 156, 0, 157, 158, 159, 160, 161, + 0, 0, 0, 163, 164, 165, 166, 167, 168, 0, + 170, 171, 172, 0, 173, 174, 175, 176, 177, 178, + 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 0, 195, 0, + 196, 197, 198, 199, 200, 201, 0, 0, 202, 203, + 204, 205, 0, 0, 206, 207, 208, 209, 210, 0, + 211, 212, 213, 0, 214, 215, 216, 0, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 0, 229, 0, 230, 231, 232, 233, 0, 234, 0, + 235, 0, 0, 0, 238, 239, 528, 0, 242, 0, + 243, 0, 244, 245, 246, 247, 0, 248, 249, 250, + 251, 252, 253, 254, 0, 256, 257, 258, 259, 0, + 260, 261, 262, 263, 264, 265, 266, 0, 267, 0, + 269, 270, 271, 272, 273, 274, 275, 276, 0, 277, + 0, 278, 0, 0, 281, 0, 283, 284, 285, 286, + 287, 288, 0, 0, 289, 0, 291, 0, 0, 293, + 294, 295, 296, 297, 298, 299, 300, 529, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 0, + 324, 325, 326, 327, 328, 0, 329, 330, 0, 332, + 0, 333, 334, 335, 336, 337, 338, 0, 339, 340, + 0, 0, 341, 342, 343, 0, 0, 344, 345, 346, + 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 0, 0, 0, 0, 362, + 363, 364, 0, 366, 367, 368, 369, 370, 371, 0, + 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 0, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 0, 401, 402, 0, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 0, 0, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 0, 0, 431, 432, 433, 434, 0, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 530, 448, 449, 0, 0, 450, 451, 0, + 452, 0, 454, 455, 456, 457, 458, 0, 459, 460, + 461, 0, 0, 462, 463, 464, 465, 466, 0, 467, + 468, 469, 470, 471, 472, 473, 474, 0, 0, 475, + 476, 477, 0, 478, 479, 480, 481, 0, 482, 483, + 484, 485, 486, 487, 488, 0, 489, 0, 491, 492, + 493, 494, 495, 496, 497, 0, 0, 498, 0, 0, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, + 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, + 2704, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 118, 119, 120, 121, 122, 123, 124, 125, 0, 126, + 127, 128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 130, 131, 0, 132, 133, 134, 0, 136, 137, + 138, 139, 140, 0, 142, 143, 0, 144, 145, 146, + 147, 148, 149, 0, 0, 150, 151, 152, 153, 154, + 155, 156, 0, 157, 158, 159, 160, 161, 0, 0, + 0, 163, 164, 165, 166, 167, 168, 0, 170, 171, + 172, 0, 173, 174, 175, 176, 177, 178, 0, 0, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 0, 195, 0, 196, 197, + 198, 199, 200, 201, 0, 0, 202, 203, 204, 205, + 0, 0, 206, 207, 208, 209, 210, 0, 211, 212, + 213, 0, 214, 215, 216, 0, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 0, 229, + 0, 230, 231, 232, 233, 0, 234, 0, 235, 0, + 0, 0, 238, 239, 528, 0, 242, 0, 243, 0, + 244, 245, 246, 247, 0, 248, 249, 250, 251, 252, + 253, 254, 0, 256, 257, 258, 259, 0, 260, 261, + 262, 263, 264, 265, 266, 0, 267, 0, 269, 270, + 271, 272, 273, 274, 275, 276, 0, 277, 0, 278, + 0, 0, 281, 0, 283, 284, 285, 286, 287, 288, + 0, 0, 289, 0, 291, 0, 0, 293, 294, 295, + 296, 297, 298, 299, 300, 529, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 0, 324, 325, + 326, 327, 328, 0, 329, 330, 0, 332, 0, 333, + 334, 335, 336, 337, 338, 0, 339, 340, 0, 0, + 341, 342, 343, 0, 0, 344, 345, 346, 0, 348, + 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 0, 0, 0, 0, 362, 363, 364, + 0, 366, 367, 368, 369, 370, 371, 0, 372, 373, + 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 0, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 0, + 401, 402, 0, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 0, 0, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 0, 0, 431, 432, 433, 434, 0, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 530, 448, 449, 0, 0, 450, 451, 0, 452, 0, + 454, 455, 456, 457, 458, 0, 459, 460, 461, 0, + 0, 462, 463, 464, 465, 466, 0, 467, 468, 469, + 470, 471, 472, 473, 474, 0, 0, 475, 476, 477, + 0, 478, 479, 480, 481, 0, 482, 483, 484, 485, + 486, 487, 488, 0, 489, 0, 491, 492, 493, 494, + 495, 496, 497, 0, 0, 498, 0, 0, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 968, + 1345, 819, 0, 0, 0, 1048, 0, 0, 2707, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 118, 119, + 120, 121, 122, 123, 124, 125, 0, 126, 127, 128, + 0, 0, 0, 564, 0, 0, 0, 0, 569, 130, + 131, 0, 132, 133, 134, 571, 136, 137, 138, 572, + 573, 574, 575, 576, 0, 144, 145, 146, 147, 148, + 149, 0, 0, 150, 151, 152, 153, 580, 581, 156, + 0, 157, 158, 159, 160, 583, 0, 585, 0, 587, + 164, 165, 166, 167, 168, 588, 170, 171, 172, 0, + 173, 174, 175, 176, 177, 178, 0, 591, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 593, 191, + 192, 594, 194, 0, 195, 0, 196, 197, 198, 199, + 200, 201, 0, 0, 202, 203, 204, 205, 0, 0, + 206, 207, 208, 209, 210, 0, 211, 212, 213, 0, + 214, 215, 216, 0, 217, 218, 219, 220, 604, 222, + 223, 224, 225, 226, 227, 605, 1346, 229, 0, 230, + 231, 608, 233, 0, 234, 0, 235, 611, 0, 613, + 238, 239, 614, 615, 242, 0, 243, 0, 618, 619, + 246, 247, 0, 248, 249, 250, 251, 252, 253, 254, + 621, 256, 257, 258, 259, 0, 260, 261, 262, 263, + 264, 265, 266, 0, 267, 624, 625, 270, 271, 272, + 273, 274, 626, 627, 0, 629, 0, 278, 631, 632, + 281, 633, 283, 284, 285, 286, 287, 288, 0, 0, + 289, 636, 291, 637, 0, 293, 294, 295, 296, 297, + 298, 299, 300, 639, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 640, 641, 642, 325, 326, 327, + 643, 0, 329, 330, 645, 332, 0, 647, 334, 648, + 336, 337, 338, 0, 339, 340, 1347, 0, 341, 342, + 343, 0, 0, 344, 345, 654, 655, 348, 656, 657, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 0, 0, 0, 0, 362, 363, 662, 663, 366, + 367, 664, 369, 370, 371, 0, 372, 373, 374, 375, + 376, 377, 0, 378, 379, 380, 381, 382, 667, 384, + 385, 386, 387, 0, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, + 670, 404, 405, 406, 671, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 0, 673, + 421, 422, 423, 424, 425, 426, 674, 428, 429, 0, + 676, 431, 432, 677, 434, 0, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 679, 448, + 680, 0, 0, 450, 451, 0, 452, 684, 454, 455, + 456, 457, 458, 0, 459, 686, 687, 0, 0, 462, + 463, 690, 465, 691, 1348, 467, 468, 693, 470, 471, + 472, 473, 474, 0, 0, 475, 476, 477, 0, 478, + 479, 480, 481, 0, 482, 483, 484, 485, 486, 698, + 699, 0, 489, 701, 491, 492, 493, 494, 495, 496, + 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, + 503, 504, 706, 707, 708, 709, 710, 711, 712, 713, + 714, 715, 716, 516, 517, 518, 519, 0, 0, 1612, + 0, 0, 1613, 0, 1349, 1350, 1614, 1615, 1616, 1617, + 1618, 1619, 1620, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1621, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1623, 1612, 0, + 0, 1613, 0, 0, 1624, 1614, 1615, 1616, 1617, 1618, + 1619, 1620, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1621, 0, 0, 0, + 0, 1625, 0, 0, 0, 0, 1623, 1612, 0, 0, + 1613, 0, 0, 1624, 1614, 1615, 1616, 1617, 1618, 1619, + 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1621, 0, 0, 0, 1894, + 1625, 0, 0, 0, 0, 1623, 0, 0, 0, 0, + 0, 0, 1624, 0, 0, 0, 1612, 0, 0, 1613, + 0, 0, 0, 1614, 1615, 1616, 1617, 1618, 1619, 1620, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1625, + 0, 0, 0, 0, 1621, 0, 0, 0, 1930, 0, + 0, 0, 0, 1931, 1623, 0, 0, 0, 1626, 0, + 0, 1624, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1627, 0, 0, 0, 0, + 1628, 0, 0, 0, 0, 0, 3514, 0, 1625, 0, 0, 0, 0, 0, 0, 0, 0, 1626, 0, 0, - 0, 0, 1627, 0, 1620, 0, 0, 0, 1939, 0, - 0, 0, 0, 0, 1622, 0, 0, 0, 0, 0, - 0, 1623, 0, 0, 0, 1628, 1629, 0, 0, 0, + 0, 0, 0, 1629, 1630, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1627, 0, 0, 0, 1631, 1628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1630, 0, 0, 0, 0, 0, 0, 0, 1624, 0, + 0, 0, 0, 0, 0, 0, 1626, 0, 0, 0, + 0, 0, 1629, 1630, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1627, 0, 0, 1632, 1631, 1628, 1633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1937, 1611, 0, 0, 1612, 1625, 0, 0, - 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 1631, 0, - 0, 1632, 0, 0, 1626, 0, 0, 0, 0, 1627, - 0, 1620, 0, 0, 0, 1633, 0, 0, 1634, 0, - 0, 1622, 0, 0, 0, 0, 0, 0, 1623, 0, - 0, 0, 1628, 1629, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1630, 0, 0, - 0, 0, 0, 0, 0, 1624, 0, 0, 0, 0, - 0, 0, 0, 0, 1625, 0, 0, 0, 0, 0, + 0, 0, 0, 1634, 0, 0, 1635, 0, 0, 0, + 0, 1629, 1630, 0, 0, 1626, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1632, 1631, 0, 1633, 0, + 0, 0, 1627, 0, 0, 0, 0, 1628, 0, 0, + 0, 0, 1634, 0, 0, 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1626, 0, 0, 0, 1631, 1627, 0, 1632, 0, + 1629, 1630, 0, 0, 1632, 0, 0, 1633, 0, 0, + 0, 0, 0, 0, 3515, 1631, 0, 0, 0, 0, + 0, 1634, 0, 0, 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1633, 0, 0, 1634, 0, 0, 0, 1628, - 1629, 0, 0, 0, 0, 1635, 0, 0, 1611, 0, - 0, 1612, 0, 0, 1630, 1613, 1614, 1615, 1616, 1617, - 1618, 1619, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2062, 0, 0, 0, 0, 1620, 0, 0, 0, - 0, 1625, 0, 0, 0, 0, 1622, 0, 0, 0, - 0, 0, 1631, 1623, 0, 1632, 0, 0, 1626, 0, - 0, 0, 0, 1627, 0, 0, 0, 0, 0, 1633, - 0, 0, 1634, 0, 0, 0, 0, 0, 0, 0, - 1624, 0, 0, 0, 0, 0, 1628, 1629, 0, 0, - 0, 0, 1635, 0, 0, 0, 0, 0, 0, 0, - 0, 1630, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1636, 0, 0, 1637, 1638, 1639, 0, 1640, - 1641, 1642, 1643, 1644, 1645, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1631, - 0, 0, 1632, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1633, 0, 0, 1634, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1635, - 0, 0, 0, 0, 0, 0, 1625, 0, 0, 0, + 0, 0, 0, 0, 0, 1636, 0, 0, 0, 0, + 0, 0, 0, 1632, 0, 0, 1633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1626, 0, 0, 0, 0, 1627, 1636, - 0, 0, 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, - 1644, 1645, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1628, 1629, 0, 0, 0, 0, 0, 0, 0, - 1611, 0, 0, 1612, 0, 0, 1630, 1613, 1614, 1615, - 1616, 1617, 1618, 1619, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1635, 0, 1620, 0, - 0, 0, 2772, 0, 0, 0, 0, 0, 1622, 0, - 0, 0, 0, 0, 1631, 1623, 1636, 1632, 0, 1637, - 1638, 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, 0, - 0, 1633, 0, 0, 1634, 0, 0, 0, 0, 0, - 0, 0, 1624, 0, 1611, 0, 0, 1612, 0, 0, - 0, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 0, + 1634, 0, 0, 1635, 0, 0, 0, 0, 0, 1612, + 0, 0, 1613, 0, 1636, 0, 1614, 1615, 1616, 1617, + 1618, 1619, 1620, 0, 0, 0, 1901, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1621, 0, 0, + 0, 1936, 0, 0, 0, 0, 0, 1623, 0, 0, + 0, 0, 0, 1636, 1624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1620, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1622, 0, 0, 0, 0, 0, 0, 1623, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1636, 0, 0, 1637, 1638, 1639, 0, - 1640, 1641, 1642, 1643, 1644, 1645, 1624, 0, 0, 0, + 0, 1625, 1637, 0, 0, 1638, 1639, 1640, 0, 1641, + 1642, 1643, 1644, 1645, 1646, 0, 0, 0, 0, 0, + 0, 0, 1636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1635, 0, 1611, 0, 0, 1612, 0, 1625, 0, - 1613, 1614, 1615, 1616, 1617, 1618, 1619, 0, 0, 0, - 0, 0, 0, 0, 0, 1626, 0, 0, 0, 0, - 1627, 1620, 0, 0, 2759, 0, 0, 0, 0, 0, - 0, 1622, 0, 0, 0, 0, 0, 0, 1623, 0, - 0, 0, 0, 1628, 1629, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1630, 0, - 0, 0, 0, 0, 0, 1624, 0, 0, 0, 0, - 0, 0, 1625, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1626, - 0, 0, 0, 0, 1627, 0, 1631, 0, 1636, 1632, - 0, 1637, 1638, 1639, 0, 1640, 1641, 1642, 1643, 1644, - 1645, 0, 0, 1633, 0, 0, 1634, 1628, 1629, 0, - 0, 0, 0, 0, 0, 0, 1611, 0, 0, 1612, - 0, 0, 1630, 1613, 1614, 1615, 1616, 1617, 1618, 1619, + 0, 1637, 0, 0, 1638, 1639, 1640, 0, 1641, 1642, + 1643, 1644, 1645, 1646, 0, 0, 0, 0, 1612, 0, + 0, 1613, 0, 0, 0, 1614, 1615, 1616, 1617, 1618, + 1619, 1620, 0, 0, 0, 0, 0, 0, 0, 0, + 1637, 0, 0, 1638, 1639, 1640, 1621, 1641, 1642, 1643, + 1644, 1645, 1646, 0, 0, 0, 1623, 0, 1626, 0, + 0, 0, 0, 1624, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1627, 0, 0, 0, 0, + 1628, 0, 0, 0, 0, 0, 0, 0, 0, 1637, + 1625, 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, 1644, + 1645, 1646, 0, 1629, 1630, 0, 0, 0, 0, 0, + 0, 0, 0, 1612, 0, 0, 1613, 0, 1631, 0, + 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1620, 0, 0, 0, 0, 0, - 0, 1625, 0, 0, 1622, 0, 0, 0, 0, 0, - 1631, 1623, 0, 1632, 0, 0, 0, 0, 1626, 0, - 0, 0, 0, 1627, 0, 0, 0, 1633, 0, 0, - 1634, 0, 0, 0, 0, 0, 0, 0, 1624, 0, - 0, 0, 0, 0, 0, 0, 1806, 1629, 0, 0, - 0, 0, 0, 1635, 0, 0, 0, 0, 0, 0, - 0, 1630, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1611, 0, 0, 1612, 0, 0, 0, 1613, - 1614, 0, 0, 1617, 1618, 1619, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1631, - 1620, 0, 1632, 0, 0, 0, 0, 0, 0, 0, - 1622, 0, 0, 0, 0, 0, 1633, 1623, 0, 1634, - 0, 0, 0, 0, 0, 0, 0, 1635, 0, 0, + 0, 1621, 0, 0, 0, 1943, 0, 0, 0, 0, + 0, 1623, 0, 0, 0, 0, 1632, 0, 1624, 1633, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1634, 0, 0, 1635, 0, 0, 0, + 0, 0, 1941, 0, 0, 1625, 0, 1626, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1627, 0, 0, 0, 0, 1628, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1629, 1630, 0, 0, 0, 0, 0, 0, + 0, 0, 1612, 0, 0, 1613, 0, 1631, 0, 1614, + 1615, 1616, 1617, 1618, 1619, 1620, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1621, 0, 0, 0, 0, 1636, 0, 0, 0, 0, + 1623, 0, 1626, 0, 0, 1632, 0, 1624, 1633, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1627, + 0, 0, 1634, 0, 1628, 1635, 0, 0, 0, 0, 0, 0, 0, 0, 1625, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1624, 0, 0, 0, 0, 0, - 0, 1626, 0, 0, 0, 0, 1627, 0, 0, 0, - 1636, 0, 0, 1637, 1638, 1639, 0, 1640, 1641, 1642, - 1643, 1644, 1645, 0, 0, 1611, 0, 0, 1612, 1628, - 1629, 0, 1613, 1614, 0, 0, 1617, 1618, 1619, 0, - 0, 0, 0, 0, 1630, 0, 0, 0, 0, 0, - 0, 0, 0, 1620, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1622, 0, 1611, 1635, 0, 1612, 0, - 1623, 0, 1613, 1614, 0, 0, 1617, 1618, 1619, 0, - 0, 0, 1631, 0, 1636, 1632, 0, 1637, 1638, 1639, - 1625, 1640, 1641, 1642, 1643, 1644, 1645, 1624, 0, 1633, - 0, 0, 1634, 1622, 0, 0, 0, 1626, 0, 0, - 1623, 0, 1627, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1629, 1630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1628, 1629, 1624, 0, 0, + 0, 0, 1631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1636, 0, 0, 1637, 1638, 1639, 0, - 1640, 1641, 1642, 1643, 1644, 1645, 0, 0, 1631, 0, - 0, 1632, 0, 1625, 0, 0, 0, 0, 0, 1635, - 0, 0, 0, 0, 0, 1633, 0, 0, 1634, 0, - 1626, 0, 0, 0, 0, 1627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1625, 0, 0, 0, 0, 1628, 1629, + 1632, 0, 1637, 1633, 0, 1638, 1639, 1640, 0, 1641, + 1642, 1643, 1644, 1645, 1646, 0, 0, 1634, 0, 0, + 1635, 2066, 0, 0, 1636, 0, 1612, 0, 0, 1613, + 0, 1626, 0, 1614, 1615, 1616, 1617, 1618, 1619, 1620, + 0, 0, 0, 0, 0, 0, 0, 0, 1627, 0, + 0, 0, 0, 1628, 1621, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1623, 0, 0, 0, 0, 0, + 0, 1624, 0, 0, 0, 0, 1629, 1630, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1631, 0, 0, 0, 0, 0, 0, 1625, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1636, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1632, + 0, 1637, 1633, 0, 1638, 1639, 1640, 0, 1641, 1642, + 1643, 1644, 1645, 1646, 0, 0, 1634, 0, 0, 1635, + 0, 0, 0, 0, 0, 1612, 0, 0, 1613, 0, + 0, 0, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1621, 0, 0, 0, 2781, 0, 0, + 0, 0, 0, 1623, 0, 1626, 0, 0, 0, 0, + 1624, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1627, 0, 0, 0, 0, 1628, 0, 0, + 0, 0, 0, 0, 0, 0, 1637, 1625, 0, 1638, + 1639, 1640, 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, + 1629, 1630, 0, 0, 0, 0, 0, 0, 1636, 0, + 1612, 0, 0, 1613, 0, 1631, 0, 1614, 1615, 1616, + 1617, 1618, 1619, 1620, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1621, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1623, 0, + 0, 0, 0, 1632, 0, 1624, 1633, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1634, 0, 0, 1635, 0, 0, 0, 0, 0, 0, + 0, 0, 1625, 0, 1626, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1627, 0, 0, 0, 0, 1628, 0, 0, 0, + 0, 0, 0, 0, 0, 1637, 0, 0, 1638, 1639, + 1640, 0, 1641, 1642, 1643, 1644, 1645, 1646, 0, 1629, + 1630, 0, 0, 0, 0, 0, 0, 0, 0, 1612, + 0, 0, 1613, 0, 1631, 0, 1614, 1615, 1616, 1617, + 1618, 1619, 1620, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1621, 0, 0, + 0, 0, 1636, 0, 0, 0, 0, 1623, 0, 1626, + 0, 0, 1632, 0, 1624, 1633, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1627, 0, 0, 1634, + 0, 1628, 1635, 0, 0, 2768, 0, 0, 0, 0, + 0, 1625, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1629, 1630, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1626, 0, 0, 1630, 0, 1627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1628, 1629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1631, 0, 1630, 1632, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1635, 1636, 0, 1633, 1637, - 1638, 1639, 0, 1640, 1641, 1642, 1643, 2188, 1645, 0, + 0, 0, 0, 0, 0, 0, 0, 1632, 0, 1637, + 1633, 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, 1644, + 1645, 1646, 0, 0, 1634, 0, 0, 1635, 0, 0, + 0, 1636, 0, 1612, 0, 0, 1613, 0, 1626, 0, + 1614, 1615, 1616, 1617, 1618, 1619, 1620, 0, 0, 0, + 0, 0, 0, 0, 0, 1627, 0, 0, 0, 0, + 1628, 1621, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1623, 0, 0, 0, 0, 0, 0, 1624, 0, + 0, 0, 0, 1811, 1630, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1631, 0, + 0, 0, 0, 0, 0, 1625, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1612, 0, 0, 1613, + 0, 0, 0, 1614, 1615, 0, 1636, 1618, 1619, 1620, + 0, 0, 0, 0, 0, 0, 1632, 0, 1637, 1633, + 0, 1638, 1639, 1640, 1621, 1641, 1642, 1643, 1644, 1645, + 1646, 0, 0, 1634, 1623, 0, 1635, 0, 0, 0, + 0, 1624, 0, 1612, 0, 0, 1613, 0, 0, 0, + 1614, 1615, 0, 0, 1618, 1619, 1620, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1631, 0, 0, 1632, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1633, 0, + 0, 1623, 1626, 0, 0, 0, 0, 0, 1624, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1627, + 0, 0, 0, 0, 1628, 0, 0, 0, 0, 0, + 0, 0, 0, 1637, 0, 1625, 1638, 1639, 1640, 0, + 1641, 1642, 1643, 1644, 1645, 1646, 0, 1629, 1630, 0, + 0, 0, 0, 0, 0, 1636, 0, 0, 0, 0, + 0, 0, 1631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1632, 0, 1627, 1633, 0, 0, 0, 1628, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1634, 0, 0, + 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1629, 1630, 1626, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1631, 0, 0, 0, 1627, + 0, 0, 0, 0, 1628, 0, 0, 0, 0, 0, + 0, 0, 1637, 0, 0, 1638, 1639, 1640, 0, 1641, + 1642, 1643, 1644, 1645, 1646, 0, 0, -2058, -2058, 0, + 0, 0, 0, 1632, 0, 0, 1633, 0, 0, 0, + 0, 0, 1631, 0, 0, 0, 0, 0, 0, 0, + 1634, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -2058, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1635, 0, - 0, 0, 1636, 0, 0, 1637, 1638, 1639, 0, 1640, - 1641, 1642, 1643, 1644, 1645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1637, 0, 0, 1638, + 1639, 1640, 0, 1641, 1642, 1643, 1644, 2196, 1646, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1636, 0, 0, 1637, 1638, - 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 555, - 0, 2085, 0, 0, 0, 1636, 0, 0, 1637, 1638, - 1639, 0, 1640, 1641, 1642, 1643, 1644, 1645, 117, 118, - 119, 120, 121, 122, 123, 124, 556, 125, 126, 127, - 557, 558, 559, 560, 561, 562, 563, 564, 565, 129, - 130, 566, 131, 132, 133, 567, 135, 136, 137, 568, - 569, 570, 571, 572, 573, 143, 144, 145, 146, 147, - 148, 574, 575, 149, 150, 151, 152, 576, 577, 155, - 578, 156, 157, 158, 159, 579, 580, 581, 582, 583, - 163, 164, 165, 166, 167, 584, 169, 170, 171, 585, - 172, 173, 174, 175, 176, 177, 586, 587, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 589, 190, - 191, 590, 193, 591, 194, 592, 195, 196, 197, 198, - 199, 200, 593, 594, 201, 202, 203, 204, 595, 596, - 205, 206, 207, 208, 209, 597, 210, 211, 212, 598, - 213, 214, 215, 599, 216, 217, 218, 219, 600, 221, - 222, 223, 224, 225, 601, 602, 227, 603, 228, 229, - 604, 231, 605, 232, 606, 233, 607, 608, 609, 236, - 237, 610, 611, 240, 612, 241, 613, 614, 615, 244, - 245, 616, 246, 247, 248, 249, 250, 251, 252, 617, - 254, 255, 256, 257, 618, 258, 259, 260, 261, 262, - 263, 264, 619, 265, 620, 621, 268, 269, 270, 271, - 272, 622, 623, 624, 625, 626, 276, 627, 628, 279, - 629, 281, 282, 283, 284, 285, 286, 630, 631, 287, - 632, 289, 633, 634, 291, 292, 293, 294, 295, 296, - 297, 298, 635, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 636, 637, 638, 323, 324, 325, 639, - 640, 327, 328, 641, 330, 642, 643, 332, 644, 334, - 335, 336, 645, 337, 338, 646, 647, 339, 340, 341, - 648, 649, 342, 343, 650, 651, 346, 652, 653, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 654, 655, 656, 657, 360, 361, 658, 659, 364, 365, - 660, 367, 368, 369, 661, 370, 371, 372, 373, 374, - 375, 662, 376, 377, 378, 663, 380, 381, 382, 383, - 664, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 665, 397, 398, 666, 400, 401, - 402, 667, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 668, 669, 417, 418, 419, - 420, 421, 422, 670, 424, 425, 671, 672, 427, 428, - 673, 430, 674, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 675, 444, 676, 677, 678, - 446, 447, 679, 448, 680, 450, 451, 452, 453, 454, - 681, 455, 682, 683, 684, 685, 458, 459, 686, 461, - 687, 688, 463, 464, 689, 466, 467, 468, 469, 470, - 690, 691, 471, 472, 473, 692, 474, 475, 476, 477, - 693, 478, 479, 480, 481, 482, 694, 695, 696, 485, - 697, 487, 488, 489, 490, 491, 492, 493, 698, 699, - 494, 700, 701, 495, 496, 497, 498, 499, 500, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, - 512, 513, 514, 515, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 556, 125, 126, 127, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 129, 130, 566, 131, 132, 133, - 567, 135, 136, 137, 568, 569, 570, 571, 572, 573, - 143, 144, 145, 146, 147, 148, 574, 575, 149, 150, - 151, 152, 576, 577, 155, 578, 156, 157, 158, 159, - 579, 580, 581, 582, 583, 163, 164, 165, 166, 167, - 584, 169, 170, 171, 585, 172, 173, 174, 175, 176, - 177, 586, 587, 179, 180, 181, 182, 183, 184, 588, - 186, 187, 188, 589, 190, 191, 590, 193, 591, 194, - 592, 195, 196, 197, 198, 199, 200, 593, 594, 201, - 202, 203, 204, 595, 596, 205, 206, 207, 208, 209, - 597, 210, 211, 212, 598, 213, 214, 215, 599, 216, - 217, 218, 219, 600, 221, 222, 223, 224, 225, 601, - 602, 227, 603, 228, 229, 604, 231, 605, 232, 606, - 233, 607, 608, 609, 236, 237, 610, 611, 240, 612, - 241, 613, 614, 615, 244, 245, 616, 246, 247, 248, - 249, 250, 251, 252, 617, 254, 255, 256, 257, 618, - 258, 259, 260, 261, 262, 263, 264, 619, 265, 620, - 621, 268, 269, 270, 271, 272, 622, 623, 624, 625, - 626, 276, 627, 628, 279, 629, 281, 282, 283, 284, - 285, 286, 630, 631, 287, 632, 289, 633, 634, 291, - 292, 293, 294, 295, 296, 297, 298, 635, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 636, 637, - 638, 323, 324, 325, 639, 640, 327, 328, 641, 330, - 642, 643, 332, 644, 334, 335, 336, 645, 337, 338, - 646, 647, 339, 340, 341, 648, 649, 342, 343, 650, - 651, 346, 652, 653, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 654, 655, 656, 657, 360, - 361, 658, 659, 364, 365, 660, 367, 368, 369, 661, - 370, 371, 372, 373, 374, 375, 662, 376, 377, 378, - 663, 380, 381, 382, 383, 664, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 665, - 397, 398, 666, 400, 401, 402, 667, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 668, 669, 417, 418, 419, 420, 421, 422, 670, 424, - 425, 671, 672, 427, 428, 673, 430, 674, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 675, 444, 676, 677, 678, 446, 447, 679, 448, 680, - 450, 451, 452, 453, 454, 681, 455, 682, 683, 684, - 685, 458, 459, 686, 461, 687, 688, 463, 464, 689, - 466, 467, 468, 469, 470, 690, 691, 471, 472, 473, - 692, 474, 475, 476, 477, 693, 478, 479, 480, 481, - 482, 694, 695, 696, 485, 697, 487, 488, 489, 490, - 491, 492, 493, 698, 699, 494, 700, 701, 495, 496, - 497, 498, 499, 500, 702, 703, 704, 705, 706, 707, - 708, 709, 710, 711, 712, 512, 513, 514, 515, 555, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1637, + 0, 0, 1638, 1639, 1640, 0, 1641, 1642, 1643, 1644, + 1645, 1646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 556, 125, 126, 127, - 557, 558, 559, 560, 561, 562, 563, 564, 565, 129, - 130, 566, 131, 132, 133, 567, 135, 136, 137, 568, - 569, 570, 571, 572, 573, 143, 144, 145, 146, 147, - 148, 574, 575, 149, 150, 151, 152, 576, 577, 155, - 578, 156, 157, 158, 159, 579, 580, 581, 582, 583, - 163, 164, 165, 166, 167, 584, 169, 170, 171, 585, - 172, 173, 174, 175, 176, 177, 586, 587, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 589, 190, - 191, 590, 193, 591, 194, 592, 195, 196, 197, 198, - 199, 200, 593, 594, 201, 202, 203, 204, 595, 596, - 205, 206, 207, 208, 209, 597, 210, 211, 212, 598, - 213, 214, 215, 599, 216, 217, 218, 219, 600, 221, - 222, 223, 224, 225, 601, 602, 227, 603, 228, 229, - 604, 231, 605, 232, 606, 233, 607, 608, 609, 236, - 237, 610, 611, 240, 612, 241, 613, 614, 615, 244, - 245, 616, 246, 247, 248, 249, 250, 940, 252, 617, - 254, 255, 256, 257, 618, 258, 259, 260, 261, 262, - 263, 264, 619, 265, 620, 621, 268, 269, 270, 271, - 272, 622, 623, 624, 625, 626, 276, 627, 628, 279, - 629, 281, 282, 283, 284, 285, 286, 630, 631, 287, - 632, 289, 633, 634, 291, 292, 293, 294, 295, 296, - 297, 298, 635, 300, 301, 302, 303, 304, 305, 306, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 559, 0, 2089, 0, 0, 0, 1637, 0, 0, 1638, + 1639, 1640, 0, 1641, 1642, 1643, 1644, 1645, 1646, 118, + 119, 120, 121, 122, 123, 124, 125, 560, 126, 127, + 128, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 130, 131, 570, 132, 133, 134, 571, 136, 137, 138, + 572, 573, 574, 575, 576, 577, 144, 145, 146, 147, + 148, 149, 578, 579, 150, 151, 152, 153, 580, 581, + 156, 582, 157, 158, 159, 160, 583, 584, 585, 586, + 587, 164, 165, 166, 167, 168, 588, 170, 171, 172, + 589, 173, 174, 175, 176, 177, 178, 590, 591, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 593, + 191, 192, 594, 194, 595, 195, 596, 196, 197, 198, + 199, 200, 201, 597, 598, 202, 203, 204, 205, 599, + 600, 206, 207, 208, 209, 210, 601, 211, 212, 213, + 602, 214, 215, 216, 603, 217, 218, 219, 220, 604, + 222, 223, 224, 225, 226, 227, 605, 606, 229, 607, + 230, 231, 608, 233, 609, 234, 610, 235, 611, 612, + 613, 238, 239, 614, 615, 242, 616, 243, 617, 618, + 619, 246, 247, 620, 248, 249, 250, 251, 252, 253, + 254, 621, 256, 257, 258, 259, 622, 260, 261, 262, + 263, 264, 265, 266, 623, 267, 624, 625, 270, 271, + 272, 273, 274, 626, 627, 628, 629, 630, 278, 631, + 632, 281, 633, 283, 284, 285, 286, 287, 288, 634, + 635, 289, 636, 291, 637, 638, 293, 294, 295, 296, + 297, 298, 299, 300, 639, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 636, 637, 638, 323, 324, 325, 639, - 640, 327, 328, 641, 330, 642, 643, 332, 644, 334, - 335, 336, 645, 337, 338, 646, 647, 339, 340, 341, - 648, 649, 342, 343, 650, 651, 346, 652, 653, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 654, 655, 656, 657, 360, 361, 658, 659, 364, 365, - 660, 367, 368, 369, 661, 370, 371, 372, 373, 374, - 375, 662, 376, 377, 378, 663, 380, 381, 382, 383, - 664, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 665, 397, 398, 666, 400, 401, - 402, 667, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 668, 669, 417, 418, 419, - 420, 421, 422, 670, 424, 425, 671, 672, 427, 428, - 673, 430, 674, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 675, 444, 676, 677, 678, - 446, 447, 679, 448, 680, 450, 451, 452, 453, 454, - 681, 455, 682, 683, 684, 685, 458, 459, 686, 461, - 687, 688, 463, 464, 689, 466, 467, 468, 469, 470, - 690, 691, 471, 472, 473, 692, 474, 475, 476, 477, - 693, 478, 479, 480, 481, 482, 694, 695, 696, 485, - 697, 487, 488, 489, 490, 491, 492, 493, 698, 699, - 494, 700, 701, 495, 496, 497, 498, 499, 500, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, - 512, 513, 514, 515, 555, 0, 0, 0, 0, 0, + 317, 318, 319, 320, 321, 640, 641, 642, 325, 326, + 327, 643, 644, 329, 330, 645, 332, 646, 647, 334, + 648, 336, 337, 338, 649, 339, 340, 650, 651, 341, + 342, 343, 652, 653, 344, 345, 654, 655, 348, 656, + 657, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 658, 659, 660, 661, 362, 363, 662, 663, + 366, 367, 664, 369, 370, 371, 665, 372, 373, 374, + 375, 376, 377, 666, 378, 379, 380, 381, 382, 667, + 384, 385, 386, 387, 668, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 669, 401, + 402, 670, 404, 405, 406, 671, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 672, + 673, 421, 422, 423, 424, 425, 426, 674, 428, 429, + 675, 676, 431, 432, 677, 434, 678, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 679, + 448, 680, 681, 682, 450, 451, 683, 452, 684, 454, + 455, 456, 457, 458, 685, 459, 686, 687, 688, 689, + 462, 463, 690, 465, 691, 692, 467, 468, 693, 470, + 471, 472, 473, 474, 694, 695, 475, 476, 477, 696, + 478, 479, 480, 481, 697, 482, 483, 484, 485, 486, + 698, 699, 700, 489, 701, 491, 492, 493, 494, 495, + 496, 497, 702, 703, 498, 704, 705, 499, 500, 501, + 502, 503, 504, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 516, 517, 518, 519, 559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 556, 125, 126, 127, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 129, 130, 566, 131, 132, 133, - 567, 135, 136, 137, 568, 569, 570, 571, 572, 573, - 143, 144, 145, 146, 147, 148, 574, 575, 149, 150, - 151, 152, 576, 577, 155, 578, 156, 157, 158, 159, - 579, 580, 581, 582, 583, 163, 164, 165, 166, 167, - 584, 169, 170, 171, 585, 172, 173, 174, 175, 176, - 177, 586, 587, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 589, 190, 191, 590, 193, 591, 194, - 592, 195, 196, 197, 198, 199, 200, 593, 594, 201, - 202, 203, 204, 595, 596, 205, 206, 207, 208, 209, - 597, 210, 211, 212, 598, 213, 214, 215, 599, 216, - 217, 218, 219, 600, 221, 222, 223, 224, 225, 601, - 602, 227, 603, 228, 229, 604, 231, 605, 232, 606, - 233, 607, 608, 609, 236, 237, 610, 611, 240, 612, - 241, 613, 614, 615, 244, 245, 616, 246, 247, 248, - 249, 250, 251, 252, 617, 254, 255, 256, 257, 618, - 258, 259, 260, 261, 262, 263, 264, 619, 265, 620, - 621, 268, 269, 270, 271, 272, 622, 623, 624, 625, - 626, 276, 627, 628, 279, 629, 281, 282, 283, 284, - 285, 286, 630, 631, 287, 632, 289, 633, 634, 291, - 292, 293, 294, 295, 296, 297, 298, 635, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 636, 637, - 638, 323, 324, 325, 639, 640, 327, 328, 641, 330, - 642, 643, 332, 644, 334, 335, 336, 645, 337, 338, - 646, 647, 339, 340, 341, 648, 649, 342, 343, 650, - 651, 346, 652, 653, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 654, 655, 656, 657, 360, - 361, 658, 659, 364, 365, 660, 367, 368, 369, 661, - 370, 371, 372, 373, 374, 375, 662, 376, 377, 378, - 663, 380, 381, 382, 383, 664, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 665, - 397, 398, 666, 400, 401, 402, 667, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 668, 669, 417, 418, 419, 420, 421, 422, 670, 424, - 425, 671, 672, 427, 428, 673, 430, 674, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 675, 444, 676, 677, 678, 446, 447, 679, 448, 680, - 450, 451, 452, 453, 454, 681, 455, 682, 683, 684, - 685, 458, 459, 686, 461, 687, 688, 463, 464, 689, - 466, 467, 468, 469, 470, 690, 691, 471, 472, 473, - 692, 474, 475, 476, 477, 693, 478, 479, 480, 481, - 482, 694, 695, 696, 485, 697, 487, 488, 489, 490, - 491, 492, 493, 698, 699, 494, 700, 701, 495, 496, - 497, 498, 499, 500, 702, 703, 704, 705, 706, 707, - 708, 709, 710, 711, 712, 512, 513, 514, 515, 555, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 560, 126, 127, 128, 561, + 562, 563, 564, 565, 566, 567, 568, 569, 130, 131, + 570, 132, 133, 134, 571, 136, 137, 138, 572, 573, + 574, 575, 576, 577, 144, 145, 146, 147, 148, 149, + 578, 579, 150, 151, 152, 153, 580, 581, 156, 582, + 157, 158, 159, 160, 583, 584, 585, 586, 587, 164, + 165, 166, 167, 168, 588, 170, 171, 172, 589, 173, + 174, 175, 176, 177, 178, 590, 591, 180, 181, 182, + 183, 184, 185, 592, 187, 188, 189, 593, 191, 192, + 594, 194, 595, 195, 596, 196, 197, 198, 199, 200, + 201, 597, 598, 202, 203, 204, 205, 599, 600, 206, + 207, 208, 209, 210, 601, 211, 212, 213, 602, 214, + 215, 216, 603, 217, 218, 219, 220, 604, 222, 223, + 224, 225, 226, 227, 605, 606, 229, 607, 230, 231, + 608, 233, 609, 234, 610, 235, 611, 612, 613, 238, + 239, 614, 615, 242, 616, 243, 617, 618, 619, 246, + 247, 620, 248, 249, 250, 251, 252, 253, 254, 621, + 256, 257, 258, 259, 622, 260, 261, 262, 263, 264, + 265, 266, 623, 267, 624, 625, 270, 271, 272, 273, + 274, 626, 627, 628, 629, 630, 278, 631, 632, 281, + 633, 283, 284, 285, 286, 287, 288, 634, 635, 289, + 636, 291, 637, 638, 293, 294, 295, 296, 297, 298, + 299, 300, 639, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 640, 641, 642, 325, 326, 327, 643, + 644, 329, 330, 645, 332, 646, 647, 334, 648, 336, + 337, 338, 649, 339, 340, 650, 651, 341, 342, 343, + 652, 653, 344, 345, 654, 655, 348, 656, 657, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 658, 659, 660, 661, 362, 363, 662, 663, 366, 367, + 664, 369, 370, 371, 665, 372, 373, 374, 375, 376, + 377, 666, 378, 379, 380, 381, 382, 667, 384, 385, + 386, 387, 668, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 669, 401, 402, 670, + 404, 405, 406, 671, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 672, 673, 421, + 422, 423, 424, 425, 426, 674, 428, 429, 675, 676, + 431, 432, 677, 434, 678, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 679, 448, 680, + 681, 682, 450, 451, 683, 452, 684, 454, 455, 456, + 457, 458, 685, 459, 686, 687, 688, 689, 462, 463, + 690, 465, 691, 692, 467, 468, 693, 470, 471, 472, + 473, 474, 694, 695, 475, 476, 477, 696, 478, 479, + 480, 481, 697, 482, 483, 484, 485, 486, 698, 699, + 700, 489, 701, 491, 492, 493, 494, 495, 496, 497, + 702, 703, 498, 704, 705, 499, 500, 501, 502, 503, + 504, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 516, 517, 518, 519, 559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 2233, 122, 123, 124, 556, 125, 126, 127, - 557, 558, 559, 560, 561, 562, 563, 564, 565, 129, - 130, 566, 131, 132, 133, 567, 135, 136, 137, 568, - 569, 570, 571, 572, 573, 143, 144, 145, 146, 147, - 148, 574, 575, 149, 150, 151, 152, 576, 577, 155, - 578, 156, 157, 158, 159, 579, 580, 581, 582, 583, - 163, 164, 165, 166, 167, 584, 169, 170, 171, 585, - 172, 173, 174, 175, 176, 177, 586, 587, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 589, 190, - 191, 590, 193, 591, 194, 592, 195, 196, 197, 198, - 199, 200, 593, 594, 201, 202, 203, 204, 595, 596, - 205, 206, 207, 2234, 209, 597, 210, 211, 212, 598, - 213, 214, 215, 599, 216, 217, 218, 219, 600, 221, - 222, 223, 224, 225, 601, 602, 227, 603, 228, 229, - 604, 231, 605, 232, 606, 233, 607, 608, 609, 236, - 237, 610, 611, 240, 612, 241, 613, 614, 615, 244, - 245, 616, 246, 247, 248, 249, 250, 251, 252, 617, - 254, 255, 256, 257, 618, 258, 259, 260, 261, 262, - 263, 264, 619, 265, 620, 621, 268, 269, 270, 271, - 272, 622, 623, 624, 625, 626, 276, 627, 628, 279, - 629, 281, 282, 283, 284, 285, 286, 630, 631, 287, - 632, 289, 633, 634, 291, 292, 293, 294, 295, 296, - 297, 298, 635, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 636, 637, 638, 323, 324, 325, 639, - 640, 327, 328, 641, 330, 642, 643, 332, 644, 334, - 335, 336, 645, 337, 338, 646, 647, 339, 340, 341, - 648, 649, 342, 343, 650, 651, 346, 652, 653, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 654, 655, 656, 657, 360, 361, 658, 659, 364, 365, - 660, 367, 368, 369, 661, 370, 371, 372, 373, 374, - 375, 662, 376, 377, 378, 663, 380, 381, 382, 383, - 664, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 665, 397, 398, 666, 400, 401, - 402, 667, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 668, 669, 417, 418, 419, - 420, 421, 2235, 670, 424, 425, 671, 672, 427, 428, - 673, 430, 674, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 675, 444, 676, 677, 678, - 446, 447, 679, 448, 680, 450, 451, 452, 453, 454, - 681, 455, 682, 683, 684, 685, 458, 459, 686, 461, - 687, 688, 463, 464, 689, 466, 467, 468, 469, 470, - 690, 691, 471, 472, 473, 692, 474, 475, 476, 477, - 693, 478, 479, 480, 481, 482, 694, 695, 696, 485, - 697, 487, 488, 489, 490, 491, 492, 493, 698, 699, - 494, 700, 701, 495, 496, 497, 498, 499, 500, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, - 512, 513, 514, 515, 964, 0, 815, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 560, 126, 127, 128, 561, 562, 563, + 564, 565, 566, 567, 568, 569, 130, 131, 570, 132, + 133, 134, 571, 136, 137, 138, 572, 573, 574, 575, + 576, 577, 144, 145, 146, 147, 148, 149, 578, 579, + 150, 151, 152, 153, 580, 581, 156, 582, 157, 158, + 159, 160, 583, 584, 585, 586, 587, 164, 165, 166, + 167, 168, 588, 170, 171, 172, 589, 173, 174, 175, + 176, 177, 178, 590, 591, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 593, 191, 192, 594, 194, + 595, 195, 596, 196, 197, 198, 199, 200, 201, 597, + 598, 202, 203, 204, 205, 599, 600, 206, 207, 208, + 209, 210, 601, 211, 212, 213, 602, 214, 215, 216, + 603, 217, 218, 219, 220, 604, 222, 223, 224, 225, + 226, 227, 605, 606, 229, 607, 230, 231, 608, 233, + 609, 234, 610, 235, 611, 612, 613, 238, 239, 614, + 615, 242, 616, 243, 617, 618, 619, 246, 247, 620, + 248, 249, 250, 251, 252, 944, 254, 621, 256, 257, + 258, 259, 622, 260, 261, 262, 263, 264, 265, 266, + 623, 267, 624, 625, 270, 271, 272, 273, 274, 626, + 627, 628, 629, 630, 278, 631, 632, 281, 633, 283, + 284, 285, 286, 287, 288, 634, 635, 289, 636, 291, + 637, 638, 293, 294, 295, 296, 297, 298, 299, 300, + 639, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 640, 641, 642, 325, 326, 327, 643, 644, 329, + 330, 645, 332, 646, 647, 334, 648, 336, 337, 338, + 649, 339, 340, 650, 651, 341, 342, 343, 652, 653, + 344, 345, 654, 655, 348, 656, 657, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 658, 659, + 660, 661, 362, 363, 662, 663, 366, 367, 664, 369, + 370, 371, 665, 372, 373, 374, 375, 376, 377, 666, + 378, 379, 380, 381, 382, 667, 384, 385, 386, 387, + 668, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 669, 401, 402, 670, 404, 405, + 406, 671, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 672, 673, 421, 422, 423, + 424, 425, 426, 674, 428, 429, 675, 676, 431, 432, + 677, 434, 678, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 679, 448, 680, 681, 682, + 450, 451, 683, 452, 684, 454, 455, 456, 457, 458, + 685, 459, 686, 687, 688, 689, 462, 463, 690, 465, + 691, 692, 467, 468, 693, 470, 471, 472, 473, 474, + 694, 695, 475, 476, 477, 696, 478, 479, 480, 481, + 697, 482, 483, 484, 485, 486, 698, 699, 700, 489, + 701, 491, 492, 493, 494, 495, 496, 497, 702, 703, + 498, 704, 705, 499, 500, 501, 502, 503, 504, 706, + 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 516, 517, 518, 519, 559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 560, 0, - 0, 0, 0, 565, 129, 130, 0, 131, 132, 133, - 567, 135, 136, 137, 568, 569, 570, 571, 572, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 576, 577, 155, 0, 156, 157, 158, 159, - 579, 0, 581, 0, 583, 163, 164, 165, 166, 167, - 584, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 587, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 589, 190, 191, 590, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 600, 221, 222, 223, 224, 225, 601, - 1342, 227, 0, 228, 229, 604, 231, 0, 232, 0, - 233, 607, 0, 609, 236, 237, 610, 611, 240, 0, - 241, 0, 614, 615, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 617, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 620, - 621, 268, 269, 270, 271, 272, 622, 623, 0, 625, - 0, 276, 627, 628, 279, 629, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 632, 289, 633, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 635, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 636, 637, - 638, 323, 324, 325, 639, 0, 327, 328, 641, 330, - 0, 643, 332, 644, 334, 335, 336, 0, 337, 338, - 1343, 0, 339, 340, 341, 0, 0, 342, 343, 650, - 651, 346, 652, 653, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 658, 659, 364, 365, 660, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 663, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 666, 400, 401, 402, 667, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 669, 417, 418, 419, 420, 421, 422, 670, 424, - 425, 0, 672, 427, 428, 673, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 675, 444, 676, 0, 0, 446, 447, 0, 448, 680, - 450, 451, 452, 453, 454, 0, 455, 682, 683, 0, - 0, 458, 459, 686, 461, 687, 1344, 463, 464, 689, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 694, 695, 0, 485, 697, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 702, 703, 704, 705, 706, 707, - 708, 709, 710, 711, 712, 512, 513, 514, 515, 964, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 560, 126, 127, 128, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 130, 131, 570, 132, 133, 134, + 571, 136, 137, 138, 572, 573, 574, 575, 576, 577, + 144, 145, 146, 147, 148, 149, 578, 579, 150, 151, + 152, 153, 580, 581, 156, 582, 157, 158, 159, 160, + 583, 584, 585, 586, 587, 164, 165, 166, 167, 168, + 588, 170, 171, 172, 589, 173, 174, 175, 176, 177, + 178, 590, 591, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 593, 191, 192, 594, 194, 595, 195, + 596, 196, 197, 198, 199, 200, 201, 597, 598, 202, + 203, 204, 205, 599, 600, 206, 207, 208, 209, 210, + 601, 211, 212, 213, 602, 214, 215, 216, 603, 217, + 218, 219, 220, 604, 222, 223, 224, 225, 226, 227, + 605, 606, 229, 607, 230, 231, 608, 233, 609, 234, + 610, 235, 611, 612, 613, 238, 239, 614, 615, 242, + 616, 243, 617, 618, 619, 246, 247, 620, 248, 249, + 250, 251, 252, 253, 254, 621, 256, 257, 258, 259, + 622, 260, 261, 262, 263, 264, 265, 266, 623, 267, + 624, 625, 270, 271, 272, 273, 274, 626, 627, 628, + 629, 630, 278, 631, 632, 281, 633, 283, 284, 285, + 286, 287, 288, 634, 635, 289, 636, 291, 637, 638, + 293, 294, 295, 296, 297, 298, 299, 300, 639, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 640, + 641, 642, 325, 326, 327, 643, 644, 329, 330, 645, + 332, 646, 647, 334, 648, 336, 337, 338, 649, 339, + 340, 650, 651, 341, 342, 343, 652, 653, 344, 345, + 654, 655, 348, 656, 657, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 658, 659, 660, 661, + 362, 363, 662, 663, 366, 367, 664, 369, 370, 371, + 665, 372, 373, 374, 375, 376, 377, 666, 378, 379, + 380, 381, 382, 667, 384, 385, 386, 387, 668, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 669, 401, 402, 670, 404, 405, 406, 671, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 672, 673, 421, 422, 423, 424, 425, + 426, 674, 428, 429, 675, 676, 431, 432, 677, 434, + 678, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 679, 448, 680, 681, 682, 450, 451, + 683, 452, 684, 454, 455, 456, 457, 458, 685, 459, + 686, 687, 688, 689, 462, 463, 690, 465, 691, 692, + 467, 468, 693, 470, 471, 472, 473, 474, 694, 695, + 475, 476, 477, 696, 478, 479, 480, 481, 697, 482, + 483, 484, 485, 486, 698, 699, 700, 489, 701, 491, + 492, 493, 494, 495, 496, 497, 702, 703, 498, 704, + 705, 499, 500, 501, 502, 503, 504, 706, 707, 708, + 709, 710, 711, 712, 713, 714, 715, 716, 516, 517, + 518, 519, 559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 3, 4, 0, 560, 0, 0, 0, 0, 565, 129, - 130, 0, 131, 132, 133, 567, 135, 136, 137, 568, - 569, 570, 571, 572, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 576, 577, 155, - 0, 156, 157, 158, 159, 579, 0, 581, 0, 583, - 163, 164, 165, 166, 167, 584, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 587, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 589, 190, - 191, 590, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 600, 221, - 222, 223, 224, 225, 601, 0, 227, 0, 228, 229, - 604, 231, 0, 232, 0, 233, 607, 0, 609, 236, - 237, 610, 611, 240, 0, 241, 0, 614, 615, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 617, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 620, 621, 268, 269, 270, 271, - 272, 622, 623, 0, 625, 0, 276, 627, 628, 279, - 629, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 632, 289, 633, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 635, 300, 301, 302, 303, 304, 305, 306, + 0, 118, 119, 120, 121, 2241, 123, 124, 125, 560, + 126, 127, 128, 561, 562, 563, 564, 565, 566, 567, + 568, 569, 130, 131, 570, 132, 133, 134, 571, 136, + 137, 138, 572, 573, 574, 575, 576, 577, 144, 145, + 146, 147, 148, 149, 578, 579, 150, 151, 152, 153, + 580, 581, 156, 582, 157, 158, 159, 160, 583, 584, + 585, 586, 587, 164, 165, 166, 167, 168, 588, 170, + 171, 172, 589, 173, 174, 175, 176, 177, 178, 590, + 591, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 593, 191, 192, 594, 194, 595, 195, 596, 196, + 197, 198, 199, 200, 201, 597, 598, 202, 203, 204, + 205, 599, 600, 206, 207, 208, 2242, 210, 601, 211, + 212, 213, 602, 214, 215, 216, 603, 217, 218, 219, + 220, 604, 222, 223, 224, 225, 226, 227, 605, 606, + 229, 607, 230, 231, 608, 233, 609, 234, 610, 235, + 611, 612, 613, 238, 239, 614, 615, 242, 616, 243, + 617, 618, 619, 246, 247, 620, 248, 249, 250, 251, + 252, 253, 254, 621, 256, 257, 258, 259, 622, 260, + 261, 262, 263, 264, 265, 266, 623, 267, 624, 625, + 270, 271, 272, 273, 274, 626, 627, 628, 629, 630, + 278, 631, 632, 281, 633, 283, 284, 285, 286, 287, + 288, 634, 635, 289, 636, 291, 637, 638, 293, 294, + 295, 296, 297, 298, 299, 300, 639, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 640, 641, 642, + 325, 326, 327, 643, 644, 329, 330, 645, 332, 646, + 647, 334, 648, 336, 337, 338, 649, 339, 340, 650, + 651, 341, 342, 343, 652, 653, 344, 345, 654, 655, + 348, 656, 657, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 658, 659, 660, 661, 362, 363, + 662, 663, 366, 367, 664, 369, 370, 371, 665, 372, + 373, 374, 375, 376, 377, 666, 378, 379, 380, 381, + 382, 667, 384, 385, 386, 387, 668, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 669, 401, 402, 670, 404, 405, 406, 671, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 672, 673, 421, 422, 423, 424, 425, 2243, 674, + 428, 429, 675, 676, 431, 432, 677, 434, 678, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 679, 448, 680, 681, 682, 450, 451, 683, 452, + 684, 454, 455, 456, 457, 458, 685, 459, 686, 687, + 688, 689, 462, 463, 690, 465, 691, 692, 467, 468, + 693, 470, 471, 472, 473, 474, 694, 695, 475, 476, + 477, 696, 478, 479, 480, 481, 697, 482, 483, 484, + 485, 486, 698, 699, 700, 489, 701, 491, 492, 493, + 494, 495, 496, 497, 702, 703, 498, 704, 705, 499, + 500, 501, 502, 503, 504, 706, 707, 708, 709, 710, + 711, 712, 713, 714, 715, 716, 516, 517, 518, 519, + 968, 0, 819, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 564, 0, 0, 0, 0, 569, + 130, 131, 0, 132, 133, 134, 571, 136, 137, 138, + 572, 573, 574, 575, 576, 0, 144, 145, 146, 147, + 148, 149, 0, 0, 150, 151, 152, 153, 580, 581, + 156, 0, 157, 158, 159, 160, 583, 0, 585, 0, + 587, 164, 165, 166, 167, 168, 588, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 591, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 593, + 191, 192, 594, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 208, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 604, + 222, 223, 224, 225, 226, 227, 605, 1346, 229, 0, + 230, 231, 608, 233, 0, 234, 0, 235, 611, 0, + 613, 238, 239, 614, 615, 242, 0, 243, 0, 618, + 619, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 621, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 624, 625, 270, 271, + 272, 273, 274, 626, 627, 0, 629, 0, 278, 631, + 632, 281, 633, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 636, 291, 637, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 639, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 636, 637, 638, 323, 324, 325, 639, - 0, 327, 328, 641, 330, 0, 643, 332, 644, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 650, 651, 346, 652, 653, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 658, 659, 364, 365, - 660, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 663, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 666, 400, 401, - 402, 667, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 669, 417, 418, 419, - 420, 421, 422, 670, 424, 425, 0, 672, 427, 428, - 673, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 675, 444, 676, 0, 0, - 446, 447, 0, 448, 680, 450, 451, 452, 453, 454, - 0, 455, 682, 683, 0, 0, 458, 459, 686, 461, - 687, 0, 463, 464, 689, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 694, 695, 0, 485, - 697, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, - 512, 513, 514, 515, 116, 0, 0, 0, 0, 0, + 317, 318, 319, 320, 321, 640, 641, 642, 325, 326, + 327, 643, 0, 329, 330, 645, 332, 0, 647, 334, + 648, 336, 337, 338, 0, 339, 340, 1347, 0, 341, + 342, 343, 0, 0, 344, 345, 654, 655, 348, 656, + 657, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 0, 0, 0, 0, 362, 363, 662, 663, + 366, 367, 664, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 667, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 670, 404, 405, 406, 671, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 673, 421, 422, 423, 424, 425, 426, 674, 428, 429, + 0, 676, 431, 432, 677, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 679, + 448, 680, 0, 0, 450, 451, 0, 452, 684, 454, + 455, 456, 457, 458, 0, 459, 686, 687, 0, 0, + 462, 463, 690, 465, 691, 1348, 467, 468, 693, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 698, 699, 0, 489, 701, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, + 502, 503, 504, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 516, 517, 518, 519, 968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 128, 129, 130, 0, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 785, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 786, 0, 787, 0, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 788, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 234, 0, 235, 236, 237, 238, 239, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 288, 289, 290, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 0, 327, 328, 329, 330, - 0, 790, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 345, 346, 347, 792, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 793, 363, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 426, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 795, 0, 0, 446, 447, 0, 448, 449, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 796, 461, 797, 0, 463, 464, 798, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 116, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 3, + 4, 0, 564, 0, 0, 0, 0, 569, 130, 131, + 0, 132, 133, 134, 571, 136, 137, 138, 572, 573, + 574, 575, 576, 0, 144, 145, 146, 147, 148, 149, + 0, 0, 150, 151, 152, 153, 580, 581, 156, 0, + 157, 158, 159, 160, 583, 0, 585, 0, 587, 164, + 165, 166, 167, 168, 588, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 591, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 593, 191, 192, + 594, 194, 0, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 208, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 604, 222, 223, + 224, 225, 226, 227, 605, 0, 229, 0, 230, 231, + 608, 233, 0, 234, 0, 235, 611, 0, 613, 238, + 239, 614, 615, 242, 0, 243, 0, 618, 619, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 621, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 624, 625, 270, 271, 272, 273, + 274, 626, 627, 0, 629, 0, 278, 631, 632, 281, + 633, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 636, 291, 637, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 639, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 640, 641, 642, 325, 326, 327, 643, + 0, 329, 330, 645, 332, 0, 647, 334, 648, 336, + 337, 338, 0, 339, 340, 0, 0, 341, 342, 343, + 0, 0, 344, 345, 654, 655, 348, 656, 657, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 662, 663, 366, 367, + 664, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 667, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 670, + 404, 405, 406, 671, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 673, 421, + 422, 423, 424, 425, 426, 674, 428, 429, 0, 676, + 431, 432, 677, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 679, 448, 680, + 0, 0, 450, 451, 0, 452, 684, 454, 455, 456, + 457, 458, 0, 459, 686, 687, 0, 0, 462, 463, + 690, 465, 691, 0, 467, 468, 693, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 698, 699, + 0, 489, 701, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 516, 517, 518, 519, 117, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 129, 130, 131, 0, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 0, 144, 145, 146, 147, 148, 149, 0, 789, + 150, 151, 152, 153, 154, 155, 156, 0, 157, 158, + 159, 160, 790, 0, 791, 0, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 208, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 792, 0, 229, 0, 230, 231, 232, 233, + 0, 234, 0, 235, 236, 0, 237, 238, 239, 240, + 241, 242, 0, 243, 0, 244, 245, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 277, 0, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 290, 291, + 292, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 0, 329, + 330, 331, 332, 0, 794, 334, 335, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 346, 347, 348, 349, 796, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 797, 365, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 430, 431, 432, + 433, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 799, 0, 0, + 450, 451, 0, 452, 453, 454, 455, 456, 457, 458, + 0, 459, 460, 461, 0, 0, 462, 463, 800, 465, + 801, 0, 467, 468, 802, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 488, 0, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 117, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 129, 130, 131, 0, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 0, + 144, 145, 146, 147, 148, 149, 0, 0, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 159, 160, + 161, 0, 162, 0, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 0, 229, 0, 230, 231, 232, 233, 0, 234, + 0, 235, 236, 0, 237, 238, 239, 240, 241, 242, + 0, 243, 0, 244, 245, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 277, 0, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 290, 291, 292, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 0, 329, 330, 331, + 332, 0, 333, 334, 335, 336, 337, 338, 0, 339, + 340, 0, 0, 341, 342, 343, 0, 0, 344, 345, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 430, 431, 432, 433, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 0, 0, 450, 451, + 0, 452, 453, 454, 455, 456, 457, 458, 0, 459, + 460, 461, 0, 0, 462, 463, 464, 465, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 488, 0, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 128, 129, - 130, 0, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 161, 0, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 178, 179, 180, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 130, 131, 0, 132, 133, 134, 0, 136, + 137, 138, 139, 140, 0, 142, 143, 0, 144, 145, + 146, 147, 148, 149, 0, 0, 150, 151, 152, 153, + 154, 155, 156, 1744, 157, 158, 159, 160, 161, 0, + 0, 1745, 163, 164, 165, 166, 167, 168, 0, 170, + 171, 172, 1746, 173, 174, 175, 176, 177, 178, 0, + 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 0, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 208, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 0, + 229, 0, 230, 231, 232, 233, 0, 234, 1747, 235, + 0, 0, 0, 238, 239, 528, 0, 242, 0, 243, + 0, 244, 245, 246, 247, 0, 248, 249, 250, 251, + 252, 1748, 254, 0, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 277, 0, + 278, 0, 0, 281, 0, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 0, 291, 0, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 529, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 0, 324, + 325, 326, 327, 328, 0, 329, 330, 0, 332, 0, + 333, 334, 335, 336, 337, 338, 0, 339, 340, 0, + 0, 341, 342, 343, 0, 0, 344, 345, 346, 0, + 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 364, 0, 366, 367, 368, 369, 370, 371, 1749, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 0, 431, 432, 433, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 530, 448, 449, 0, 0, 450, 451, 0, 452, + 0, 454, 455, 456, 457, 458, 0, 459, 460, 461, + 0, 0, 462, 463, 464, 465, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 0, 1750, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 488, 0, 489, 0, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 130, 131, 0, 132, 133, 134, 0, 136, 137, 138, + 139, 140, 0, 142, 143, 0, 144, 145, 146, 147, + 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, + 156, 1744, 157, 158, 159, 160, 161, 0, 0, 0, + 163, 164, 165, 166, 167, 168, 0, 170, 171, 172, + 1746, 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 234, 0, 235, 236, - 237, 238, 239, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 288, 289, 290, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 191, 192, 193, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 208, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 0, 229, 0, + 230, 231, 232, 233, 0, 234, 1747, 235, 0, 0, + 0, 238, 239, 528, 0, 242, 0, 243, 0, 244, + 245, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 0, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 277, 0, 278, 0, + 0, 281, 0, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 0, 291, 2323, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 0, 327, 328, 329, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 345, 346, 347, 348, 349, + 317, 318, 319, 320, 321, 322, 0, 324, 325, 326, + 327, 328, 0, 329, 330, 0, 332, 0, 333, 334, + 335, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 426, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, 444, 445, 0, 0, - 446, 447, 0, 448, 449, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, + 360, 361, 0, 0, 0, 0, 362, 363, 364, 0, + 366, 367, 368, 369, 370, 371, 1749, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 0, 431, 432, 433, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 530, + 448, 449, 0, 0, 450, 451, 0, 452, 0, 454, + 455, 456, 457, 458, 0, 459, 460, 461, 0, 0, + 462, 463, 464, 465, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 0, 1750, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 488, 0, 489, 0, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 0, 0, 0, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 527, 0, + 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 3, + 4, 0, 0, 0, 0, 0, 0, 0, 130, 131, + 0, 132, 133, 134, 0, 136, 137, 138, 139, 140, + 0, 142, 143, 0, 144, 145, 146, 147, 148, 149, + 0, 0, 150, 151, 152, 153, 154, 155, 156, 0, + 157, 158, 159, 160, 161, 0, 0, 0, 163, 164, + 165, 166, 167, 168, 0, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 0, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 208, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 0, 229, 0, 230, 231, + 232, 233, 0, 234, 0, 235, 0, 0, 0, 238, + 239, 528, 0, 242, 0, 243, 0, 244, 245, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 0, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 277, 0, 278, 0, 0, 281, + 0, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 0, 291, 0, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 0, 324, 325, 326, 327, 328, + 0, 329, 330, 0, 332, 0, 333, 334, 335, 336, + 337, 338, 0, 339, 340, 0, 0, 341, 342, 343, + 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 364, 0, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 0, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 0, + 431, 432, 433, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 530, 448, 449, + 0, 0, 450, 451, 0, 452, 0, 454, 455, 456, + 457, 458, 0, 459, 460, 461, 0, 0, 462, 463, + 464, 465, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, + 0, 489, 0, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 1739, 156, 157, 158, 159, - 160, 0, 0, 1740, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 1741, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 1742, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 1743, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 1744, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 1745, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 554, 126, 127, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 131, 0, 132, + 133, 134, 0, 136, 137, 138, 139, 140, 0, 142, + 143, 0, 144, 145, 146, 147, 148, 149, 0, 0, + 150, 151, 152, 153, 154, 155, 156, 0, 157, 158, + 159, 160, 161, 0, 0, 0, 163, 164, 165, 166, + 167, 168, 0, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 208, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 0, 229, 0, 230, 231, 232, 233, + 0, 234, 0, 235, 0, 0, 0, 238, 239, 528, + 0, 242, 0, 243, 0, 244, 245, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 0, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 277, 0, 278, 0, 0, 281, 0, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 0, 291, + 0, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 324, 325, 326, 327, 328, 0, 329, + 330, 0, 332, 0, 333, 334, 335, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 364, 0, 366, 367, 368, 555, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 0, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 0, 431, 432, + 433, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 530, 448, 449, 0, 0, + 450, 451, 0, 452, 0, 454, 455, 456, 457, 458, + 0, 459, 460, 461, 0, 0, 462, 463, 464, 465, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 488, 0, 489, + 0, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 1739, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 1741, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 130, 131, 0, 132, 133, 134, + 0, 136, 137, 138, 139, 140, 0, 142, 143, 0, + 144, 145, 146, 147, 148, 149, 0, 0, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 159, 160, + 161, 0, 0, 0, 163, 164, 165, 166, 167, 168, + 0, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 0, 229, 0, 230, 231, 232, 233, 0, 234, + 0, 235, 0, 0, 0, 238, 239, 528, 0, 242, + 0, 243, 0, 244, 245, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 0, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 277, 0, 278, 0, 0, 281, 0, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 0, 291, 0, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 529, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 0, 324, 325, 326, 327, 328, 0, 329, 330, 0, + 332, 0, 333, 334, 335, 336, 337, 338, 0, 339, + 340, 0, 795, 341, 342, 343, 0, 0, 344, 345, + 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 364, 0, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 0, 431, 432, 433, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 530, 448, 449, 0, 0, 450, 451, + 0, 452, 0, 454, 455, 456, 457, 458, 0, 459, + 460, 461, 0, 0, 462, 463, 464, 465, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 488, 0, 489, 0, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 130, 131, 0, 132, 133, 134, 0, 136, + 137, 138, 139, 140, 0, 142, 143, 0, 144, 145, + 146, 147, 148, 149, 0, 0, 150, 151, 152, 153, + 154, 155, 156, 0, 157, 158, 159, 160, 161, 0, + 0, 0, 163, 164, 165, 166, 167, 168, 0, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 0, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 208, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 0, + 229, 0, 230, 231, 232, 233, 0, 234, 0, 235, + 0, 0, 0, 238, 239, 528, 0, 242, 0, 243, + 0, 244, 245, 246, 247, 0, 248, 249, 250, 251, + 252, 900, 254, 0, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 277, 0, + 278, 0, 0, 281, 0, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 0, 291, 0, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 529, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 0, 324, + 325, 326, 327, 328, 0, 329, 330, 0, 332, 0, + 333, 334, 335, 336, 337, 338, 0, 339, 340, 0, + 795, 341, 342, 343, 0, 0, 344, 345, 346, 0, + 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 364, 0, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 0, 431, 432, 433, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 530, 448, 449, 0, 0, 450, 451, 0, 452, + 0, 454, 455, 456, 457, 458, 0, 459, 460, 461, + 0, 0, 462, 463, 464, 465, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 488, 0, 489, 0, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 942, 126, 127, + 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 130, 131, 0, 132, 133, 134, 0, 136, 137, 138, + 139, 140, 0, 142, 143, 0, 144, 145, 146, 147, + 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, + 156, 0, 157, 158, 159, 160, 161, 0, 0, 0, + 163, 164, 165, 166, 167, 168, 0, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 1742, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 2318, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, + 191, 192, 193, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 208, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 0, 229, 0, + 230, 231, 232, 233, 0, 234, 0, 235, 0, 0, + 0, 238, 239, 528, 0, 242, 0, 243, 0, 244, + 245, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 0, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 277, 0, 278, 0, + 0, 281, 0, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 0, 291, 0, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, + 317, 318, 319, 320, 321, 322, 0, 324, 325, 326, + 327, 328, 0, 329, 330, 0, 332, 0, 333, 334, + 335, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 1744, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 1745, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, + 360, 361, 0, 0, 0, 0, 362, 363, 364, 0, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 0, 431, 432, 433, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 530, + 448, 449, 0, 0, 450, 451, 0, 452, 0, 454, + 455, 456, 457, 458, 0, 459, 460, 461, 0, 0, + 462, 463, 464, 465, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 488, 0, 489, 0, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 527, 0, + 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 130, 131, + 0, 132, 133, 134, 0, 136, 137, 138, 139, 140, + 0, 142, 143, 0, 144, 145, 146, 147, 148, 149, + 0, 0, 150, 151, 152, 153, 154, 155, 156, 0, + 157, 158, 159, 160, 161, 0, 0, 0, 163, 164, + 165, 166, 167, 168, 0, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 0, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 208, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 1169, 227, 228, 0, 229, 0, 230, 231, + 232, 233, 0, 234, 0, 235, 0, 0, 0, 238, + 239, 528, 0, 242, 0, 243, 0, 244, 245, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 0, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 277, 0, 278, 0, 0, 281, + 0, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 0, 291, 0, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 0, 324, 325, 326, 327, 328, + 0, 329, 330, 0, 332, 0, 333, 334, 335, 336, + 337, 338, 0, 339, 340, 0, 795, 341, 342, 343, + 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 364, 0, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 0, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 0, + 431, 432, 433, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 530, 448, 449, + 0, 0, 450, 451, 0, 452, 0, 454, 455, 456, + 457, 458, 0, 459, 460, 461, 0, 0, 462, 463, + 464, 465, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, + 0, 489, 0, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 527, 1947, 0, 0, + 0, 0, 1948, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 131, 0, 132, + 133, 134, 0, 136, 137, 138, 139, 140, 0, 142, + 143, 0, 144, 145, 146, 147, 148, 149, 0, 0, + 150, 151, 152, 153, 154, 155, 156, 0, 157, 158, + 159, 160, 161, 0, 0, 0, 163, 164, 165, 166, + 167, 168, 0, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 208, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 0, 229, 0, 230, 231, 232, 233, + 0, 234, 0, 235, 0, 0, 0, 238, 239, 528, + 0, 242, 0, 243, 0, 244, 245, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 0, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 277, 0, 278, 0, 0, 281, 0, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 0, 291, + 0, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 324, 325, 326, 327, 328, 0, 329, + 330, 0, 332, 0, 333, 334, 335, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 364, 0, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 0, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 0, 431, 432, + 433, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 530, 448, 449, 0, 0, + 450, 451, 0, 452, 0, 454, 455, 456, 457, 458, + 0, 459, 460, 461, 0, 0, 462, 463, 464, 465, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 488, 0, 489, + 0, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 3, 4, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 549, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 550, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 130, 131, 0, 132, 133, 134, + 0, 136, 137, 138, 139, 140, 0, 142, 143, 0, + 144, 145, 146, 147, 148, 149, 0, 0, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 159, 160, + 161, 0, 0, 0, 163, 164, 165, 166, 167, 168, + 0, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 0, 229, 0, 230, 231, 232, 233, 0, 234, + 0, 235, 0, 0, 0, 238, 239, 528, 0, 1955, + 0, 243, 0, 244, 245, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 0, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 277, 0, 278, 0, 0, 281, 0, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 0, 291, 0, 0, + 293, 294, 1956, 296, 297, 298, 299, 300, 529, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 0, 324, 325, 326, 327, 328, 0, 329, 330, 0, + 332, 0, 333, 334, 335, 336, 337, 338, 0, 339, + 340, 0, 0, 341, 342, 343, 0, 0, 344, 345, + 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 364, 0, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 0, 431, 432, 433, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 530, 448, 449, 0, 0, 450, 451, + 1957, 452, 0, 454, 1958, 456, 1959, 458, 0, 459, + 460, 461, 0, 0, 462, 463, 464, 465, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 1960, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 488, 0, 489, 0, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 130, 131, 0, 132, 133, 134, 0, 136, + 137, 138, 139, 140, 0, 142, 143, 0, 144, 145, + 146, 147, 148, 149, 0, 0, 150, 151, 152, 153, + 154, 155, 156, 0, 157, 158, 159, 160, 161, 0, + 0, 0, 163, 164, 165, 166, 167, 168, 0, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 0, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 208, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 0, + 229, 0, 230, 231, 232, 233, 0, 234, 0, 235, + 0, 0, 0, 238, 239, 528, 0, 242, 0, 243, + 0, 244, 245, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 0, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 277, 0, + 278, 0, 0, 281, 0, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 0, 291, 0, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 529, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 0, 324, + 325, 326, 327, 328, 0, 329, 330, 0, 332, 0, + 333, 334, 335, 336, 337, 338, 0, 339, 340, 0, + 0, 341, 342, 343, 0, 0, 344, 345, 346, 0, + 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 364, 0, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 0, 431, 432, 433, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 530, 448, 449, 0, 0, 450, 451, 0, 452, + 0, 454, 455, 456, 457, 458, 0, 459, 460, 461, + 0, 0, 462, 463, 464, 465, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 488, 0, 489, 0, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 527, 0, 819, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 130, 131, 0, 132, 133, 134, 0, 136, 137, 138, + 139, 140, 0, 142, 143, 0, 144, 145, 146, 147, + 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, + 156, 0, 157, 158, 159, 160, 161, 0, 0, 0, + 163, 164, 165, 166, 167, 168, 0, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, + 191, 192, 193, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 208, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 0, 229, 0, + 230, 231, 232, 233, 0, 234, 0, 235, 0, 0, + 0, 238, 239, 528, 0, 242, 0, 243, 0, 244, + 245, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 0, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 277, 0, 278, 0, + 0, 281, 0, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 0, 291, 0, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, + 317, 318, 319, 320, 321, 322, 0, 324, 325, 326, + 327, 328, 0, 329, 330, 0, 332, 0, 333, 334, + 335, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 551, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, + 360, 361, 0, 0, 0, 0, 362, 363, 364, 0, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 0, 431, 432, 433, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 530, + 448, 449, 0, 0, 450, 451, 0, 452, 0, 454, + 455, 456, 457, 458, 0, 459, 460, 461, 0, 0, + 462, 463, 464, 465, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 488, 0, 489, 0, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 791, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 549, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 896, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 791, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 938, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 1943, 0, 0, 0, 0, 1944, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 825, 126, 127, 128, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 130, 131, + 0, 132, 133, 134, 0, 136, 137, 138, 139, 140, + 0, 142, 143, 0, 144, 145, 146, 147, 148, 149, + 0, 0, 150, 151, 152, 153, 154, 155, 156, 0, + 157, 158, 159, 160, 161, 0, 0, 0, 163, 164, + 165, 166, 167, 168, 0, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 0, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 208, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 0, 229, 0, 230, 231, + 232, 233, 0, 234, 0, 235, 0, 0, 0, 238, + 239, 528, 0, 826, 0, 243, 0, 244, 245, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 0, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 277, 0, 278, 0, 0, 281, + 0, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 0, 291, 0, 0, 293, 294, 827, 296, 297, 298, + 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 0, 324, 325, 326, 327, 328, + 0, 329, 330, 0, 332, 0, 333, 334, 335, 336, + 337, 338, 0, 339, 340, 0, 0, 341, 342, 343, + 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 364, 0, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 0, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 828, 426, 427, 428, 429, 0, 0, + 431, 432, 433, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 530, 448, 449, + 0, 0, 450, 451, 0, 452, 0, 454, 455, 456, + 457, 458, 0, 459, 829, 461, 0, 0, 830, 463, + 464, 465, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, + 0, 489, 0, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 1951, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 1952, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 1953, 448, 0, - 450, 1954, 452, 1955, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 1956, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 549, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 815, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 131, 0, 132, + 133, 134, 0, 136, 137, 138, 139, 140, 0, 142, + 143, 0, 144, 145, 146, 147, 148, 149, 0, 0, + 150, 151, 152, 153, 154, 155, 156, 0, 157, 158, + 159, 160, 161, 0, 0, 0, 163, 164, 165, 166, + 167, 168, 0, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 208, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 0, 229, 0, 230, 231, 232, 233, + 0, 234, 0, 235, 0, 0, 0, 238, 239, 528, + 0, 242, 0, 243, 0, 244, 245, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 0, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 277, 0, 278, 0, 0, 281, 0, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 0, 291, + 0, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 324, 325, 326, 327, 328, 0, 329, + 330, 0, 332, 0, 333, 334, 335, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 364, 0, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 383, 384, 385, 862, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 0, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 0, 431, 432, + 433, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 530, 448, 449, 0, 0, + 450, 451, 0, 452, 0, 454, 455, 456, 457, 458, + 0, 459, 460, 461, 0, 0, 462, 463, 464, 465, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 488, 0, 489, + 0, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 130, 131, 0, 132, 133, 134, + 0, 136, 137, 138, 139, 140, 0, 142, 143, 0, + 144, 145, 146, 147, 148, 149, 0, 0, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 159, 160, + 161, 0, 0, 0, 163, 164, 165, 166, 167, 168, + 0, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 0, 229, 0, 230, 231, 232, 233, 0, 234, + 0, 235, 0, 0, 0, 238, 239, 528, 0, 242, + 0, 243, 0, 244, 245, 246, 247, 0, 248, 249, + 250, 251, 252, 895, 254, 0, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 277, 0, 278, 0, 0, 281, 0, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 0, 291, 0, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 529, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 0, 324, 325, 326, 327, 328, 0, 329, 330, 0, + 332, 0, 333, 334, 335, 336, 337, 338, 0, 339, + 340, 0, 0, 341, 342, 343, 0, 0, 344, 345, + 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 364, 0, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 0, 431, 432, 433, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 530, 448, 449, 0, 0, 450, 451, + 0, 452, 0, 454, 455, 456, 457, 458, 0, 459, + 460, 461, 0, 0, 462, 463, 464, 465, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 488, 0, 489, 0, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 822, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 130, 131, 0, 132, 133, 134, 0, 136, + 137, 138, 139, 140, 0, 142, 143, 0, 144, 145, + 146, 147, 148, 149, 0, 0, 150, 151, 152, 153, + 154, 155, 156, 0, 157, 158, 159, 160, 161, 0, + 0, 0, 163, 164, 165, 166, 167, 168, 0, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 0, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 208, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 0, + 229, 0, 230, 231, 232, 233, 0, 234, 0, 235, + 0, 0, 0, 238, 239, 528, 0, 242, 0, 243, + 0, 244, 245, 246, 247, 0, 248, 249, 250, 251, + 252, 898, 254, 0, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 277, 0, + 278, 0, 0, 281, 0, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 0, 291, 0, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 529, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 0, 324, + 325, 326, 327, 328, 0, 329, 330, 0, 332, 0, + 333, 334, 335, 336, 337, 338, 0, 339, 340, 0, + 0, 341, 342, 343, 0, 0, 344, 345, 346, 0, + 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 364, 0, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 0, 431, 432, 433, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 530, 448, 449, 0, 0, 450, 451, 0, 452, + 0, 454, 455, 456, 457, 458, 0, 459, 460, 461, + 0, 0, 462, 463, 464, 465, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 488, 0, 489, 0, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 130, 131, 0, 132, 133, 134, 0, 136, 137, 138, + 139, 140, 0, 142, 143, 0, 144, 145, 146, 147, + 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, + 156, 0, 157, 158, 159, 160, 161, 0, 0, 0, + 163, 164, 165, 166, 167, 168, 0, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 823, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 824, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, + 191, 192, 193, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 208, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 0, 229, 0, + 230, 231, 232, 233, 0, 234, 0, 235, 0, 0, + 0, 238, 239, 528, 0, 242, 0, 243, 0, 244, + 245, 246, 247, 0, 248, 249, 250, 251, 252, 902, + 254, 0, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 277, 0, 278, 0, + 0, 281, 0, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 0, 291, 0, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, + 317, 318, 319, 320, 321, 322, 0, 324, 325, 326, + 327, 328, 0, 329, 330, 0, 332, 0, 333, 334, + 335, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 825, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 826, 457, 0, 0, 827, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, + 360, 361, 0, 0, 0, 0, 362, 363, 364, 0, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 0, 431, 432, 433, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 530, + 448, 449, 0, 0, 450, 451, 0, 452, 0, 454, + 455, 456, 457, 458, 0, 459, 460, 461, 0, 0, + 462, 463, 464, 465, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 488, 0, 489, 0, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 527, 0, + 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 130, 131, + 0, 132, 133, 134, 0, 136, 137, 138, 139, 140, + 0, 142, 143, 0, 144, 145, 146, 147, 148, 149, + 0, 0, 150, 151, 152, 153, 154, 155, 156, 0, + 157, 158, 159, 160, 161, 0, 0, 0, 163, 164, + 165, 166, 167, 168, 0, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 0, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 208, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 0, 229, 0, 230, 231, + 232, 233, 0, 234, 0, 235, 0, 0, 0, 238, + 239, 528, 0, 242, 0, 243, 0, 244, 245, 246, + 247, 0, 248, 249, 250, 251, 252, 930, 254, 0, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 277, 0, 278, 0, 0, 281, + 0, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 0, 291, 0, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 0, 324, 325, 326, 327, 328, + 0, 329, 330, 0, 332, 0, 333, 334, 335, 336, + 337, 338, 0, 339, 340, 0, 0, 341, 342, 343, + 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 364, 0, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 0, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 0, + 431, 432, 433, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 530, 448, 449, + 0, 0, 450, 451, 0, 452, 0, 454, 455, 456, + 457, 458, 0, 459, 460, 461, 0, 0, 462, 463, + 464, 465, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, + 0, 489, 0, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 859, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 549, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 891, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 131, 0, 132, + 133, 134, 0, 136, 137, 138, 139, 140, 0, 142, + 143, 0, 144, 145, 146, 147, 148, 149, 0, 0, + 150, 151, 152, 153, 154, 155, 156, 0, 157, 158, + 159, 160, 161, 0, 0, 0, 163, 164, 165, 166, + 167, 168, 0, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 208, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 0, 229, 0, 230, 231, 232, 233, + 0, 234, 0, 235, 0, 0, 0, 238, 239, 528, + 0, 242, 0, 243, 0, 244, 245, 246, 247, 0, + 248, 249, 250, 251, 252, 958, 254, 0, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 277, 0, 278, 0, 0, 281, 0, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 0, 291, + 0, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 324, 325, 326, 327, 328, 0, 329, + 330, 0, 332, 0, 333, 334, 335, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 364, 0, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 0, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 0, 431, 432, + 433, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 530, 448, 449, 0, 0, + 450, 451, 0, 452, 0, 454, 455, 456, 457, 458, + 0, 459, 460, 461, 0, 0, 462, 463, 464, 465, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 488, 0, 489, + 0, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 894, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 549, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 898, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 130, 131, 0, 132, 133, 134, + 0, 136, 137, 138, 139, 140, 0, 142, 143, 0, + 144, 145, 146, 147, 148, 149, 0, 0, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 159, 160, + 161, 0, 0, 0, 163, 164, 165, 166, 167, 168, + 0, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 0, 229, 0, 230, 231, 232, 233, 0, 234, + 0, 235, 0, 0, 0, 238, 239, 528, 0, 242, + 0, 243, 0, 244, 245, 246, 247, 0, 248, 249, + 250, 251, 252, 961, 254, 0, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 277, 0, 278, 0, 0, 281, 0, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 0, 291, 0, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 529, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 0, 324, 325, 326, 327, 328, 0, 329, 330, 0, + 332, 0, 333, 334, 335, 336, 337, 338, 0, 339, + 340, 0, 0, 341, 342, 343, 0, 0, 344, 345, + 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 364, 0, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 0, 431, 432, 433, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 530, 448, 449, 0, 0, 450, 451, + 0, 452, 0, 454, 455, 456, 457, 458, 0, 459, + 460, 461, 0, 0, 462, 463, 464, 465, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 488, 0, 489, 0, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 926, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 549, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 0, 1003, + 0, 0, 130, 131, 0, 132, 133, 134, 0, 136, + 137, 138, 139, 140, 0, 142, 143, 0, 144, 145, + 146, 147, 148, 149, 0, 0, 150, 151, 152, 153, + 154, 155, 156, 0, 157, 158, 159, 160, 161, 0, + 0, 0, 163, 164, 165, 166, 167, 168, 0, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 0, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 208, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 0, + 229, 0, 230, 231, 232, 233, 0, 234, 0, 235, + 0, 0, 0, 238, 239, 528, 0, 242, 0, 243, + 0, 244, 245, 246, 247, 0, 248, 249, 250, 251, + 252, 253, 254, 0, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 277, 0, + 278, 0, 0, 281, 0, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 0, 291, 0, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 529, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 0, 324, + 325, 326, 327, 328, 0, 329, 330, 0, 332, 0, + 333, 334, 335, 336, 337, 338, 0, 339, 340, 0, + 0, 341, 342, 343, 0, 0, 344, 345, 346, 0, + 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 364, 0, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 0, 431, 432, 433, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 530, 448, 449, 0, 0, 450, 451, 0, 452, + 0, 454, 455, 456, 457, 458, 0, 459, 460, 461, + 0, 0, 462, 463, 464, 465, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 488, 0, 489, 0, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 0, 1026, 0, 0, + 130, 131, 0, 132, 133, 134, 0, 136, 137, 138, + 139, 140, 0, 142, 143, 0, 144, 145, 146, 147, + 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, + 156, 0, 157, 158, 159, 160, 161, 0, 0, 0, + 163, 164, 165, 166, 167, 168, 0, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 954, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, + 191, 192, 193, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 208, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 0, 229, 0, + 230, 231, 232, 233, 0, 234, 0, 235, 0, 0, + 0, 238, 239, 528, 0, 242, 0, 243, 0, 244, + 245, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 0, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 277, 0, 278, 0, + 0, 281, 0, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 0, 291, 0, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, + 317, 318, 319, 320, 321, 322, 0, 324, 325, 326, + 327, 328, 0, 329, 330, 0, 332, 0, 333, 334, + 335, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, + 360, 361, 0, 0, 0, 0, 362, 363, 364, 0, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 0, 431, 432, 433, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 530, + 448, 449, 0, 0, 450, 451, 0, 452, 0, 454, + 455, 456, 457, 458, 0, 459, 460, 461, 0, 0, + 462, 463, 464, 465, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 488, 0, 489, 0, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 957, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 825, 126, 127, 128, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 130, 131, + 0, 132, 133, 134, 0, 136, 137, 138, 139, 140, + 0, 142, 143, 0, 144, 145, 146, 147, 148, 149, + 0, 0, 150, 151, 152, 153, 154, 155, 156, 0, + 157, 158, 159, 160, 161, 0, 0, 0, 163, 164, + 165, 166, 167, 168, 0, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 0, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 208, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 0, 229, 0, 230, 231, + 232, 233, 0, 234, 0, 235, 0, 0, 0, 238, + 239, 528, 0, 242, 0, 243, 0, 244, 245, 246, + 247, 0, 248, 249, 250, 251, 252, 253, 254, 0, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 277, 0, 278, 0, 0, 281, + 0, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 0, 291, 0, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 0, 324, 325, 326, 327, 328, + 0, 329, 330, 0, 332, 0, 333, 334, 335, 336, + 337, 338, 0, 339, 340, 0, 0, 341, 342, 343, + 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 364, 0, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 0, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 0, + 431, 432, 433, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 530, 448, 449, + 0, 0, 450, 451, 0, 452, 0, 454, 455, 456, + 457, 458, 0, 459, 829, 461, 0, 0, 830, 463, + 464, 465, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, + 0, 489, 0, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 1000, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 131, 0, 132, + 133, 134, 0, 136, 137, 138, 139, 140, 0, 142, + 143, 0, 144, 145, 146, 147, 148, 149, 0, 0, + 150, 151, 152, 153, 154, 155, 156, 0, 157, 158, + 159, 160, 161, 0, 0, 0, 163, 164, 165, 166, + 167, 168, 0, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 208, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 0, 229, 0, 230, 231, 232, 233, + 0, 234, 0, 235, 0, 0, 0, 238, 239, 528, + 0, 242, 0, 243, 0, 244, 245, 246, 247, 0, + 248, 249, 250, 251, 252, 1304, 254, 0, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 277, 0, 278, 0, 0, 281, 0, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 0, 291, + 0, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 324, 325, 326, 327, 328, 0, 329, + 330, 0, 332, 0, 333, 334, 335, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 364, 0, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 0, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 0, 431, 432, + 433, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 530, 448, 449, 0, 0, + 450, 451, 0, 452, 0, 454, 455, 456, 457, 458, + 0, 459, 460, 461, 0, 0, 462, 463, 464, 465, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 488, 0, 489, + 0, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 1023, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 130, 131, 0, 132, 133, 134, + 0, 136, 137, 138, 139, 140, 0, 142, 143, 0, + 144, 145, 146, 147, 148, 149, 0, 0, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 159, 160, + 161, 0, 0, 0, 163, 164, 165, 166, 167, 168, + 0, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 208, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 0, 229, 0, 230, 231, 232, 233, 0, 234, + 0, 235, 0, 0, 0, 238, 239, 528, 0, 242, + 0, 243, 0, 244, 245, 246, 247, 0, 248, 249, + 250, 251, 252, 1306, 254, 0, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 0, + 277, 0, 278, 0, 0, 281, 0, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 0, 291, 0, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 529, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 0, 324, 325, 326, 327, 328, 0, 329, 330, 0, + 332, 0, 333, 334, 335, 336, 337, 338, 0, 339, + 340, 0, 0, 341, 342, 343, 0, 0, 344, 345, + 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 364, 0, 366, 367, 368, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 0, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 0, 0, 431, 432, 433, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 530, 448, 449, 0, 0, 450, 451, + 0, 452, 0, 454, 455, 456, 457, 458, 0, 459, + 460, 461, 0, 0, 462, 463, 464, 465, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 487, 488, 0, 489, 0, 491, + 492, 493, 494, 495, 496, 497, 0, 0, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 822, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, + 0, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 126, 127, 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 130, 131, 0, 132, 133, 134, 0, 136, + 137, 138, 139, 140, 0, 142, 143, 0, 144, 145, + 146, 147, 148, 149, 0, 0, 150, 151, 152, 153, + 154, 155, 156, 0, 157, 158, 159, 160, 161, 0, + 0, 0, 163, 164, 165, 166, 167, 168, 0, 170, + 171, 172, 0, 173, 174, 175, 176, 177, 178, 0, + 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 0, 195, 0, 196, + 197, 198, 199, 200, 201, 0, 0, 202, 203, 204, + 205, 0, 0, 206, 207, 208, 209, 210, 0, 211, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 0, + 229, 0, 230, 231, 232, 233, 0, 234, 0, 235, + 0, 0, 0, 238, 239, 528, 0, 242, 0, 243, + 0, 244, 245, 246, 247, 0, 248, 249, 250, 251, + 252, 1309, 254, 0, 256, 257, 258, 259, 0, 260, + 261, 262, 263, 264, 265, 266, 0, 267, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 0, 277, 0, + 278, 0, 0, 281, 0, 283, 284, 285, 286, 287, + 288, 0, 0, 289, 0, 291, 0, 0, 293, 294, + 295, 296, 297, 298, 299, 300, 529, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 0, 324, + 325, 326, 327, 328, 0, 329, 330, 0, 332, 0, + 333, 334, 335, 336, 337, 338, 0, 339, 340, 0, + 0, 341, 342, 343, 0, 0, 344, 345, 346, 0, + 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 0, 0, 0, 0, 362, 363, + 364, 0, 366, 367, 368, 369, 370, 371, 0, 372, + 373, 374, 375, 376, 377, 0, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 0, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 0, 0, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 0, 0, 431, 432, 433, 434, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 530, 448, 449, 0, 0, 450, 451, 0, 452, + 0, 454, 455, 456, 457, 458, 0, 459, 460, 461, + 0, 0, 462, 463, 464, 465, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 0, 0, 475, 476, + 477, 0, 478, 479, 480, 481, 0, 482, 483, 484, + 485, 486, 487, 488, 0, 489, 0, 491, 492, 493, + 494, 495, 496, 497, 0, 0, 498, 0, 0, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 527, 0, 553, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 130, 131, 0, 132, 133, 134, 0, 136, 137, 138, + 139, 140, 0, 142, 143, 0, 144, 145, 146, 147, + 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, + 156, 0, 157, 158, 159, 160, 161, 0, 0, 0, + 163, 164, 165, 166, 167, 168, 0, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, + 191, 192, 193, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 208, 209, 210, 0, 211, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 0, 229, 0, + 230, 231, 232, 233, 0, 234, 0, 235, 0, 0, + 0, 238, 239, 528, 0, 242, 0, 243, 0, 244, + 245, 246, 247, 0, 248, 249, 250, 251, 252, 1311, + 254, 0, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 0, 277, 0, 278, 0, + 0, 281, 0, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 0, 291, 0, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, + 317, 318, 319, 320, 321, 322, 0, 324, 325, 326, + 327, 328, 0, 329, 330, 0, 332, 0, 333, 334, + 335, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 826, 457, 0, 0, 827, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, + 360, 361, 0, 0, 0, 0, 362, 363, 364, 0, + 366, 367, 368, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 0, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 0, 0, 431, 432, 433, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 530, + 448, 449, 0, 0, 450, 451, 0, 452, 0, 454, + 455, 456, 457, 458, 0, 459, 460, 461, 0, 0, + 462, 463, 464, 465, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 0, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 487, 488, 0, 489, 0, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, + 512, 513, 514, 515, 516, 517, 518, 519, 527, 0, + 553, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 0, 126, 127, 128, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 130, 131, + 0, 132, 133, 134, 0, 136, 137, 138, 139, 140, + 0, 142, 143, 0, 144, 145, 146, 147, 148, 149, + 0, 0, 150, 151, 152, 153, 154, 155, 156, 0, + 157, 158, 159, 160, 161, 0, 0, 0, 163, 164, + 165, 166, 167, 168, 0, 170, 171, 172, 0, 173, + 174, 175, 176, 177, 178, 0, 0, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 0, 195, 0, 196, 197, 198, 199, 200, + 201, 0, 0, 202, 203, 204, 205, 0, 0, 206, + 207, 208, 209, 210, 0, 211, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 0, 229, 0, 230, 231, + 232, 233, 0, 234, 0, 235, 0, 0, 0, 238, + 239, 528, 0, 242, 0, 243, 0, 244, 245, 246, + 247, 0, 248, 249, 250, 251, 252, 2237, 254, 0, + 256, 257, 258, 259, 0, 260, 261, 262, 263, 264, + 265, 266, 0, 267, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 0, 277, 0, 278, 0, 0, 281, + 0, 283, 284, 285, 286, 287, 288, 0, 0, 289, + 0, 291, 0, 0, 293, 294, 295, 296, 297, 298, + 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 0, 324, 325, 326, 327, 328, + 0, 329, 330, 0, 332, 0, 333, 334, 335, 336, + 337, 338, 0, 339, 340, 0, 0, 341, 342, 343, + 0, 0, 344, 345, 346, 0, 348, 0, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 0, 0, 0, 0, 362, 363, 364, 0, 366, 367, + 368, 369, 370, 371, 0, 372, 373, 374, 375, 376, + 377, 0, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 0, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 0, 401, 402, 0, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 0, 0, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 0, 0, + 431, 432, 433, 434, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 530, 448, 449, + 0, 0, 450, 451, 0, 452, 0, 454, 455, 456, + 457, 458, 0, 459, 460, 461, 0, 0, 462, 463, + 464, 465, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 0, 0, 475, 476, 477, 0, 478, 479, + 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, + 0, 489, 0, 491, 492, 493, 494, 495, 496, 497, + 0, 0, 498, 0, 0, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 1477, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 1303, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 549, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 1305, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, + 0, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 1478, 0, 0, -790, 0, 1479, 130, 131, 0, 132, + 133, 134, 1480, 136, 137, 138, 0, 1481, 1482, 1483, + 1484, 0, 144, 145, 146, 147, 148, 149, 0, 0, + 150, 151, 152, 153, 1485, 1486, 156, 0, 157, 158, + 159, 160, 0, 0, 1487, 0, 1488, 164, 165, 166, + 167, 168, 1489, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 1490, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 1491, 191, 192, 1492, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 1061, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 0, 222, 223, 224, 225, + 226, 227, 0, 0, 229, 0, 230, 231, 1493, 233, + 0, 234, 0, 235, 1494, 0, 1495, 238, 239, -790, + 1496, 242, 0, 243, 0, 0, 0, 246, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 1497, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 1498, 0, 270, 271, 272, 273, 274, 1499, + 1500, 0, 1501, 0, 278, 1502, 1503, 281, 1504, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 1505, 291, + 1506, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 1507, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 1508, 1509, 1510, 325, 326, 327, 0, 0, 329, + 330, 1511, 332, 0, 0, 334, 1512, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 0, 1513, 348, 1514, 0, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 0, 1515, 366, 367, 0, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 381, 382, 1516, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 1517, 404, 405, + 406, 1518, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 1519, 421, 422, 423, + 424, 425, 426, 1520, 428, 429, 0, 1521, 431, 432, + 1522, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 1523, 448, 0, 0, 0, + 450, 451, 0, 452, 1524, 454, 455, 456, 457, 458, + 0, 459, 1525, 1526, 0, 0, 462, 463, 0, 465, + 0, 0, 467, 468, 1527, 470, 471, 472, 473, 474, + 1528, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 0, 1529, 0, 489, + 1530, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 527, + 0, 553, 0, 0, 0, 0, 0, 0, 0, 0, + 516, 517, 518, 519, 0, 0, 0, 0, 118, 119, + 120, 121, 122, 123, 124, 125, 0, 126, 127, 128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, + 131, 0, 132, 133, 134, 0, 136, 137, 138, 139, + 140, 0, 142, 143, 0, 144, 145, 146, 147, 148, + 149, 0, 0, 150, 151, 152, 153, 154, 155, 156, + 0, 157, 158, 159, 160, 161, 0, 0, 0, 163, + 164, 165, 166, 167, 168, 0, 170, 171, 172, 0, + 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 0, 195, 0, 196, 197, 198, 199, + 200, 201, 0, 0, 202, 203, 204, 205, 0, 0, + 206, 207, 208, 209, 210, 0, 211, 212, 213, 0, + 214, 215, 216, 0, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 0, 229, 0, 230, + 231, 232, 233, 0, 234, 0, 235, 0, 0, 0, + 238, 239, 528, 0, 242, 0, 243, 0, 244, 245, + 246, 247, 0, 248, 249, 250, 251, 252, 2983, 254, + 0, 256, 257, 258, 259, 0, 260, 261, 262, 263, + 264, 265, 266, 0, 267, 0, 269, 270, 271, 272, + 273, 274, 275, 276, 0, 277, 0, 278, 0, 0, + 281, 0, 283, 284, 285, 286, 287, 288, 0, 0, + 289, 0, 291, 0, 0, 293, 294, 295, 296, 297, + 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 0, 324, 325, 326, 327, + 328, 0, 329, 330, 0, 332, 0, 333, 334, 335, + 336, 337, 338, 0, 339, 340, 0, 0, 341, 342, + 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 0, 0, 0, 0, 362, 363, 364, 0, 366, + 367, 368, 369, 370, 371, 0, 372, 373, 374, 375, + 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 0, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, + 0, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 0, 0, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 0, + 0, 431, 432, 433, 434, 0, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 530, 448, + 449, 0, 0, 450, 451, 0, 452, 0, 454, 455, + 456, 457, 458, 0, 459, 460, 461, 0, 0, 462, + 463, 464, 465, 466, 0, 467, 468, 469, 470, 471, + 472, 473, 474, 0, 0, 475, 476, 477, 0, 478, + 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, + 488, 0, 489, 0, 491, 492, 493, 494, 495, 496, + 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 1308, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 549, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 1310, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 549, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 118, 119, 120, 121, + 122, 123, 124, 125, 0, 126, 127, 128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 130, 131, 0, + 132, 133, 134, 0, 136, 137, 138, 139, 140, 0, + 142, 143, 0, 144, 145, 146, 147, 148, 149, 0, + 0, 150, 151, 152, 153, 154, 155, 156, 0, 157, + 158, 159, 160, 161, 0, 0, 0, 163, 164, 165, + 166, 167, 168, 0, 170, 171, 172, 0, 173, 174, + 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 0, 195, 0, 196, 197, 198, 199, 200, 201, + 0, 0, 202, 203, 204, 205, 0, 0, 206, 207, + 208, 209, 210, 0, 211, 212, 213, 0, 214, 215, + 216, 0, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 0, 229, 0, 230, 231, 232, + 233, 0, 234, 0, 235, 0, 0, 0, 238, 239, + 528, 0, 242, 0, 243, 0, 244, 245, 246, 247, + 0, 248, 249, 250, 251, 252, 253, 254, 0, 256, + 257, 258, 259, 0, 260, 261, 262, 263, 264, 265, + 266, 0, 267, 0, 269, 270, 271, 272, 273, 274, + 275, 276, 0, 277, 0, 278, 0, 0, 281, 0, + 283, 284, 285, 286, 287, 288, 0, 0, 289, 0, + 291, 0, 0, 293, 294, 295, 296, 297, 298, 299, + 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 0, 324, 325, 326, 327, 328, 0, + 329, 330, 0, 332, 0, 333, 334, 335, 336, 337, + 338, 0, 339, 340, 0, 0, 341, 342, 343, 0, + 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 0, + 0, 0, 0, 362, 363, 364, 0, 366, 367, 368, + 369, 370, 371, 0, 372, 373, 374, 375, 376, 377, + 0, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 0, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 0, 401, 402, 0, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 0, 0, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 0, 0, 431, + 432, 433, 434, 0, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 530, 448, 449, 0, + 0, 450, 451, 0, 452, 0, 454, 455, 456, 457, + 458, 0, 459, 460, 461, 0, 0, 462, 463, 464, + 465, 466, 0, 467, 468, 469, 470, 471, 472, 473, + 474, 0, 0, 475, 476, 477, 0, 478, 479, 480, + 481, 0, 482, 483, 484, 485, 486, 487, 488, 0, + 489, 0, 491, 492, 493, 494, 495, 496, 497, 0, + 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, + 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, + 0, 0, 0, 0, 118, 119, 120, 121, 122, 123, + 124, 125, 0, 126, 127, 128, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 130, 131, 0, 132, 133, + 134, 0, 136, 137, 138, 139, 140, 0, 142, 143, + 0, 144, 145, 146, 147, 148, 149, 0, 0, 150, + 151, 152, 153, 154, 155, 156, 0, 157, 158, 159, + 160, 161, 0, 0, 0, 163, 164, 165, 166, 167, + 168, 0, 170, 171, 172, 0, 173, 174, 175, 176, + 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 0, + 195, 0, 196, 197, 198, 199, 200, 201, 0, 0, + 202, 203, 204, 205, 0, 0, 206, 207, 208, 209, + 210, 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 2229, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, + 227, 228, 0, 229, 0, 230, 231, 232, 233, 0, + 234, 0, 235, 0, 0, 0, 238, 239, 528, 0, + 840, 0, 243, 0, 244, 245, 246, 247, 0, 248, + 249, 250, 251, 252, 253, 254, 0, 256, 257, 258, + 259, 0, 260, 261, 262, 263, 264, 265, 266, 0, + 267, 0, 269, 270, 271, 272, 273, 274, 275, 276, + 0, 277, 0, 278, 0, 0, 281, 0, 283, 284, + 285, 286, 287, 288, 0, 0, 289, 0, 291, 0, + 0, 293, 294, 841, 296, 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 1476, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 1477, 0, 0, -788, 0, 1478, 129, - 130, 0, 131, 132, 133, 1479, 135, 136, 137, 0, - 1480, 1481, 1482, 1483, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 1484, 1485, 155, - 0, 156, 157, 158, 159, 0, 0, 1486, 0, 1487, - 163, 164, 165, 166, 167, 1488, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 1489, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 1490, 190, - 191, 1491, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 1059, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 0, 221, - 222, 223, 224, 225, 0, 0, 227, 0, 228, 229, - 1492, 231, 0, 232, 0, 233, 1493, 0, 1494, 236, - 237, -788, 1495, 240, 0, 241, 0, 0, 0, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 1496, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 1497, 0, 268, 269, 270, 271, - 272, 1498, 1499, 0, 1500, 0, 276, 1501, 1502, 279, - 1503, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 1504, 289, 1505, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 1506, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 1507, 1508, 1509, 323, 324, 325, 0, - 0, 327, 328, 1510, 330, 0, 0, 332, 1511, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 0, 1512, 346, 1513, 0, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 0, 1514, 364, 365, - 0, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 1515, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 1516, 400, 401, - 402, 1517, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 1518, 417, 418, 419, - 420, 421, 422, 1519, 424, 425, 0, 1520, 427, 428, - 1521, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 1522, 444, 0, 0, 0, - 446, 447, 0, 448, 1523, 450, 451, 452, 453, 454, - 0, 455, 1524, 1525, 0, 0, 458, 459, 0, 461, - 0, 0, 463, 464, 1526, 466, 467, 468, 469, 470, - 1527, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 0, 1528, 0, 485, - 1529, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 523, - 0, 549, 0, 0, 0, 0, 0, 0, 0, 0, - 512, 513, 514, 515, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 2974, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 0, 0, 0, 0, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 0, 324, 325, 326, 327, 328, 0, 329, 330, + 0, 332, 0, 333, 334, 335, 336, 337, 338, 0, + 339, 340, 0, 0, 341, 342, 343, 0, 0, 344, + 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 0, 0, 0, + 0, 362, 363, 364, 0, 366, 367, 368, 369, 370, + 371, 0, 372, 373, 374, 375, 376, 377, 0, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 0, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 0, 401, 402, 0, 404, 405, 406, + 407, 408, 409, 410, 411, 842, 413, 414, 415, 416, + 417, 418, 419, 420, 0, 0, 421, 422, 423, 424, + 843, 426, 427, 428, 429, 0, 0, 431, 432, 433, + 434, 0, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 530, 448, 449, 0, 0, 450, + 451, 0, 452, 0, 454, 455, 456, 457, 458, 0, + 459, 844, 461, 0, 0, 462, 463, 464, 465, 466, + 0, 467, 468, 469, 470, 471, 472, 473, 474, 0, + 0, 475, 476, 477, 0, 478, 479, 480, 481, 0, + 482, 483, 484, 485, 486, 487, 488, 0, 489, 0, + 491, 492, 493, 494, 495, 496, 497, 0, 0, 498, + 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, + 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, + 0, 126, 127, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 130, 131, 0, 132, 133, 134, 0, + 136, 137, 138, 139, 140, 0, 142, 143, 0, 144, + 145, 146, 147, 148, 149, 0, 0, 150, 151, 152, + 153, 154, 155, 156, 0, 157, 158, 159, 160, 161, + 0, 0, 0, 163, 164, 165, 166, 167, 168, 0, + 170, 171, 172, 0, 173, 174, 175, 176, 177, 178, + 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 0, 195, 0, + 196, 197, 198, 199, 200, 201, 0, 0, 202, 203, + 204, 205, 0, 0, 206, 207, 208, 209, 210, 0, + 211, 212, 213, 0, 214, 215, 216, 0, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 0, 229, 0, 230, 231, 232, 233, 0, 234, 0, + 235, 0, 0, 0, 238, 239, 528, 0, 242, 0, + 243, 0, 244, 245, 246, 247, 0, 248, 249, 250, + 251, 252, 954, 254, 0, 256, 257, 258, 259, 0, + 260, 261, 262, 263, 264, 265, 266, 0, 267, 0, + 269, 270, 271, 272, 273, 274, 275, 276, 0, 277, + 0, 278, 0, 0, 281, 0, 283, 284, 285, 286, + 287, 288, 0, 0, 289, 0, 291, 0, 0, 293, + 294, 295, 296, 297, 298, 299, 300, 529, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 0, + 324, 325, 326, 327, 328, 0, 329, 330, 0, 332, + 0, 333, 334, 335, 336, 337, 338, 0, 339, 340, + 0, 0, 341, 342, 343, 0, 0, 344, 345, 346, + 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 0, 0, 0, 0, 362, + 363, 364, 0, 366, 367, 368, 369, 370, 371, 0, + 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 0, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 0, 401, 402, 0, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 0, 0, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 0, 0, 431, 432, 433, 434, 0, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 530, 448, 449, 0, 0, 450, 451, 0, + 452, 0, 454, 455, 456, 457, 458, 0, 459, 460, + 461, 0, 0, 462, 463, 464, 465, 466, 0, 467, + 468, 469, 470, 471, 472, 473, 474, 0, 0, 475, + 476, 477, 0, 478, 479, 480, 481, 0, 482, 483, + 484, 485, 486, 487, 488, 0, 489, 0, 491, 492, + 493, 494, 495, 496, 497, 0, 0, 498, 0, 0, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, + 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 837, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 838, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 839, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 840, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 841, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 0, 0, 0, 0, + 118, 119, 120, 121, 122, 123, 124, 125, 0, 126, + 127, 128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 130, 131, 0, 132, 133, 134, 0, 136, 137, + 138, 139, 140, 0, 142, 143, 0, 144, 145, 146, + 147, 148, 149, 0, 0, 150, 151, 152, 153, 154, + 155, 156, 0, 157, 158, 159, 160, 161, 0, 0, + 0, 163, 164, 165, 166, 167, 168, 0, 170, 171, + 172, 0, 173, 174, 175, 176, 177, 178, 0, 0, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 0, 195, 0, 196, 197, + 198, 199, 200, 201, 0, 0, 202, 203, 204, 205, + 0, 0, 206, 207, 208, 209, 210, 0, 211, 212, + 213, 0, 214, 215, 216, 0, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 0, 229, + 0, 230, 231, 232, 233, 0, 234, 0, 235, 0, + 0, 0, 238, 239, 528, 0, 242, 0, 243, 0, + 244, 245, 246, 247, 0, 248, 249, 250, 251, 252, + 253, 254, 0, 256, 257, 258, 259, 0, 260, 261, + 262, 263, 264, 265, 266, 0, 267, 0, 269, 270, + 271, 272, 273, 274, 275, 276, 0, 277, 0, 278, + 0, 0, 281, 0, 283, 284, 285, 286, 287, 288, + 0, 0, 289, 0, 291, 0, 0, 293, 294, 295, + 296, 297, 298, 299, 300, 529, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 0, 324, 325, + 326, 327, 328, 0, 329, 330, 0, 332, 0, 333, + 334, 335, 336, 337, 338, 0, 339, 340, 0, 0, + 341, 342, 343, 0, 0, 344, 345, 346, 0, 348, + 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 0, 0, 0, 0, 362, 363, 364, + 0, 366, 367, 368, 369, 370, 371, 0, 372, 373, + 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 0, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 0, + 401, 402, 0, 404, 405, 406, 407, 408, 409, 410, + 411, 842, 413, 414, 415, 416, 417, 418, 419, 420, + 0, 0, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 0, 0, 431, 432, 433, 434, 0, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 530, 448, 449, 0, 0, 450, 451, 0, 452, 0, + 454, 455, 456, 457, 458, 0, 459, 844, 461, 0, + 0, 462, 463, 464, 465, 466, 0, 467, 468, 469, + 470, 471, 472, 473, 474, 0, 0, 475, 476, 477, + 0, 478, 479, 480, 481, 0, 482, 483, 484, 485, + 486, 487, 488, 0, 489, 0, 491, 492, 493, 494, + 495, 496, 497, 0, 0, 498, 0, 0, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 950, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, + 0, 0, 0, 0, 0, 0, 0, 0, 118, 119, + 120, 121, 122, 123, 124, 125, 0, 126, 127, 128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, + 131, 0, 132, 133, 134, 0, 136, 137, 138, 139, + 140, 0, 142, 143, 0, 144, 145, 146, 147, 148, + 149, 0, 0, 150, 151, 152, 153, 154, 155, 156, + 0, 157, 158, 159, 160, 161, 0, 0, 0, 163, + 164, 165, 166, 167, 168, 0, 170, 171, 172, 0, + 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 0, 195, 0, 196, 197, 198, 199, + 200, 201, 0, 0, 202, 203, 204, 205, 0, 0, + 206, 207, 208, 209, 210, 0, 211, 212, 213, 0, + 214, 215, 216, 0, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 0, 229, 0, 230, + 231, 232, 233, 0, 234, 0, 235, 0, 0, 0, + 238, 239, 528, 0, 242, 0, 243, 0, 244, 245, + 246, 247, 0, 248, 249, 250, 251, 252, 1313, 254, + 0, 256, 257, 258, 259, 0, 260, 261, 262, 263, + 264, 265, 266, 0, 267, 0, 269, 270, 271, 272, + 273, 274, 275, 276, 0, 277, 0, 278, 0, 0, + 281, 0, 283, 284, 285, 286, 287, 288, 0, 0, + 289, 0, 291, 0, 0, 293, 294, 295, 296, 297, + 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 0, 324, 325, 326, 327, + 328, 0, 329, 330, 0, 332, 0, 333, 334, 335, + 336, 337, 338, 0, 339, 340, 0, 0, 341, 342, + 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 0, 0, 0, 0, 362, 363, 364, 0, 366, + 367, 368, 369, 370, 371, 0, 372, 373, 374, 375, + 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 0, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, + 0, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 0, 0, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 0, + 0, 431, 432, 433, 434, 0, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 530, 448, + 449, 0, 0, 450, 451, 0, 452, 0, 454, 455, + 456, 457, 458, 0, 459, 460, 461, 0, 0, 462, + 463, 464, 465, 466, 0, 467, 468, 469, 470, 471, + 472, 473, 474, 0, 0, 475, 476, 477, 0, 478, + 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, + 488, 0, 489, 0, 491, 492, 493, 494, 495, 496, + 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 839, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 841, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 118, 119, 120, 121, + 122, 123, 124, 125, 0, 126, 127, 128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 130, 131, 0, + 132, 133, 134, 0, 136, 137, 138, 139, 140, 0, + 142, 143, 0, 144, 145, 146, 147, 148, 149, 0, + 0, 150, 151, 152, 153, 154, 155, 156, 0, 157, + 158, 159, 160, 161, 0, 0, 0, 163, 164, 165, + 166, 167, 168, 0, 170, 171, 172, 0, 173, 174, + 175, 176, 177, 178, 0, 0, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 0, 195, 0, 196, 197, 198, 199, 200, 201, + 0, 0, 202, 203, 204, 205, 0, 0, 206, 207, + 208, 209, 210, 0, 211, 212, 213, 0, 214, 215, + 216, 0, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 0, 229, 0, 230, 231, 232, + 233, 0, 234, 0, 235, 0, 0, 0, 238, 239, + 528, 0, 242, 0, 243, 0, 244, 245, 246, 247, + 0, 248, 249, 250, 251, 252, 1324, 254, 0, 256, + 257, 258, 259, 0, 260, 261, 262, 263, 264, 265, + 266, 0, 267, 0, 269, 270, 271, 272, 273, 274, + 275, 276, 0, 277, 0, 278, 0, 0, 281, 0, + 283, 284, 285, 286, 287, 288, 0, 0, 289, 0, + 291, 0, 0, 293, 294, 295, 296, 297, 298, 299, + 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 0, 324, 325, 326, 327, 328, 0, + 329, 330, 0, 332, 0, 333, 334, 335, 336, 337, + 338, 0, 339, 340, 0, 0, 341, 342, 343, 0, + 0, 344, 345, 346, 0, 348, 0, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 0, + 0, 0, 0, 362, 363, 364, 0, 366, 367, 368, + 369, 370, 371, 0, 372, 373, 374, 375, 376, 377, + 0, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 0, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 0, 401, 402, 0, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 0, 0, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 0, 0, 431, + 432, 433, 434, 0, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 530, 448, 449, 0, + 0, 450, 451, 0, 452, 0, 454, 455, 456, 457, + 458, 0, 459, 460, 461, 0, 0, 462, 463, 464, + 465, 466, 0, 467, 468, 469, 470, 471, 472, 473, + 474, 0, 0, 475, 476, 477, 0, 478, 479, 480, + 481, 0, 482, 483, 484, 485, 486, 487, 488, 0, + 489, 0, 491, 492, 493, 494, 495, 496, 497, 0, + 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, + 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, + 0, 0, 0, 0, 118, 119, 120, 121, 122, 123, + 124, 125, 0, 126, 127, 128, 0, 0, 0, 0, + 0, 0, 1672, 0, 0, 130, 131, 0, 132, 133, + 134, 0, 136, 137, 138, 139, 140, 0, 142, 143, + 0, 144, 145, 146, 147, 148, 149, 0, 0, 150, + 151, 152, 153, 154, 155, 156, 0, 157, 158, 159, + 160, 161, 0, 0, 0, 163, 164, 165, 166, 167, + 168, 0, 170, 171, 172, 0, 173, 174, 175, 176, + 177, 178, 0, 0, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 0, + 195, 0, 196, 197, 198, 199, 200, 201, 0, 0, + 202, 203, 204, 205, 0, 0, 206, 207, 208, 209, + 210, 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 1299, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, + 227, 228, 0, 229, 0, 230, 231, 232, 233, 0, + 234, 0, 235, 0, 0, 0, 238, 239, 528, 0, + 242, 0, 243, 0, 244, 245, 246, 247, 0, 248, + 249, 250, 251, 252, 253, 254, 0, 256, 257, 258, + 259, 0, 260, 261, 262, 263, 264, 265, 266, 0, + 267, 0, 269, 270, 271, 272, 273, 274, 275, 276, + 0, 277, 0, 278, 0, 0, 281, 0, 283, 284, + 285, 286, 287, 288, 0, 0, 289, 0, 291, 0, + 0, 293, 294, 295, 296, 297, 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 0, 324, 325, 326, 327, 328, 0, 329, 330, + 0, 332, 0, 333, 334, 335, 336, 337, 338, 0, + 339, 340, 0, 0, 341, 342, 343, 0, 0, 344, + 345, 346, 0, 348, 0, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 0, 0, 0, + 0, 362, 363, 364, 0, 366, 367, 368, 369, 370, + 371, 0, 372, 373, 374, 375, 376, 377, 0, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 0, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 0, 401, 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 1320, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 0, 0, 0, 0, + 417, 418, 419, 420, 0, 0, 421, 422, 423, 424, + 425, 0, 427, 428, 429, 0, 0, 431, 432, 433, + 434, 0, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 530, 448, 449, 0, 0, 450, + 451, 0, 452, 0, 454, 455, 456, 457, 458, 0, + 459, 460, 461, 0, 0, 462, 463, 464, 465, 466, + 0, 467, 468, 469, 470, 471, 472, 473, 474, 0, + 0, 475, 476, 477, 0, 478, 479, 480, 481, 0, + 482, 483, 484, 485, 486, 487, 488, 0, 489, 0, + 491, 492, 493, 494, 495, 496, 497, 0, 0, 498, + 0, 0, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 1671, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 0, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, + 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, + 0, 126, 127, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 130, 131, 0, 132, 133, 134, 0, + 136, 137, 138, 139, 140, 0, 142, 143, 0, 144, + 145, 146, 147, 148, 149, 0, 0, 150, 151, 152, + 153, 154, 155, 156, 0, 157, 158, 159, 160, 161, + 0, 0, 0, 163, 164, 165, 166, 167, 168, 0, + 170, 171, 172, 0, 173, 174, 175, 176, 177, 178, + 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 0, 195, 0, + 196, 197, 198, 199, 200, 201, 0, 0, 202, 203, + 204, 205, 0, 0, 206, 207, 208, 209, 210, 0, + 211, 212, 213, 0, 214, 215, 216, 0, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 0, 229, 0, 230, 231, 232, 233, 0, 234, 0, + 235, 0, 0, 0, 238, 239, 528, 0, 242, 0, + 243, 0, 244, 245, 246, 247, 0, 248, 249, 250, + 251, 252, 1852, 254, 0, 256, 257, 258, 259, 0, + 260, 261, 262, 263, 264, 265, 266, 0, 267, 0, + 269, 270, 271, 272, 273, 274, 275, 276, 0, 277, + 0, 278, 0, 0, 281, 0, 283, 284, 285, 286, + 287, 288, 0, 0, 289, 0, 291, 0, 0, 293, + 294, 295, 296, 297, 298, 299, 300, 529, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 0, + 324, 325, 326, 327, 328, 0, 329, 330, 0, 332, + 0, 333, 334, 335, 336, 337, 338, 0, 339, 340, + 0, 0, 341, 342, 343, 0, 0, 344, 345, 346, + 0, 348, 0, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 0, 0, 0, 0, 362, + 363, 364, 0, 366, 367, 368, 369, 370, 371, 0, + 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 0, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 0, 401, 402, 0, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 0, 0, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 0, 0, 431, 432, 433, 434, 0, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 530, 448, 449, 0, 0, 450, 451, 0, + 452, 0, 454, 455, 456, 457, 458, 0, 459, 460, + 461, 0, 0, 462, 463, 464, 465, 466, 0, 467, + 468, 469, 470, 471, 472, 473, 474, 0, 0, 475, + 476, 477, 0, 478, 479, 480, 481, 0, 482, 483, + 484, 485, 486, 487, 488, 0, 489, 0, 491, 492, + 493, 494, 495, 496, 497, 0, 0, 498, 0, 0, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, + 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 1847, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 523, 0, 0, 0, 0, 0, + 118, 119, 120, 121, 122, 123, 124, 125, 0, 126, + 127, 128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 130, 131, 0, 132, 133, 134, 0, 136, 137, + 138, 139, 140, 0, 142, 143, 0, 144, 145, 146, + 147, 148, 149, 0, 0, 150, 151, 152, 153, 154, + 155, 156, 0, 157, 158, 159, 160, 161, 0, 0, + 0, 163, 164, 165, 166, 167, 168, 0, 170, 171, + 172, 0, 173, 174, 175, 176, 177, 178, 0, 0, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 0, 195, 0, 196, 197, + 198, 199, 200, 201, 0, 0, 202, 203, 204, 205, + 0, 0, 206, 207, 208, 209, 210, 0, 211, 212, + 213, 0, 214, 215, 216, 0, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 0, 229, + 0, 230, 231, 232, 233, 0, 234, 0, 235, 0, + 0, 0, 238, 239, 528, 0, 242, 0, 243, 0, + 244, 245, 246, 247, 0, 248, 249, 250, 251, 252, + 2224, 254, 0, 256, 257, 258, 259, 0, 260, 261, + 262, 263, 264, 265, 266, 0, 267, 0, 269, 270, + 271, 272, 273, 274, 275, 276, 0, 277, 0, 278, + 0, 0, 281, 0, 283, 284, 285, 286, 287, 288, + 0, 0, 289, 0, 291, 0, 0, 293, 294, 295, + 296, 297, 298, 299, 300, 529, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 0, 324, 325, + 326, 327, 328, 0, 329, 330, 0, 332, 0, 333, + 334, 335, 336, 337, 338, 0, 339, 340, 0, 0, + 341, 342, 343, 0, 0, 344, 345, 346, 0, 348, + 0, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 0, 0, 0, 0, 362, 363, 364, + 0, 366, 367, 368, 369, 370, 371, 0, 372, 373, + 374, 375, 376, 377, 0, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 0, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 0, + 401, 402, 0, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 0, 0, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 0, 0, 431, 432, 433, 434, 0, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 530, 448, 449, 0, 0, 450, 451, 0, 452, 0, + 454, 455, 456, 457, 458, 0, 459, 460, 461, 0, + 0, 462, 463, 464, 465, 466, 0, 467, 468, 469, + 470, 471, 472, 473, 474, 0, 0, 475, 476, 477, + 0, 478, 479, 480, 481, 0, 482, 483, 484, 485, + 486, 487, 488, 0, 489, 0, 491, 492, 493, 494, + 495, 496, 497, 0, 0, 498, 0, 0, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 244, 245, 0, 246, 247, 248, - 249, 250, 2216, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 523, + 0, 0, 0, 0, 0, 0, 0, 0, 118, 119, + 120, 121, 122, 123, 124, 125, 0, 126, 127, 128, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, + 131, 0, 132, 133, 134, 0, 136, 137, 138, 139, + 140, 0, 142, 143, 0, 144, 145, 146, 147, 148, + 149, 0, 0, 150, 151, 152, 153, 154, 155, 156, + 0, 157, 158, 159, 160, 161, 0, 0, 0, 163, + 164, 165, 166, 167, 168, 0, 170, 171, 172, 0, + 173, 174, 175, 176, 177, 178, 0, 0, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 0, 195, 0, 196, 197, 198, 199, + 200, 201, 0, 0, 202, 203, 204, 205, 0, 0, + 206, 207, 208, 209, 210, 0, 211, 212, 213, 0, + 214, 215, 216, 0, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 0, 229, 0, 230, + 231, 232, 233, 0, 234, 0, 235, 0, 0, 0, + 238, 239, 528, 0, 242, 0, 243, 0, 244, 245, + 246, 247, 0, 248, 249, 250, 251, 252, 2239, 254, + 0, 256, 257, 258, 259, 0, 260, 261, 262, 263, + 264, 265, 266, 0, 267, 0, 269, 270, 271, 272, + 273, 274, 275, 276, 0, 277, 0, 278, 0, 0, + 281, 0, 283, 284, 285, 286, 287, 288, 0, 0, + 289, 0, 291, 0, 0, 293, 294, 295, 296, 297, + 298, 299, 300, 529, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 0, 324, 325, 326, 327, + 328, 0, 329, 330, 0, 332, 0, 333, 334, 335, + 336, 337, 338, 0, 339, 340, 0, 0, 341, 342, + 343, 0, 0, 344, 345, 346, 0, 348, 0, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 0, 0, 0, 0, 362, 363, 364, 0, 366, + 367, 368, 369, 370, 371, 0, 372, 373, 374, 375, + 376, 377, 0, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 0, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 0, 401, 402, + 0, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 0, 0, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 0, + 0, 431, 432, 433, 434, 0, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 530, 448, + 449, 0, 0, 450, 451, 0, 452, 0, 454, 455, + 456, 457, 458, 0, 459, 460, 461, 0, 0, 462, + 463, 464, 465, 466, 0, 467, 468, 469, 470, 471, + 472, 473, 474, 0, 0, 475, 476, 477, 0, 478, + 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, + 488, 0, 489, 0, 491, 492, 493, 494, 495, 496, + 497, 0, 0, 498, 0, 0, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 1477, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, - 130, 0, 131, 132, 133, 0, 135, 136, 137, 138, - 139, 0, 141, 142, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 153, 154, 155, - 0, 156, 157, 158, 159, 160, 0, 0, 0, 162, - 163, 164, 165, 166, 167, 0, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 0, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 207, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 0, 227, 0, 228, 229, - 230, 231, 0, 232, 0, 233, 0, 0, 0, 236, - 237, 524, 0, 240, 0, 241, 0, 242, 243, 244, - 245, 0, 246, 247, 248, 249, 250, 2231, 252, 0, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 0, 267, 268, 269, 270, 271, - 272, 273, 274, 0, 275, 0, 276, 0, 0, 279, - 0, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 0, 289, 0, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 525, 300, 301, 302, 303, 304, 305, 306, + 0, 0, 0, 0, 0, 0, 118, 119, 120, 121, + 122, 123, 124, 125, 0, 126, 127, 128, 0, 0, + 0, 1478, 0, 0, 0, 0, 1479, 130, 131, 0, + 132, 133, 134, 1480, 136, 137, 138, 0, 1481, 1482, + 1483, 1484, 0, 144, 145, 146, 147, 148, 149, 0, + 0, 150, 151, 152, 153, 1485, 1486, 156, 0, 157, + 158, 159, 160, 0, 0, 1487, 0, 1488, 164, 165, + 166, 167, 168, 1489, 170, 171, 172, 0, 173, 174, + 175, 176, 177, 178, 0, 1490, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 1491, 191, 192, 1492, + 194, 0, 195, 0, 196, 197, 198, 199, 200, 201, + 0, 0, 202, 203, 204, 205, 0, 0, 206, 207, + 1061, 209, 210, 0, 211, 212, 213, 0, 214, 215, + 216, 0, 217, 218, 219, 220, 0, 222, 223, 224, + 225, 226, 227, 0, 0, 229, 0, 230, 231, 1493, + 233, 0, 234, 0, 235, 1494, 0, 1495, 238, 239, + 0, 1496, 242, 0, 243, 0, 0, 0, 246, 247, + 0, 248, 249, 250, 251, 252, 253, 254, 1497, 256, + 257, 258, 259, 0, 260, 261, 262, 263, 264, 265, + 266, 0, 267, 1498, 0, 270, 271, 272, 273, 274, + 1499, 1500, 0, 1501, 0, 278, 1502, 1503, 281, 1504, + 283, 284, 285, 286, 287, 288, 0, 0, 289, 1505, + 291, 1506, 0, 293, 294, 295, 296, 297, 298, 299, + 300, 1507, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 1508, 1509, 1510, 325, 326, 327, 0, 0, + 329, 330, 1511, 332, 0, 0, 334, 1512, 336, 337, + 338, 0, 339, 340, 0, 0, 341, 342, 343, 0, + 0, 344, 345, 0, 1513, 348, 1514, 0, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 0, + 0, 0, 0, 362, 363, 0, 1515, 366, 367, 0, + 369, 370, 371, 0, 372, 373, 374, 375, 376, 377, + 0, 378, 379, 380, 381, 382, 1516, 384, 385, 386, + 387, 0, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 0, 401, 402, 1517, 404, + 405, 406, 1518, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 0, 1519, 421, 422, + 423, 424, 425, 426, 1520, 428, 429, 0, 1521, 431, + 432, 1522, 434, 0, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 1523, 448, 0, 0, + 0, 450, 451, 0, 452, 1524, 454, 455, 456, 457, + 458, 0, 459, 1525, 1526, 0, 0, 462, 463, 0, + 465, 0, 0, 467, 468, 1527, 470, 471, 472, 473, + 474, 1528, 0, 475, 476, 477, 0, 478, 479, 480, + 481, 0, 482, 483, 484, 485, 486, 0, 1529, 0, + 489, 1530, 491, 492, 493, 494, 495, 496, 497, 0, + 0, 498, 0, 0, 499, 500, 501, 502, 503, 504, + 1477, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 516, 517, 518, 519, 0, 0, 0, 0, 118, + 119, 120, 121, 122, 123, 124, 125, 0, 126, 127, + 128, 0, 0, 0, 1478, 0, 0, 0, 0, 1479, + 130, 131, 0, 132, 133, 134, 1480, 136, 137, 138, + 0, 1481, 1482, 1483, 1484, 0, 144, 145, 146, 147, + 148, 149, 0, 0, 150, 151, 152, 153, 1485, 1486, + 156, 0, 157, 158, 159, 160, 0, 0, 1487, 0, + 1488, 164, 165, 166, 167, 168, 1489, 170, 171, 172, + 0, 173, 174, 175, 176, 177, 178, 0, 1490, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 1491, + 191, 192, 1492, 194, 0, 195, 0, 196, 197, 198, + 199, 200, 201, 0, 0, 202, 203, 204, 205, 0, + 0, 206, 207, 1061, 209, 210, 0, 211, 212, 213, + 0, 1834, 215, 216, 0, 217, 218, 219, 220, 0, + 222, 223, 224, 225, 226, 227, 0, 0, 229, 0, + 230, 231, 1493, 233, 0, 234, 0, 235, 1494, 0, + 1495, 238, 239, 0, 1496, 242, 0, 243, 0, 0, + 0, 246, 247, 0, 248, 249, 250, 251, 252, 253, + 254, 1497, 256, 257, 258, 259, 0, 260, 261, 262, + 263, 264, 265, 266, 0, 267, 1498, 0, 270, 271, + 272, 273, 274, 1499, 1500, 0, 1501, 0, 278, 1502, + 1503, 281, 1504, 283, 284, 285, 286, 287, 288, 0, + 0, 289, 1505, 291, 1506, 0, 293, 294, 295, 296, + 297, 298, 299, 300, 1507, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 0, 322, 323, 324, 325, 326, - 0, 327, 328, 0, 330, 0, 331, 332, 333, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 344, 0, 346, 0, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 362, 0, 364, 365, - 366, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 379, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 0, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 0, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 0, 0, 427, 428, - 429, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 526, 444, 445, 0, 0, - 446, 447, 0, 448, 0, 450, 451, 452, 453, 454, - 0, 455, 456, 457, 0, 0, 458, 459, 460, 461, - 462, 0, 463, 464, 465, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 483, 484, 0, 485, - 0, 487, 488, 489, 490, 491, 492, 493, 0, 0, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 1476, 0, 0, 0, 0, 0, + 317, 318, 319, 320, 321, 1508, 1509, 1510, 325, 326, + 327, 0, 0, 329, 330, 1511, 332, 0, 0, 334, + 1512, 336, 337, 338, 0, 339, 340, 0, 0, 341, + 342, 343, 0, 0, 344, 345, 0, 1513, 348, 1514, + 0, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 0, 0, 0, 0, 362, 363, 0, 1515, + 366, 367, 0, 369, 370, 371, 0, 372, 373, 374, + 375, 376, 377, 0, 378, 379, 380, 381, 382, 1516, + 384, 385, 386, 387, 0, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 0, 401, + 402, 1517, 404, 405, 406, 1518, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 0, + 1519, 421, 422, 423, 424, 425, 426, 1520, 428, 429, + 0, 1521, 431, 432, 1522, 434, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 1523, + 448, 0, 0, 0, 450, 451, 0, 452, 1524, 454, + 455, 456, 457, 458, 0, 459, 1525, 1526, 0, 0, + 462, 463, 0, 465, 0, 0, 467, 468, 1527, 470, + 471, 472, 473, 474, 1528, 0, 475, 476, 477, 0, + 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, + 0, 1529, 0, 489, 1530, 491, 492, 493, 494, 495, + 496, 497, 0, 0, 498, 0, 0, 499, 500, 501, + 502, 503, 504, 3153, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 516, 517, 518, 519, 0, 0, + 0, 0, 118, 119, 120, 121, 122, 123, 124, 125, + 0, 126, 127, 128, 0, 0, 0, 2905, 0, 0, + 0, 0, 2906, 130, 131, 0, 132, 133, 134, 2907, + 136, 137, 138, 0, 1481, 2908, 1483, 1484, 0, 144, + 145, 146, 147, 148, 149, 0, 0, 150, 151, 152, + 153, 1485, 1486, 156, 0, 157, 158, 159, 160, 0, + 0, 2909, 0, 2910, 164, 165, 166, 167, 168, 2911, + 170, 171, 172, 0, 173, 174, 175, 176, 177, 178, + 0, 2912, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 1491, 191, 192, 1492, 194, 0, 195, 0, + 196, 197, 198, 199, 200, 201, 0, 0, 202, 203, + 204, 205, 0, 0, 206, 207, 1061, 209, 210, 0, + 211, 212, 213, 0, 214, 215, 216, 0, 217, 218, + 219, 220, 0, 222, 223, 224, 225, 226, 227, 0, + 0, 229, 0, 230, 231, 1493, 233, 0, 234, 0, + 235, 2913, 0, 2914, 238, 239, 2915, 2916, 242, 0, + 243, 0, 0, 0, 246, 247, 0, 248, 249, 250, + 251, 252, 253, 254, 2917, 256, 257, 258, 259, 0, + 260, 261, 262, 263, 264, 265, 266, 0, 267, 2918, + 0, 270, 271, 272, 273, 274, 1499, 1500, 0, 1501, + 0, 278, 2919, 2920, 281, 2921, 283, 284, 285, 286, + 287, 288, 0, 0, 289, 2922, 291, 2923, 0, 293, + 294, 295, 296, 297, 298, 299, 300, 3154, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 1508, 2925, + 1510, 325, 326, 327, 0, 0, 329, 330, 2927, 332, + 0, 0, 334, 1512, 336, 337, 338, 0, 339, 340, + 0, 0, 341, 342, 343, 0, 0, 344, 345, 0, + 2929, 348, 2930, 0, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 0, 0, 0, 0, 362, + 363, 0, 2931, 366, 367, 0, 369, 370, 371, 0, + 372, 373, 374, 375, 376, 377, 0, 378, 379, 380, + 381, 382, 1516, 384, 385, 386, 387, 0, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 0, 401, 402, 2932, 404, 405, 406, 0, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 0, 2933, 421, 422, 423, 424, 425, 426, + 0, 428, 429, 0, 2935, 431, 432, 1522, 434, 0, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 3155, 448, 0, 0, 0, 450, 451, 0, + 452, 2937, 454, 455, 456, 457, 458, 0, 459, 1525, + 1526, 0, 0, 462, 463, 0, 465, 0, 0, 467, + 468, 2938, 470, 471, 472, 473, 474, 0, 0, 475, + 476, 477, 0, 478, 479, 480, 481, 0, 482, 483, + 484, 485, 486, 0, 1529, 0, 489, 2940, 491, 492, + 493, 494, 495, 496, 497, 0, 0, 498, 0, 0, + 499, 500, 501, 502, 503, 504, 527, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 516, 517, 518, + 519, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 125, 0, 126, 127, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 131, 0, 132, + 133, 134, 0, 136, 137, 138, 139, 140, 0, 142, + 143, 0, 144, 145, 146, 147, 148, 149, 0, 0, + 150, 151, 152, 153, 154, 155, 156, 0, 157, 158, + 159, 160, 161, 0, 0, 0, 163, 164, 165, 166, + 167, 168, 0, 170, 171, 172, 0, 173, 174, 175, + 176, 177, 178, 0, 0, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 0, 195, 0, 196, 197, 198, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 0, 0, 206, 207, 208, + 209, 210, 0, 211, 212, 213, 0, 214, 215, 216, + 0, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 0, 229, 0, 230, 231, 232, 233, + 0, 234, 0, 235, 0, 0, 0, 238, 239, 528, + 0, 242, 0, 243, 0, 244, 245, 0, 247, 0, + 248, 249, 250, 251, 252, 253, 254, 0, 256, 257, + 258, 259, 0, 260, 261, 262, 263, 264, 265, 266, + 0, 267, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 0, 277, 0, 278, 0, 0, 281, 0, 283, + 284, 285, 286, 287, 288, 0, 0, 289, 0, 291, + 0, 0, 293, 294, 295, 296, 297, 298, 299, 300, + 529, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 324, 325, 326, 327, 328, 0, 329, + 330, 0, 332, 0, 333, 334, 335, 336, 337, 338, + 0, 339, 340, 0, 0, 341, 342, 343, 0, 0, + 344, 345, 346, 0, 348, 0, 350, 351, 352, 353, + 354, 355, 356, 0, 358, 359, 360, 361, 0, 0, + 0, 0, 362, 363, 364, 0, 366, 367, 368, 369, + 370, 371, 0, 372, 373, 374, 375, 376, 377, 0, + 378, 379, 380, 0, 382, 383, 384, 385, 386, 387, + 0, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 0, 401, 402, 0, 404, 405, + 406, 407, 0, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 0, 0, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 0, 0, 431, 432, + 433, 434, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 530, 448, 449, 0, 0, + 450, 451, 0, 452, 0, 454, 455, 456, 457, 458, + 0, 459, 460, 461, 0, 0, 462, 463, 464, 465, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 0, 0, 475, 476, 477, 0, 478, 479, 480, 481, + 0, 482, 483, 484, 485, 486, 487, 488, 0, 489, + 0, 491, 492, 493, 494, 495, 496, 497, 0, 0, + 498, 0, 0, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 1771, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 1477, 0, - 0, 0, 0, 1478, 129, 130, 0, 131, 132, 133, - 1479, 135, 136, 137, 0, 1480, 1481, 1482, 1483, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 1484, 1485, 155, 0, 156, 157, 158, 159, - 0, 0, 1486, 0, 1487, 163, 164, 165, 166, 167, - 1488, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 1489, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 1490, 190, 191, 1491, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 1059, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 0, 221, 222, 223, 224, 225, 0, - 0, 227, 0, 228, 229, 1492, 231, 0, 232, 0, - 233, 1493, 0, 1494, 236, 237, 0, 1495, 240, 0, - 241, 0, 0, 0, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 1496, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 1497, - 0, 268, 269, 270, 271, 272, 1498, 1499, 0, 1500, - 0, 276, 1501, 1502, 279, 1503, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 1504, 289, 1505, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 1506, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 1507, 1508, - 1509, 323, 324, 325, 0, 0, 327, 328, 1510, 330, - 0, 0, 332, 1511, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 0, - 1512, 346, 1513, 0, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 0, 1514, 364, 365, 0, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 1515, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 1516, 400, 401, 402, 1517, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 1518, 417, 418, 419, 420, 421, 422, 1519, 424, - 425, 0, 1520, 427, 428, 1521, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 1522, 444, 0, 0, 0, 446, 447, 0, 448, 1523, - 450, 451, 452, 453, 454, 0, 455, 1524, 1525, 0, - 0, 458, 459, 0, 461, 0, 0, 463, 464, 1526, - 466, 467, 468, 469, 470, 1527, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 0, 1528, 0, 485, 1529, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 1476, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 512, 513, 514, 515, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 1477, 0, - 0, 0, 0, 1478, 129, 130, 0, 131, 132, 133, - 1479, 135, 136, 137, 0, 1480, 1481, 1482, 1483, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 1484, 1485, 155, 0, 156, 157, 158, 159, - 0, 0, 1486, 0, 1487, 163, 164, 165, 166, 167, - 1488, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 1489, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 1490, 190, 191, 1491, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 1059, 208, 209, - 0, 210, 211, 212, 0, 1829, 214, 215, 0, 216, - 217, 218, 219, 0, 221, 222, 223, 224, 225, 0, - 0, 227, 0, 228, 229, 1492, 231, 0, 232, 0, - 233, 1493, 0, 1494, 236, 237, 0, 1495, 240, 0, - 241, 0, 0, 0, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 1496, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 1497, - 0, 268, 269, 270, 271, 272, 1498, 1499, 0, 1500, - 0, 276, 1501, 1502, 279, 1503, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 1504, 289, 1505, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 1506, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 1507, 1508, - 1509, 323, 324, 325, 0, 0, 327, 328, 1510, 330, - 0, 0, 332, 1511, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 0, - 1512, 346, 1513, 0, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 0, 1514, 364, 365, 0, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 1515, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 1516, 400, 401, 402, 1517, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 1518, 417, 418, 419, 420, 421, 422, 1519, 424, - 425, 0, 1520, 427, 428, 1521, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 1522, 444, 0, 0, 0, 446, 447, 0, 448, 1523, - 450, 451, 452, 453, 454, 0, 455, 1524, 1525, 0, - 0, 458, 459, 0, 461, 0, 0, 463, 464, 1526, - 466, 467, 468, 469, 470, 1527, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 0, 1528, 0, 485, 1529, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 3144, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 512, 513, 514, 515, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 2896, 0, - 0, 0, 0, 2897, 129, 130, 0, 131, 132, 133, - 2898, 135, 136, 137, 0, 1480, 2899, 1482, 1483, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 1484, 1485, 155, 0, 156, 157, 158, 159, - 0, 0, 2900, 0, 2901, 163, 164, 165, 166, 167, - 2902, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 2903, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 1490, 190, 191, 1491, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 1059, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 0, 221, 222, 223, 224, 225, 0, - 0, 227, 0, 228, 229, 1492, 231, 0, 232, 0, - 233, 2904, 0, 2905, 236, 237, 2906, 2907, 240, 0, - 241, 0, 0, 0, 244, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 2908, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 2909, - 0, 268, 269, 270, 271, 272, 1498, 1499, 0, 1500, - 0, 276, 2910, 2911, 279, 2912, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 2913, 289, 2914, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 3145, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 1507, 2916, - 1509, 323, 324, 325, 0, 0, 327, 328, 2918, 330, - 0, 0, 332, 1511, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 0, - 2920, 346, 2921, 0, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 0, 2922, 364, 365, 0, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 377, 378, - 1515, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 2923, 400, 401, 402, 0, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 2924, 417, 418, 419, 420, 421, 422, 0, 424, - 425, 0, 2926, 427, 428, 1521, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 3146, 444, 0, 0, 0, 446, 447, 0, 448, 2928, - 450, 451, 452, 453, 454, 0, 455, 1524, 1525, 0, - 0, 458, 459, 0, 461, 0, 0, 463, 464, 2929, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 0, 1528, 0, 485, 2931, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 523, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 512, 513, 514, 515, 0, - 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, - 124, 0, 125, 126, 127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, - 0, 135, 136, 137, 138, 139, 0, 141, 142, 0, - 143, 144, 145, 146, 147, 148, 0, 0, 149, 150, - 151, 152, 153, 154, 155, 0, 156, 157, 158, 159, - 160, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 169, 170, 171, 0, 172, 173, 174, 175, 176, - 177, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 0, 194, - 0, 195, 196, 197, 198, 199, 200, 0, 0, 201, - 202, 203, 204, 0, 0, 205, 206, 207, 208, 209, - 0, 210, 211, 212, 0, 213, 214, 215, 0, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 0, 227, 0, 228, 229, 230, 231, 0, 232, 0, - 233, 0, 0, 0, 236, 237, 524, 0, 240, 0, - 241, 0, 242, 243, 0, 245, 0, 246, 247, 248, - 249, 250, 251, 252, 0, 254, 255, 256, 257, 0, - 258, 259, 260, 261, 262, 263, 264, 0, 265, 0, - 267, 268, 269, 270, 271, 272, 273, 274, 0, 275, - 0, 276, 0, 0, 279, 0, 281, 282, 283, 284, - 285, 286, 0, 0, 287, 0, 289, 0, 0, 291, - 292, 293, 294, 295, 296, 297, 298, 525, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 0, - 322, 323, 324, 325, 326, 0, 327, 328, 0, 330, - 0, 331, 332, 333, 334, 335, 336, 0, 337, 338, - 0, 0, 339, 340, 341, 0, 0, 342, 343, 344, - 0, 346, 0, 348, 349, 350, 351, 352, 353, 354, - 0, 356, 357, 358, 359, 0, 0, 0, 0, 360, - 361, 362, 0, 364, 365, 366, 367, 368, 369, 0, - 370, 371, 372, 373, 374, 375, 0, 376, 0, 378, - 379, 380, 381, 382, 383, 0, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 0, - 397, 398, 0, 400, 401, 402, 403, 0, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 0, 0, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 0, 0, 427, 428, 429, 430, 0, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 526, 444, 445, 0, 0, 446, 447, 0, 448, 0, - 450, 451, 452, 453, 454, 0, 455, 456, 457, 0, - 0, 458, 459, 460, 461, 462, 0, 463, 464, 465, - 466, 467, 468, 469, 470, 0, 0, 471, 472, 473, - 0, 474, 475, 476, 477, 0, 478, 479, 480, 481, - 482, 483, 484, 0, 485, 0, 487, 488, 489, 490, - 491, 492, 493, 0, 0, 494, 0, 0, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 1766, + 0, 0, 0, 118, 119, 120, 121, 122, 123, 124, + 125, 0, 126, 127, 128, 0, 0, 0, 1478, 0, + 0, 0, 0, 1479, 130, 131, 0, 132, 133, 134, + 1480, 136, 137, 138, 0, 1481, 1482, 1483, 1484, 0, + 144, 145, 146, 147, 148, 149, 0, 0, 150, 151, + 152, 153, 1485, 1486, 156, 0, 157, 158, 159, 160, + 0, 0, 1487, 0, 1488, 164, 165, 166, 167, 168, + 1489, 170, 171, 172, 0, 173, 174, 175, 176, 177, + 178, 0, 1490, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 1491, 191, 192, 1492, 194, 0, 195, + 0, 196, 197, 198, 199, 200, 201, 0, 0, 202, + 203, 204, 205, 0, 0, 206, 207, 1061, 209, 210, + 0, 211, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 219, 220, 0, 222, 223, 224, 225, 226, 227, + 0, 0, 229, 0, 230, 231, 1493, 233, 0, 234, + 0, 235, 1494, 0, 1495, 238, 239, 0, 1496, 242, + 0, 243, 0, 0, 0, 246, 247, 0, 248, 249, + 250, 251, 252, 253, 254, 1497, 256, 257, 258, 259, + 0, 260, 261, 262, 263, 264, 265, 266, 0, 267, + 1498, 0, 270, 271, 272, 273, 274, 1499, 1500, 0, + 1501, 0, 278, 1502, 1503, 281, 1504, 283, 284, 285, + 286, 287, 288, 0, 0, 289, 1505, 291, 1506, 0, + 293, 294, 295, 296, 297, 298, 299, 300, 0, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 1508, + 1509, 1510, 325, 326, 327, 0, 0, 329, 330, 1511, + 332, 0, 0, 334, 1512, 336, 337, 338, 0, 339, + 340, 0, 0, 341, 342, 343, 0, 0, 344, 345, + 0, 1513, 348, 1514, 0, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, + 362, 363, 0, 1515, 366, 367, 0, 369, 370, 371, + 0, 372, 373, 374, 375, 376, 377, 0, 378, 379, + 380, 381, 382, 1516, 384, 385, 386, 387, 0, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 0, 401, 402, 1517, 404, 405, 406, 0, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 0, 1519, 421, 422, 423, 424, 425, + 426, 0, 428, 429, 0, 1521, 431, 432, 1522, 434, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 0, 448, 0, 0, 0, 450, 451, + 0, 452, 1524, 454, 455, 456, 457, 458, 0, 459, + 1525, 1526, 0, 0, 462, 463, 0, 465, 0, 0, + 467, 468, 1527, 470, 471, 472, 473, 474, 0, 0, + 475, 476, 477, 0, 478, 479, 480, 481, 0, 482, + 483, 484, 485, 486, 0, 1529, 0, 489, 1530, 491, + 492, 493, 494, 495, 496, 497, 0, 1, 498, 0, + 0, 499, 500, 501, 502, 503, 504, 2, 0, 3, + 4, 0, 0, 0, 0, 1, 0, 0, 516, 517, + 518, 519, 0, 0, 0, 2, 0, 6, 0, 0, + 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, + 8, 0, 0, 0, 7, 0, 0, 0, 0, 0, + 0, 10, 0, 0, 0, 0, 0, 0, 8, 0, + 0, 0, 0, 11, 0, 750, 0, 0, 0, 10, + 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, + 0, 11, 0, 750, 0, 0, 0, 0, 0, 0, + 0, 14, 15, 0, 13, 0, 0, 0, 0, 0, + 0, 0, 751, 0, 0, 0, 0, 0, 18, 14, + 15, 0, 0, 0, 0, 0, 19, 0, 0, 0, + 751, 0, 0, 0, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 22, 19, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 125, 126, 127, - 0, 0, 0, 1477, 0, 0, 0, 0, 1478, 129, - 130, 0, 131, 132, 133, 1479, 135, 136, 137, 0, - 1480, 1481, 1482, 1483, 0, 143, 144, 145, 146, 147, - 148, 0, 0, 149, 150, 151, 152, 1484, 1485, 155, - 0, 156, 157, 158, 159, 0, 0, 1486, 0, 1487, - 163, 164, 165, 166, 167, 1488, 169, 170, 171, 0, - 172, 173, 174, 175, 176, 177, 0, 1489, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 1490, 190, - 191, 1491, 193, 0, 194, 0, 195, 196, 197, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 0, 0, - 205, 206, 1059, 208, 209, 0, 210, 211, 212, 0, - 213, 214, 215, 0, 216, 217, 218, 219, 0, 221, - 222, 223, 224, 225, 0, 0, 227, 0, 228, 229, - 1492, 231, 0, 232, 0, 233, 1493, 0, 1494, 236, - 237, 0, 1495, 240, 0, 241, 0, 0, 0, 244, - 245, 0, 246, 247, 248, 249, 250, 251, 252, 1496, - 254, 255, 256, 257, 0, 258, 259, 260, 261, 262, - 263, 264, 0, 265, 1497, 0, 268, 269, 270, 271, - 272, 1498, 1499, 0, 1500, 0, 276, 1501, 1502, 279, - 1503, 281, 282, 283, 284, 285, 286, 0, 0, 287, - 1504, 289, 1505, 0, 291, 292, 293, 294, 295, 296, - 297, 298, 0, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 1507, 1508, 1509, 323, 324, 325, 0, - 0, 327, 328, 1510, 330, 0, 0, 332, 1511, 334, - 335, 336, 0, 337, 338, 0, 0, 339, 340, 341, - 0, 0, 342, 343, 0, 1512, 346, 1513, 0, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 360, 361, 0, 1514, 364, 365, - 0, 367, 368, 369, 0, 370, 371, 372, 373, 374, - 375, 0, 376, 377, 378, 1515, 380, 381, 382, 383, - 0, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 0, 397, 398, 1516, 400, 401, - 402, 0, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 0, 1518, 417, 418, 419, - 420, 421, 422, 0, 424, 425, 0, 1520, 427, 428, - 1521, 430, 0, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 0, 444, 0, 0, 0, - 446, 447, 0, 448, 1523, 450, 451, 452, 453, 454, - 0, 455, 1524, 1525, 0, 0, 458, 459, 0, 461, - 0, 0, 463, 464, 1526, 466, 467, 468, 469, 470, - 0, 0, 471, 472, 473, 0, 474, 475, 476, 477, - 0, 478, 479, 480, 481, 482, 0, 1528, 0, 485, - 1529, 487, 488, 489, 490, 491, 492, 493, 0, 1, - 494, 0, 0, 495, 496, 497, 498, 499, 500, 2, - 0, 3, 4, 0, 0, 0, 0, 1, 0, 0, - 512, 513, 514, 515, 0, 0, 0, 2, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, - 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, - 0, 0, 8, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 0, 11, 0, 746, 0, 0, - 0, 10, 0, 0, 0, 0, 0, 0, 13, 0, - 0, 0, 0, 11, 0, 746, 0, 0, 0, 0, - 0, 0, 0, 14, 15, 0, 13, 0, 0, 0, - 0, 0, 0, 0, 747, 0, 0, 0, 0, 0, - 18, 14, 15, 0, 0, 0, 0, 0, 19, 0, - 0, 0, 747, 0, 0, 0, 0, 0, 18, 0, - 0, 0, 0, 0, 22, 0, 19, 0, 23, 0, + 0, 22, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 22, 0, 0, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, -1424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -1424, 0, 0, + 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, - 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 26, 27, 28, 0, 0, 0, 0, 0, 29, 0, + 0, 30, 0, 0, 0, 0, 0, 0, 26, 27, + 28, 0, 0, 0, 0, 0, 29, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 27, 28, 29, 0, 0, 0, 0, 0, 30, - 0, 0, 31, 0, 0, 0, 0, 0, 0, 27, - 28, 29, 0, 0, 0, 0, 0, 30, 0, 0, - 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, - 33, 0, 0, 0, 0, 0, 0, 0, 0, 32, - 0, 0, 0, 0, 0, 0, 34, 0, 33, 0, - 0, 0, 0, 35, 0, 0, 0, 36, 0, 0, - 0, 0, 0, 0, 34, 0, 0, 37, 0, 0, - 0, 35, 0, 0, 0, 36, 0, 0, 0, 38, - 0, 0, 0, 39, 0, 37, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, - 0, 39, 0, 40, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, - 0, 40, 43, 0, 0, 0, 0, 44, 0, 0, - 0, 748, 0, 0, 41, 0, 0, 0, 0, 0, - 43, 0, 0, 45, 0, 44, 0, 0, 0, 0, + 31, 0, 0, 0, 0, 0, 0, 33, 0, 32, + 0, 0, 0, 0, 34, 0, 0, 0, 35, 0, + 0, 0, 0, 0, 0, 33, 0, 0, 36, 0, + 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, + 37, 0, 0, 0, 38, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, + 0, 0, 38, 0, 39, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, + 0, 0, 39, 42, 0, 0, 0, 0, 43, 0, + 0, 0, 752, 0, 0, 40, 0, 0, 0, 0, + 0, 42, 0, 0, 44, 0, 43, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 44, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 45, 0, 0, 0, 0, 0, 46, 0, 0, + 0, 0, 753, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 749, 0, 0, 0, 46, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 47 + 46 }; static const yytype_int16 yycheck[] = { - 7, 516, 0, 0, 47, 835, 895, 73, 920, 16, - 0, 0, 0, 809, 0, 0, 23, 16, 881, 1157, - 741, 0, 0, 7, 1224, 990, 0, 858, 904, 1222, - 1236, 1418, 925, 1692, 1655, 981, 749, 970, 1210, 23, - 38, 20, 2172, 1197, 981, 970, 955, 0, 1079, 1032, - 20, 981, 1298, 17, 2141, 77, 2143, 981, 1466, 1199, - 1191, 77, 2227, 1202, 2162, 1574, 1987, 20, 75, 76, - 39, 959, 970, 0, 1608, 1609, 2612, 0, 46, 1276, - 2314, 0, 2612, 2107, 23, 2651, 0, 1227, 0, 0, - 0, 75, 76, 2161, 1797, 26, 0, 1323, 0, 0, - 0, 2223, 100, 2673, 1124, 0, 0, 35, 895, 1129, - 897, 7, 899, 748, 0, 742, 75, 76, 2649, 0, - 0, 0, 1087, 999, 0, 0, 2666, 23, 749, 0, - 805, 2275, 2276, 2277, 2486, 810, 75, 76, 2294, 5, - 2568, 110, 0, 5, 2572, 9, 9, 1819, 979, 5, - 0, 23, 5, 1712, 0, 1988, 1928, 13, 14, 80, - 13, 14, 1659, 5, 11, 1815, 1710, 2985, 5, 16, - 5, 5, 45, 63, 5, 5, 13, 14, 5, 75, - 76, 1106, 13, 14, 772, 5, 982, 5, 5, 9, - 5, 1053, 1054, 2315, 9, 13, 14, 13, 14, 46, - 5, 5, 1135, 75, 76, 5, 5, 5, 1070, 5, - 1135, 2970, 13, 14, 40, 1816, 1961, 1962, 2302, 139, - 3, 4, 5, 2306, 45, 11, 9, 1972, 2300, 2988, - 16, 1976, 119, 80, 60, 63, 55, 172, 82, 3, - 3, 5, 190, 2365, 2366, 871, 2368, 876, 4, 93, - 100, 1057, 1033, 9, 100, 1086, 876, 970, 2437, 2437, - 1243, 74, 171, 2824, 1140, 4, 90, 1073, 63, 1252, - 9, 34, 35, 244, 171, 124, 287, 3149, 1211, 11, - 106, 1214, 1215, 15, 16, 290, 1211, 802, 2870, 1214, - 1215, 180, 2940, 11, 172, 1433, 226, 15, 16, 5, - 122, 107, 11, 295, 82, 129, 15, 16, 983, 289, - 312, 5, 11, 107, 46, 93, 15, 16, 183, 295, - 995, 312, 2805, 0, 2807, 30, 275, 2530, 1466, 2532, - 122, 122, 2419, 38, 117, 850, 147, 46, 973, 107, - 64, 106, 272, 20, 117, 137, 23, 1519, 80, 75, - 74, 192, 171, 379, 1135, 168, 1186, 1187, 40, 1190, - 278, 38, 119, 388, 366, 53, 1612, 1954, 1955, 1956, - 47, 80, 132, 161, 30, 201, 3280, 30, 166, 3344, - 13, 14, 38, 163, 3388, 38, 161, 2531, 30, 2925, - 212, 41, 120, 40, 30, 192, 2582, 1309, 75, 76, - 77, 148, 3238, 165, 3240, 11, 217, 170, 338, 172, - 1898, 365, 37, 117, 2980, 163, 2581, 1280, 3177, 3477, - 1345, 1346, 33, 100, 250, 2991, 2556, 2130, 478, 1210, - 308, 3312, 4, 478, 260, 218, 108, 9, 132, 289, - 46, 1929, 503, 289, 476, 1338, 272, 104, 59, 237, - 500, 2982, 199, 514, 2478, 500, 2578, 240, 2580, 389, - 3518, 3279, 237, 108, 514, 159, 194, 357, 500, 3473, - 3374, 3436, 337, 3377, 80, 393, 126, 448, 304, 3079, - 3316, 3081, 230, 307, 295, 250, 190, 213, 176, 514, - 132, 271, 518, 175, 1525, 260, 132, 2683, 286, 3147, - 1746, 366, 451, 514, 272, 193, 279, 509, 358, 514, - 198, 352, 358, 2716, 392, 328, 240, 1298, 509, 428, - 63, 451, 279, 180, 284, 3107, 518, 3010, 175, 357, - 356, 428, 3093, 166, 514, 327, 534, 1163, 8, 3411, - 413, 11, 518, 514, 3126, 15, 16, 172, 236, 19, - 20, 21, 472, 2732, 2732, 381, 3437, 3375, 355, 1188, - 514, 323, 357, 1151, 82, 454, 514, 3471, 1188, 456, - 274, 2693, 1980, 279, 400, 93, 370, 1092, 2662, 514, - 274, 588, 289, 208, 428, 279, 1740, 2659, 2509, 588, - 284, 512, 413, 1424, 503, 516, 2679, 421, 2107, 224, - 0, 1322, 3202, 2375, 1801, 454, 1327, 516, 1438, 234, - 416, 2145, 1333, 3149, 416, 272, 478, 3376, 132, 3149, - 2179, 463, 1484, 1485, 3164, 1455, 476, 1340, 518, 451, - 476, 1857, 445, 444, 2178, 82, 518, 1837, 500, 403, - 404, 1566, 505, 506, 1890, 2317, 93, 1509, 514, 513, - 428, 478, 514, 1578, 520, 1580, 1902, 2307, 514, 517, - 451, 514, 2171, 510, 520, 515, 1872, 517, 2165, 515, - 3098, 517, 514, 500, 1657, 3103, 2841, 514, 512, 514, - 514, 1606, 516, 514, 514, 1491, 1932, 514, 2433, 515, - 518, 396, 2848, 1939, 514, 514, 514, 514, 514, 514, - 3052, 464, 1329, 391, 1339, 1511, 749, 1569, 1570, 514, - 514, 2312, 3278, 514, 514, 514, 514, 3287, 514, 1340, - 1551, 1552, 505, 506, 510, 1601, 1602, 1603, 198, 272, - 1561, 1977, 406, 2967, 249, 1981, 361, 476, 1519, 1545, - 396, 435, 749, 396, 1575, 120, 3286, 161, 161, 505, - 506, 221, 446, 166, 2822, 380, 1431, 800, 11, 274, - 274, 500, 454, 2009, 415, 108, 505, 506, 425, 748, - 284, 514, 119, 1604, 503, 507, 508, 509, 510, 749, - 517, 430, 789, 265, 1709, 1710, 2707, 516, 1985, 507, - 508, 509, 510, 800, 468, 748, 505, 506, 507, 508, - 509, 510, 453, 1941, 2828, 789, 505, 506, 507, 508, - 509, 510, 3337, 3338, 357, 881, 800, 2961, 149, 194, - 3386, 291, 514, 237, 237, 454, 848, 80, 835, 836, - 479, 1612, 848, 2420, 2421, 2422, 2423, 1770, 320, 274, - 3371, 800, 1980, 386, 279, 1770, 2968, 1780, 191, 513, - 1783, 858, 420, 784, 422, 1780, 2875, 534, 1783, 206, - 524, 800, 1845, 2784, 2883, 3390, 823, 824, 825, 200, - 868, 868, 286, 286, 244, 3411, 1765, 356, 868, 868, - 868, 3411, 868, 868, 853, 514, 856, 244, 512, 868, - 868, 859, 516, 789, 868, 902, 903, 1412, 3429, 906, - 907, 336, 871, 1624, 800, 2131, 464, 386, 2741, 837, - 838, 2744, 840, 2746, 1552, 868, 1004, 789, 515, 274, - 2058, 518, 513, 1561, 2627, 272, 2629, 274, 800, 1949, - 1823, 3497, 244, 524, 1022, 1798, 1799, 1800, 1026, 3173, - 1873, 868, 71, 72, 3109, 868, 1855, 173, 1873, 868, - 1859, 1738, 959, 1862, 868, 4, 868, 868, 868, 226, - 9, 925, 2496, 970, 868, 1746, 868, 868, 868, 2478, - 5, 978, 979, 868, 868, 1873, 1864, 984, 1765, 478, - 987, 988, 868, 990, 991, 992, 993, 868, 868, 868, - 132, 3089, 868, 868, 973, 514, 173, 868, 1785, 1006, - 370, 500, 4, 1790, 26, 272, 1013, 9, 258, 259, - 2397, 365, 366, 370, 37, 514, 2147, 159, 2149, 245, - 973, 509, 1006, 132, 1031, 1032, 1033, 177, 516, 1013, - 514, 501, 502, 503, 147, 505, 506, 507, 508, 509, - 510, 4, 177, 1009, 1087, 1052, 9, 1006, 161, 1015, - 159, 2251, 1880, 166, 1013, 1776, 1884, 512, 370, 1887, - 1781, 516, 512, 2201, 1071, 108, 516, 1006, 245, 1994, - 352, 748, 749, 2319, 1013, 1082, 1083, 1084, 448, 1086, - 1087, 2278, 509, 3004, 1091, 420, 59, 422, 3253, 516, - 240, 448, 1091, 2796, 512, 74, 514, 1423, 516, 1425, - 1426, 80, 377, 2612, 217, 240, 1937, 1014, 377, 1890, - 1006, 1018, 789, 1120, 93, 137, 342, 1013, 202, 2259, - 74, 1902, 389, 800, 237, 375, 376, 512, 251, 514, - 1137, 1138, 274, 420, 1006, 422, 448, 279, 117, 433, - 119, 1013, 284, 515, 514, 416, 518, 1169, 1170, 172, - 1172, 1932, 466, 1169, 1170, 381, 1172, 514, 1939, 515, - 1873, 374, 518, 117, 1171, 342, 377, 30, 1175, 1176, - 279, 848, 2137, 286, 476, 284, 478, 244, 1185, 1186, - 1187, 514, 295, 1190, 451, 208, 2233, 2326, 2235, 2020, - 416, 868, 244, 2332, 1163, 420, 1977, 422, 171, 177, - 1981, 224, 514, 1210, 381, 515, 1987, 2453, 518, 837, - 838, 234, 840, 8, 515, 515, 11, 518, 518, 2144, - 15, 16, 85, 514, 19, 20, 21, 206, 2009, 515, - 515, 94, 518, 518, 6, 370, 1243, 514, 10, 416, - 466, 36, 166, 342, 26, 1252, 18, 2578, 514, 2580, - 32, 514, 2177, 2178, 202, 118, 873, 1226, 875, 244, - 82, 33, 240, 515, 2095, 37, 518, 514, 26, 1276, - 420, 293, 422, 515, 32, 515, 518, 515, 518, 2142, - 518, 515, 381, 514, 518, 420, 108, 422, 171, 466, - 514, 1298, 514, 435, 42, 274, 973, 2435, 448, 514, - 279, 2439, 2710, 370, 446, 13, 14, 1314, 1297, 1297, - 514, 1297, 1297, 448, 507, 1314, 1323, 416, 370, 2828, - 274, 2230, 500, 2232, 3489, 279, 435, 190, 171, 1006, - 514, 444, 354, 1340, 356, 313, 1013, 446, 361, 497, - 203, 314, 315, 316, 3474, 515, 3476, 223, 518, 328, - 1357, 173, 13, 14, 3441, 137, 1363, 380, 1357, 107, - 1339, 109, 26, 111, 386, 344, 2612, 466, 32, 3456, - 1340, 1048, 515, 497, 328, 518, 2206, 13, 14, 137, - 202, 448, 516, 1060, 289, 370, 1339, 3517, 515, 170, - 344, 518, 370, 2305, 515, 2595, 448, 518, 516, 377, - 514, 2594, 518, 1410, 1411, 515, 379, 515, 518, 1416, - 1087, 1418, 515, 13, 14, 518, 1423, 1424, 1425, 1426, - 2626, 515, 370, 245, 3511, 2579, 221, 515, 515, 3516, - 518, 1438, 1439, 381, 1418, 171, 1443, 515, 1445, 294, - 518, 1448, 420, 416, 422, 59, 1453, 514, 1455, 1456, - 2643, 1458, 2483, 2484, 2593, 1462, 2595, 515, 514, 1443, - 518, 1445, 514, 448, 1448, 417, 445, 223, 416, 1453, - 448, 497, 1456, 137, 1458, 454, 449, 515, 1462, 515, - 518, 152, 518, 350, 1443, 515, 1445, 460, 518, 1448, - 152, 445, 1169, 1170, 1453, 1172, 291, 1456, 152, 1458, - 454, 342, 515, 1462, 1443, 518, 1445, 188, 189, 1448, - 515, 293, 1519, 518, 1453, 2461, 2462, 1456, 466, 1458, - 2351, 2486, 1418, 1462, 2461, 2462, 2463, 152, 3231, 514, - 3233, 2461, 2457, 2458, 152, 293, 2460, 171, 2319, 402, - 381, 514, 405, 1033, 1551, 1552, 1418, 1443, 370, 1445, - 1548, 1548, 1448, 1560, 1561, 13, 14, 1453, 1548, 381, - 1456, 1568, 1458, 40, 515, 416, 1462, 518, 1575, 1548, - 1548, 1443, 354, 1445, 1548, 416, 1448, 258, 259, 515, - 515, 1453, 518, 518, 1456, 515, 1458, 515, 518, 514, - 1462, 274, 350, 1600, 416, 1548, 354, 1604, 40, 515, - 1607, 40, 518, 89, 386, 1612, 1613, 1614, 1615, 1616, - 1617, 1618, 1619, 1620, 1621, 13, 14, 439, 1625, 1626, - 3241, 60, 1621, 1630, 2345, 466, 466, 1634, 386, 293, - 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 2352, - 3149, 1648, 152, 515, 466, 2891, 518, 480, 1655, 26, - 1657, 515, 152, 515, 518, 32, 518, 515, 365, 366, - 518, 152, 1339, 13, 14, 13, 14, 106, 107, 1676, - 516, 2547, 2453, 1695, 152, 457, 13, 14, 117, 1695, - 314, 315, 316, 5, 13, 14, 350, 2612, 2842, 2889, - 354, 1698, 13, 14, 375, 376, 13, 14, 289, 457, - 13, 14, 1709, 1710, 1674, 352, 501, 502, 503, 428, - 505, 506, 507, 508, 509, 510, 13, 14, 13, 14, - 1210, 514, 386, 13, 14, 13, 14, 171, 2509, 13, - 14, 13, 14, 13, 14, 514, 175, 13, 14, 1746, - 2570, 13, 14, 13, 14, 379, 13, 14, 1755, 514, - 1757, 13, 14, 2925, 365, 366, 1755, 514, 1757, 2965, - 137, 2654, 201, 515, 2676, 418, 1443, 219, 1445, 224, - 2633, 1448, 365, 366, 262, 263, 1453, 2686, 299, 1456, - 3439, 1458, 416, 514, 3443, 1462, 224, 535, 375, 376, - 1797, 224, 540, 457, 1801, 543, 514, 1804, 1805, 459, - 460, 3047, 3451, 3452, 126, 127, 3193, 26, 1298, 3483, - 3484, 250, 296, 32, 2797, 449, 40, 2742, 1137, 1138, - 235, 260, 514, 5, 5, 514, 460, 324, 514, 514, - 514, 2612, 5, 272, 8, 274, 5, 11, 1845, 3498, - 514, 15, 16, 1841, 5, 19, 20, 21, 514, 171, - 1857, 5, 148, 9, 477, 514, 8, 1864, 1865, 11, - 301, 518, 36, 15, 16, 304, 1873, 19, 20, 21, - 514, 1548, 104, 518, 515, 40, 219, 386, 286, 166, - 514, 166, 284, 1890, 59, 514, 235, 1894, 1895, 428, - 1897, 93, 514, 428, 518, 1902, 1903, 1904, 1905, 1906, - 1907, 1908, 3411, 3149, 1911, 1912, 1913, 1914, 1915, 1916, - 1917, 1918, 1919, 1920, 59, 59, 293, 356, 137, 1926, - 1927, 428, 428, 1930, 265, 1932, 2707, 524, 108, 221, - 1937, 476, 1939, 428, 428, 152, 100, 377, 274, 198, - 274, 274, 381, 514, 40, 514, 274, 2880, 274, 152, - 1627, 171, 1959, 516, 13, 2880, 1963, 3344, 1965, 515, - 2885, 400, 1969, 402, 515, 26, 405, 3160, 515, 515, - 1977, 32, 171, 350, 1981, 515, 1983, 354, 1985, 1963, - 1987, 518, 515, 2892, 2893, 1969, 515, 514, 473, 224, - 224, 514, 314, 315, 316, 281, 514, 463, 281, 518, - 3387, 516, 2009, 2784, 1963, 516, 514, 2932, 2933, 386, - 1969, 514, 514, 2020, 2021, 514, 2737, 39, 1695, 472, - 9, 514, 514, 426, 1963, 426, 11, 352, 518, 1519, - 1969, 513, 426, 279, 521, 524, 428, 518, 514, 514, - 180, 162, 171, 791, 117, 518, 515, 221, 454, 3436, - 217, 518, 2095, 2060, 3019, 265, 226, 379, 2065, 2066, - 290, 312, 389, 312, 518, 180, 219, 1963, 390, 3275, - 518, 226, 515, 1969, 293, 514, 137, 514, 274, 3217, - 457, 295, 287, 2090, 2091, 226, 333, 466, 2095, 514, - 412, 1963, 152, 3, 416, 26, 514, 1969, 171, 152, - 514, 32, 2109, 152, 152, 2112, 476, 2114, 152, 3, - 2891, 37, 40, 289, 274, 40, 42, 291, 289, 59, - 171, 11, 1612, 2130, 2131, 40, 166, 449, 515, 515, - 2137, 350, 515, 2140, 515, 354, 514, 885, 460, 291, - 2861, 514, 180, 514, 2925, 166, 3, 39, 3, 512, - 2157, 512, 1829, 428, 476, 428, 2140, 428, 515, 428, - 513, 515, 518, 2170, 1841, 3411, 171, 386, 515, 917, - 521, 516, 514, 2157, 497, 101, 515, 13, 500, 497, - 2187, 2188, 514, 19, 515, 933, 934, 935, 936, 497, - 428, 515, 514, 155, 514, 31, 515, 2204, 514, 2206, - 515, 2140, 249, 515, 514, 473, 137, 40, 2215, 45, - 46, 518, 3137, 3138, 3414, 3127, 59, 518, 2157, 290, - 499, 290, 503, 3004, 3149, 451, 2233, 2234, 2235, 243, - 303, 59, 293, 59, 2233, 2234, 2235, 985, 457, 265, - 428, 314, 315, 316, 2140, 274, 172, 8, 514, 152, - 11, 202, 152, 177, 15, 16, 1746, 152, 19, 20, - 21, 2157, 428, 281, 281, 2272, 3047, 2310, 2140, 147, - 428, 2278, 108, 515, 514, 36, 40, 428, 202, 428, - 352, 514, 208, 161, 515, 2157, 1963, 3000, 166, 350, - 518, 287, 1969, 354, 289, 40, 152, 476, 224, 279, - 515, 171, 514, 514, 59, 185, 379, 2314, 234, 515, - 2299, 2299, 2319, 2299, 2299, 2314, 240, 515, 515, 166, - 80, 512, 515, 515, 143, 386, 515, 501, 502, 503, - 2337, 505, 506, 507, 508, 509, 510, 198, 515, 217, - 171, 524, 268, 416, 2351, 2352, 514, 300, 358, 501, - 502, 503, 2359, 505, 506, 507, 508, 509, 510, 237, - 2359, 518, 293, 289, 180, 515, 514, 3243, 3149, 515, - 294, 514, 3203, 290, 3205, 152, 449, 515, 515, 518, - 514, 175, 439, 515, 515, 3215, 516, 460, 314, 515, - 2397, 514, 514, 40, 518, 321, 457, 515, 514, 40, - 1890, 86, 454, 476, 518, 171, 514, 475, 286, 515, - 515, 198, 1902, 2397, 515, 513, 513, 295, 2095, 350, - 515, 515, 3218, 354, 3220, 518, 515, 500, 515, 460, - 2437, 289, 59, 503, 3346, 361, 2113, 3402, 515, 515, - 515, 514, 1932, 2486, 476, 204, 2453, 117, 1196, 1939, - 515, 40, 2129, 226, 380, 386, 514, 88, 2524, 191, - 221, 1209, 2469, 2140, 279, 0, 3355, 279, 2475, 2476, - 516, 516, 428, 3336, 516, 516, 2519, 516, 503, 2486, - 2157, 516, 1230, 516, 428, 515, 3411, 1977, 516, 516, - 2497, 1981, 516, 2500, 513, 2502, 420, 1987, 422, 515, - 3330, 2397, 2509, 2510, 516, 516, 2513, 2514, 516, 516, - 516, 2518, 2519, 516, 516, 516, 516, 516, 2525, 2009, - 513, 445, 516, 449, 448, 2397, 457, 2570, 454, 516, - 291, 8, 516, 2540, 11, 516, 40, 516, 15, 16, - 2538, 2538, 516, 2550, 516, 1293, 2544, 516, 2538, 516, - 516, 516, 515, 274, 1302, 514, 7, 8, 107, 2538, - 2538, 40, 13, 2570, 2538, 100, 444, 514, 19, 46, - 476, 289, 23, 514, 25, 26, 53, 9, 514, 30, - 31, 32, 351, 518, 35, 2538, 335, 38, 39, 518, - 59, 42, 514, 198, 45, 46, 515, 515, 191, 513, - 459, 91, 2609, 80, 344, 2612, 2613, 518, 2615, 514, - 2609, 515, 147, 40, 2613, 152, 2615, 516, 515, 55, - 2627, 124, 2629, 152, 75, 76, 161, 40, 515, 366, - 3411, 166, 366, 2310, 512, 40, 171, 515, 516, 515, - 514, 514, 40, 518, 454, 180, 514, 309, 514, 100, - 185, 279, 2650, 248, 190, 454, 107, 108, 109, 110, - 111, 439, 514, 3384, 2653, 2653, 102, 2653, 2653, 292, - 74, 74, 80, 9, 515, 515, 514, 368, 1033, 93, - 2678, 515, 217, 2681, 513, 59, 2729, 123, 513, 133, - 503, 272, 289, 1441, 40, 439, 514, 2704, 292, 176, - 2707, 292, 237, 514, 204, 141, 515, 515, 515, 145, - 289, 459, 289, 515, 386, 551, 193, 2724, 2725, 365, - 122, 198, 2729, 37, 451, 2732, 148, 25, 42, 36, - 365, 167, 297, 868, 170, 2596, 1763, 2228, 25, 26, - 501, 502, 503, 3245, 505, 506, 507, 508, 509, 510, - 186, 286, 2759, 3387, 289, 2609, 3340, 3488, 2548, 236, - 295, 8, 1864, 2885, 11, 2340, 2773, 3361, 15, 16, - 3466, 2778, 2779, 3120, 3415, 2818, 2783, 2784, 40, 3424, - 3459, 2788, 147, 3179, 2791, 2792, 1197, 101, 2221, 2796, - 2797, 171, 2234, 2800, 3309, 3413, 161, 2804, 60, 46, - 335, 166, 2218, 2588, 2811, 3422, 53, 2667, 2615, 2486, - 3410, 2298, 1295, 2359, 291, 3000, 2645, 1322, 2204, 1005, - 2804, 1156, 2170, 358, 1734, 2418, 1178, 114, 3396, 2319, - 1698, 3318, 3207, 80, 2187, 1179, 1733, 23, 1975, 2157, - 2732, 1181, 2519, 279, 106, 2804, 1005, 3042, 2855, 2397, - 151, 287, 217, 2445, 800, 1210, 2863, 789, 172, 2396, - 3141, 2538, 1990, 983, 981, 2804, 1873, 2544, 981, 981, - 171, 981, 237, 309, 981, 2882, 1873, 981, 981, 981, - 3322, 416, 3321, 2171, 2891, 2067, 2476, 1439, 2069, 2022, - 2113, 2110, 2493, 2570, 208, 2811, 3307, 2538, 145, 783, - 336, 1807, 1983, 1360, 1340, 1674, 37, 743, 2804, 444, - 224, 42, 2549, 175, 391, 1675, 100, -1, 2925, 454, - 234, 286, 2271, 303, -1, 1673, -1, 1675, 1234, 176, - 295, -1, 2804, -1, 314, 315, 316, 1685, 473, 201, - 475, 476, -1, 1298, -1, -1, 193, -1, -1, -1, - -1, 198, 40, -1, 268, -1, -1, -1, -1, -1, - 2967, -1, -1, 2453, -1, 2972, -1, -1, 2967, -1, - 101, -1, 60, 2650, -1, 1723, 3019, 512, -1, -1, - 515, 516, 517, -1, -1, 2983, -1, -1, 250, 236, - -1, -1, -1, 3000, -1, -1, 3003, 3004, 260, 379, - 314, 2678, -1, -1, 2681, -1, -1, 321, -1, -1, - 272, -1, 3019, 314, 315, 316, -1, -1, 106, 2509, - -1, 498, -1, 859, -1, -1, -1, -1, 505, 506, - 507, 508, 509, 510, -1, -1, 416, -1, -1, -1, - 3047, 172, 304, -1, 291, 3052, -1, 361, -1, -1, - -1, -1, 2729, -1, -1, -1, 3063, 3064, -1, -1, - 3067, -1, 3069, -1, -1, -1, 380, -1, -1, 449, - 1818, 1819, 1820, 1821, 1822, -1, -1, 208, 379, 444, - 460, -1, -1, -1, 535, -1, -1, 3094, -1, 540, - -1, -1, 543, 224, 356, -1, 476, -1, 8, -1, - 551, 11, -1, 234, -1, 15, 16, -1, -1, -1, - -1, 3118, -1, 201, -1, 416, -1, -1, -1, 381, - 500, -1, 2612, -1, -1, -1, -1, 2804, -1, -1, - -1, -1, -1, -1, 514, 449, 46, 268, 400, -1, - -1, 2818, 3149, 53, 391, -1, -1, 512, 449, -1, - -1, 516, -1, -1, -1, 177, -1, -1, 289, 460, - -1, -1, 250, -1, 1519, -1, 3173, -1, 3166, 3167, - 80, -1, 260, -1, 3173, 476, -1, -1, -1, -1, - 202, -1, 3189, 314, 272, 1033, 3193, -1, -1, -1, - 321, -1, -1, -1, -1, -1, 3203, -1, 3205, 500, - 3207, -1, -1, -1, 3211, 1953, 3213, -1, 3215, 3193, - -1, 1033, -1, 514, -1, -1, 304, 2707, 240, 3226, - -1, -1, -1, -1, 3231, 8, 3233, -1, 11, -1, - 361, -1, 15, 16, 3241, 145, 19, 20, 21, -1, - -1, -1, -1, -1, 3242, -1, 3244, 3254, -1, 380, - -1, 498, 3259, -1, -1, 3254, -1, 1612, 505, 506, - 507, 508, 509, 510, -1, -1, 176, -1, 356, -1, - -1, -1, 294, -1, -1, -1, 151, -1, -1, -1, - 177, -1, -1, 193, -1, -1, -1, 3285, 198, -1, - 741, 742, 743, 381, 2784, -1, 171, 3193, -1, -1, - -1, 3308, -1, 3301, -1, 202, 2983, 3305, -1, -1, - -1, 3318, 400, 988, 171, -1, -1, -1, 449, -1, - 1156, 3193, -1, 3330, -1, -1, 236, -1, -1, -1, - -1, 782, 783, 784, -1, -1, -1, 3344, 789, -1, - 791, -1, 3019, 240, -1, -1, -1, -1, 370, 800, - -1, -1, -1, 804, 805, 3362, -1, -1, 809, 810, - 3344, -1, 1210, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 823, 824, 825, -1, -1, -1, -1, -1, - 3387, 291, -1, -1, -1, -1, 837, 838, 1210, 840, - -1, 1746, -1, -1, -1, 3402, -1, 294, 420, -1, - 422, 2891, 853, 3387, 3411, -1, 3413, -1, 859, -1, - -1, -1, -1, -1, 3413, 198, 313, 439, -1, -1, - 871, -1, -1, 445, -1, -1, 448, -1, -1, 3436, - 3428, -1, -1, -1, 885, 2925, -1, -1, 221, 314, - 315, 316, -1, 3450, 3451, 3452, -1, -1, 3344, -1, - 1298, -1, 3436, -1, -1, -1, 3454, 314, 315, 316, - -1, -1, -1, -1, -1, -1, 917, 918, -1, -1, - 3477, -1, 3344, 370, -1, -1, 1298, -1, 929, -1, - 377, 391, 933, 934, 935, 936, -1, -1, -1, 3166, - 3167, 3387, -1, -1, 1330, 782, 1332, 784, 949, -1, - -1, -1, -1, -1, 379, -1, -1, 988, 291, -1, - -1, 3518, -1, -1, 3004, 3387, -1, -1, -1, -1, - -1, -1, 379, 420, -1, 422, -1, 814, -1, -1, - -1, 982, 983, -1, 985, 1890, -1, 988, -1, -1, - 3436, 416, 439, 994, 995, -1, -1, 1902, 445, 1000, - -1, 448, 839, 2301, -1, 1006, -1, 3047, -1, 416, - -1, -1, 1013, -1, 3436, 3242, -1, 3244, 2316, 2317, - 2318, -1, 1023, -1, 449, -1, -1, 1932, -1, 1030, - -1, -1, -1, 2331, 1939, 460, 2334, -1, 498, 1040, - -1, 2339, 449, -1, -1, 505, 506, 507, 508, 509, - 510, 476, 8, 460, -1, 11, -1, -1, 3285, 15, - 16, -1, -1, 19, 20, 21, -1, -1, -1, 476, - -1, -1, 1977, -1, 3301, 500, 1981, -1, 3305, 988, - -1, -1, 1987, -1, -1, -1, -1, -1, 1089, 514, - 46, -1, -1, 500, -1, -1, -1, 53, -1, -1, - -1, -1, -1, -1, 2009, -1, -1, 514, -1, 3149, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 1519, -1, -1, 80, -1, -1, 2425, 2426, 2427, - -1, 13, -1, 970, -1, -1, -1, 19, 1139, -1, - 1141, -1, -1, -1, 981, 1176, -1, 1519, -1, 31, - -1, -1, -1, -1, 1185, 1156, 1157, -1, -1, -1, - -1, -1, 1163, 45, 46, -1, -1, -1, 501, 502, - 503, -1, 505, 506, 507, 508, 509, 510, -1, -1, - -1, -1, -1, -1, 1185, 1410, 1411, -1, -1, -1, - -1, 1416, -1, 1030, -1, 1196, 1197, -1, -1, -1, - -1, 3428, -1, -1, -1, -1, -1, -1, 1209, -1, - -1, 8, -1, -1, 1612, -1, -1, -1, 15, 16, - 176, -1, 19, 20, 21, 1226, 108, 3454, -1, 1230, - -1, -1, -1, -1, 1235, -1, -1, 193, -1, -1, - 1612, -1, 198, -1, -1, -1, -1, 1033, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1096, - -1, -1, -1, -1, -1, -1, 2564, -1, -1, 1106, - -1, -1, -1, -1, -1, -1, 1185, -1, -1, -1, - 236, -1, -1, -1, -1, -1, -1, -1, -1, 1126, - 1291, -1, 1293, -1, -1, -1, -1, -1, 1135, -1, - -1, 1302, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 8, 1313, -1, 11, -1, -1, -1, 15, 16, - -1, 1322, 19, 20, 21, -1, 1327, -1, 1329, 1330, - -1, 1332, 1333, -1, -1, 291, -1, -1, -1, 36, - -1, -1, -1, -1, -1, -1, -1, -1, 1746, -1, - -1, -1, -1, -1, -1, 1741, -1, 2655, -1, 1360, - -1, -1, -1, -1, -1, 1751, -1, 1753, -1, -1, - 1756, 3411, -1, -1, 1746, -1, 1762, -1, 1764, 1410, - 1411, -1, -1, -1, -1, 1416, -1, -1, -1, -1, - -1, 1777, -1, -1, -1, -1, 1782, -1, -1, -1, - 1786, 1787, 1788, 1789, -1, 1791, 1792, -1, -1, 1410, - 1411, -1, -1, -1, 2319, 1416, -1, 1418, -1, 2717, - 2718, 2719, 2720, -1, 1210, -1, -1, -1, -1, -1, - 1431, -1, 1433, 1434, -1, 391, -1, -1, -1, -1, - 1441, -1, 1443, -1, 1445, -1, -1, 1448, -1, -1, - -1, -1, 1453, 1033, -1, 1456, -1, 1458, -1, -1, - -1, 1462, -1, 1464, -1, 1466, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 1890, -1, 291, -1, -1, -1, -1, -1, - -1, 1410, 1411, -1, 1902, -1, -1, 1416, -1, -1, - -1, -1, 1298, -1, -1, -1, -1, -1, 1890, 1356, - -1, -1, -1, 1360, 221, -1, -1, -1, -1, -1, - 1902, -1, -1, -1, 1932, -1, -1, -1, -1, -1, - -1, 1939, 498, -1, -1, 501, 502, 503, 2453, 505, - 506, 507, 508, 509, 510, -1, -1, -1, -1, -1, - 1932, -1, -1, -1, -1, -1, -1, 1939, -1, -1, - -1, 2869, -1, 1574, -1, -1, -1, -1, -1, 1977, - -1, -1, -1, 1981, 1585, 8, -1, -1, 11, 1987, - -1, -1, 15, 16, 291, -1, 19, 20, 21, -1, - -1, -1, -1, -1, 2509, 1977, -1, -1, -1, 1981, - -1, 2009, -1, -1, -1, 1987, -1, -1, -1, -1, - -1, -1, -1, 1624, -1, -1, -1, -1, -1, -1, - 1210, -1, -1, -1, -1, -1, -1, 2009, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1698, -1, 551, - 1671, -1, 1673, -1, 1675, -1, -1, -1, 1903, 1904, - 1905, 1906, 1907, 1908, 1685, 1686, 1911, 1912, 1913, 1914, - 1915, 1916, 1917, 1918, 1919, 1920, -1, 1698, -1, -1, - -1, -1, -1, -1, 501, 502, 503, 2612, 505, 506, - 507, 508, 509, 510, -1, -1, -1, -1, 1298, -1, - -1, -1, 1723, -1, 1725, -1, -1, -1, -1, -1, - -1, -1, -1, 1519, -1, -1, -1, -1, -1, 1740, - 1741, -1, -1, -1, 1653, -1, -1, -1, -1, -1, - 1751, 1752, 1753, 1754, -1, 1756, -1, -1, -1, -1, - -1, 1762, -1, 1764, -1, -1, 2152, -1, -1, -1, - -1, 8, -1, -1, 11, 1776, 1777, -1, 15, 16, - 1781, 1782, 19, 20, 21, 1786, 1787, 1788, 1789, 1698, - 1791, 1792, -1, -1, -1, -1, -1, -1, 221, -1, - -1, -1, 2707, -1, 501, 502, 503, 1808, 505, 506, - 507, 508, 509, 510, -1, 1816, -1, 1818, 1819, 1820, - 1821, 1822, -1, -1, -1, -1, 1612, -1, 1665, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 1839, -1, + 7, 899, 0, 46, 0, 0, 0, 520, 0, 16, + 0, 0, 89, 90, 0, 0, 23, 16, 0, 0, + 87, 838, 20, 38, 20, 23, 0, 887, 7, 813, + 7, 1240, 861, 745, 1227, 20, 908, 1698, 753, 37, + 1424, 993, 924, 1159, 23, 1034, 23, 976, 46, 929, + 1214, 37, 1201, 91, 1226, 1081, 20, 91, 23, 984, + 959, 1575, 1656, 1549, 984, 1280, 984, 2180, 984, 1165, + 1203, 2166, 1802, 17, 1206, 1470, 963, 2235, 1609, 1610, + 0, 1302, 89, 90, 0, 2345, 0, 0, 976, 2657, + 23, 89, 90, 91, 1989, 0, 111, 45, 1231, 0, + 2231, 1327, 0, 1126, 2111, 103, 0, 0, 1131, 34, + 89, 90, 89, 90, 2165, 753, 2659, 103, 2621, 2680, + 0, 2621, 0, 0, 89, 90, 0, 0, 0, 2145, + 1002, 2147, 2673, 0, 0, 0, 0, 1089, 809, 0, + 2493, 0, 746, 814, 752, 2302, 0, 1990, 2283, 2284, + 2285, 2577, 0, 982, 9, 2581, 89, 90, 5, 5, + 0, 1718, 1826, 5, 1820, 1823, 13, 14, 1716, 1965, + 2313, 899, 1035, 901, 63, 903, 5, 0, 1055, 1056, + 1660, 80, 1978, 771, 5, 55, 5, 5, 63, 2320, + 5, 9, 5, 2314, 2309, 1072, 9, 5, 13, 14, + 5, 985, 5, 1932, 5, 5, 5, 5, 1137, 2992, + 13, 14, 13, 14, 13, 14, 5, 45, 11, 107, + 2978, 13, 14, 16, 5, 5, 5, 5, 5, 74, + 82, 45, 119, 172, 191, 26, 882, 2995, 13, 14, + 124, 93, 2373, 2374, 4, 2376, 82, 139, 30, 9, + 11, 104, 2444, 63, 5, 16, 38, 93, 1247, 1088, + 100, 976, 173, 3, 4, 5, 4, 1256, 30, 9, + 1142, 9, 122, 30, 1137, 9, 38, 100, 122, 90, + 3158, 38, 856, 882, 147, 46, 1215, 1169, 2833, 1218, + 1219, 291, 2444, 806, 2951, 288, 122, 126, 127, 2879, + 3, 11, 172, 172, 276, 15, 16, 290, 296, 11, + 245, 313, 107, 15, 16, 986, 3288, 107, 129, 80, + 2814, 37, 2816, 1439, 169, 193, 1059, 998, 181, 313, + 382, 34, 35, 245, 119, 2537, 46, 2539, 132, 40, + 853, 40, 1075, 172, 46, 203, 137, 3321, 11, 296, + 184, 1214, 15, 16, 1470, 218, 1520, 106, 132, 181, + 193, 3353, 41, 213, 117, 368, 1195, 369, 391, 977, + 80, 3486, 53, 2591, 1191, 1192, 120, 117, 80, 3, + 409, 5, 108, 457, 1035, 30, 117, 213, 279, 148, + 166, 3397, 1613, 359, 457, 479, 30, 433, 418, 164, + 1553, 122, 108, 2538, 2134, 120, 3346, 3347, 33, 1562, + 3382, 2427, 3527, 3385, 515, 481, 137, 1902, 519, 503, + 273, 2989, 164, 389, 172, 11, 1286, 3185, 1310, 15, + 16, 2934, 2590, 296, 59, 64, 456, 503, 373, 1302, + 85, 200, 471, 517, 2987, 74, 482, 126, 1933, 94, + 290, 195, 2565, 3445, 517, 2998, 2587, 173, 2589, 3399, + 191, 373, 1342, 1958, 1959, 1960, 192, 290, 171, 521, + 173, 360, 3446, 118, 2692, 176, 3482, 176, 2485, 219, + 195, 275, 454, 273, 329, 360, 315, 316, 317, 231, + 358, 285, 431, 209, 517, 280, 177, 308, 132, 3156, + 1526, 241, 251, 294, 3287, 396, 340, 272, 3480, 225, + 512, 285, 261, 194, 517, 373, 451, 517, 199, 235, + 245, 361, 355, 2725, 517, 3019, 384, 280, 512, 280, + 1751, 419, 4, 521, 517, 369, 3116, 9, 361, 451, + 538, 63, 3420, 2686, 275, 13, 191, 1193, 324, 2741, + 360, 19, 538, 382, 2669, 3135, 237, 3102, 290, 204, + 517, 419, 30, 1214, 393, 1153, 357, 506, 359, 2690, + 149, 2702, 459, 457, 521, 428, 44, 45, 373, 431, + 519, 1094, 517, 475, 447, 592, 415, 1982, 416, 2741, + 419, 1806, 1166, 592, 1193, 431, 1745, 2111, 389, 468, + 3383, 1430, 416, 448, 454, 517, 517, 328, 1485, 1486, + 454, 469, 241, 424, 1326, 25, 515, 399, 2149, 1331, + 519, 2516, 201, 452, 466, 1337, 3384, 1444, 454, 1344, + 2187, 3172, 521, 1510, 463, 457, 1862, 399, 2186, 479, + 75, 109, 399, 1460, 2440, 1838, 521, 517, 364, 245, + 479, 1302, 13, 14, 2383, 3158, 479, 1520, 3158, 2315, + 481, 516, 481, 517, 2322, 2179, 520, 383, 1877, 1658, + 517, 517, 520, 1894, 503, 517, 523, 523, 518, 2343, + 520, 3107, 503, 431, 503, 1906, 3112, 518, 517, 2169, + 521, 30, 2850, 1570, 1571, 518, 517, 520, 517, 517, + 2857, 3088, 517, 3090, 517, 115, 1344, 515, 3061, 517, + 753, 519, 517, 394, 517, 1936, 517, 517, 517, 517, + 513, 2981, 1943, 1552, 1553, 517, 451, 804, 517, 1333, + 1602, 1603, 1604, 1562, 3295, 1343, 517, 517, 517, 517, + 517, 479, 517, 3286, 259, 260, 753, 1576, 508, 509, + 1613, 273, 513, 3294, 752, 753, 752, 11, 1979, 1492, + 405, 804, 1983, 408, 467, 503, 1437, 752, 508, 509, + 508, 509, 1987, 266, 508, 509, 1605, 373, 59, 1512, + 2831, 162, 406, 407, 1012, 82, 793, 227, 108, 753, + 1018, 2012, 517, 132, 250, 793, 93, 804, 508, 509, + 510, 511, 512, 513, 345, 423, 804, 425, 510, 511, + 512, 513, 3380, 851, 793, 1548, 793, 851, 173, 275, + 887, 2716, 13, 14, 3211, 804, 80, 804, 321, 1945, + 2837, 838, 839, 273, 2884, 2970, 13, 14, 360, 804, + 506, 856, 2892, 384, 74, 2976, 1775, 510, 511, 512, + 513, 517, 3395, 851, 861, 451, 1785, 238, 1847, 1788, + 793, 876, 518, 378, 379, 521, 1982, 389, 419, 1520, + 3438, 804, 1770, 871, 178, 871, 871, 871, 419, 871, + 506, 871, 871, 162, 11, 871, 871, 117, 1751, 871, + 871, 172, 515, 519, 517, 859, 519, 871, 2793, 906, + 907, 341, 517, 910, 911, 1418, 2636, 2750, 2638, 2135, + 2753, 0, 2755, 1625, 862, 840, 841, 3420, 843, 46, + 3420, 517, 508, 509, 510, 511, 512, 513, 469, 245, + 1953, 82, 1009, 2428, 2429, 2430, 2431, 241, 3198, 1016, + 520, 5, 93, 1803, 1804, 1805, 2062, 40, 1828, 1878, + 467, 871, 392, 80, 309, 871, 963, 871, 871, 238, + 3118, 1860, 1613, 3506, 214, 1864, 871, 60, 1867, 976, + 871, 2485, 2503, 871, 981, 982, 167, 871, 871, 977, + 987, 977, 1869, 990, 991, 929, 993, 994, 995, 996, + 1878, 871, 977, 871, 871, 227, 119, 871, 871, 871, + 13, 14, 1009, 3098, 871, 871, 871, 871, 287, 1016, + 871, 1009, 871, 106, 454, 1743, 1885, 4, 1016, 162, + 1889, 2405, 9, 1892, 167, 521, 1033, 1034, 1035, 245, + 1009, 1894, 1009, 117, 315, 316, 317, 1016, 275, 1016, + 395, 273, 1770, 1906, 1009, 275, 1089, 1054, 5, 275, + 280, 1016, 1050, 172, 280, 2151, 37, 373, 2154, 2545, + 518, 132, 1790, 521, 1062, 2258, 1073, 1795, 132, 1781, + 3247, 2286, 3249, 1936, 1786, 2805, 1009, 1084, 1085, 1086, + 1943, 1088, 1089, 1016, 207, 4, 1093, 555, 172, 160, + 9, 1089, 481, 2209, 1093, 238, 160, 516, 174, 329, + 1751, 382, 517, 2324, 3262, 4, 174, 2621, 527, 202, + 9, 516, 1941, 339, 503, 1122, 1979, 347, 3013, 423, + 1983, 425, 527, 481, 245, 515, 1989, 515, 517, 519, + 517, 519, 1139, 1140, 2267, 451, 1174, 1175, 419, 1177, + 1174, 1175, 108, 1177, 287, 503, 512, 451, 3325, 2012, + 273, 1166, 275, 519, 423, 512, 425, 373, 251, 517, + 392, 26, 519, 1878, 826, 827, 828, 32, 261, 1176, + 246, 452, 1007, 1180, 1181, 355, 1174, 1175, 246, 1177, + 273, 380, 463, 1190, 1191, 1192, 380, 1017, 1195, 2141, + 1025, 1021, 173, 203, 1029, 2024, 315, 316, 317, 2331, + 518, 517, 132, 521, 275, 2337, 515, 1214, 517, 280, + 518, 275, 305, 521, 285, 1230, 280, 423, 448, 425, + 304, 285, 454, 1429, 252, 1431, 1432, 457, 209, 345, + 160, 315, 316, 317, 8, 451, 517, 11, 2459, 436, + 1247, 15, 16, 1894, 225, 19, 20, 21, 419, 1256, + 840, 841, 373, 843, 235, 1906, 518, 518, 26, 521, + 521, 469, 36, 382, 32, 479, 359, 481, 384, 345, + 2099, 377, 137, 1280, 55, 518, 8, 345, 521, 747, + 2241, 380, 2243, 15, 16, 1936, 2146, 19, 20, 21, + 518, 384, 1943, 521, 518, 1302, 518, 521, 382, 521, + 419, 517, 2587, 419, 2589, 517, 1301, 1301, 384, 1301, + 403, 1318, 1301, 167, 518, 518, 384, 521, 521, 1318, + 1327, 102, 518, 2837, 2719, 521, 2442, 517, 1979, 2445, + 451, 162, 1983, 452, 517, 419, 167, 1344, 1989, 2238, + 3498, 2240, 123, 419, 463, 1343, 518, 1343, 517, 521, + 280, 419, 517, 469, 1361, 285, 71, 72, 1343, 1366, + 141, 2012, 1361, 518, 145, 517, 521, 438, 452, 137, + 3483, 517, 3485, 1450, 438, 172, 1453, 787, 449, 463, + 1344, 1458, 517, 364, 1461, 449, 517, 168, 518, 1466, + 171, 521, 517, 469, 862, 479, 517, 2214, 517, 517, + 2621, 469, 383, 423, 517, 425, 187, 238, 818, 1416, + 1417, 2604, 879, 3526, 881, 1422, 510, 1424, 518, 503, + 503, 521, 1429, 1430, 1431, 1432, 2635, 178, 500, 294, + 2312, 2603, 842, 517, 3450, 13, 14, 1444, 1445, 2588, + 224, 518, 290, 1450, 521, 1424, 1453, 1424, 222, 3465, + 519, 1458, 1450, 1460, 1461, 1453, 287, 13, 14, 1466, + 1458, 2324, 500, 1461, 2490, 2491, 518, 877, 1466, 521, + 2602, 1450, 2604, 1450, 1453, 178, 1453, 13, 14, 1458, + 2652, 1458, 1461, 518, 1461, 1450, 521, 1466, 1453, 1466, + 241, 1424, 357, 1458, 518, 40, 1461, 521, 519, 280, + 203, 1466, 518, 518, 3520, 521, 521, 288, 438, 3525, + 3240, 518, 3242, 1520, 521, 60, 171, 1450, 292, 449, + 1453, 13, 14, 521, 389, 1458, 294, 517, 1461, 310, + 2359, 172, 518, 1466, 518, 521, 518, 521, 241, 521, + 518, 2493, 2467, 2468, 2469, 1552, 1553, 2467, 2468, 2467, + 2466, 1549, 295, 1549, 1561, 1562, 13, 14, 339, 1549, + 292, 106, 1569, 1549, 1549, 518, 976, 1549, 1549, 1576, + 518, 13, 14, 521, 984, 1549, 518, 518, 518, 521, + 8, 521, 59, 11, 147, 353, 517, 15, 16, 357, + 518, 420, 295, 521, 1601, 460, 2459, 518, 1605, 162, + 521, 1608, 518, 500, 167, 521, 1613, 1614, 1615, 1616, + 1617, 1618, 1619, 1620, 1621, 1622, 13, 14, 46, 1626, + 1627, 389, 373, 1622, 1631, 53, 518, 224, 1635, 521, + 1628, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, + 518, 2353, 1649, 521, 3158, 2360, 13, 14, 152, 1656, + 6, 1658, 80, 2516, 10, 218, 3250, 202, 13, 14, + 13, 14, 18, 1701, 13, 14, 353, 1701, 13, 14, + 1677, 152, 423, 2324, 425, 238, 32, 13, 14, 2900, + 36, 152, 2554, 13, 14, 13, 14, 152, 1098, 152, + 1158, 419, 460, 13, 14, 26, 40, 1704, 1108, 518, + 451, 32, 2851, 1701, 517, 2898, 251, 275, 1715, 1716, + 469, 1675, 13, 14, 13, 14, 261, 145, 1128, 40, + 423, 89, 425, 26, 287, 13, 14, 1137, 273, 32, + 504, 505, 506, 296, 508, 509, 510, 511, 512, 513, + 152, 26, 13, 14, 1751, 448, 152, 32, 451, 177, + 189, 190, 483, 1760, 519, 1762, 13, 14, 2621, 152, + 305, 1760, 2579, 1762, 152, 2974, 194, 13, 14, 290, + 2934, 199, 504, 505, 506, 431, 508, 509, 510, 511, + 512, 513, 2642, 2663, 368, 369, 355, 3448, 368, 369, + 517, 3452, 368, 369, 517, 1802, 2695, 178, 517, 1806, + 1035, 2683, 1809, 1810, 368, 369, 137, 518, 2459, 237, + 263, 264, 378, 379, 359, 462, 463, 2806, 3202, 517, + 259, 260, 2171, 2172, 3460, 3461, 3492, 3493, 1139, 1140, + 421, 220, 300, 225, 137, 3056, 1834, 517, 225, 384, + 1847, 225, 517, 297, 40, 1843, 3507, 517, 5, 517, + 236, 325, 137, 2716, 5, 1862, 517, 1843, 403, 517, + 241, 5, 1869, 1870, 292, 2516, 1334, 517, 1336, 5, + 26, 1878, 517, 5, 517, 5, 32, 26, 148, 517, + 9, 517, 480, 32, 447, 302, 521, 1894, 104, 1966, + 521, 1898, 1899, 518, 1901, 1972, 220, 40, 389, 1906, + 1907, 1908, 1909, 1910, 1911, 1912, 3420, 167, 1915, 1916, + 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 287, 167, + 285, 59, 236, 1930, 1931, 517, 431, 1934, 517, 1936, + 2793, 126, 127, 314, 1941, 93, 1943, 3158, 521, 378, + 379, 431, 59, 59, 431, 431, 108, 266, 527, 222, + 1360, 431, 431, 479, 380, 152, 1963, 275, 100, 1966, + 2889, 1968, 275, 294, 517, 1972, 394, 40, 1966, 3353, + 2621, 275, 1979, 518, 1972, 275, 1983, 172, 1985, 1214, + 1987, 137, 1989, 517, 275, 199, 152, 1966, 137, 1966, + 172, 294, 373, 1972, 519, 1972, 13, 3169, 518, 380, + 518, 1966, 2901, 2902, 1035, 2012, 518, 1972, 172, 294, + 518, 518, 3396, 225, 517, 521, 518, 2024, 2025, 518, + 476, 225, 353, 282, 282, 521, 357, 39, 517, 517, + 466, 475, 517, 1966, 2746, 519, 519, 2900, 9, 1972, + 355, 517, 423, 11, 425, 517, 429, 517, 517, 429, + 353, 517, 516, 429, 357, 280, 2099, 2064, 389, 521, + 527, 3445, 2069, 2070, 524, 2716, 521, 1302, 353, 517, + 451, 2934, 357, 501, 82, 3284, 3028, 517, 181, 431, + 508, 509, 510, 511, 512, 513, 389, 2094, 2095, 37, + 172, 163, 2099, 457, 42, 518, 521, 218, 266, 521, + 108, 2099, 392, 227, 389, 8, 2113, 291, 11, 2116, + 3226, 2118, 15, 16, 313, 313, 19, 20, 21, 2117, + 315, 316, 317, 521, 181, 521, 220, 2134, 2135, 460, + 227, 227, 334, 518, 2141, 2133, 8, 2144, 294, 11, + 517, 275, 2793, 15, 16, 294, 2144, 19, 20, 21, + 3013, 296, 469, 101, 2161, 288, 517, 460, 2870, 517, + 152, 152, 152, 2161, 152, 2144, 174, 2144, 479, 40, + 152, 2178, 3, 275, 517, 460, 290, 3, 290, 2144, + 40, 59, 2161, 1214, 2161, 172, 11, 382, 2195, 2196, + 40, 167, 518, 3056, 517, 203, 2161, 353, 393, 3420, + 181, 357, 518, 167, 353, 2212, 518, 2214, 357, 518, + 517, 2144, 517, 3, 3, 39, 2223, 515, 515, 521, + 415, 431, 431, 431, 419, 173, 431, 519, 2161, 518, + 3423, 518, 516, 389, 2241, 2242, 2243, 518, 246, 976, + 389, 524, 2241, 2242, 2243, 500, 518, 178, 500, 2900, + 518, 518, 518, 518, 3136, 518, 1666, 452, 500, 172, + 431, 209, 8, 517, 517, 11, 517, 517, 463, 15, + 16, 1302, 203, 2280, 155, 2318, 250, 225, 1746, 2286, + 1690, 1691, 517, 2934, 479, 1520, 476, 235, 1756, 40, + 1758, 59, 521, 1761, 3009, 3158, 468, 291, 291, 1767, + 46, 1769, 502, 506, 460, 244, 454, 53, 503, 59, + 241, 460, 2307, 2307, 1782, 2307, 59, 2324, 2307, 1787, + 2318, 269, 517, 1791, 1792, 1793, 1794, 199, 1796, 1797, + 521, 266, 431, 275, 80, 2342, 517, 152, 2345, 203, + 152, 152, 290, 431, 431, 431, 2345, 431, 282, 282, + 222, 518, 2359, 2360, 517, 40, 517, 355, 518, 288, + 2367, 479, 3013, 40, 295, 373, 521, 315, 2367, 290, + 152, 1108, 280, 172, 322, 59, 384, 518, 1613, 518, + 3252, 518, 517, 3212, 186, 3214, 517, 167, 1798, 292, + 518, 80, 515, 518, 143, 199, 518, 172, 2405, 145, + 1137, 1811, 1812, 518, 517, 3056, 517, 3224, 518, 518, + 301, 419, 518, 517, 521, 361, 364, 291, 518, 527, + 292, 181, 152, 521, 176, 518, 2405, 517, 2405, 442, + 519, 177, 40, 518, 442, 383, 517, 2444, 518, 518, + 517, 517, 373, 3227, 518, 3229, 521, 40, 194, 86, + 2493, 457, 2459, 199, 521, 172, 2471, 517, 478, 3411, + 518, 469, 518, 199, 2531, 518, 3364, 516, 1878, 2476, + 516, 521, 2405, 3355, 1884, 2482, 2483, 518, 1215, 518, + 518, 1218, 1219, 2526, 518, 3345, 2493, 290, 463, 1520, + 506, 237, 423, 59, 425, 2493, 518, 2504, 205, 518, + 2507, 479, 2509, 518, 452, 117, 40, 3158, 518, 2516, + 2517, 442, 517, 2520, 2521, 227, 1751, 448, 2525, 2526, + 451, 88, 3339, 192, 280, 2532, 280, 506, 2526, 431, + 519, 431, 40, 519, 519, 519, 2579, 275, 107, 519, + 2547, 40, 519, 516, 516, 290, 292, 2545, 518, 2545, + 2557, 517, 519, 2551, 519, 2545, 519, 3420, 519, 2545, + 2545, 7, 8, 2545, 2545, 2551, 519, 13, 479, 519, + 519, 2545, 2579, 19, 519, 519, 519, 23, 519, 25, + 518, 2579, 1613, 29, 30, 31, 9, 519, 34, 519, + 518, 37, 38, 519, 519, 41, 519, 519, 44, 45, + 519, 504, 505, 506, 519, 508, 509, 510, 511, 512, + 513, 2618, 1349, 1350, 2621, 2622, 521, 2624, 519, 2618, + 519, 519, 519, 2622, 519, 2624, 519, 517, 517, 2636, + 354, 2638, 504, 505, 506, 517, 508, 509, 510, 511, + 512, 513, 517, 89, 90, 336, 59, 199, 394, 518, + 518, 521, 192, 37, 516, 521, 462, 103, 42, 1894, + 2658, 91, 108, 109, 110, 111, 112, 2662, 2662, 98, + 2662, 1906, 2658, 2662, 518, 347, 517, 40, 152, 519, + 518, 3393, 124, 152, 40, 518, 369, 2685, 2156, 369, + 2688, 40, 40, 521, 517, 2738, 518, 126, 127, 2685, + 517, 1936, 2688, 517, 457, 310, 2713, 517, 1943, 2716, + 280, 249, 191, 457, 442, 74, 517, 101, 293, 74, + 1751, 9, 80, 518, 518, 517, 2733, 2734, 371, 516, + 518, 2738, 516, 59, 2741, 133, 2813, 506, 273, 93, + 2738, 290, 442, 172, 1979, 40, 517, 293, 1983, 293, + 517, 462, 518, 518, 1989, 501, 518, 205, 290, 290, + 518, 2768, 508, 509, 510, 511, 512, 513, 389, 3420, + 122, 368, 454, 148, 25, 2782, 36, 2012, 368, 298, + 2787, 2788, 2894, 1768, 2827, 2792, 2793, 2236, 871, 173, + 2797, 2618, 1676, 2800, 2801, 1238, 2605, 181, 2805, 2806, + 2279, 1812, 2809, 2306, 2367, 3318, 2813, 147, 3009, 3370, + 3475, 2654, 3129, 2820, 3424, 2813, 3433, 3187, 3468, 788, + 2229, 2242, 162, 1201, 3422, 209, 2597, 167, 3431, 2827, + 1567, 2226, 3419, 2674, 2813, 2348, 2813, 2624, 2248, 1298, + 1869, 225, 1579, 2556, 1581, 3316, 1344, 3254, 2813, 3396, + 2555, 235, 3349, 1326, 147, 3497, 877, 2864, 74, 2545, + 2212, 1008, 1158, 1894, 80, 2872, 2334, 1740, 1008, 162, + 1607, 2178, 2426, 1183, 167, 1906, 1184, 93, 218, 3405, + 2813, 1035, 2195, 1704, 2891, 269, 315, 316, 317, 3327, + 2300, 3216, 1739, 2900, 23, 2161, 1977, 3051, 238, 2405, + 1186, 117, 2741, 119, 2404, 1936, 290, 793, 2318, 2451, + 804, 3150, 1943, 1992, 0, 986, 984, 1878, 984, 984, + 984, 984, 984, 984, 1878, 218, 3331, 2934, 3330, 984, + 984, 315, 2071, 2483, 2179, 2117, 2026, 2820, 322, 2114, + 2073, 2500, 1675, 1985, 1445, 238, 103, 287, 1979, -1, + 2360, -1, 1983, 382, -1, -1, 296, -1, 1989, 2369, + -1, 2371, -1, -1, 393, 2375, -1, 2377, -1, -1, + -1, -1, -1, 2980, 2981, -1, -1, -1, 1715, 1716, + 364, 2012, 2981, -1, -1, 3028, 415, -1, -1, -1, + 419, 207, 2990, -1, 287, -1, -1, -1, -1, 383, + -1, -1, 3009, 296, 2990, 3012, 3013, -1, -1, -1, + 439, -1, -1, -1, 100, -1, -1, -1, -1, -1, + -1, 3028, -1, 452, -1, -1, -1, -1, 8, -1, + 3028, 11, -1, -1, 463, 15, 16, -1, 1775, 19, + 20, 21, -1, -1, -1, -1, -1, -1, 1785, 3056, + 479, 1788, -1, -1, 3061, -1, -1, -1, -1, 275, + 1214, 147, -1, -1, 280, 3072, 3073, -1, 452, 3076, + -1, 3078, -1, 457, 503, -1, 162, -1, -1, -1, + -1, 167, -1, -1, 1035, -1, 172, -1, 517, 2324, + -1, -1, -1, 539, -1, 181, 3103, -1, 544, -1, + 186, 547, -1, -1, -1, -1, -1, 447, 1035, 555, + -1, -1, -1, 329, 2582, 2583, 8, -1, -1, 11, + 3127, -1, -1, 15, 16, -1, -1, 19, 20, 21, + -1, 347, 218, -1, -1, -1, -1, -1, -1, -1, + -1, 1878, 2610, -1, 36, -1, -1, -1, 1302, -1, + -1, 3158, 238, -1, 447, -1, -1, 2625, 2626, 2627, + 2628, 2629, 2630, 2631, 2632, 2633, 2634, -1, -1, -1, + -1, -1, -1, -1, -1, 515, 3174, 3175, 518, 519, + -1, -1, -1, -1, 991, -1, -1, -1, 3174, 3175, + 3197, 3198, -1, -1, -1, 3202, -1, -1, -1, 3198, + -1, 287, -1, -1, 290, 3212, -1, 3214, -1, 3216, + 296, 2621, -1, 3220, -1, 3222, -1, 3224, -1, 199, + -1, -1, 515, 3202, 2459, 3202, 519, -1, 3235, -1, + -1, -1, 448, 3240, -1, 3242, -1, -1, -1, -1, + -1, 457, 222, 3250, 2654, -1, -1, -1, -1, -1, + 336, -1, -1, 3251, -1, 3253, 3263, -1, -1, 1996, + -1, 3268, -1, 1214, 3263, 3251, -1, 3253, -1, 3202, + -1, 8, -1, -1, 11, 361, -1, -1, 15, 16, + -1, 2516, -1, -1, -1, -1, -1, 1214, 40, -1, + -1, -1, -1, 2324, -1, 3293, -1, -1, -1, 745, + 746, 747, -1, -1, -1, -1, -1, 3293, 60, 46, + 3317, 3309, 292, -1, -1, 3313, 53, -1, -1, -1, + 3327, -1, -1, 3309, -1, -1, -1, 3313, -1, -1, + 222, -1, 3339, 419, -1, 991, -1, -1, -1, -1, + -1, 787, 788, 80, -1, -1, 3353, 793, -1, 795, + 37, 1302, -1, -1, 106, 42, -1, -1, 804, -1, + -1, 447, 808, 809, 3371, -1, 1520, 813, 814, -1, + -1, 457, -1, -1, 3353, 1302, 3353, -1, -1, -1, + 826, 827, 828, 1190, -1, -1, 2621, -1, -1, 3396, + 476, -1, 478, 479, 840, 841, -1, 843, -1, -1, + 292, -1, -1, 2871, 3411, -1, -1, 2817, 145, -1, + 856, 2148, -1, 3420, 101, 3422, 862, 3396, -1, 3396, + 3353, -1, -1, 3422, 176, -1, -1, 873, 2459, 515, + 876, 877, 518, 519, 520, -1, -1, -1, 3445, 3437, + 177, -1, -1, -1, -1, -1, -1, -1, 2185, 2186, + 202, 3437, 3459, 3460, 3461, -1, -1, 194, -1, 1613, + -1, -1, 199, 3396, -1, 3463, 3445, -1, 3445, -1, + -1, -1, -1, -1, -1, 921, 922, 3463, -1, 3486, + -1, 2716, -1, -1, -1, 2516, 173, -1, -1, -1, + 936, 937, 938, 939, 940, -1, -1, -1, 40, 251, + 237, -1, -1, -1, -1, -1, -1, 953, -1, 261, + -1, -1, 3445, -1, -1, -1, -1, -1, 60, -1, + 3527, 273, 209, -1, 504, 505, 506, -1, 508, 509, + 510, 511, 512, 513, -1, -1, -1, -1, 225, 985, + 986, -1, 988, -1, -1, 991, -1, -1, 235, -1, + -1, 997, 998, 305, -1, 292, -1, 1003, 2793, -1, + -1, -1, -1, 1009, 106, 107, -1, -1, -1, 1520, + 1016, -1, -1, -1, -1, 117, 2986, -1, -1, -1, + 1026, -1, 269, -1, -1, 172, -1, -1, -1, -1, + 2621, -1, -1, 1520, 13, -1, 1042, 1751, -1, 3009, + 19, -1, -1, 290, -1, -1, -1, 359, -1, 1416, + 1417, 30, 504, 505, 506, 1422, 508, 509, 510, 511, + 512, 513, -1, -1, -1, 44, 45, -1, 315, -1, + -1, -1, 384, -1, 176, 322, -1, -1, -1, -1, + -1, 8, -1, -1, 11, 1091, -1, -1, 15, 16, + -1, 403, 19, 20, 21, -1, -1, 394, -1, -1, + 202, -1, 1613, -1, -1, 2900, -1, -1, -1, 36, + 3138, -1, -1, -1, -1, -1, -1, 364, -1, 3089, + -1, -1, -1, -1, -1, 2716, 1613, -1, -1, -1, + 109, 3159, 3160, -1, -1, 1141, 383, -1, 1144, 2934, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 251, + -1, -1, 1158, 1159, -1, -1, 3184, 304, -1, 261, + 1166, -1, -1, -1, -1, -1, 2463, 2464, 315, 316, + 317, 273, -1, 275, -1, -1, -1, -1, -1, -1, + 1894, -1, -1, -1, 1190, -1, -1, -1, 3158, -1, + -1, -1, 1906, -1, 1200, 1201, -1, -1, -1, 0, + 1416, 1417, 2793, 305, 501, 452, 1422, 1213, -1, -1, + 457, 508, 509, 510, 511, 512, 513, -1, 3013, -1, + -1, -1, 1936, -1, 1230, -1, -1, -1, 1234, 1943, + -1, -1, -1, 1239, -1, 382, -1, -1, -1, -1, + 1751, -1, -1, -1, -1, -1, -1, -1, 37, -1, + -1, -1, -1, 42, -1, -1, -1, 359, -1, -1, + -1, 3056, -1, -1, 1751, 1979, -1, -1, -1, 1983, + -1, 41, 419, -1, -1, 1989, -1, -1, -1, -1, + -1, -1, 384, -1, -1, -1, -1, 1654, -1, 1295, + -1, 1297, -1, -1, -1, 222, -1, 1303, 2012, 100, + -1, 403, -1, 405, -1, 452, 408, -1, -1, 2900, + -1, 1317, 101, -1, -1, 3285, 463, 991, -1, -1, + 1326, -1, -1, -1, 2621, 1331, -1, 1333, 1334, -1, + 1336, 1337, 479, -1, -1, -1, -1, 1704, 108, -1, + 110, -1, 112, 2934, -1, -1, 147, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 503, -1, -1, -1, + -1, 162, -1, 3158, -1, 292, 167, -1, -1, -1, + 517, 172, -1, -1, -1, -1, -1, -1, -1, -1, + 181, -1, -1, 1894, 173, 186, -1, -1, 3416, 8, + -1, -1, 11, -1, -1, 1906, 15, 16, -1, -1, + 19, 20, 21, -1, -1, -1, -1, 1894, -1, -1, + 1416, 1417, -1, -1, -1, 517, 1422, 218, 1424, 1906, + 209, -1, 3013, -1, -1, 1936, -1, -1, -1, -1, + -1, 1437, 1943, 1439, 1440, -1, 225, 238, -1, -1, + -1, 1447, -1, -1, 1450, -1, 235, 1453, -1, 1936, + 3420, -1, 1458, -1, 2751, 1461, 1943, -1, -1, -1, + 1466, -1, 1468, -1, 1470, 3056, -1, -1, 1979, -1, + -1, -1, 1983, -1, -1, -1, -1, -1, 1989, -1, + 269, -1, -1, -1, -1, -1, 287, -1, -1, 290, + -1, -1, 1979, -1, -1, 296, 1983, -1, -1, -1, + -1, 2012, 1989, -1, -1, -1, -1, 1181, -1, -1, + -1, -1, -1, -1, -1, -1, 1190, -1, -1, -1, + -1, -1, -1, -1, -1, 2012, 315, -1, -1, -1, + -1, -1, -1, 322, -1, 336, -1, -1, -1, -1, + 1907, 1908, 1909, 1910, 1911, 1912, -1, -1, 1915, 1916, + 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, -1, -1, + 361, -1, -1, -1, -1, -1, -1, 3158, 151, 1575, + -1, -1, -1, -1, -1, 364, 555, 504, 505, 506, + 1586, 508, 509, 510, 511, 512, 513, -1, -1, 172, + -1, -1, 2889, 8, 383, -1, 11, 2894, -1, -1, + 15, 16, -1, 222, -1, -1, -1, 151, -1, -1, + 2324, -1, -1, -1, 8, -1, -1, 11, 419, 1625, + -1, 15, 16, -1, -1, 3420, -1, -1, 172, -1, + -1, 46, -1, -1, -1, -1, -1, -1, 53, -1, + -1, -1, -1, -1, 2941, 2942, 447, -1, -1, -1, + 172, -1, 46, -1, -1, -1, 457, -1, -1, 53, + -1, -1, -1, 452, -1, 80, 1672, -1, 1674, -1, + 1676, -1, -1, 292, -1, 476, -1, 478, 479, -1, + -1, 1687, -1, 1689, 1690, 1691, 80, -1, -1, -1, + -1, 1907, 1908, 1909, 1910, 1911, 1912, -1, 1704, 1915, + 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, -1, + -1, -1, -1, -1, 515, -1, -1, 518, 519, 520, + -1, -1, -1, 1729, -1, 1731, -1, 2094, 2095, -1, + 145, -1, 315, 316, 317, -1, -1, -1, -1, 1745, + 1746, -1, 1416, 1417, -1, 2459, -1, -1, 1422, -1, + 1756, 1757, 1758, 1759, -1, 1761, -1, -1, -1, -1, + -1, 1767, 177, 1769, -1, -1, -1, 746, 747, 539, + -1, 315, 316, 317, 544, 1781, 1782, 547, -1, 194, + 1786, 1787, -1, 177, 199, 1791, 1792, 1793, 1794, -1, + 1796, 1797, -1, 315, 316, 317, -1, -1, -1, 382, + 194, -1, 2516, -1, -1, 199, -1, 1813, -1, -1, + -1, -1, -1, 2324, -1, -1, 1822, 1823, 1824, 1825, + 1826, 1827, 237, -1, -1, -1, -1, -1, -1, 3420, + -1, -1, -1, -1, -1, 1841, 419, 2324, 382, -1, + -1, -1, -1, 237, -1, 2212, 0, -1, -1, 3146, + 3147, 1857, -1, -1, -1, -1, -1, -1, -1, -1, + 382, 3158, -1, -1, -1, -1, -1, -1, -1, 452, + -1, -1, -1, -1, -1, 419, -1, 292, 2094, 2095, + 463, -1, -1, 862, -1, 504, 505, 506, -1, 508, + 509, 510, 511, 512, 513, -1, 479, 419, 292, -1, + -1, 1907, 1908, 1909, 1910, 1911, 1912, 2621, 452, 1915, + 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 463, + 503, -1, -1, -1, -1, 178, -1, -1, -1, -1, + 452, -1, -1, -1, 517, 479, -1, -1, -1, 1945, + -1, 463, -1, -1, -1, -1, 100, -1, 2459, -1, + 203, 1957, -1, -1, -1, -1, -1, 479, -1, 503, + 1966, -1, -1, -1, -1, -1, 1972, -1, -1, -1, + -1, 1977, 2459, 517, -1, -1, 1982, -1, -1, 394, + -1, 503, -1, -1, -1, 1991, 1992, -1, 241, -1, + -1, -1, -1, 147, -1, 517, -1, -1, -1, -1, + 394, -1, 2716, -1, -1, 2516, -1, -1, 162, -1, + -1, -1, -1, 167, -1, -1, -1, -1, 172, -1, + -1, -1, -1, -1, 1003, 795, -1, 181, -1, 2516, + 1704, -1, 186, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 295, -1, -1, -1, -1, 1026, -1, -1, + -1, -1, -1, -1, -1, 8, 2062, -1, 11, -1, + 2066, 314, 15, 16, 218, 2071, 19, 20, 21, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 2793, + -1, -1, -1, 36, 238, -1, 501, -1, 2094, 2095, + -1, -1, -1, 508, 509, 510, 511, 512, 513, -1, + -1, -1, -1, 873, -1, 2111, -1, 501, -1, -1, + 2621, -1, 1091, -1, 508, 509, 510, 511, 512, 513, + 373, -1, -1, 3420, -1, -1, -1, 380, -1, -1, + -1, -1, -1, 287, 2621, -1, 290, -1, 2144, -1, + -1, -1, 296, -1, -1, -1, -1, -1, -1, -1, + 2156, 921, -1, 2520, 2521, 2161, -1, -1, -1, 2165, + -1, -1, -1, -1, -1, -1, 936, 937, 938, 939, + 423, -1, 425, -1, -1, -1, -1, -1, -1, 1158, + 1159, -1, 336, -1, -1, -1, 2900, -1, -1, 442, + -1, -1, -1, -1, -1, 448, -1, -1, 451, -1, + -1, -1, -1, 2209, -1, 2716, 2212, 361, -1, 2215, + -1, -1, -1, -1, -1, -1, -1, -1, 988, -1, + 2934, -1, -1, -1, -1, 2231, -1, -1, -1, 2716, + -1, -1, -1, 1907, 1908, 1909, 1910, 1911, 1912, -1, + -1, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, + 1924, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 419, -1, -1, -1, 222, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 1852, -1, -1, -1, -1, -1, -1, -1, -1, - 742, 743, -1, -1, -1, 2090, 2091, -1, 291, -1, - -1, 3169, 1903, 1904, 1905, 1906, 1907, 1908, -1, 2784, - 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, - -1, -1, 3190, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 1903, 1904, 1905, 1906, 1907, 1908, -1, -1, - 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, - -1, 2319, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1519, - 1941, -1, -1, 2329, -1, -1, -1, 2319, -1, -1, - -1, -1, 1953, -1, 3252, -1, 1793, -1, -1, -1, - 1746, -1, 1963, -1, -1, -1, -1, -1, 1969, 1806, - 1807, -1, -1, -1, 1975, -1, -1, 859, -1, 1980, - -1, -1, -1, -1, 221, 3283, 2891, -1, 1989, 1990, - -1, 24, -1, -1, 1903, 1904, 1905, 1906, 1907, 1908, - -1, -1, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, - 1919, 1920, -1, -1, -1, -1, -1, -1, -1, -1, - 2925, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 1612, -1, -1, -1, 1873, -1, -1, -1, - -1, -1, 1879, -1, -1, -1, -1, -1, 81, -1, - -1, -1, -1, -1, 291, 2453, -1, 2058, -1, 2090, - 2091, 2062, -1, -1, 97, -1, 2067, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 501, 502, - 503, 2453, 505, 506, 507, 508, 509, 510, -1, 2090, - 2091, -1, -1, -1, -1, -1, -1, -1, -1, 3004, - -1, -1, -1, -1, 1890, -1, 2107, -1, -1, -1, - -1, 2509, -1, 146, -1, -1, 1902, -1, 1000, -1, - -1, -1, -1, 156, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 168, -1, 2509, -1, 2140, - 173, 1023, 3047, -1, -1, -1, 1932, -1, -1, -1, - -1, 2152, -1, 1939, -1, -1, 2157, -1, -1, -1, - 2161, -1, -1, -1, -1, -1, 1746, -1, -1, 202, - -1, -1, -1, 2204, -1, -1, -1, -1, -1, -1, - -1, 2090, 2091, -1, -1, -1, -1, 2573, 2574, -1, - -1, 1977, -1, -1, -1, 1981, -1, 37, -1, -1, - 2201, 1987, 42, 2204, -1, -1, 2207, 1089, -1, -1, - -1, -1, 245, -1, 2612, 2601, 249, -1, -1, -1, - -1, -1, 2223, 2009, -1, -1, -1, -1, -1, -1, - 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, - 2612, -1, -1, -1, 3149, -1, -1, -1, -1, -1, + -1, -1, 2793, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 447, -1, -1, 2302, -1, -1, 3013, + -1, -1, 2308, 457, 2520, 2521, 2793, -1, -1, -1, + -1, -1, -1, -1, 2320, 2321, 2322, 2323, -1, -1, + -1, -1, 476, -1, 478, 479, -1, -1, 2334, -1, + 2336, -1, -1, 2339, -1, -1, -1, 2343, -1, 292, + -1, 2347, 3056, -1, -1, -1, 2713, 2353, -1, -1, + -1, -1, -1, -1, 1333, 1334, -1, 1336, -1, -1, + -1, 515, -1, -1, 518, 519, 520, 2373, 2374, -1, + 2376, 2738, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 2900, + -1, -1, -1, -1, 8, -1, -1, 11, -1, 2405, + -1, 15, 16, -1, -1, 19, 20, 21, -1, -1, + -1, -1, -1, 2900, -1, -1, -1, -1, -1, 2425, + 2094, 2095, -1, 2934, -1, -1, -1, 2433, 2434, 2435, + 1200, -1, -1, -1, -1, -1, 2442, -1, 2444, 2445, + -1, -1, -1, 1213, 3158, 2451, -1, 2934, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 101, -1, -1, 501, 502, 503, -1, 505, 506, - 507, 508, 509, 510, 1156, 1157, -1, -1, -1, -1, - 313, -1, -1, -1, -1, -1, 319, -1, 2513, 2514, - -1, -1, -1, 2294, -1, 2204, -1, -1, -1, -1, - 2301, 334, 126, 127, -1, -1, -1, -1, -1, 2707, - 1890, 2312, -1, -1, 2315, 2316, 2317, 2318, -1, -1, - -1, -1, 1902, -1, -1, -1, -1, -1, 2329, -1, - 2331, -1, 172, 2334, 367, 2707, -1, 370, 2339, -1, - 180, -1, -1, -1, 2345, -1, -1, 171, 381, -1, - -1, 384, 1932, -1, -1, -1, -1, -1, -1, 1939, - -1, -1, -1, -1, 2365, 2366, -1, 2368, 208, 402, + 1439, -1, -1, -1, 1234, 2471, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 8, -1, -1, 11, 2485, + -1, -1, 15, 16, 17, 18, 19, 20, 21, 1468, + -1, 1470, -1, -1, -1, -1, -1, 2713, -1, -1, + -1, -1, 3013, 36, -1, 2872, -1, -1, -1, -1, + -1, -1, -1, 46, 2520, 2521, -1, -1, -1, -1, + 53, -1, -1, -1, -1, -1, 3013, 1297, -1, -1, + -1, -1, -1, 1303, -1, -1, -1, -1, 2212, -1, + -1, -1, -1, 2549, -1, 3056, -1, 80, -1, 2555, + -1, 504, 505, 506, -1, 508, 509, 510, 511, 512, + 513, -1, -1, -1, -1, -1, -1, 2573, -1, 3056, + -1, 2577, -1, -1, -1, 2581, 2582, 2583, -1, -1, + -1, 2587, 2588, 2589, -1, 2591, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 416, 224, -1, 2784, -1, -1, 422, - 423, -1, -1, -1, 234, -1, 2397, 1977, -1, -1, - 433, 1981, -1, 2240, -1, -1, 439, 1987, -1, -1, - -1, -1, 2784, -1, -1, -1, 2417, -1, -1, -1, - -1, -1, -1, -1, 2425, 2426, 2427, -1, 268, 2009, - -1, -1, -1, 466, 2435, -1, 2437, -1, 2439, -1, - -1, -1, -1, -1, 2445, -1, -1, 1329, 1330, 289, - 1332, -1, -1, -1, -1, 2292, -1, -1, -1, -1, + -1, -1, -1, -1, 2610, -1, 2612, -1, 222, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 2625, + 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 2310, 314, -1, 2862, 2478, -1, 2704, - -1, 321, 2513, 2514, -1, -1, -1, -1, -1, -1, - 314, 315, 316, 2891, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 3411, -1, -1, -1, - -1, -1, 2513, 2514, -1, 2352, -1, -1, -1, 2891, - -1, 361, -1, -1, 2361, -1, 2363, 2925, -1, -1, - 2367, -1, 2369, 2319, -1, -1, -1, -1, -1, -1, - 380, 2542, -1, -1, -1, -1, -1, 2548, -1, -1, - -1, 1433, -1, 2925, -1, 379, -1, -1, -1, -1, - -1, -1, -1, 2564, -1, -1, 390, 2568, -1, -1, - -1, 2572, 2573, 2574, -1, -1, -1, 2578, 2579, 2580, - -1, 2582, 1464, -1, 1466, -1, -1, -1, 412, -1, - -1, -1, 416, -1, -1, -1, -1, -1, -1, -1, - 2601, 0, 2603, -1, 2513, 2514, 3004, -1, -1, 449, - -1, -1, -1, -1, 454, 2616, 2617, 2618, 2619, 2620, - 2621, 2622, 2623, 2624, 2625, 449, -1, -1, -1, -1, - -1, -1, 3004, -1, -1, -1, 460, -1, 2863, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 2649, 3047, - -1, -1, 476, -1, 2655, 8, -1, -1, 11, -1, - -1, -1, 15, 16, -1, -1, 2667, 2453, -1, -1, - -1, -1, -1, 2704, -1, 3047, 500, -1, -1, -1, - -1, -1, 2683, -1, -1, -1, -1, -1, -1, -1, - 514, -1, 2693, 46, -1, -1, -1, -1, 2729, -1, - 53, 100, -1, 2704, -1, -1, -1, -1, -1, 2710, - -1, -1, -1, -1, -1, -1, 2717, 2718, 2719, 2720, - -1, -1, -1, 2509, -1, -1, -1, 80, 2729, -1, - -1, 2732, -1, -1, -1, 2736, 2737, -1, -1, 2319, - -1, -1, 2773, 3129, 2745, -1, -1, -1, 147, -1, - -1, 3149, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 161, -1, 3150, 3151, -1, 166, -1, -1, - -1, 2772, 171, -1, -1, 2612, -1, 3149, 3003, -1, - -1, 180, -1, -1, -1, -1, 185, -1, -1, -1, - 3176, -1, 145, -1, -1, 2704, -1, -1, -1, -1, - -1, 2802, -1, 2804, -1, -1, -1, -1, 2645, -1, - -1, -1, -1, -1, -1, -1, -1, 2818, 217, -1, - 2729, 2822, -1, 176, -1, -1, 2612, 2828, -1, -1, - -1, -1, 2863, -1, -1, -1, 26, -1, 237, -1, - 193, 2842, 32, 1725, -1, 198, -1, 2848, -1, -1, - 40, -1, -1, -1, -1, -1, -1, -1, -1, 1741, - 2861, 2862, 2863, -1, -1, -1, -1, -1, 2869, 1751, - 60, 1753, -1, 2453, 1756, -1, -1, -1, -1, -1, - 1762, -1, 1764, 236, -1, 2886, -1, 286, -1, -1, - 289, -1, -1, -1, -1, 1777, 295, -1, -1, -1, - 1782, -1, -1, -1, 1786, 1787, 1788, 1789, -1, 1791, - 1792, -1, -1, -1, -1, -1, 106, -1, -1, -1, - -1, 2707, -1, -1, -1, -1, -1, -1, -1, 2509, - -1, -1, -1, -1, -1, -1, 335, -1, 291, -1, + -1, -1, -1, -1, 177, 3012, -1, 3158, -1, -1, + -1, 2657, -1, -1, -1, -1, 2872, -1, 2664, -1, + -1, 194, -1, -1, -1, -1, 199, -1, 2674, -1, + -1, 3158, -1, -1, -1, -1, -1, 1447, 292, -1, + -1, -1, -1, -1, -1, -1, 2692, -1, -1, 222, + 223, -1, -1, -1, -1, -1, 2702, -1, -1, -1, + -1, -1, -1, -1, 237, -1, 3420, 2713, -1, -1, + -1, -1, -1, 2719, -1, -1, -1, -1, -1, -1, + 2726, 2727, 2728, 2729, -1, -1, -1, -1, -1, -1, + -1, -1, 2738, -1, -1, 2741, -1, -1, -1, 2745, + 2746, -1, 275, -1, -1, 278, -1, -1, 2754, 26, + -1, -1, 1731, -1, -1, 32, -1, -1, -1, 292, + -1, -1, 295, 40, -1, -1, -1, 1746, -1, -1, + -1, -1, -1, -1, -1, 2781, -1, 1756, -1, 1758, + -1, -1, 1761, 60, -1, -1, -1, -1, 1767, -1, + 1769, -1, -1, -1, -1, -1, 3012, -1, -1, -1, + -1, -1, -1, 1782, -1, 2811, -1, 2813, 1787, -1, + -1, -1, 1791, 1792, 1793, 1794, -1, 1796, 1797, -1, + -1, 2827, -1, -1, -1, 2831, -1, -1, -1, 106, + -1, 2837, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 2851, 2520, 2521, -1, -1, + -1, 2857, -1, -1, -1, 3222, -1, -1, -1, -1, + 137, 394, -1, -1, 2870, 2871, 2872, -1, -1, -1, + 3, -1, 2878, -1, -1, 8, -1, -1, 11, -1, + -1, -1, 15, 16, 17, 18, 19, 20, 21, 2895, + 504, 505, 506, -1, 508, 509, 510, 511, 512, 513, + -1, -1, -1, 36, 1674, -1, 1676, 40, -1, 3420, + -1, -1, -1, 46, -1, -1, -1, 1687, -1, -1, + 53, -1, -1, -1, -1, 202, -1, -1, -1, -1, + -1, -1, -1, 3420, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 80, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1729, + -1, -1, -1, -1, -1, -1, 1945, 2973, 501, -1, + 2976, 504, 505, 506, 251, 508, 509, 510, 511, 512, + 513, -1, -1, 2989, 261, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 527, -1, 273, -1, 1977, 3005, + -1, -1, -1, 1982, -1, -1, 3012, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 294, -1, -1, + -1, -1, 8, -1, -1, 11, -1, -1, 305, 15, + 16, -1, 3038, 19, 20, 21, -1, -1, 3044, 2713, + -1, -1, -1, -1, 177, 3051, -1, -1, -1, -1, + -1, -1, 1822, 1823, 1824, 1825, -1, 1827, -1, -1, + 46, 194, -1, -1, 2738, -1, 199, 53, -1, -1, + -1, -1, -1, -1, -1, -1, 353, -1, -1, 3085, + 357, -1, 359, 2062, -1, -1, -1, -1, -1, 222, + 223, -1, 2071, -1, 80, -1, -1, -1, -1, -1, + -1, 3107, -1, -1, 237, -1, 3112, 384, 2782, -1, + -1, -1, 389, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 8, -1, -1, 11, 403, -1, -1, 15, + 16, -1, 3138, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 275, -1, -1, 278, -1, -1, -1, -1, + -1, -1, -1, 3159, 3160, -1, -1, -1, -1, 292, + 46, -1, 295, -1, -1, -1, -1, 53, -1, -1, + -1, -1, 3178, -1, 3180, -1, -1, 2156, 3184, -1, + -1, -1, -1, 460, -1, -1, -1, 1957, -1, -1, + -1, 177, -1, 3199, 80, -1, 3202, -1, 2872, -1, + -1, 838, 839, -1, -1, -1, -1, -1, 194, -1, + -1, -1, -1, 199, -1, -1, 3222, -1, -1, -1, + 3226, 3227, -1, 3229, -1, -1, -1, -1, -1, -1, + 2209, -1, -1, -1, -1, -1, 2215, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 3254, -1, + -1, 237, -1, -1, -1, 3261, -1, -1, -1, 145, + -1, 394, -1, -1, -1, -1, -1, -1, -1, 906, + -1, -1, -1, 910, 911, -1, 8, -1, -1, 11, + -1, -1, -1, 15, 16, -1, 3292, -1, -1, -1, + -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 292, -1, 194, -1, + -1, -1, -1, 199, 46, -1, -1, -1, -1, -1, + -1, 53, -1, -1, -1, 3331, 963, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 3012, -1, + -1, -1, -1, -1, 981, -1, -1, 3353, 80, -1, + 987, 237, -1, 990, -1, 2334, 993, 994, 995, 996, + -1, -1, -1, -1, -1, -1, -1, -1, 501, -1, + -1, 504, 505, 506, 3380, 508, 509, 510, 511, 512, + 513, -1, -1, -1, -1, -1, -1, 3393, 3394, -1, + 3396, 3397, -1, -1, -1, -1, 1033, 1034, -1, 3405, + -1, -1, -1, -1, -1, -1, 292, -1, 394, -1, + 3416, -1, -1, 145, -1, 8, -1, 1054, 11, -1, + -1, -1, 15, 16, 17, 18, 19, 20, 21, -1, + -1, -1, 3438, -1, -1, -1, 1073, -1, -1, 3445, + -1, -1, -1, 36, -1, 177, -1, 1084, 1085, 1086, + -1, 1088, 1089, 46, -1, -1, -1, -1, -1, -1, + 53, -1, 194, 2442, -1, -1, 2445, 199, -1, -1, + -1, -1, 2451, -1, -1, -1, 3482, -1, -1, -1, + -1, -1, -1, -1, -1, 1122, -1, 80, -1, -1, + -1, 3497, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 1139, 1140, -1, 237, -1, -1, 394, -1, + -1, -1, -1, -1, -1, 501, -1, -1, 504, 505, + 506, -1, 508, 509, 510, 511, 512, 513, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 2308, 1176, + -1, -1, -1, 1180, 1181, -1, -1, -1, 3222, -1, + -1, 2321, 2322, 2323, 1191, 1192, -1, -1, -1, -1, + 292, -1, -1, -1, -1, -1, 2336, -1, -1, 2339, + -1, -1, -1, -1, -1, -1, -1, 2347, -1, -1, + -1, -1, -1, -1, 177, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 2577, -1, + -1, 194, 2581, 2582, 2583, -1, 199, -1, -1, -1, + 1247, -1, -1, -1, -1, 501, -1, -1, -1, 1256, + -1, -1, 508, 509, 510, 511, 512, 513, -1, 222, + 223, 2610, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 1280, 237, -1, 2625, 2626, 2627, 2628, + 2629, 2630, 2631, 2632, 2633, 2634, -1, -1, -1, -1, + -1, -1, 394, 2433, 2434, 2435, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 68, 69, -1, -1, -1, + -1, -1, 275, -1, -1, 278, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 292, + 0, -1, 295, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 109, 110, -1, -1, + 113, 114, 22, -1, -1, -1, -1, -1, -1, 1366, + -1, -1, 32, -1, 34, 35, -1, -1, -1, -1, + 2719, -1, -1, -1, -1, -1, -1, 47, -1, -1, + -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, + -1, 61, -1, -1, -1, -1, 2745, -1, -1, 501, + -1, -1, -1, -1, -1, 75, 508, 509, 510, 511, + 512, 513, -1, -1, 84, -1, 86, -1, -1, -1, + -1, -1, 1429, -1, 1431, 1432, 189, 190, 98, -1, + 100, 394, -1, 2573, -1, -1, -1, 1444, 1445, -1, + -1, 111, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 1460, -1, -1, 126, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, - -1, -1, -1, -1, 2863, -1, -1, -1, -1, 358, - -1, -1, -1, 2964, -1, -1, -1, 2968, -1, -1, - -1, 2808, 3003, -1, -1, -1, -1, 835, 836, -1, - -1, 2982, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 2996, -1, -1, 2784, -1, - -1, -1, 3003, -1, -1, -1, -1, -1, -1, -1, - -1, 201, -1, 3411, -1, -1, -1, 416, 98, -1, - -1, 3407, -1, -1, -1, -1, -1, -1, 3029, -1, - -1, -1, 2612, -1, 3035, -1, -1, -1, 391, 3411, - -1, 3042, -1, -1, 902, 444, 126, 127, 906, 907, - -1, -1, -1, -1, -1, 454, -1, -1, -1, 1941, - 250, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 260, -1, -1, -1, 473, 3076, 475, 476, -1, -1, - -1, -1, 272, -1, -1, -1, 0, -1, -1, -1, - -1, 171, -1, 1975, 3003, -1, -1, 3098, 1980, -1, - -1, 959, 3103, 293, -1, 2891, -1, -1, -1, -1, - -1, -1, -1, 512, 304, -1, 515, 516, 517, -1, - 978, -1, -1, -1, -1, -1, 984, 2707, 3129, 987, - -1, -1, 990, 991, 992, 993, -1, -1, -1, 2925, - 2977, -1, -1, -1, -1, 498, -1, -1, -1, 3150, - 3151, -1, 505, 506, 507, 508, 509, 510, -1, -1, - 350, -1, -1, 3000, 354, -1, 356, -1, 3169, -1, - 3171, -1, -1, 1031, 1032, 3176, 2058, -1, -1, -1, - -1, -1, 3213, -1, -1, 2067, 100, -1, -1, 3190, - -1, 381, 3193, -1, 1052, -1, 386, -1, -1, -1, - -1, -1, -1, -1, 2784, -1, -1, -1, -1, -1, - 400, -1, 3213, 1071, 68, 69, 3217, 3218, 3004, 3220, - -1, -1, -1, -1, 1082, 1083, 1084, -1, 1086, 1087, - -1, -1, -1, 147, 314, 315, 316, -1, -1, -1, - 3, -1, 5, 3080, 3245, -1, -1, 161, -1, -1, - -1, 3252, 166, -1, -1, 109, 110, 171, -1, 113, - 114, 3047, 1120, -1, -1, -1, 180, 457, -1, -1, - 2152, 185, -1, -1, -1, -1, -1, -1, -1, 1137, - 1138, -1, 3283, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 379, - -1, -1, -1, 217, 3213, 68, 69, -1, -1, -1, - 390, 2891, 3149, 1171, -1, -1, -1, 1175, 1176, 2201, - -1, 3322, -1, 237, -1, 2207, -1, -1, 1186, 1187, - -1, -1, 412, -1, 188, 189, 416, -1, -1, -1, - -1, -1, -1, 3344, -1, 2925, 109, 110, -1, -1, - 113, 114, -1, -1, -1, -1, 436, -1, -1, -1, - -1, -1, -1, 3149, -1, -1, -1, -1, -1, 449, - 3371, -1, 286, -1, -1, 289, -1, -1, -1, -1, - 460, 295, -1, 3384, 3385, 1243, 3387, 3388, -1, -1, - -1, -1, -1, -1, 1252, 3396, 476, -1, 252, 253, - 254, 255, 256, 257, 258, 259, 3407, -1, 262, 263, - -1, -1, -1, -1, -1, -1, -1, -1, 1276, -1, - 500, 335, -1, -1, 3004, 188, 189, -1, 3429, -1, - -1, -1, -1, -1, 514, 3436, -1, -1, -1, 3276, - -1, -1, -1, -1, 358, -1, -1, 2329, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 3047, -1, -1, - -1, -1, 3473, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 3488, -1, 252, - 253, 254, 255, 256, 257, 258, 259, -1, -1, 262, - 263, -1, 416, -1, -1, 1363, -1, -1, -1, -1, + -1, -1, -1, 143, -1, -1, -1, -1, -1, -1, + -1, 151, -1, 153, 154, -1, -1, -1, -1, -1, + 253, 254, 255, 256, 257, 258, 259, 260, 168, -1, + 263, 264, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 375, 376, -1, -1, -1, -1, -1, -1, -1, - 444, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 454, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 2435, -1, -1, -1, 2439, -1, 473, - -1, 475, 476, 2445, -1, 1423, -1, 1425, 1426, 3149, - -1, -1, -1, -1, 3411, -1, -1, -1, -1, -1, - 1438, 1439, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1455, 512, -1, - -1, 515, 516, 517, -1, -1, -1, -1, -1, -1, - -1, -1, 375, 376, -1, -1, 470, 471, -1, -1, - -1, 8, -1, -1, 11, 3411, -1, -1, 15, 16, - 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, - 494, 495, -1, -1, -1, -1, -1, -1, -1, 36, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, - 514, -1, -1, -1, -1, -1, 53, -1, -1, -1, + -1, -1, 2871, -1, 2664, -1, -1, -1, 198, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 501, -1, + -1, 504, 505, 506, 214, 508, 509, 510, 511, 512, + 513, -1, -1, -1, 1561, -1, -1, -1, 521, -1, + -1, -1, 1569, -1, -1, -1, -1, -1, -1, -1, + 240, -1, -1, -1, 337, 338, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 2726, 2727, 2728, 2729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 2568, -1, -1, -1, - 2572, 2573, 2574, 80, -1, -1, -1, -1, -1, -1, - -1, -1, 1560, -1, -1, -1, -1, 470, 471, -1, - 1568, -1, -1, -1, -1, -1, -1, -1, -1, 2601, + -1, 1608, -1, -1, -1, -1, -1, 1614, 1615, 1616, + 1617, 1618, 1619, 1620, 1621, 378, 379, -1, -1, 1626, + 1627, -1, -1, -1, 1631, -1, -1, -1, 1635, -1, + -1, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, + -1, -1, 1649, -1, -1, 315, 316, 317, -1, 1656, + -1, 1658, -1, 323, -1, -1, 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 494, 495, -1, 2616, 2617, 2618, 2619, 2620, 2621, - 2622, 2623, 2624, 2625, -1, -1, -1, -1, -1, 1607, - -1, -1, -1, -1, -1, 1613, 1614, 1615, 1616, 1617, - 1618, 1619, 1620, -1, -1, -1, -1, 1625, 1626, -1, - -1, -1, 1630, -1, -1, -1, 1634, -1, -1, 1637, - 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, -1, 176, - 1648, -1, -1, -1, -1, -1, -1, 1655, -1, 1657, - -1, -1, -1, -1, -1, -1, 193, -1, -1, -1, - -1, 198, -1, -1, -1, -1, -1, -1, 1676, -1, - -1, -1, -1, -1, -1, 0, -1, -1, 2710, -1, - -1, 3411, -1, -1, 221, 222, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 22, -1, 236, - -1, 1709, 1710, -1, 2736, -1, -1, 32, -1, 34, - 35, 8, -1, -1, 11, -1, -1, -1, 15, 16, - -1, -1, 47, -1, -1, -1, -1, 52, -1, -1, - -1, -1, -1, -1, -1, -1, 61, 274, -1, -1, - 277, -1, -1, -1, -1, -1, -1, -1, -1, 46, - 75, -1, -1, -1, 291, -1, 53, 294, -1, 84, - -1, 86, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 98, -1, 100, -1, -1, -1, -1, - -1, -1, -1, 80, -1, -1, 111, -1, -1, 1797, - -1, -1, -1, 1801, -1, -1, 1804, 1805, -1, -1, - -1, 126, 127, 128, -1, -1, -1, -1, -1, -1, - -1, -1, 137, -1, -1, -1, -1, -1, 143, -1, - -1, -1, -1, -1, -1, -1, 151, -1, 153, 154, - 2862, -1, -1, -1, -1, -1, -1, 1845, -1, -1, - -1, -1, 167, -1, -1, -1, 171, -1, 145, -1, - -1, -1, -1, -1, 391, -1, 1864, 1865, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 197, -1, -1, -1, -1, -1, -1, 176, - -1, -1, -1, -1, -1, -1, 1894, 1895, 213, 1897, - -1, -1, -1, -1, -1, 8, 193, -1, 11, -1, - -1, 198, 15, 16, 17, 18, 19, 20, 21, -1, - -1, -1, -1, -1, 239, -1, -1, -1, 1926, 1927, - -1, -1, 1930, 36, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 46, -1, -1, -1, -1, -1, 236, - 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 1959, -1, -1, -1, -1, -1, 1965, -1, -1, - -1, 498, -1, -1, 501, 502, 503, 80, 505, 506, - 507, 508, 509, 510, -1, 1983, -1, 1985, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 524, -1, 314, - 315, 316, -1, -1, 291, -1, -1, 322, -1, -1, - 325, -1, -1, 3035, -1, -1, 988, -1, -1, -1, - 3042, -1, -1, 2021, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 354, - -1, -1, -1, -1, -1, -1, -1, -1, 363, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 2060, -1, 379, 24, -1, 2065, 2066, -1, - -1, 386, -1, 176, -1, 390, 3098, -1, -1, -1, - -1, 3103, -1, -1, -1, 400, -1, -1, -1, -1, - 193, -1, -1, -1, -1, 198, -1, 412, -1, -1, - -1, 416, -1, -1, 391, -1, -1, 3129, -1, -1, - -1, 2109, -1, -1, 2112, -1, 2114, -1, 221, 222, - -1, 436, 81, -1, -1, -1, -1, -1, 3150, 3151, - -1, -1, 2130, 236, 449, 1107, -1, 452, 97, -1, - 455, -1, -1, -1, -1, 460, -1, -1, -1, -1, - -1, -1, -1, -1, 3176, -1, -1, -1, -1, -1, - -1, 476, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 274, 2170, -1, 277, -1, -1, -1, -1, -1, - 1152, -1, -1, -1, -1, 500, -1, 146, 291, 2187, - 2188, 294, -1, -1, -1, 3217, -1, 156, -1, 514, - -1, -1, 517, -1, -1, -1, -1, -1, 2206, 168, - -1, 498, -1, 1185, 173, -1, -1, 2215, 505, 506, - 507, 508, 509, 510, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, - -1, -1, 15, 16, -1, 1237, 19, 20, 21, -1, - -1, -1, -1, -1, 2272, -1, -1, -1, -1, -1, - 2278, -1, -1, -1, -1, -1, 245, -1, 391, -1, - 249, -1, -1, 46, -1, -1, -1, -1, -1, -1, - 53, -1, -1, -1, -1, -1, -1, 1279, -1, -1, - -1, -1, -1, -1, 1286, -1, 3, -1, -1, -1, - -1, 8, -1, -1, 11, -1, -1, 80, 15, 16, - 17, 18, 19, 20, 21, -1, -1, -1, -1, 2337, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, - -1, -1, -1, 40, -1, -1, -1, -1, -1, 46, - 319, -1, -1, -1, 1336, -1, 53, -1, -1, -1, - -1, -1, -1, -1, -1, 334, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 3407, -1, -1, -1, 1361, - -1, -1, -1, 80, -1, 498, -1, -1, 501, 502, - 503, -1, 505, 506, 507, 508, 509, 510, 367, -1, - -1, 370, -1, -1, -1, 518, -1, -1, -1, -1, - -1, -1, 381, 176, -1, 384, -1, -1, -1, -1, - -1, -1, -1, -1, 1406, -1, 1408, -1, 1410, 1411, - 193, 1413, -1, 402, 1416, 198, -1, 1419, -1, -1, - 1422, -1, -1, -1, -1, 1427, -1, 416, 1430, -1, - -1, -1, -1, -1, 423, -1, -1, -1, 221, 222, - -1, 2469, -1, -1, 433, -1, -1, 2475, 2476, -1, - 439, -1, -1, 236, -1, -1, -1, -1, 2486, 176, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 2497, - 1472, -1, 2500, -1, 2502, -1, 193, 466, -1, -1, - -1, 198, 2510, -1, -1, -1, -1, -1, -1, -1, - 2518, 2519, -1, -1, 277, -1, -1, 2525, -1, -1, - -1, -1, -1, -1, 221, 222, -1, -1, 291, -1, - -1, -1, 2540, -1, -1, -1, -1, -1, -1, 236, - -1, -1, 2550, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 2570, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 1556, -1, -1, 274, -1, -1, - 277, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1572, -1, -1, -1, 291, -1, -1, 294, -1, -1, - 1582, 1583, 1584, -1, -1, -1, 1588, -1, -1, -1, - 1592, -1, -1, -1, -1, -1, -1, -1, -1, 2627, - -1, 2629, -1, -1, -1, -1, -1, -1, 391, -1, - 8, -1, -1, 11, -1, -1, -1, 15, 16, -1, + 1677, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 357, -1, -1, + -1, -1, -1, -1, -1, 3044, 366, -1, -1, -1, + -1, -1, 3051, -1, -1, -1, -1, -1, 1715, 1716, + 473, 474, 382, -1, -1, -1, -1, -1, -1, 389, + -1, -1, -1, 393, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 403, 497, 498, -1, -1, 2878, -1, + -1, -1, -1, -1, -1, 415, -1, -1, -1, 419, + -1, -1, -1, -1, 517, -1, -1, -1, 3107, 8, + -1, -1, 11, 3112, -1, -1, 15, 16, -1, 439, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 452, -1, -1, 455, -1, 36, 458, 3138, + -1, -1, -1, 463, -1, 1802, -1, 46, -1, 1806, + -1, -1, 1809, 1810, 53, -1, -1, -1, -1, 479, + 3159, 3160, -1, 8, -1, -1, 11, -1, -1, -1, + 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, + -1, 80, -1, 503, -1, 3184, -1, -1, -1, -1, + 1847, 36, -1, -1, -1, 40, -1, 517, -1, -1, + 520, 46, -1, -1, -1, -1, -1, -1, 53, -1, + -1, -1, 1869, 1870, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 3226, -1, -1, + -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, + -1, 1898, 1899, -1, 1901, -1, -1, -1, -1, -1, + -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, + 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, + -1, -1, -1, 1930, 1931, -1, -1, 1934, 177, -1, + -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 46, -1, -1, -1, 194, -1, -1, 53, -1, + 199, -1, -1, -1, -1, -1, 1963, -1, -1, -1, + -1, 1968, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 222, 223, 80, -1, -1, 1985, -1, + 1987, -1, 177, -1, -1, -1, -1, -1, 237, -1, + -1, -1, -1, -1, -1, -1, -1, 991, -1, 194, + -1, 26, -1, -1, 199, -1, -1, 32, -1, -1, + -1, -1, -1, -1, -1, 40, -1, -1, 2025, -1, + -1, -1, -1, -1, -1, -1, 275, 222, 223, 278, + -1, -1, -1, -1, -1, 60, -1, -1, 3178, -1, + -1, -1, 237, 292, -1, -1, 295, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 2064, -1, 3199, + -1, -1, 2069, 2070, -1, -1, -1, 3416, -1, -1, + -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, + 275, 106, -1, 278, -1, -1, -1, -1, -1, 194, + -1, -1, -1, -1, 199, -1, -1, 292, -1, -1, + 295, -1, -1, -1, -1, -1, 2113, -1, -1, 2116, + -1, 2118, 137, -1, -1, 1109, -1, 222, 223, -1, + -1, 3261, -1, -1, -1, -1, -1, 2134, -1, -1, + -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 394, -1, -1, -1, -1, + -1, -1, 3292, -1, -1, -1, -1, -1, -1, -1, + 1154, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 275, 2178, -1, 278, -1, -1, -1, 202, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 292, 2195, 2196, + 295, -1, -1, -1, -1, -1, 1190, -1, -1, 394, + -1, -1, -1, -1, -1, -1, -1, 2214, -1, -1, + -1, -1, -1, -1, -1, -1, 2223, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 251, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 261, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1241, 273, -1, + -1, -1, 501, -1, -1, 504, 505, 506, -1, 508, + 509, 510, 511, 512, 513, -1, -1, -1, -1, 294, + -1, -1, -1, 2280, -1, -1, -1, -1, -1, 2286, + 305, -1, -1, -1, -1, -1, -1, -1, -1, 394, + -1, 1285, -1, -1, -1, -1, 1290, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 501, -1, -1, 504, + 505, 506, -1, 508, 509, 510, 511, 512, 513, -1, + -1, -1, -1, 518, -1, -1, -1, -1, 353, -1, + 8, -1, 357, 11, 359, 2342, -1, 15, 16, 17, + 18, 19, 20, 21, -1, -1, 1340, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 36, 384, + -1, -1, -1, -1, 389, -1, -1, -1, 46, -1, + 1364, -1, -1, -1, -1, 53, -1, -1, 403, -1, + -1, -1, -1, -1, 3, -1, 5, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 501, -1, -1, 504, + 505, 506, 80, 508, 509, 510, 511, 512, 513, -1, + -1, -1, -1, 518, -1, -1, -1, -1, 1412, -1, + 1414, -1, 1416, 1417, -1, 1419, -1, -1, 1422, -1, + -1, 1425, -1, -1, 1428, 460, -1, -1, -1, 1433, + -1, -1, 1436, -1, -1, -1, -1, -1, -1, 68, + 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 68, 69, -1, -1, -1, -1, -1, 2476, + -1, -1, -1, -1, -1, 2482, 2483, -1, -1, 1473, + -1, -1, -1, -1, -1, -1, 2493, -1, -1, -1, + 109, 110, -1, -1, 113, 114, -1, 2504, -1, 177, + 2507, -1, 2509, 109, 110, -1, -1, 113, 114, -1, + 2517, -1, -1, -1, -1, -1, 194, -1, 2525, 2526, + -1, 199, -1, -1, -1, 2532, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, - -1, 11, -1, -1, -1, 15, 16, -1, 46, -1, - -1, -1, 1654, -1, -1, 53, -1, 8, -1, -1, + 2547, -1, -1, -1, 222, 223, -1, -1, -1, -1, + 2557, -1, -1, -1, -1, -1, -1, -1, -1, 237, + -1, -1, -1, 1557, -1, -1, -1, -1, -1, -1, + 189, 190, 2579, -1, -1, -1, -1, -1, -1, 1573, + -1, -1, -1, 189, 190, -1, -1, -1, -1, 1583, + 1584, 1585, -1, -1, -1, 1589, -1, 275, -1, 1593, + 278, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 292, -1, -1, 295, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 2636, + -1, 2638, -1, -1, 253, 254, 255, 256, 257, 258, + 259, 260, -1, -1, 263, 264, -1, 253, 254, 255, + 256, 257, 258, 259, 260, -1, -1, 263, 264, -1, + -1, 1655, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, 18, 19, 20, - 21, -1, -1, -1, 391, -1, 46, -1, -1, -1, - -1, -1, 80, 53, -1, 36, -1, -1, -1, 40, - 1692, -1, -1, -1, -1, 46, 2724, 2725, -1, -1, - -1, -1, 53, -1, -1, -1, 1708, -1, -1, -1, - 80, 1713, -1, -1, -1, 498, -1, -1, 501, 502, - 503, -1, 505, 506, 507, 508, 509, 510, 1730, 80, - -1, 2759, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 2773, -1, 145, -1, -1, - 2778, 2779, -1, -1, -1, 2783, -1, -1, -1, -1, - 2788, -1, -1, 2791, 2792, -1, -1, -1, 2796, 2797, - -1, -1, 2800, -1, -1, 145, -1, -1, 176, -1, - -1, 498, -1, 2811, 501, 502, 503, -1, 505, 506, - 507, 508, 509, 510, -1, 193, -1, -1, -1, -1, - 198, -1, -1, -1, -1, -1, 176, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 193, -1, 176, -1, 2855, 198, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 236, -1, - -1, -1, 193, -1, -1, -1, -1, 198, -1, -1, - -1, -1, -1, -1, 2882, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 236, -1, -1, -1, - 221, 222, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 236, -1, -1, -1, -1, - 1892, -1, -1, 291, -1, -1, -1, -1, 1900, 1901, - -1, 1903, 1904, 1905, 1906, 1907, 1908, -1, -1, 1911, - 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, - -1, 291, -1, 274, -1, -1, 277, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 291, -1, -1, 294, 2972, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, - -1, 11, -1, -1, -1, 15, 16, 17, 18, 19, - 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, - -1, 3019, -1, 391, -1, -1, 46, -1, -1, -1, - -1, -1, -1, 53, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 391, 2024, -1, 3052, 2027, -1, -1, -1, -1, - 80, -1, -1, -1, -1, 3063, 3064, -1, -1, 3067, - 391, 3069, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 3094, -1, -1, -1, - -1, 2073, -1, -1, -1, 2077, 2078, 2079, 2080, 2081, - 2082, 2083, 2084, -1, -1, -1, -1, -1, 2090, 2091, - 3118, 2093, 2094, -1, -1, -1, -1, -1, -1, -1, - 498, -1, -1, 2105, -1, -1, 2108, 505, 506, 507, - 508, 509, 510, -1, 2116, 2117, 2118, 2119, 2120, 2121, - 2122, 2123, 2124, 2125, -1, -1, 176, -1, 498, -1, - -1, -1, -1, -1, -1, 505, 506, 507, 508, 509, - 510, -1, -1, 193, -1, -1, -1, 498, 198, 2151, - 501, 502, 503, -1, 505, 506, 507, 508, 509, 510, - -1, 3189, -1, -1, 515, -1, -1, -1, -1, -1, - -1, 221, 222, -1, -1, -1, -1, -1, -1, 3207, - -1, -1, -1, 3211, -1, -1, 236, 3215, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 3226, -1, - -1, -1, 2204, 3231, -1, 3233, -1, -1, -1, -1, - -1, -1, -1, 3241, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 274, -1, -1, 277, -1, -1, - -1, 3259, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 291, -1, -1, 294, -1, -1, -1, 8, -1, - -1, 11, -1, -1, -1, 15, 16, 17, 18, 19, - 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 2273, -1, -1, -1, -1, 36, -1, -1, -1, - 3308, 2283, 2284, -1, -1, -1, 46, -1, -1, -1, - 3318, -1, -1, 53, -1, -1, -1, -1, -1, -1, - -1, -1, 3330, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 3362, -1, -1, -1, -1, -1, - -1, 391, -1, -1, -1, -1, 2348, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 2372, 2373, 2374, -1, -1, 2377, 2378, 2379, 2380, 2381, - 2382, -1, -1, -1, 2386, 2387, 2388, 2389, 2390, 2391, - 2392, 2393, 2394, 2395, -1, -1, -1, -1, 2400, 2401, - -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, - 16, 17, 18, 19, 20, 21, 176, -1, -1, -1, - -1, -1, 3450, 3451, 3452, -1, 2428, -1, -1, -1, - 36, -1, 2434, 193, -1, -1, -1, -1, 198, -1, - 46, -1, -1, -1, -1, -1, -1, 53, 498, 3477, - -1, 501, 502, 503, -1, 505, 506, 507, 508, 509, - 510, 221, 222, -1, -1, 515, 2468, -1, -1, -1, - -1, -1, -1, -1, 80, -1, 236, -1, -1, -1, - -1, -1, -1, -1, -1, 2487, -1, -1, 2490, 2491, - 3518, -1, -1, -1, -1, -1, 2498, 2499, -1, -1, + 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, + -1, -1, -1, -1, 1698, 46, -1, -1, -1, -1, + -1, -1, 53, -1, -1, -1, 394, -1, 337, 338, + 1714, -1, -1, -1, -1, 1719, 2733, 2734, -1, -1, + -1, 337, 338, -1, -1, -1, -1, -1, -1, 80, + -1, -1, 1736, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 378, + 379, 2768, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 8, 378, 379, 11, 2782, -1, -1, 15, 16, + 2787, 2788, 19, 20, 21, 2792, -1, -1, -1, -1, + 2797, -1, -1, 2800, 2801, -1, -1, -1, 2805, 2806, + -1, -1, 2809, -1, -1, -1, -1, -1, -1, 46, + -1, -1, -1, 2820, -1, -1, 53, -1, -1, -1, + -1, -1, -1, 501, -1, -1, 504, 505, 506, -1, + 508, 509, 510, 511, 512, 513, 177, -1, -1, -1, + 518, -1, -1, 80, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 194, 473, 474, -1, 2864, 199, -1, + -1, -1, -1, -1, -1, -1, -1, 473, 474, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 497, 498, + -1, 222, 223, -1, 2891, -1, -1, -1, -1, -1, + -1, 497, 498, -1, -1, -1, 237, -1, -1, -1, + -1, -1, 1896, -1, -1, -1, -1, -1, -1, -1, + 1904, 1905, -1, 1907, 1908, 1909, 1910, 1911, 1912, -1, + -1, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, + 1924, 1925, -1, -1, 275, -1, -1, 278, -1, -1, + 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 292, -1, -1, 295, -1, -1, 194, -1, -1, + -1, -1, 199, -1, -1, -1, -1, 8, -1, -1, + 11, -1, -1, 2980, 15, 16, 17, 18, 19, 20, + 21, -1, -1, -1, -1, 222, 223, -1, -1, -1, + -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, + 237, -1, -1, -1, -1, 46, -1, -1, -1, -1, + -1, -1, 53, -1, -1, -1, -1, -1, -1, -1, + -1, 3028, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 2028, -1, -1, 2031, 275, 80, + -1, 278, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 394, 3061, 292, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 3072, 3073, -1, -1, 3076, + -1, 3078, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 2077, -1, -1, -1, 2081, 2082, 2083, + 2084, 2085, 2086, 2087, 2088, -1, 3103, -1, -1, -1, + 2094, 2095, -1, 2097, 2098, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 2109, -1, -1, 2112, -1, + 3127, -1, -1, -1, -1, -1, 2120, 2121, 2122, 2123, + 2124, 2125, 2126, 2127, 2128, 2129, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 2512, 2513, 2514, 2515, 274, 2517, -1, 277, -1, 2521, + -1, -1, -1, 194, -1, -1, -1, 394, 199, -1, + 501, 2155, -1, 504, 505, 506, -1, 508, 509, 510, + 511, 512, 513, -1, -1, -1, -1, 518, -1, -1, + -1, 222, 223, -1, -1, -1, -1, -1, -1, -1, + 3197, -1, -1, -1, -1, -1, 237, -1, -1, -1, + -1, -1, -1, -1, -1, 24, -1, -1, -1, 3216, + -1, -1, -1, 3220, -1, -1, -1, 3224, 2212, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 3235, -1, + -1, -1, -1, 3240, 275, 3242, -1, 278, -1, -1, + -1, -1, -1, 3250, -1, -1, -1, -1, -1, -1, + -1, 292, -1, -1, 295, -1, -1, -1, -1, -1, + -1, 3268, 81, -1, 501, -1, -1, 504, 505, 506, + -1, 508, 509, 510, 511, 512, 513, -1, 97, -1, + -1, -1, -1, -1, -1, -1, -1, 2281, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 2291, 2292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 291, -1, -1, 294, -1, -1, -1, -1, -1, + 3317, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 3327, -1, -1, -1, -1, -1, -1, 146, -1, -1, + -1, -1, 3339, -1, -1, -1, -1, 156, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 169, -1, -1, 394, -1, 174, -1, -1, -1, -1, + -1, -1, 2356, -1, 3371, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 203, -1, 2380, 2381, 2382, -1, + -1, 2385, 2386, 2387, 2388, 2389, 2390, -1, -1, -1, + 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, + 8, -1, -1, 11, 2408, 2409, -1, 15, 16, 17, + 18, 19, 20, 21, -1, -1, -1, 246, -1, -1, + -1, 250, -1, -1, -1, -1, -1, -1, 36, -1, + -1, -1, 2436, -1, -1, -1, -1, 2441, 46, -1, + -1, -1, 3459, 3460, 3461, 53, -1, -1, -1, -1, + 501, -1, -1, 504, 505, 506, -1, 508, 509, 510, + 511, 512, 513, -1, -1, -1, -1, 518, -1, 3486, + -1, 2475, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 176, -1, -1, 2575, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 193, -1, -1, - -1, 8, 198, -1, 11, -1, -1, -1, 15, 16, - 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 221, 222, -1, -1, 36, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, - 236, 391, -1, -1, -1, -1, 53, -1, -1, -1, - -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, - 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, - -1, -1, -1, 80, -1, -1, -1, -1, 274, 36, - -1, 277, -1, -1, -1, -1, -1, -1, -1, 46, - 2682, -1, -1, -1, -1, 291, 53, 26, 294, -1, - -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, - -1, 40, 2704, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 80, -1, -1, -1, -1, -1, -1, - -1, 60, -1, 8, -1, -1, 11, -1, -1, -1, - 15, 16, 17, 18, 19, 20, 21, -1, 498, -1, - -1, 501, 502, 503, -1, 505, 506, 507, 508, 509, - 510, 36, -1, -1, -1, 515, -1, -1, 2760, 176, - 2762, 46, -1, -1, -1, -1, 2768, 106, 53, -1, - -1, -1, -1, -1, -1, 2777, 193, -1, 2780, -1, - 2782, 198, -1, -1, 2786, 391, -1, 2789, 2790, -1, - -1, 2793, 2794, -1, -1, 80, -1, -1, 137, 2801, - -1, -1, -1, -1, 221, 222, -1, -1, 2810, 176, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 236, - -1, -1, -1, 2825, -1, -1, 193, -1, -1, -1, - -1, 198, -1, -1, -1, -1, -1, -1, -1, -1, + 2494, 320, -1, 2497, 2498, -1, -1, -1, -1, -1, + -1, 2505, 2506, -1, -1, -1, 335, -1, -1, -1, + 3527, -1, -1, -1, -1, 2519, 2520, 2521, 2522, -1, + 2524, -1, -1, -1, 2528, -1, 8, -1, -1, 11, + -1, -1, -1, 15, 16, 17, 18, 19, 20, 21, + -1, 370, -1, -1, 373, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 36, 384, -1, -1, 387, -1, + -1, -1, -1, -1, 46, -1, -1, -1, -1, 177, + -1, 53, -1, -1, -1, -1, 405, -1, -1, -1, + 2584, -1, -1, -1, -1, -1, 194, -1, -1, -1, + 419, 199, -1, 8, -1, -1, 11, 426, 80, -1, + 15, 16, 17, 18, 19, 20, 21, 436, -1, -1, + -1, -1, -1, 442, 222, 223, -1, -1, -1, -1, + -1, 36, -1, -1, -1, -1, -1, -1, -1, 237, + -1, 46, -1, -1, -1, -1, -1, -1, 53, -1, + 469, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 221, 222, -1, 274, -1, -1, - 277, 2863, 201, -1, -1, -1, -1, -1, -1, 236, - -1, -1, -1, -1, 291, -1, -1, 294, -1, -1, + -1, -1, -1, -1, -1, 80, -1, 275, -1, -1, + 278, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 292, 2689, -1, 295, -1, -1, + -1, -1, -1, -1, -1, 177, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 2713, + -1, -1, 194, -1, -1, -1, -1, 199, -1, -1, + -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, + -1, -1, 15, 16, 17, 18, 19, 20, 21, -1, + 222, 223, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 36, -1, 237, -1, -1, 41, -1, + -1, -1, 177, 46, -1, 2769, -1, 2771, -1, -1, + 53, -1, -1, 2777, -1, -1, -1, -1, -1, 194, + -1, -1, 2786, -1, 199, 2789, 394, 2791, -1, -1, + -1, 2795, -1, 275, 2798, 2799, 278, 80, 2802, 2803, + -1, -1, -1, -1, -1, -1, 2810, 222, 223, -1, + 292, -1, -1, 295, -1, 2819, -1, -1, -1, -1, + -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, + 2834, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 126, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 24, -1, -1, -1, + 275, -1, -1, 278, -1, -1, -1, -1, 2872, -1, + -1, -1, -1, -1, -1, -1, -1, 292, -1, -1, + 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 501, 177, -1, 504, 505, 506, -1, + 508, 509, 510, 511, 512, 513, -1, -1, -1, -1, + 518, 194, 394, 81, -1, -1, 199, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 222, + 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 176, 498, -1, -1, 501, 502, 503, -1, 505, - 506, 507, 508, 509, 510, -1, -1, 274, 193, 515, - 277, 250, -1, 198, -1, -1, -1, -1, -1, -1, - -1, 260, -1, -1, 291, -1, -1, 294, -1, -1, - -1, -1, -1, 272, -1, -1, 221, 222, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 146, 394, + -1, -1, -1, -1, -1, -1, -1, -1, 156, -1, + -1, -1, 275, -1, -1, 278, -1, -1, -1, -1, + -1, 169, -1, -1, -1, -1, 174, 3011, 3012, 292, + -1, -1, 295, -1, -1, -1, -1, -1, -1, 501, + -1, -1, 504, 505, 506, -1, 508, 509, 510, 511, + 512, 513, 3036, 3037, -1, 203, 518, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 236, -1, -1, 293, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 304, -1, -1, -1, -1, - -1, -1, -1, -1, 391, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 274, - 68, 69, 277, -1, -1, -1, -1, -1, -1, -1, - 3002, 3003, -1, -1, -1, -1, 291, -1, -1, 294, - -1, 350, -1, -1, -1, 354, -1, 356, -1, -1, - -1, -1, -1, -1, 391, 3027, 3028, -1, -1, -1, - -1, 109, 110, -1, -1, 113, 114, -1, -1, -1, - -1, -1, 381, -1, -1, -1, -1, 386, -1, 3051, - -1, -1, -1, 3055, -1, 3057, 3058, 3059, -1, -1, - 3062, 400, -1, 3065, 3066, -1, -1, -1, -1, -1, - -1, -1, 3074, -1, -1, -1, -1, -1, -1, -1, - -1, 498, -1, -1, 501, 502, 503, -1, 505, 506, - 507, 508, 509, 510, -1, -1, -1, -1, 515, -1, - -1, -1, -1, -1, -1, -1, 391, -1, -1, -1, - 188, 189, -1, 3115, -1, -1, -1, -1, 457, 3121, + -1, -1, -1, -1, -1, -1, 3060, -1, -1, -1, + 3064, -1, 3066, 3067, 3068, -1, -1, 3071, -1, -1, + 3074, 3075, -1, -1, -1, -1, -1, -1, 246, 3083, + -1, -1, 250, -1, -1, -1, 501, -1, -1, 504, + 505, 506, -1, 508, 509, 510, 511, 512, 513, -1, + -1, -1, -1, 518, -1, -1, -1, -1, -1, -1, + -1, 394, -1, -1, -1, -1, -1, -1, -1, -1, + 3124, -1, -1, -1, -1, -1, 3130, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 3143, + -1, -1, -1, -1, -1, -1, 314, -1, -1, -1, + -1, -1, 320, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 335, -1, -1, + -1, -1, 3176, -1, 457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 498, 3134, -1, 501, 502, 503, -1, 505, 506, - 507, 508, 509, 510, -1, -1, -1, -1, 515, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 3168, -1, -1, -1, - -1, -1, -1, -1, 252, 253, 254, 255, 256, 257, - 258, 259, -1, -1, 262, 263, -1, -1, -1, -1, - -1, -1, -1, 3195, -1, -1, -1, -1, -1, -1, + 3204, -1, 370, -1, -1, 373, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 384, -1, 501, 387, + -1, 504, 505, 506, -1, 508, 509, 510, 511, 512, + 513, -1, -1, 3237, 3238, 3239, -1, 405, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 498, -1, -1, 501, 502, 503, -1, - 505, 506, 507, 508, 509, 510, 3228, 3229, 3230, -1, - 515, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 3248, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 3260, -1, + -1, 419, -1, 3257, -1, -1, -1, 425, 426, -1, + -1, -1, -1, -1, -1, 3269, -1, -1, 436, -1, + -1, -1, -1, -1, 442, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 469, -1, -1, -1, -1, -1, -1, -1, -1, + 3314, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 3332, -1, + -1, -1, -1, -1, -1, -1, -1, 3341, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 375, 376, -1, - -1, -1, -1, -1, 3306, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 3323, -1, -1, -1, -1, -1, -1, -1, -1, - 3332, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 3366, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 3357, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 3392, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 3383, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 470, 471, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, - 6, 7, 8, 9, 10, -1, 494, 495, -1, -1, - -1, -1, -1, -1, 3426, -1, 22, 23, 24, 25, - 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, - -1, -1, -1, 39, -1, -1, 42, 43, 44, -1, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 3480, 75, - 76, 77, 78, 79, -1, 81, -1, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, - 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, -1, 120, 121, 122, 123, 124, 125, - -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, - 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, - 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, -1, 162, 163, 164, 165, - -1, 167, -1, 169, 170, -1, 172, 173, 174, 175, - 176, 177, -1, 179, -1, 181, 182, 183, 184, -1, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, - -1, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, -1, 218, -1, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, -1, -1, 233, 234, 235, - 236, -1, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - -1, 287, 288, -1, -1, 291, 292, 293, -1, -1, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, -1, -1, - -1, -1, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, -1, 329, 330, 331, 332, 333, 334, -1, - 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, -1, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, -1, -1, 381, 382, 383, 384, 385, - 386, 387, 388, 389, -1, 391, 392, 393, 394, 395, - -1, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, -1, -1, 414, 415, - -1, 417, 418, 419, 420, 421, 422, 423, -1, 425, - 426, 427, -1, -1, 430, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, -1, -1, - 446, 447, 448, -1, 450, 451, 452, 453, -1, 455, - 456, 457, 458, 459, 460, 461, -1, 463, 464, 465, - 466, 467, 468, 469, 470, 471, -1, -1, 474, -1, - -1, 477, 478, 479, 480, 481, 482, 483, 484, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, - 496, 497, 498, -1, -1, -1, -1, -1, -1, 505, - 506, 507, -1, -1, -1, -1, 512, -1, 514, -1, - -1, -1, -1, 519, 520, -1, 522, 523, 524, 3, + -1, -1, -1, -1, 3, 4, 5, 6, 7, 8, + 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 3435, -1, 22, 23, 24, 25, 26, 27, 28, + 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, + 39, -1, -1, 42, 43, 44, -1, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 3489, 75, 76, 77, 78, + 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, + 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, + 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, + -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, -1, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, -1, -1, 234, 235, 236, 237, -1, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, -1, -1, -1, -1, -1, -1, 508, + 509, 510, -1, -1, -1, -1, 515, -1, 517, -1, + -1, -1, -1, 522, 523, -1, 525, 526, 527, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, @@ -12544,96 +11369,149 @@ static const yytype_int16 yycheck[] = 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, 170, -1, 172, 173, - 174, 175, 176, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, -1, -1, 233, - 234, 235, 236, -1, 238, 239, 240, 241, 242, 243, + 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, + 164, 165, 166, -1, 168, -1, 170, 171, -1, 173, + 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, + 184, 185, -1, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, -1, 200, 201, 202, 203, + 204, 205, 206, -1, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, -1, 219, -1, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, -1, -1, + 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, 299, 300, 301, 302, 303, + 284, 285, 286, -1, 288, 289, -1, -1, 292, 293, + 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, 361, 362, 363, + 314, -1, -1, -1, -1, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, -1, 330, 331, 332, 333, + 334, 335, -1, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, 391, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, 418, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, + 374, 375, 376, 377, 378, 379, 380, 381, -1, -1, + 384, 385, 386, 387, 388, 389, 390, 391, 392, -1, + 394, 395, 396, 397, 398, -1, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, -1, -1, 417, 418, -1, 420, 421, 422, 423, + 424, 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - 464, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, + 444, 445, 446, -1, -1, 449, 450, 451, -1, 453, + 454, 455, 456, -1, 458, 459, 460, 461, 462, 463, + 464, -1, 466, 467, 468, 469, 470, 471, 472, 473, + 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, -1, -1, -1, -1, -1, - -1, 505, 506, 507, -1, -1, -1, -1, 512, -1, - 514, -1, -1, -1, -1, 519, 520, -1, 522, 523, - 524, 3, 4, 5, 6, 7, 8, 9, 10, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, - 32, 33, -1, -1, -1, -1, -1, 39, -1, -1, - 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, -1, 75, 76, 77, 78, 79, -1, 81, - -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, -1, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, - 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, -1, - 162, 163, 164, 165, -1, 167, -1, 169, 170, 171, - 172, 173, 174, 175, 176, 177, -1, 179, -1, 181, - 182, 183, 184, -1, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, - 202, 203, 204, 205, -1, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, -1, 218, -1, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, - -1, 233, 234, 235, 236, -1, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, -1, 287, 288, -1, -1, 291, - 292, 293, -1, -1, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, -1, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, -1, 329, 330, 331, - 332, 333, 334, -1, 336, 337, 338, 339, 340, 341, - 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, -1, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, -1, 381, - 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, -1, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, -1, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, -1, 425, 426, 427, -1, -1, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, -1, -1, 446, 447, 448, 449, 450, 451, - 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, - -1, 463, 464, 465, 466, 467, 468, 469, 470, 471, - -1, -1, 474, -1, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 498, -1, 500, -1, - -1, -1, -1, 505, 506, 507, -1, -1, -1, -1, - 512, -1, 514, 515, -1, -1, -1, 519, 520, -1, - 522, 523, 3, 4, 5, 6, 7, 8, 9, 10, + 494, 495, 496, 497, 498, 499, 500, 501, -1, -1, + -1, -1, -1, -1, 508, 509, 510, -1, -1, -1, + -1, 515, -1, 517, -1, -1, -1, -1, 522, 523, + -1, 525, 526, 527, 3, 4, 5, 6, 7, 8, + 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, + 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, + 39, -1, -1, 42, 43, 44, -1, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, + 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, + 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + -1, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, + -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, 172, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, -1, -1, 234, 235, 236, 237, -1, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, -1, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, 452, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, -1, 503, -1, -1, -1, -1, 508, + 509, 510, -1, -1, -1, -1, 515, -1, 517, 518, + -1, -1, -1, 522, 523, -1, 525, 526, 3, 4, + 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, + -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, + -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, -1, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, -1, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, 171, 172, 173, 174, + 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, -1, -1, 234, + 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, -1, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, 452, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, 467, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 501, -1, 503, -1, + -1, -1, -1, 508, 509, 510, -1, -1, -1, -1, + 515, -1, 517, -1, -1, -1, -1, 522, 523, -1, + 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, 39, -1, @@ -12645,104 +11523,157 @@ static const yytype_int16 yycheck[] = 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, -1, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - -1, 162, 163, 164, 165, -1, 167, -1, 169, 170, - 171, 172, 173, 174, 175, 176, 177, -1, 179, -1, - 181, 182, 183, 184, -1, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, - 201, 202, 203, 204, 205, -1, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, -1, 218, -1, 220, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + 171, 172, 173, 174, 175, 176, 177, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - -1, -1, 233, 234, 235, 236, -1, 238, 239, 240, + 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, -1, 287, 288, -1, -1, - 291, 292, 293, -1, -1, 296, 297, 298, 299, 300, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, -1, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, -1, 329, 330, - 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, - 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, -1, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 377, 378, 379, -1, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, -1, 397, 398, 399, 400, + 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, - 421, 422, 423, -1, 425, 426, 427, -1, -1, 430, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, -1, -1, 446, 447, 448, 449, 450, - 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, - 461, -1, 463, 464, 465, 466, 467, 468, 469, 470, - 471, -1, -1, 474, -1, 476, 477, 478, 479, 480, + 411, 412, 413, 414, -1, -1, 417, 418, 419, 420, + 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, 452, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, 467, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, -1, 500, - -1, -1, -1, -1, 505, 506, 507, -1, -1, -1, - -1, 512, -1, 514, -1, -1, -1, -1, 519, 520, - -1, 522, 523, 3, 4, 5, 6, 7, 8, 9, - 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, - -1, 31, 32, 33, -1, -1, -1, -1, -1, 39, - -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, - -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, - -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, -1, - 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, - 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, - 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, -1, 162, 163, 164, 165, -1, 167, -1, 169, - 170, 171, 172, 173, 174, 175, 176, 177, -1, 179, - -1, 181, 182, 183, 184, -1, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, - 200, 201, 202, 203, 204, 205, -1, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, -1, 218, -1, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, -1, -1, 233, 234, 235, 236, -1, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, -1, 287, 288, -1, - -1, 291, 292, 293, -1, -1, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, -1, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 327, -1, 329, - 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, - 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, -1, 359, - 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, - -1, 391, 392, 393, 394, 395, -1, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, -1, -1, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, -1, 425, 426, 427, -1, -1, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, -1, -1, 446, 447, 448, 449, - 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, - 460, 461, -1, 463, 464, 465, 466, 467, 468, 469, - 470, 471, -1, -1, 474, -1, 476, 477, 478, 479, - 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, -1, - 500, -1, -1, -1, -1, 505, 506, 507, -1, -1, - -1, -1, 512, -1, 514, -1, -1, -1, -1, 519, - 520, -1, 522, 523, 3, 4, 5, 6, 7, 8, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, -1, 503, -1, -1, -1, -1, 508, 509, 510, + -1, -1, -1, -1, 515, -1, 517, -1, -1, -1, + -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, + 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, + 37, -1, 39, -1, -1, 42, 43, 44, -1, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, 171, -1, 173, 174, 175, 176, + 177, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, -1, -1, 234, 235, 236, + 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, 394, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, 421, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, 465, 466, + 467, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, -1, -1, -1, -1, -1, + -1, 508, 509, 510, -1, -1, -1, -1, 515, -1, + 517, 518, -1, -1, -1, 522, 523, -1, 525, 526, + 3, 4, 5, 6, 7, -1, 9, 10, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, -1, -1, 39, -1, -1, 42, + 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, -1, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, 171, 172, + 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, -1, + -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, -1, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, -1, 417, 418, 419, 420, 421, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, 452, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, 467, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, -1, -1, + 503, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 515, -1, 517, -1, -1, -1, -1, 522, + 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, + 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, -1, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, @@ -12750,202 +11681,46 @@ static const yytype_int16 yycheck[] = 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, 132, -1, 134, 135, 136, 137, 138, + 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, -1, 172, 173, 174, 175, 176, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233, 234, 235, 236, -1, 238, + 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, 172, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, -1, 233, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, + 279, 280, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - -1, -1, -1, -1, -1, -1, 505, 506, 507, -1, - -1, -1, -1, 512, -1, 514, 515, -1, -1, -1, - 519, 520, -1, 522, 523, 3, 4, 5, 6, 7, - -1, 9, 10, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, - -1, 39, -1, -1, 42, 43, 44, -1, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, - 78, 79, -1, 81, -1, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, - 118, -1, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, - 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, -1, 162, 163, 164, 165, -1, 167, - -1, 169, 170, 171, 172, 173, 174, 175, 176, 177, - -1, 179, -1, 181, 182, 183, 184, -1, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - -1, 199, 200, 201, 202, 203, 204, 205, -1, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, -1, - 218, -1, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, -1, -1, 233, 234, 235, 236, -1, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, -1, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, 291, 292, 293, -1, -1, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, -1, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - -1, 329, 330, 331, 332, 333, 334, -1, 336, 337, - 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - -1, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, -1, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, - 418, 419, 420, 421, 422, 423, -1, 425, 426, 427, - -1, -1, 430, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, 447, - 448, 449, 450, 451, 452, 453, -1, 455, 456, 457, - 458, 459, 460, 461, -1, 463, 464, 465, 466, 467, - 468, 469, 470, 471, -1, -1, 474, -1, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - -1, -1, 500, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 512, -1, 514, -1, -1, -1, - -1, 519, 520, -1, 522, 523, 3, 4, 5, 6, - 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, - 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, - -1, -1, 39, -1, -1, 42, 43, 44, -1, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, - 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, - 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, -1, 120, 121, 122, 123, 124, 125, -1, - -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, - 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, - -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, -1, 162, 163, 164, 165, -1, - 167, -1, 169, 170, 171, 172, 173, 174, 175, 176, - 177, -1, 179, -1, 181, 182, 183, 184, -1, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, -1, 199, 200, 201, 202, 203, 204, 205, -1, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - -1, 218, -1, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, -1, 232, 233, 234, 235, 236, - -1, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, - 287, 288, -1, -1, 291, 292, 293, -1, -1, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, -1, -1, -1, - -1, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, -1, 329, 330, 331, 332, 333, 334, -1, 336, - 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, -1, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, -1, -1, 381, 382, 383, 384, 385, 386, - 387, 388, 389, -1, 391, 392, 393, 394, 395, -1, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, -1, -1, 414, 415, -1, - 417, 418, 419, 420, 421, 422, 423, -1, 425, 426, - 427, -1, 429, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, -1, -1, 446, - 447, 448, -1, 450, 451, 452, 453, -1, 455, 456, - 457, 458, 459, 460, 461, -1, 463, 464, 465, 466, - 467, 468, 469, 470, 471, -1, -1, 474, -1, -1, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, -1, -1, -1, -1, -1, -1, 505, 506, - 507, -1, -1, -1, -1, 512, -1, 514, -1, -1, - -1, -1, 519, 520, -1, 522, 523, 3, 4, 5, - 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, - 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, - -1, 37, -1, 39, -1, -1, 42, 43, 44, -1, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, -1, 75, - 76, 77, 78, 79, -1, 81, -1, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, - 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, -1, 120, 121, 122, 123, 124, 125, - -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, - 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, - 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, -1, 162, 163, 164, 165, - -1, 167, -1, 169, 170, -1, 172, 173, 174, 175, - 176, 177, -1, 179, -1, 181, 182, 183, 184, -1, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, - -1, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, -1, 218, -1, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, -1, -1, 233, 234, 235, - 236, -1, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - -1, 287, 288, -1, -1, 291, 292, 293, -1, -1, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, -1, -1, - -1, -1, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, -1, 329, 330, 331, 332, 333, 334, -1, - 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, -1, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, -1, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, -1, 391, 392, 393, 394, 395, - -1, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, -1, -1, 414, 415, - -1, 417, 418, 419, 420, 421, 422, 423, -1, 425, - 426, 427, -1, -1, 430, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, -1, -1, - 446, 447, 448, -1, 450, 451, 452, 453, -1, 455, - 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, - 466, 467, 468, 469, 470, 471, -1, -1, 474, -1, - -1, 477, 478, 479, 480, 481, 482, 483, 484, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, - 496, 497, 498, -1, -1, -1, -1, -1, -1, 505, - 506, 507, -1, -1, -1, -1, 512, -1, 514, -1, - -1, -1, -1, 519, 520, -1, 522, 523, 3, 4, + 499, 500, 501, -1, -1, -1, -1, -1, -1, 508, + 509, 510, -1, -1, -1, -1, 515, -1, 517, -1, + -1, -1, -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, @@ -12961,95 +11736,148 @@ static const yytype_int16 yycheck[] = 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, -1, 162, 163, 164, - 165, -1, 167, -1, 169, 170, -1, 172, 173, 174, - 175, 176, 177, -1, 179, -1, 181, 182, 183, 184, - -1, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, -1, 199, 200, 201, 202, 203, 204, - 205, -1, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, -1, 218, -1, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, -1, -1, 233, 234, - 235, 236, -1, 238, 239, 240, 241, 242, 243, 244, + 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, 171, -1, 173, 174, + 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, -1, -1, 234, + 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, -1, 287, 288, -1, -1, 291, 292, 293, -1, - -1, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, -1, - -1, -1, -1, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, -1, 329, 330, 331, 332, 333, 334, - -1, 336, 337, 338, 339, 340, 341, 342, 343, -1, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, -1, 359, 360, 361, 362, 363, 364, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, -1, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, -1, 391, 392, 393, 394, - 395, -1, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, -1, -1, 414, - 415, -1, 417, 418, 419, 420, 421, 422, 423, -1, - 425, 426, 427, -1, -1, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, -1, - -1, 446, 447, 448, -1, 450, 451, 452, 453, -1, - 455, 456, 457, 458, 459, 460, 461, -1, 463, 464, - 465, 466, 467, 468, 469, 470, 471, -1, -1, 474, - -1, -1, 477, 478, 479, 480, 481, 482, 483, 484, + 375, 376, 377, 378, 379, 380, 381, -1, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, 394, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, 421, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, -1, -1, -1, -1, -1, -1, - 505, 506, 507, -1, -1, -1, -1, 512, -1, 514, - 515, -1, -1, -1, 519, 520, -1, 522, 523, 3, - 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - -1, -1, -1, -1, 38, 39, -1, -1, 42, 43, - 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, 170, -1, 172, 173, - 174, 175, 176, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, -1, -1, 233, - 234, 235, 236, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, 418, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - 464, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, -1, -1, -1, -1, -1, - -1, 505, 506, 507, -1, -1, -1, -1, 512, -1, - 514, -1, -1, -1, -1, 519, 520, -1, 522, 523, + 495, 496, 497, 498, 499, 500, 501, -1, -1, -1, + -1, -1, -1, 508, 509, 510, -1, -1, -1, -1, + 515, -1, 517, -1, -1, -1, -1, 522, 523, -1, + 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, 37, -1, 39, -1, + -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, 394, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, 467, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, -1, -1, -1, -1, -1, -1, 508, 509, 510, + -1, -1, -1, -1, 515, -1, 517, 518, -1, -1, + -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, + 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, + -1, 38, 39, -1, -1, 42, 43, 44, -1, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, 171, -1, 173, 174, 175, 176, + 177, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, -1, -1, 234, 235, 236, + 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, 421, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + 467, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, -1, -1, -1, -1, -1, + -1, 508, 509, 510, -1, -1, -1, -1, 515, -1, + 517, -1, -1, -1, -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, @@ -13065,96 +11893,149 @@ static const yytype_int16 yycheck[] = 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, -1, 162, - 163, 164, 165, -1, 167, -1, 169, 170, -1, 172, - 173, 174, 175, 176, 177, -1, 179, -1, 181, 182, - 183, 184, -1, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, - 203, 204, 205, -1, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, -1, 218, -1, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, -1, -1, - 233, 234, 235, 236, -1, 238, 239, 240, 241, 242, + 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, 171, -1, + 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, -1, + -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, -1, 287, 288, -1, -1, 291, 292, - 293, -1, -1, 296, 297, 298, 299, 300, 301, 302, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, -1, -1, -1, -1, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, -1, 329, 330, 331, 332, - 333, 334, -1, 336, 337, 338, 339, 340, 341, 342, - 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, -1, 359, 360, 361, 362, + 313, 314, -1, -1, -1, -1, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 377, 378, -1, 380, 381, 382, - 383, 384, 385, 386, 387, 388, 389, -1, 391, 392, - 393, 394, 395, -1, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, - -1, 414, 415, -1, 417, 418, 419, 420, 421, 422, - 423, -1, 425, 426, 427, -1, -1, 430, 431, 432, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, 421, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, -1, -1, 446, 447, 448, -1, 450, 451, 452, - 453, -1, 455, 456, 457, 458, 459, 460, 461, -1, - 463, 464, 465, 466, 467, 468, 469, 470, 471, -1, - -1, 474, -1, -1, 477, 478, 479, 480, 481, 482, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, 467, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 494, 495, 496, 497, 498, -1, -1, -1, -1, - -1, -1, 505, 506, 507, -1, -1, -1, -1, 512, - -1, 514, 515, -1, -1, -1, 519, 520, -1, 522, - 523, 3, 4, 5, 6, 7, 8, 9, 10, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, - 32, 33, -1, -1, -1, 37, -1, 39, -1, -1, - 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, -1, 75, 76, 77, 78, 79, -1, 81, - -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, -1, 120, 121, - 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, - -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, - 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, -1, - 162, 163, 164, 165, -1, 167, -1, 169, 170, -1, - 172, 173, 174, 175, 176, 177, -1, 179, -1, 181, - 182, 183, 184, -1, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, - 202, 203, 204, 205, -1, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, -1, 218, -1, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, - -1, 233, 234, 235, 236, -1, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, -1, 287, 288, -1, -1, 291, - 292, 293, -1, -1, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, -1, -1, -1, -1, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, -1, 329, 330, 331, - 332, 333, 334, -1, 336, 337, 338, 339, 340, 341, - 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, -1, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, -1, 380, 381, - 382, 383, 384, 385, 386, 387, 388, 389, -1, 391, - 392, 393, 394, 395, -1, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - -1, -1, 414, 415, -1, 417, 418, 419, 420, 421, - 422, 423, -1, 425, 426, 427, -1, -1, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, -1, -1, 446, 447, 448, -1, 450, 451, - 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, - -1, 463, 464, 465, 466, 467, 468, 469, 470, 471, - -1, -1, 474, -1, -1, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 498, -1, -1, -1, - -1, -1, -1, 505, 506, 507, -1, -1, -1, -1, - 512, -1, 514, -1, -1, -1, -1, 519, 520, -1, - 522, 523, 3, 4, 5, 6, 7, 8, 9, 10, + 493, 494, 495, 496, 497, 498, 499, 500, 501, -1, + -1, -1, -1, -1, -1, 508, 509, 510, -1, -1, + -1, -1, 515, -1, 517, 518, -1, -1, -1, 522, + 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, + 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, + 29, -1, 31, 32, 33, -1, -1, -1, 37, -1, + 39, -1, -1, 42, 43, 44, -1, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, + 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, + 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, + 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, + -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, -1, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, -1, -1, 234, 235, 236, 237, -1, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, -1, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, -1, -1, -1, -1, -1, -1, 508, + 509, 510, -1, -1, -1, -1, 515, -1, 517, -1, + -1, -1, -1, 522, 523, -1, 525, 526, 3, 4, + 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, + -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, + -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, -1, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, 171, -1, 173, 174, + 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, -1, -1, 234, + 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, 394, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, 421, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, 467, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 501, -1, -1, -1, + -1, -1, -1, 508, 509, 510, -1, -1, -1, -1, + 515, -1, 517, -1, -1, -1, -1, 522, 523, -1, + 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, -1, -1, 39, -1, @@ -13170,199 +12051,43 @@ static const yytype_int16 yycheck[] = 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - -1, 162, 163, 164, 165, -1, 167, -1, 169, 170, - -1, 172, 173, 174, 175, 176, 177, -1, 179, -1, - 181, 182, 183, 184, -1, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, - 201, 202, 203, 204, 205, -1, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, -1, 218, -1, 220, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - -1, -1, 233, 234, 235, 236, -1, 238, 239, 240, + 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, -1, 287, 288, -1, -1, - 291, 292, 293, -1, -1, 296, 297, 298, 299, 300, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, -1, -1, -1, -1, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, -1, 329, 330, - 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, - 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, -1, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 377, 378, -1, -1, - 381, 382, 383, 384, 385, 386, 387, 388, 389, -1, - 391, 392, 393, 394, 395, -1, 397, 398, 399, 400, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, -1, -1, 414, 415, -1, 417, 418, 419, 420, - 421, 422, 423, -1, 425, 426, 427, -1, -1, 430, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, -1, -1, 446, 447, 448, -1, 450, - 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, - 461, -1, 463, 464, 465, 466, 467, 468, 469, 470, - 471, -1, -1, 474, -1, -1, 477, 478, 479, 480, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, 467, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, -1, -1, - -1, -1, -1, -1, 505, 506, 507, -1, -1, -1, - -1, 512, -1, 514, -1, -1, -1, -1, 519, 520, - -1, 522, 523, 3, 4, 5, 6, 7, 8, 9, - 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, -1, -1, -1, -1, -1, 39, - -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, - -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, - -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, -1, - 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, - 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, - 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, -1, 162, 163, 164, 165, -1, 167, -1, 169, - 170, -1, 172, 173, 174, 175, 176, 177, -1, 179, - -1, 181, 182, 183, 184, -1, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, - 200, 201, 202, 203, 204, 205, -1, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, -1, 218, -1, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, -1, -1, 233, 234, 235, 236, -1, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, -1, 287, 288, -1, - -1, 291, 292, 293, -1, -1, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, -1, -1, -1, -1, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 327, -1, 329, - 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, - 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, -1, 359, - 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, -1, - -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, - -1, 391, 392, 393, 394, 395, -1, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, -1, -1, 414, 415, -1, 417, 418, 419, - 420, 421, 422, 423, -1, 425, 426, 427, -1, -1, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, -1, -1, 446, 447, 448, -1, - 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, - 460, 461, -1, 463, 464, 465, 466, 467, 468, 469, - 470, 471, -1, -1, 474, -1, -1, 477, 478, 479, - 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, -1, - -1, -1, -1, -1, -1, 505, 506, 507, -1, -1, - -1, -1, 512, -1, 514, -1, -1, -1, -1, 519, - 520, -1, 522, 523, 3, 4, 5, 6, 7, 8, - 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - 39, -1, -1, 42, 43, 44, -1, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, 171, 172, 173, 174, 175, 176, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233, 234, 235, 236, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - -1, -1, -1, -1, -1, -1, 505, 506, 507, -1, - -1, -1, -1, 512, -1, 514, -1, -1, -1, -1, - 519, 520, -1, 522, 523, 3, 4, 5, 6, 7, - 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, - -1, 39, -1, -1, 42, 43, 44, -1, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, - 78, 79, -1, 81, -1, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, - 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, - 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, -1, 162, 163, 164, 165, -1, 167, - -1, 169, 170, -1, 172, 173, 174, 175, 176, 177, - -1, 179, -1, 181, 182, 183, 184, -1, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - -1, 199, 200, 201, 202, 203, 204, 205, -1, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, -1, - 218, -1, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, -1, -1, 233, 234, 235, 236, -1, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, 291, 292, 293, -1, -1, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, -1, -1, -1, -1, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - -1, 329, 330, 331, 332, 333, 334, -1, 336, 337, - 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - -1, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, -1, -1, 381, 382, 383, 384, 385, 386, 387, - 388, 389, -1, 391, 392, 393, 394, 395, -1, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, -1, -1, 414, 415, -1, 417, - 418, 419, 420, 421, 422, 423, -1, 425, 426, 427, - -1, -1, 430, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, 447, - 448, -1, 450, 451, 452, 453, -1, 455, 456, 457, - 458, 459, 460, 461, -1, 463, 464, 465, 466, 467, - 468, 469, 470, 471, -1, -1, 474, -1, -1, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, -1, -1, -1, -1, -1, -1, 505, 506, 507, - -1, -1, -1, -1, 512, -1, 514, 515, -1, -1, - -1, 519, 520, -1, 522, 523, 3, 4, 5, 6, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, -1, -1, -1, -1, -1, -1, 508, 509, 510, + -1, -1, -1, -1, 515, -1, 517, -1, -1, -1, + -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, @@ -13378,199 +12103,43 @@ static const yytype_int16 yycheck[] = -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, -1, 162, 163, 164, 165, -1, - 167, -1, 169, 170, -1, 172, 173, 174, 175, 176, - 177, -1, 179, -1, 181, 182, 183, 184, -1, 186, + 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, 171, 172, 173, 174, 175, 176, + 177, 178, -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, -1, 199, 200, 201, 202, 203, 204, 205, -1, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - -1, 218, -1, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, -1, -1, 233, 234, 235, 236, - -1, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, -1, -1, 234, 235, 236, + 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, - 287, 288, -1, -1, 291, 292, 293, -1, -1, 296, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, -1, -1, -1, - -1, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, -1, 329, 330, 331, 332, 333, 334, -1, 336, - 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, -1, 359, 360, 361, 362, 363, 364, 365, 366, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, -1, -1, 381, 382, 383, 384, 385, 386, - 387, 388, 389, -1, 391, 392, 393, 394, 395, -1, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, -1, -1, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, -1, 425, 426, - 427, -1, -1, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, -1, -1, 446, - 447, 448, -1, 450, 451, 452, 453, -1, 455, 456, - 457, 458, 459, 460, 461, -1, 463, 464, 465, 466, - 467, 468, 469, 470, 471, -1, -1, 474, -1, -1, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, 394, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, 421, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + 467, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, -1, -1, -1, -1, -1, -1, 505, 506, - 507, -1, -1, -1, -1, 512, -1, 514, -1, -1, - -1, -1, 519, 520, -1, 522, 523, 3, 4, 5, - 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, - 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, - -1, -1, -1, 39, -1, -1, 42, 43, 44, -1, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, -1, 75, - 76, 77, 78, 79, -1, 81, -1, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, - 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, -1, 120, 121, 122, 123, 124, 125, - -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, - 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, - 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, -1, 162, 163, 164, 165, - -1, 167, -1, 169, 170, -1, 172, 173, 174, 175, - 176, 177, -1, 179, -1, 181, 182, 183, 184, -1, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, - -1, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, -1, 218, -1, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, -1, -1, 233, 234, 235, - 236, -1, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - -1, 287, 288, -1, -1, 291, 292, 293, -1, -1, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, -1, -1, - -1, -1, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, -1, 329, 330, 331, 332, 333, 334, -1, - 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, -1, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, -1, -1, 381, 382, 383, 384, 385, - 386, 387, 388, 389, -1, 391, 392, 393, 394, 395, - -1, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, -1, -1, 414, 415, - -1, 417, 418, 419, 420, 421, 422, 423, -1, 425, - 426, 427, -1, -1, 430, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, -1, -1, - 446, 447, 448, -1, 450, 451, 452, 453, -1, 455, - 456, 457, 458, 459, 460, 461, -1, 463, 464, 465, - 466, 467, 468, 469, 470, 471, -1, 473, 474, -1, - -1, 477, 478, 479, 480, 481, 482, 483, 484, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, - 496, 497, 498, -1, -1, -1, -1, -1, -1, 505, - 506, 507, -1, -1, -1, -1, 512, -1, 514, -1, - -1, -1, -1, 519, 520, -1, 522, 523, 3, 4, - 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, - -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, - -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, -1, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, - 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, - 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, -1, 120, 121, 122, 123, 124, - 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, - 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, - 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, -1, 162, 163, 164, - 165, -1, 167, -1, 169, 170, -1, 172, 173, 174, - 175, 176, 177, -1, 179, -1, 181, 182, 183, 184, - -1, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, -1, 199, 200, 201, 202, 203, 204, - 205, -1, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, -1, 218, -1, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, -1, -1, 233, 234, - 235, 236, -1, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, -1, 287, 288, -1, -1, 291, 292, 293, -1, - -1, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, -1, - -1, -1, -1, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, -1, 329, 330, 331, 332, 333, 334, - -1, 336, 337, 338, 339, 340, 341, 342, 343, -1, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, -1, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, -1, -1, 381, 382, 383, 384, - 385, 386, 387, 388, 389, -1, 391, 392, 393, 394, - 395, -1, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, -1, -1, 414, - 415, -1, 417, 418, 419, 420, 421, 422, 423, -1, - 425, 426, 427, -1, -1, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, -1, - -1, 446, 447, 448, -1, 450, 451, 452, 453, -1, - 455, 456, 457, 458, 459, 460, 461, -1, 463, 464, - 465, 466, 467, 468, 469, 470, 471, -1, -1, 474, - -1, -1, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, -1, -1, -1, -1, -1, -1, - 505, 506, 507, -1, -1, -1, -1, 512, -1, 514, - -1, -1, -1, -1, 519, 520, -1, 522, 523, 3, - 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, 39, -1, -1, 42, 43, - 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, 170, -1, 172, 173, - 174, 175, 176, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, -1, -1, 233, - 234, 235, 236, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, 391, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - 464, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, -1, -1, -1, -1, -1, - -1, 505, 506, 507, -1, -1, -1, -1, 512, -1, - 514, -1, -1, -1, -1, 519, 520, -1, 522, 523, + 497, 498, 499, 500, 501, -1, -1, -1, -1, -1, + -1, 508, 509, 510, -1, -1, -1, -1, 515, -1, + 517, -1, -1, -1, -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, @@ -13586,200 +12155,44 @@ static const yytype_int16 yycheck[] = 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, -1, 162, - 163, 164, 165, -1, 167, -1, 169, 170, -1, 172, - 173, 174, 175, 176, 177, -1, 179, -1, 181, 182, - 183, 184, -1, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, - 203, 204, 205, -1, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, -1, 218, -1, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, -1, -1, - 233, 234, 235, 236, -1, 238, 239, 240, 241, 242, + 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, 171, -1, + 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, -1, + -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, -1, 287, 288, -1, -1, 291, 292, - 293, -1, -1, 296, 297, 298, 299, 300, 301, 302, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, -1, -1, -1, -1, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, -1, 329, 330, 331, 332, - 333, 334, -1, 336, 337, 338, 339, 340, 341, 342, - 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, -1, 359, 360, 361, 362, + 313, 314, -1, -1, -1, -1, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 377, 378, -1, -1, 381, 382, - 383, 384, 385, 386, 387, 388, 389, -1, 391, 392, - 393, 394, 395, -1, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, - -1, 414, 415, 416, 417, 418, 419, 420, 421, 422, - 423, -1, 425, 426, 427, -1, -1, 430, 431, 432, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, 421, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, -1, -1, 446, 447, 448, -1, 450, 451, 452, - 453, -1, 455, 456, 457, 458, 459, 460, 461, -1, - 463, 464, 465, 466, 467, 468, 469, 470, 471, -1, - -1, 474, -1, -1, 477, 478, 479, 480, 481, 482, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, 467, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 494, 495, 496, 497, 498, -1, -1, -1, -1, - -1, -1, 505, 506, 507, -1, -1, -1, -1, 512, - -1, 514, -1, -1, -1, -1, 519, 520, -1, 522, - 523, 3, 4, 5, 6, 7, 8, 9, 10, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, - 32, 33, -1, -1, -1, -1, -1, 39, -1, -1, - 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, -1, 75, 76, 77, 78, 79, -1, 81, - -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, -1, 120, 121, - 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, - -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, - 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, -1, - 162, 163, 164, 165, -1, 167, -1, 169, 170, -1, - 172, 173, 174, 175, 176, 177, -1, 179, -1, 181, - 182, 183, 184, -1, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, - 202, 203, 204, 205, -1, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, -1, 218, -1, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, - -1, 233, 234, 235, 236, -1, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, -1, 287, 288, -1, -1, 291, - 292, 293, -1, -1, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, -1, -1, -1, -1, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, -1, 329, 330, 331, - 332, 333, 334, -1, 336, 337, 338, 339, 340, 341, - 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, -1, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, -1, -1, 381, - 382, 383, 384, 385, 386, 387, 388, 389, -1, 391, - 392, 393, 394, 395, -1, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - -1, -1, 414, 415, -1, 417, 418, 419, 420, 421, - 422, 423, -1, 425, 426, 427, -1, -1, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, -1, -1, 446, 447, 448, -1, 450, 451, - 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, - -1, 463, 464, 465, 466, 467, 468, 469, 470, 471, - -1, -1, 474, -1, -1, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 498, -1, -1, -1, - -1, -1, -1, 505, 506, 507, -1, -1, -1, -1, - 512, -1, 514, -1, -1, -1, -1, 519, 520, -1, - 522, 523, 3, 4, 5, 6, 7, 8, 9, 10, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, - 31, 32, 33, -1, -1, -1, -1, -1, 39, -1, - -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, - 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, -1, 120, - 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, - 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, - 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - -1, 162, 163, 164, 165, -1, 167, -1, 169, 170, - -1, 172, 173, 174, 175, 176, 177, -1, 179, -1, - 181, 182, 183, 184, -1, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, - 201, 202, 203, 204, 205, -1, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, -1, 218, -1, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - -1, -1, 233, 234, 235, 236, -1, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, -1, 287, 288, -1, -1, - 291, 292, 293, -1, -1, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, -1, -1, -1, -1, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, -1, 329, 330, - 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, - 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, -1, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 377, 378, -1, -1, - 381, 382, 383, 384, 385, 386, 387, 388, 389, -1, - 391, 392, 393, 394, 395, -1, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, -1, -1, 414, 415, -1, 417, 418, 419, 420, - 421, 422, 423, -1, 425, 426, 427, -1, -1, 430, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, -1, -1, 446, 447, 448, -1, 450, - 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, - 461, -1, 463, 464, 465, 466, 467, 468, 469, 470, - 471, -1, -1, 474, -1, -1, 477, 478, 479, 480, - 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, -1, -1, - -1, -1, -1, -1, 505, 506, 507, -1, -1, -1, - -1, 512, -1, 514, -1, -1, -1, -1, 519, 520, - -1, 522, 523, 3, 4, 5, 6, 7, 8, 9, - 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, - -1, 31, 32, 33, -1, -1, -1, -1, -1, 39, - -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, - -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, - -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, -1, - 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, - 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, - 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, -1, 162, 163, 164, 165, -1, 167, -1, 169, - 170, -1, 172, 173, 174, 175, 176, 177, -1, 179, - -1, 181, 182, 183, 184, -1, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, - 200, 201, 202, 203, 204, 205, -1, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, -1, 218, -1, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, -1, -1, 233, 234, 235, 236, -1, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, -1, 287, 288, -1, - -1, 291, 292, 293, -1, -1, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, -1, -1, -1, -1, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 327, -1, 329, - 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, - 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, -1, 359, - 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, -1, - -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, - -1, 391, 392, 393, 394, 395, -1, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, -1, -1, 414, 415, -1, 417, 418, 419, - 420, 421, 422, 423, -1, 425, 426, 427, -1, -1, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, -1, -1, 446, 447, 448, -1, - 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, - 460, 461, -1, 463, 464, 465, 466, 467, 468, 469, - 470, 471, -1, -1, 474, -1, -1, 477, 478, 479, - 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, -1, - -1, -1, -1, -1, -1, 505, 506, 507, -1, -1, - -1, -1, 512, -1, 514, -1, -1, -1, -1, 519, - 520, -1, 522, 523, 3, 4, 5, 6, 7, 8, + 493, 494, 495, 496, 497, 498, 499, 500, 501, -1, + -1, -1, -1, -1, -1, 508, 509, 510, -1, -1, + -1, -1, 515, -1, 517, 518, -1, -1, -1, 522, + 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, @@ -13795,199 +12208,43 @@ static const yytype_int16 yycheck[] = 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, -1, 172, 173, 174, 175, 176, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233, 234, 235, 236, -1, 238, + 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, -1, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, + 279, 280, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - -1, -1, -1, -1, -1, -1, 505, 506, 507, -1, - -1, -1, -1, 512, -1, 514, -1, -1, -1, -1, - 519, 520, -1, 522, 523, 3, 4, 5, 6, 7, - 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, - -1, 39, -1, -1, 42, 43, 44, -1, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, - 78, 79, -1, 81, -1, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, - 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, - 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, -1, 162, 163, 164, 165, -1, 167, - -1, 169, 170, -1, 172, 173, 174, 175, 176, 177, - -1, 179, -1, 181, 182, 183, 184, -1, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - -1, 199, 200, 201, 202, 203, 204, 205, -1, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, -1, - 218, -1, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, -1, -1, 233, 234, 235, 236, -1, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, 291, 292, 293, -1, -1, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, -1, -1, -1, -1, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - -1, 329, 330, 331, 332, 333, 334, -1, 336, 337, - 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - -1, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, -1, -1, 381, 382, 383, 384, 385, 386, 387, - 388, 389, -1, 391, 392, 393, 394, 395, -1, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, -1, -1, 414, 415, -1, 417, - 418, 419, 420, 421, 422, 423, -1, 425, 426, 427, - -1, -1, 430, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, 447, - 448, -1, 450, 451, 452, 453, -1, 455, 456, 457, - 458, 459, 460, 461, -1, 463, 464, 465, 466, 467, - 468, 469, 470, 471, -1, -1, 474, -1, -1, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, -1, -1, -1, -1, -1, -1, 505, 506, 507, - -1, -1, -1, -1, 512, -1, 514, -1, -1, -1, - -1, 519, 520, -1, 522, 523, 3, 4, 5, 6, - 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, - 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, - -1, -1, 39, -1, -1, 42, 43, 44, -1, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, - 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, - 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, -1, 120, 121, 122, 123, 124, 125, -1, - -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, - 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, - -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, -1, 162, 163, 164, 165, -1, - 167, -1, 169, 170, -1, 172, 173, 174, 175, 176, - 177, -1, 179, -1, 181, 182, 183, 184, -1, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, -1, 199, 200, 201, 202, 203, 204, 205, -1, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - -1, 218, -1, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, -1, -1, 233, 234, 235, 236, - -1, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, - 287, 288, -1, -1, 291, 292, 293, -1, -1, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, -1, -1, -1, - -1, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, -1, 329, 330, 331, 332, 333, 334, -1, 336, - 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, -1, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, -1, -1, 381, 382, 383, 384, 385, 386, - 387, 388, 389, -1, 391, 392, 393, 394, 395, -1, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, -1, -1, 414, 415, -1, - 417, 418, 419, 420, 421, 422, 423, -1, 425, 426, - 427, -1, -1, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, -1, -1, 446, - 447, 448, -1, 450, 451, 452, 453, -1, 455, 456, - 457, 458, 459, 460, 461, -1, 463, 464, 465, 466, - 467, 468, 469, 470, 471, -1, -1, 474, -1, -1, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, -1, -1, -1, -1, -1, -1, 505, 506, - 507, -1, -1, -1, -1, 512, -1, 514, -1, -1, - -1, -1, 519, 520, -1, 522, 523, 3, 4, 5, - 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, - 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, - -1, -1, -1, 39, -1, -1, 42, 43, 44, -1, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, -1, 75, - 76, 77, 78, 79, -1, 81, -1, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, - 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, -1, 120, 121, 122, 123, 124, 125, - -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, - 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, - 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, -1, 162, 163, 164, 165, - -1, 167, -1, 169, 170, -1, 172, 173, 174, 175, - 176, 177, -1, 179, -1, 181, 182, 183, 184, -1, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, - -1, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, -1, 218, -1, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, -1, -1, 233, 234, 235, - 236, -1, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - -1, 287, 288, -1, -1, 291, 292, 293, -1, -1, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, -1, -1, - -1, -1, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, -1, 329, 330, 331, 332, 333, 334, -1, - 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, -1, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, -1, -1, 381, 382, 383, 384, 385, - 386, 387, 388, 389, -1, 391, 392, 393, 394, 395, - -1, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, -1, -1, 414, 415, - -1, 417, 418, 419, 420, 421, 422, 423, -1, 425, - 426, 427, -1, -1, 430, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, -1, -1, - 446, 447, 448, -1, 450, 451, 452, 453, -1, 455, - 456, 457, 458, 459, 460, 461, -1, 463, 464, 465, - 466, 467, 468, 469, 470, 471, -1, -1, 474, -1, - -1, 477, 478, 479, 480, 481, 482, 483, 484, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, - 496, 497, 498, -1, -1, -1, -1, -1, -1, 505, - 506, 507, -1, -1, -1, -1, 512, -1, 514, -1, - -1, -1, -1, 519, 520, -1, 522, 523, 3, 4, + 499, 500, 501, -1, -1, -1, -1, -1, -1, 508, + 509, 510, -1, -1, -1, -1, 515, -1, 517, -1, + -1, -1, -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, @@ -14003,202 +12260,46 @@ static const yytype_int16 yycheck[] = 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, -1, 162, 163, 164, - 165, -1, 167, -1, 169, 170, -1, 172, 173, 174, - 175, 176, 177, -1, 179, -1, 181, 182, 183, 184, - -1, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, -1, 199, 200, 201, 202, 203, 204, - 205, -1, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, -1, 218, -1, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, -1, -1, 233, 234, - 235, 236, -1, 238, 239, 240, 241, 242, 243, 244, + 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, 171, -1, 173, 174, + 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, -1, -1, 234, + 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, -1, 287, 288, -1, -1, 291, 292, 293, -1, - -1, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, -1, - -1, -1, -1, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, -1, 329, 330, 331, 332, 333, 334, - -1, 336, 337, 338, 339, 340, 341, 342, 343, -1, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, -1, 359, 360, 361, 362, 363, 364, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, -1, -1, 381, 382, 383, 384, - 385, 386, 387, 388, 389, -1, 391, 392, 393, 394, - 395, -1, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, -1, -1, 414, - 415, -1, 417, 418, 419, 420, 421, 422, 423, -1, - 425, 426, 427, -1, -1, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, -1, - -1, 446, 447, 448, -1, 450, 451, 452, 453, -1, - 455, 456, 457, 458, 459, 460, 461, -1, 463, 464, - 465, 466, 467, 468, 469, 470, 471, -1, -1, 474, - -1, -1, 477, 478, 479, 480, 481, 482, 483, 484, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, 394, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, 421, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, 467, 468, 469, 470, 471, 472, 473, 474, + -1, 476, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, -1, -1, -1, -1, -1, -1, - 505, 506, 507, -1, -1, -1, -1, 512, -1, 514, - -1, -1, -1, -1, 519, 520, -1, 522, 523, 3, - 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, 39, -1, -1, 42, 43, - 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, 170, -1, 172, 173, - 174, 175, 176, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, -1, -1, 233, - 234, 235, 236, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, 391, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, 418, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - 464, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, -1, -1, -1, -1, -1, - -1, 505, 506, 507, -1, -1, -1, -1, 512, -1, - 514, -1, -1, -1, -1, 519, 520, -1, 522, 523, - 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, - 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, - 33, -1, -1, -1, -1, -1, 39, -1, -1, 42, - 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, - 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, - -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, - -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, -1, 162, - 163, 164, 165, -1, 167, -1, 169, 170, -1, 172, - 173, 174, 175, 176, 177, -1, 179, -1, 181, 182, - 183, 184, -1, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, - 203, 204, 205, -1, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, -1, 218, -1, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, -1, -1, - 233, 234, 235, 236, -1, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, -1, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, -1, 287, 288, -1, -1, 291, 292, - 293, -1, -1, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, -1, -1, -1, -1, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, -1, 329, 330, 331, 332, - 333, 334, -1, 336, 337, 338, 339, 340, 341, 342, - 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, -1, 359, 360, 361, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 377, 378, -1, -1, 381, 382, - 383, 384, 385, 386, 387, 388, 389, -1, 391, 392, - 393, 394, 395, -1, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, - -1, 414, 415, -1, 417, 418, 419, 420, 421, 422, - 423, -1, 425, 426, 427, -1, -1, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, -1, -1, 446, 447, 448, -1, 450, 451, 452, - 453, -1, 455, 456, 457, 458, 459, 460, 461, -1, - 463, 464, 465, 466, 467, 468, 469, 470, 471, -1, - -1, 474, -1, -1, 477, 478, 479, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 494, 495, 496, 497, -1, -1, -1, -1, -1, - -1, -1, 505, 506, -1, -1, -1, -1, -1, 512, - -1, 514, -1, -1, -1, -1, 519, 520, -1, 522, - 523, 3, 4, 5, 6, 7, 8, 9, 10, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, - 32, 33, -1, -1, -1, -1, -1, 39, -1, -1, - 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, -1, 75, 76, 77, 78, 79, -1, 81, - -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, -1, 120, 121, - 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, - -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, - 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, -1, - 162, 163, 164, 165, -1, 167, -1, 169, 170, -1, - 172, 173, 174, 175, 176, 177, -1, 179, -1, 181, - 182, 183, 184, -1, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, - 202, 203, 204, 205, -1, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, -1, 218, -1, 220, -1, - -1, 223, 224, 225, 226, 227, 228, 229, 230, -1, - -1, 233, 234, 235, 236, -1, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, -1, 275, 276, -1, 278, 279, 280, 281, - 282, 283, 284, 285, -1, 287, 288, -1, -1, 291, - 292, 293, -1, -1, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, -1, -1, -1, -1, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, -1, 329, 330, 331, - 332, 333, 334, -1, 336, 337, 338, 339, 340, 341, - 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, -1, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, -1, -1, 381, - 382, 383, 384, 385, 386, 387, 388, 389, -1, 391, - 392, 393, 394, 395, -1, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - -1, -1, 414, 415, -1, 417, 418, 419, 420, 421, - 422, 423, -1, 425, 426, 427, -1, -1, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, -1, -1, 446, 447, 448, -1, 450, 451, - 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, - -1, 463, 464, 465, 466, 467, 468, 469, 470, 471, - -1, -1, 474, -1, -1, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 498, -1, -1, -1, - -1, -1, -1, 505, 506, 507, -1, -1, -1, -1, - 512, -1, 514, -1, -1, -1, -1, 519, 520, -1, - 522, 523, 3, 4, 5, 6, 7, -1, 9, 10, + 495, 496, 497, 498, 499, 500, 501, -1, -1, -1, + -1, -1, -1, 508, 509, 510, -1, -1, -1, -1, + 515, -1, 517, -1, -1, -1, -1, 522, 523, -1, + 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, @@ -14207,100 +12308,153 @@ static const yytype_int16 yycheck[] = 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, + 111, 112, 113, 114, 115, 116, 117, 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - -1, 162, 163, 164, 165, -1, 167, -1, 169, 170, - -1, 172, 173, 174, 175, 176, 177, -1, 179, -1, - 181, 182, 183, 184, -1, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, - 201, 202, 203, 204, 205, -1, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, -1, 218, -1, 220, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - -1, -1, 233, 234, 235, 236, -1, 238, 239, 240, + 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, -1, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, -1, 287, 288, -1, -1, - 291, 292, 293, -1, -1, 296, 297, 298, 299, 300, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, -1, -1, -1, -1, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, -1, 329, 330, - 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, - 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, -1, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 377, 378, -1, -1, - 381, 382, 383, 384, 385, 386, 387, 388, 389, -1, - 391, 392, 393, 394, 395, -1, 397, 398, 399, 400, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, -1, -1, 414, 415, -1, 417, 418, 419, 420, - 421, 422, 423, -1, 425, 426, 427, -1, -1, 430, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, -1, -1, 446, 447, 448, -1, 450, - 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, - 461, -1, 463, 464, 465, 466, 467, 468, 469, 470, - 471, -1, -1, 474, -1, -1, 477, 478, 479, 480, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, 467, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, -1, -1, -1, - -1, -1, -1, -1, 505, 506, -1, -1, -1, -1, - -1, 512, -1, 514, -1, -1, -1, -1, 519, 520, - -1, 522, 523, 3, 4, 5, 6, 7, 8, 9, - 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, - -1, 31, 32, 33, -1, -1, -1, -1, -1, 39, - -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, - -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, - -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, - 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, - 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, - 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, -1, 162, 163, 164, 165, -1, 167, -1, 169, - 170, -1, 172, 173, 174, 175, 176, 177, -1, 179, - -1, 181, 182, 183, 184, -1, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, - 200, 201, 202, 203, 204, 205, -1, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, -1, 218, -1, - 220, -1, 222, 223, 224, 225, 226, 227, 228, 229, - 230, -1, -1, 233, 234, 235, 236, -1, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, -1, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, -1, 287, 288, -1, - -1, 291, 292, 293, -1, -1, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, -1, -1, -1, -1, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 327, -1, 329, - 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, - 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, -1, 359, - 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, -1, - -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, - -1, 391, 392, 393, 394, 395, -1, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, -1, -1, 414, 415, -1, 417, 418, 419, - 420, 421, 422, 423, -1, 425, 426, 427, -1, -1, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, -1, -1, 446, 447, 448, -1, - 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, - 460, 461, -1, 463, 464, 465, 466, 467, 468, 469, - 470, 471, -1, -1, 474, -1, -1, 477, 478, 479, - 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, -1, -1, - -1, -1, -1, -1, -1, 505, 506, -1, -1, -1, - -1, -1, 512, -1, 514, -1, -1, -1, -1, 519, - 520, -1, 522, 523, 3, 4, 5, 6, 7, -1, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, -1, -1, -1, -1, -1, -1, 508, 509, 510, + -1, -1, -1, -1, 515, -1, 517, -1, -1, -1, + -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, + 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, 39, -1, -1, 42, 43, 44, -1, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, 171, -1, 173, 174, 175, 176, + 177, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, -1, -1, 234, 235, 236, + 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, 394, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + 467, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, -1, -1, -1, -1, -1, + -1, 508, 509, 510, -1, -1, -1, -1, 515, -1, + 517, -1, -1, -1, -1, 522, 523, -1, 525, 526, + 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, -1, -1, 39, -1, -1, 42, + 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, -1, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, 171, -1, + 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, -1, + -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, 419, 420, 421, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, 467, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 501, -1, + -1, -1, -1, -1, -1, 508, 509, 510, -1, -1, + -1, -1, 515, -1, 517, -1, -1, -1, -1, 522, + 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, @@ -14311,101 +12465,154 @@ static const yytype_int16 yycheck[] = 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, -1, 172, 173, 174, 175, 176, 177, -1, - 179, 180, 181, 182, 183, 184, -1, 186, 187, 188, + 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, -1, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233, 234, 235, 236, -1, 238, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, -1, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 512, -1, 514, -1, -1, -1, -1, - 519, 520, -1, 522, 523, 3, 4, 5, 6, 7, - -1, 9, 10, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, - -1, 39, -1, -1, 42, 43, 44, -1, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, - 78, 79, -1, 81, -1, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, - 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, - 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, - 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, -1, 162, 163, 164, 165, -1, 167, - -1, 169, 170, -1, 172, 173, 174, 175, 176, 177, - -1, 179, -1, 181, 182, 183, 184, -1, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - -1, 199, 200, 201, 202, 203, 204, 205, -1, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, -1, - 218, -1, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, -1, -1, 233, 234, 235, 236, -1, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, -1, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, 291, 292, 293, -1, -1, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, -1, -1, -1, -1, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - -1, 329, 330, 331, 332, 333, 334, -1, 336, 337, - 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - -1, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, -1, -1, 381, 382, 383, 384, 385, 386, 387, - 388, 389, -1, 391, 392, 393, 394, 395, -1, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, -1, -1, 414, 415, -1, 417, - 418, 419, 420, 421, 422, 423, -1, 425, 426, 427, - -1, -1, 430, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, 447, - 448, -1, 450, 451, 452, 453, -1, 455, 456, 457, - 458, 459, 460, 461, -1, 463, 464, 465, 466, 467, - 468, 469, 470, 471, -1, -1, 474, -1, -1, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, -1, -1, -1, -1, -1, -1, 508, + 509, 510, -1, -1, -1, -1, 515, -1, 517, -1, + -1, -1, -1, 522, 523, -1, 525, 526, 3, 4, + 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, + -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, + -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, -1, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, 171, -1, 173, 174, + 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, -1, -1, 234, + 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, 394, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, 421, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, 467, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 501, -1, -1, -1, + -1, -1, -1, 508, 509, 510, -1, -1, -1, -1, + 515, -1, 517, -1, -1, -1, -1, 522, 523, -1, + 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 512, -1, 514, -1, -1, -1, - -1, 519, 520, -1, 522, 523, 3, 4, 5, 6, - 7, -1, 9, 10, -1, -1, -1, -1, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, 39, -1, + -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, 394, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, 467, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, -1, -1, -1, -1, -1, -1, 508, 509, 510, + -1, -1, -1, -1, 515, -1, 517, -1, -1, -1, + -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, + 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, -1, 46, @@ -14416,352 +12623,630 @@ static const yytype_int16 yycheck[] = 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + 117, 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, -1, 162, 163, 164, 165, -1, - 167, -1, 169, 170, -1, 172, 173, 174, 175, 176, - 177, -1, 179, -1, 181, 182, 183, 184, -1, 186, + 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, 171, -1, 173, 174, 175, 176, + 177, 178, -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, -1, 199, 200, 201, 202, 203, 204, 205, -1, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - -1, 218, -1, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, -1, -1, 233, 234, 235, 236, - -1, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, -1, -1, 234, 235, 236, + 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, -1, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, - 287, 288, -1, -1, 291, 292, 293, -1, -1, 296, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, -1, -1, -1, - -1, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, -1, 329, 330, 331, 332, 333, 334, -1, 336, - 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, -1, 359, 360, 361, 362, 363, 364, 365, 366, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, -1, -1, 381, 382, 383, 384, 385, 386, - 387, 388, 389, -1, 391, 392, 393, 394, 395, -1, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, -1, -1, 414, 415, -1, - 417, 418, 419, 420, 421, 422, 423, -1, 425, 426, - 427, -1, -1, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, -1, -1, 446, - 447, 448, -1, 450, 451, 452, 453, -1, 455, 456, - 457, 458, 459, 460, 461, -1, 463, 464, 465, 466, - 467, 468, 469, 470, 471, -1, -1, 474, -1, -1, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, 394, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, 421, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + 467, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 512, -1, 514, -1, -1, - -1, -1, 519, 520, -1, 522, 523, 3, 4, 5, - 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, - 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, - -1, -1, -1, 39, -1, -1, 42, 43, 44, -1, - 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, - 56, 57, -1, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, -1, 75, - 76, 77, 78, 79, -1, 81, -1, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, - 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, -1, 120, 121, 122, 123, 124, 125, - -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, - 136, 137, 138, -1, 140, 141, 142, -1, 144, -1, - 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, -1, 162, 163, 164, 165, - -1, 167, -1, 169, 170, -1, 172, 173, 174, 175, - -1, 177, -1, 179, -1, 181, 182, 183, 184, -1, - 186, 187, 188, 189, 190, 191, 192, -1, 194, 195, - 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, - -1, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, -1, 218, -1, 220, -1, -1, 223, 224, 225, - 226, 227, 228, 229, 230, -1, -1, 233, 234, 235, - -1, -1, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, -1, 275, - 276, -1, 278, 279, 280, 281, 282, 283, 284, 285, - -1, 287, 288, -1, -1, 291, 292, 293, -1, -1, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, -1, -1, - -1, -1, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, -1, 329, 330, 331, 332, 333, 334, -1, - 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, -1, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, -1, -1, 381, 382, 383, 384, 385, - 386, 387, 388, 389, -1, -1, 392, 393, 394, 395, - -1, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, -1, -1, 414, 415, - -1, 417, 418, 419, 420, 421, 422, 423, -1, 425, - 426, 427, -1, -1, 430, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, -1, -1, - 446, 447, 448, -1, 450, 451, 452, 453, -1, 455, - 456, 457, 458, 459, 460, 461, -1, 463, 464, 465, - 466, 467, 468, 469, 470, 471, -1, -1, 474, -1, - -1, 477, 478, 479, 480, 481, 482, 483, 484, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, - 496, 497, -1, -1, -1, -1, -1, -1, -1, 505, - 506, 507, -1, 3, 4, 5, 512, -1, 514, 9, - -1, -1, -1, 519, 520, -1, 522, 523, -1, -1, - -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, - -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, - -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, - 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, - -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, - -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, - 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, - 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, - 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, -1, 162, 163, 164, 165, -1, 167, -1, 169, - 170, -1, 172, 173, 174, 175, 176, 177, -1, 179, - -1, 181, 182, 183, 184, -1, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, - 200, 201, 202, 203, 204, 205, -1, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, -1, 218, -1, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, -1, -1, 233, 234, 235, 236, -1, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, -1, 275, 276, 277, 278, -1, - 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, - -1, 291, 292, 293, -1, -1, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, -1, -1, -1, -1, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 327, -1, 329, - 330, 331, 332, 333, 334, -1, 336, 337, 338, 339, - 340, 341, 342, 343, -1, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, -1, 359, - 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, -1, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, - -1, 391, 392, 393, 394, 395, -1, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, -1, -1, 414, 415, -1, 417, 418, 419, - 420, 421, 422, 423, -1, 425, 426, 427, -1, -1, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, -1, -1, 446, 447, 448, -1, - 450, 451, 452, 453, -1, 455, 456, 457, 458, 459, - 460, 461, -1, 463, 464, 465, 466, 467, 468, 469, - 470, 471, -1, -1, 474, -1, -1, 477, 478, 479, - 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, -1, -1, - -1, -1, 3, -1, -1, 505, 506, 507, -1, -1, - -1, -1, 512, -1, 514, -1, -1, -1, -1, -1, - 520, 22, 23, 24, 25, 26, 27, 28, 29, -1, - 31, 32, 33, -1, -1, -1, -1, -1, -1, 40, - -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, - 51, 52, 53, 54, -1, 56, 57, -1, 59, 60, - 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, - 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, - -1, -1, 83, 84, 85, 86, 87, 88, -1, 90, - 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, - -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, - 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, - 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, - 141, 142, -1, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, -1, 160, - 161, 162, 163, 164, 165, 166, 167, -1, 169, -1, - -1, -1, 173, 174, 175, -1, 177, -1, 179, -1, - 181, 182, 183, 184, -1, 186, 187, 188, 189, 190, - 191, 192, -1, 194, 195, 196, 197, -1, 199, 200, - 201, 202, 203, 204, 205, -1, 207, -1, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, -1, 220, - -1, -1, 223, -1, 225, 226, 227, 228, 229, 230, - -1, -1, 233, -1, 235, -1, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, -1, 269, 270, - 271, 272, 273, -1, 275, 276, -1, 278, -1, 280, - 281, 282, 283, 284, 285, 286, 287, 288, -1, -1, - 291, 292, 293, -1, 295, 296, 297, 298, -1, 300, - -1, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, -1, -1, -1, -1, 318, 319, 320, - -1, 322, 323, 324, 325, 326, 327, -1, 329, 330, - 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, - 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, -1, 359, 360, - -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 377, 378, -1, -1, - 381, 382, 383, 384, 385, 386, 387, 388, 389, -1, - -1, 392, 393, 394, 395, -1, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, -1, -1, 414, 415, -1, 417, -1, 419, 420, - 421, 422, 423, -1, 425, 426, 427, -1, -1, 430, - 431, 432, 433, 434, -1, 436, 437, 438, 439, 440, - 441, 442, 443, 444, -1, 446, 447, 448, -1, 450, - 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, - 461, -1, 463, -1, 465, 466, 467, 468, 469, 470, - 471, -1, -1, 474, -1, -1, 477, 478, 479, 480, - 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 3, -1, 5, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 515, -1, 22, 23, 24, 25, - 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, - 46, 47, 48, -1, 50, 51, 52, 53, 54, -1, - 56, 57, -1, 59, 60, 61, 62, 63, 64, -1, - -1, 67, 68, 69, 70, 71, 72, 73, -1, 75, - 76, 77, 78, 79, -1, -1, -1, 83, 84, 85, - 86, 87, 88, -1, 90, 91, 92, -1, 94, 95, - 96, 97, 98, 99, -1, -1, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, -1, 118, -1, 120, 121, 122, 123, 124, 125, - -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, - 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, - 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, -1, 160, -1, 162, 163, 164, 165, - -1, 167, -1, 169, -1, -1, -1, 173, 174, 175, - -1, 177, -1, 179, -1, 181, 182, 183, 184, -1, - 186, 187, 188, 189, 190, 191, 192, -1, 194, 195, - 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, - -1, 207, -1, 209, 210, 211, 212, 213, 214, 215, - 216, -1, 218, -1, 220, -1, -1, 223, -1, 225, - 226, 227, 228, 229, 230, -1, -1, 233, -1, 235, - -1, -1, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, -1, 269, 270, 271, 272, 273, -1, 275, - 276, -1, 278, -1, 280, 281, 282, 283, 284, 285, - -1, 287, 288, -1, -1, 291, 292, 293, -1, -1, - 296, 297, 298, -1, 300, -1, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, -1, -1, - -1, -1, 318, 319, 320, -1, 322, 323, 324, 325, - 326, 327, -1, 329, 330, 331, 332, 333, 334, -1, - 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, -1, 359, 360, -1, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, -1, -1, 381, 382, 383, 384, 385, - 386, 387, 388, 389, -1, -1, 392, 393, 394, 395, - -1, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, -1, -1, 414, 415, - -1, 417, -1, 419, 420, 421, 422, 423, -1, 425, - 426, 427, -1, -1, 430, 431, 432, 433, 434, -1, - 436, 437, 438, 439, 440, 441, 442, 443, -1, -1, - 446, 447, 448, -1, 450, 451, 452, 453, -1, 455, - 456, 457, 458, 459, 460, 461, -1, 463, -1, 465, - 466, 467, 468, 469, 470, 471, -1, -1, 474, -1, - -1, 477, 478, 479, 480, 481, 482, 483, 484, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, - 496, 497, 3, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 514, 515, - -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, - 31, 32, 33, 34, 35, -1, 37, -1, -1, -1, - -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, - 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, - 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, - 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, - 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, -1, 160, - -1, 162, 163, 164, 165, -1, 167, -1, 169, 170, - 171, 172, 173, 174, 175, 176, 177, -1, 179, -1, - 181, 182, 183, 184, -1, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, - 201, 202, 203, 204, 205, -1, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, -1, 218, -1, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - -1, -1, 233, 234, 235, 236, -1, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, -1, 275, 276, 277, 278, -1, 280, - 281, 282, 283, 284, 285, -1, 287, 288, -1, -1, - 291, 292, 293, -1, -1, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, -1, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, -1, 329, 330, - 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, - 341, 342, 343, -1, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, -1, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 497, 498, 499, 500, 501, -1, -1, -1, -1, -1, + -1, 508, 509, 510, -1, -1, -1, -1, 515, -1, + 517, -1, -1, -1, -1, 522, 523, -1, 525, 526, + 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, -1, -1, 39, -1, -1, 42, + 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, -1, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, 171, -1, + 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, -1, + -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, 421, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, 467, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 501, -1, + -1, -1, -1, -1, -1, 508, 509, 510, -1, -1, + -1, -1, 515, -1, 517, -1, -1, -1, -1, 522, + 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, + 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, + 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, + 39, -1, -1, 42, 43, 44, -1, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, + 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, + 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, + 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, + -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, -1, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, -1, -1, 234, 235, 236, 237, -1, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, -1, -1, -1, -1, -1, -1, 508, + 509, 510, -1, -1, -1, -1, 515, -1, 517, -1, + -1, -1, -1, 522, 523, -1, 525, 526, 3, 4, + 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, + -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, + -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, -1, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, 171, -1, 173, 174, + 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, -1, -1, 234, + 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, 394, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, 421, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, 467, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 501, -1, -1, -1, + -1, -1, -1, 508, 509, 510, -1, -1, -1, -1, + 515, -1, 517, -1, -1, -1, -1, 522, 523, -1, + 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, 39, -1, + -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, -1, 397, 398, 399, 400, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, - 421, 422, 423, -1, 425, 426, 427, -1, -1, 430, - 431, 432, 433, 434, -1, 436, 437, 438, 439, 440, - 441, 442, 443, -1, -1, 446, 447, 448, 449, 450, - 451, 452, 453, -1, 455, 456, 457, 458, 459, 460, - 461, -1, 463, 464, 465, 466, 467, 468, 469, 470, - 471, -1, -1, 474, -1, 476, 477, 478, 479, 480, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, 467, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, -1, 3, 500, - 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 514, -1, -1, -1, 22, 23, 24, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, -1, -1, -1, -1, -1, -1, 508, 509, 510, + -1, -1, -1, -1, 515, -1, 517, -1, -1, -1, + -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, + 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, 39, -1, -1, 42, 43, 44, -1, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, 171, -1, 173, 174, 175, 176, + 177, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, -1, -1, 234, 235, 236, + 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, 394, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, 421, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + 467, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, -1, -1, -1, -1, -1, + -1, 508, 509, 510, -1, -1, -1, -1, 515, -1, + 517, -1, -1, -1, -1, 522, 523, -1, 525, 526, + 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, -1, -1, 39, -1, -1, 42, + 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, -1, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, 171, -1, + 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, -1, + -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, -1, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, 421, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, 467, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, -1, -1, + -1, -1, -1, -1, -1, 508, 509, -1, -1, -1, + -1, -1, 515, -1, 517, -1, -1, -1, -1, 522, + 523, -1, 525, 526, 3, 4, 5, 6, 7, 8, + 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, + 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, + 39, -1, -1, 42, 43, 44, -1, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, + 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, + 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, + 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, + -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, -1, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, -1, -1, 224, 225, 226, 227, 228, + 229, 230, 231, -1, -1, 234, 235, 236, 237, -1, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, -1, 276, 277, -1, + 279, 280, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, -1, -1, -1, -1, -1, -1, 508, + 509, 510, -1, -1, -1, -1, 515, -1, 517, -1, + -1, -1, -1, 522, 523, -1, 525, 526, 3, 4, + 5, 6, 7, -1, 9, 10, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, - -1, -1, -1, -1, -1, -1, -1, 42, 43, 44, + -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, 64, - -1, 66, 67, 68, 69, 70, 71, 72, 73, -1, + 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, -1, -1, 134, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, -1, 160, -1, 162, 163, 164, - 165, -1, 167, -1, 169, 170, 171, 172, 173, 174, - 175, 176, 177, -1, 179, -1, 181, 182, 183, 184, - -1, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, -1, 199, 200, 201, 202, 203, 204, - 205, -1, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, -1, 218, -1, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, -1, 233, 234, - 235, 236, -1, 238, 239, 240, 241, 242, 243, 244, + 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, 171, -1, 173, 174, + 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, -1, -1, 234, + 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, -1, - 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, - 285, -1, 287, 288, -1, 290, 291, 292, 293, -1, - -1, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, -1, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, -1, 329, 330, 331, 332, 333, 334, - -1, 336, 337, 338, 339, 340, 341, 342, 343, -1, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, -1, 359, 360, 361, 362, 363, 364, + -1, -1, -1, -1, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, -1, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, -1, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, -1, - 425, 426, 427, -1, -1, 430, 431, 432, 433, 434, - -1, 436, 437, 438, 439, 440, 441, 442, 443, -1, - -1, 446, 447, 448, 449, 450, 451, 452, 453, -1, - 455, 456, 457, 458, 459, 460, 461, -1, 463, 464, - 465, 466, 467, 468, 469, 470, 471, -1, -1, 474, - -1, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, 394, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, 421, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, 467, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, -1, 3, 500, 5, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 514, + 495, 496, 497, 498, 499, 500, -1, -1, -1, -1, + -1, -1, -1, 508, 509, -1, -1, -1, -1, -1, + 515, -1, 517, -1, -1, -1, -1, 522, 523, -1, + 525, 526, 3, 4, 5, 6, 7, 8, 9, 10, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, 39, -1, + -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + 171, -1, 173, 174, 175, 176, 177, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, -1, 223, 224, 225, 226, 227, 228, 229, 230, + 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, -1, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, 394, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, 467, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + -1, -1, -1, -1, -1, -1, -1, 508, 509, -1, + -1, -1, -1, -1, 515, -1, 517, -1, -1, -1, + -1, 522, 523, -1, 525, 526, 3, 4, 5, 6, + 7, -1, 9, 10, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, 39, -1, -1, 42, 43, 44, -1, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, 171, -1, 173, 174, 175, 176, + 177, 178, -1, 180, 181, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, -1, -1, 234, 235, 236, + 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, -1, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, 394, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, 421, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + 467, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 515, -1, + 517, -1, -1, -1, -1, 522, 523, -1, 525, 526, + 3, 4, 5, 6, 7, -1, 9, 10, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, -1, -1, 39, -1, -1, 42, + 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, -1, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, 171, -1, + 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, -1, + -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, -1, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, 421, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, 467, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 515, -1, 517, -1, -1, -1, -1, 522, + 523, -1, 525, 526, 3, 4, 5, 6, 7, -1, + 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, 42, 43, 44, -1, 46, 47, 48, + 39, -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, @@ -14771,92 +13256,296 @@ static const yytype_int16 yycheck[] = 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, -1, 172, 173, 174, 175, 176, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, -1, 233, 234, 235, 236, -1, 238, + 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, -1, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, -1, 275, 276, 277, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, 290, 291, 292, 293, -1, -1, 296, 297, 298, + 269, 270, 271, 272, 273, 274, -1, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 514, -1, -1, 22, 23, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 515, -1, 517, -1, + -1, -1, -1, 522, 523, -1, 525, 526, 3, 4, + 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, + -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, + -1, 46, 47, 48, 49, 50, 51, 52, -1, 54, + 55, 56, 57, -1, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + -1, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, 171, -1, 173, 174, + 175, 176, -1, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, -1, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, -1, -1, 224, + 225, 226, 227, 228, 229, 230, 231, -1, -1, 234, + 235, 236, -1, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + -1, 276, 277, -1, 279, 280, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, 421, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, 467, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, -1, -1, -1, -1, + -1, -1, -1, 508, 509, 510, -1, 3, 4, 5, + 515, -1, 517, 9, -1, -1, -1, 522, 523, -1, + 525, 526, -1, -1, -1, -1, 22, 23, 24, 25, + 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, + -1, 37, -1, -1, -1, -1, 42, 43, 44, -1, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, -1, 59, 60, 61, 62, 63, 64, -1, + -1, 67, 68, 69, 70, 71, 72, 73, -1, 75, + 76, 77, 78, 79, -1, 81, -1, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, + 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, -1, 118, -1, 120, 121, 122, 123, 124, 125, + -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, + 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, + 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, + 166, -1, 168, -1, 170, 171, -1, 173, 174, 175, + 176, 177, 178, -1, 180, -1, 182, 183, 184, 185, + -1, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, -1, 200, 201, 202, 203, 204, 205, + 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, -1, 219, -1, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, -1, -1, 234, 235, + 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, -1, + 276, 277, 278, 279, -1, 281, 282, 283, 284, 285, + 286, -1, 288, 289, 290, -1, 292, 293, 294, -1, + -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, -1, + -1, -1, -1, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, -1, 330, 331, 332, 333, 334, 335, + -1, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, -1, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, -1, 394, 395, + 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, -1, + -1, 417, 418, -1, 420, 421, 422, 423, 424, 425, + 426, -1, 428, 429, 430, -1, -1, 433, 434, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, -1, -1, 449, 450, 451, -1, 453, 454, 455, + 456, -1, 458, 459, 460, 461, 462, 463, 464, -1, + 466, 467, 468, 469, 470, 471, 472, 473, 474, -1, + -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, -1, -1, -1, -1, 3, + -1, -1, 508, 509, 510, -1, -1, -1, -1, 515, + -1, 517, -1, -1, -1, -1, -1, 523, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, 42, 43, - 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, + -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, + 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, + 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, + 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, + -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, + 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, + 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, 170, -1, 172, 173, - 174, 175, 176, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, -1, -1, 233, - 234, 235, 236, -1, 238, 239, 240, 241, 242, 243, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, -1, 161, 162, 163, + 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, + 174, 175, 176, -1, 178, -1, 180, -1, 182, 183, + 184, 185, -1, 187, 188, 189, 190, 191, 192, 193, + -1, 195, 196, 197, 198, -1, 200, 201, 202, 203, + 204, 205, 206, -1, 208, -1, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, -1, 221, -1, -1, + 224, -1, 226, 227, 228, 229, 230, 231, -1, -1, + 234, -1, 236, -1, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - -1, 275, 276, 277, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, 299, 300, 301, 302, 303, + 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, + 274, -1, 276, 277, -1, 279, -1, 281, 282, 283, + 284, 285, 286, 287, 288, 289, -1, -1, 292, 293, + 294, -1, 296, 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, 391, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, 418, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - 464, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, + 314, -1, -1, -1, -1, 319, 320, 321, -1, 323, + 324, 325, 326, 327, 328, -1, 330, 331, 332, 333, + 334, 335, -1, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, + -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, -1, -1, + 384, 385, 386, 387, 388, 389, 390, 391, 392, -1, + -1, 395, 396, 397, 398, -1, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, -1, -1, 417, 418, -1, 420, -1, 422, 423, + 424, 425, 426, -1, 428, 429, 430, -1, -1, 433, + 434, 435, 436, 437, -1, 439, 440, 441, 442, 443, + 444, 445, 446, 447, -1, 449, 450, 451, -1, 453, + 454, 455, 456, -1, 458, 459, 460, 461, 462, 463, + 464, -1, 466, -1, 468, 469, 470, 471, 472, 473, + 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, + 494, 495, 496, 497, 498, 499, 500, 3, -1, 5, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 518, -1, 22, 23, 24, 25, + 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, + 46, 47, 48, -1, 50, 51, 52, 53, 54, -1, + 56, 57, -1, 59, 60, 61, 62, 63, 64, -1, + -1, 67, 68, 69, 70, 71, 72, 73, -1, 75, + 76, 77, 78, 79, -1, -1, -1, 83, 84, 85, + 86, 87, 88, -1, 90, 91, 92, -1, 94, 95, + 96, 97, 98, 99, -1, -1, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, -1, 118, -1, 120, 121, 122, 123, 124, 125, + -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, + 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, + 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, -1, 161, -1, 163, 164, 165, + 166, -1, 168, -1, 170, -1, -1, -1, 174, 175, + 176, -1, 178, -1, 180, -1, 182, 183, 184, 185, + -1, 187, 188, 189, 190, 191, 192, 193, -1, 195, + 196, 197, 198, -1, 200, 201, 202, 203, 204, 205, + 206, -1, 208, -1, 210, 211, 212, 213, 214, 215, + 216, 217, -1, 219, -1, 221, -1, -1, 224, -1, + 226, 227, 228, 229, 230, 231, -1, -1, 234, -1, + 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, -1, 270, 271, 272, 273, 274, -1, + 276, 277, -1, 279, -1, 281, 282, 283, 284, 285, + 286, -1, 288, 289, -1, -1, 292, 293, 294, -1, + -1, 297, 298, 299, -1, 301, -1, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, -1, + -1, -1, -1, 319, 320, 321, -1, 323, 324, 325, + 326, 327, 328, -1, 330, 331, 332, 333, 334, 335, + -1, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, -1, 362, 363, -1, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, -1, -1, 384, 385, + 386, 387, 388, 389, 390, 391, 392, -1, -1, 395, + 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, -1, + -1, 417, 418, -1, 420, -1, 422, 423, 424, 425, + 426, -1, 428, 429, 430, -1, -1, 433, 434, 435, + 436, 437, -1, 439, 440, 441, 442, 443, 444, 445, + 446, -1, -1, 449, 450, 451, -1, 453, 454, 455, + 456, -1, 458, 459, 460, 461, 462, 463, 464, -1, + 466, -1, 468, 469, 470, 471, 472, 473, 474, -1, + -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 514, -1, -1, 22, 23, 24, 25, 26, 27, 28, + -1, 517, 518, -1, 22, 23, 24, 25, 26, 27, + 28, 29, -1, 31, 32, 33, 34, 35, -1, 37, + -1, -1, -1, -1, 42, 43, 44, -1, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + -1, 59, 60, 61, 62, 63, 64, -1, -1, 67, + 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, + 78, 79, -1, 81, -1, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, + 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, + 118, -1, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, + 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, -1, 161, -1, 163, 164, 165, 166, -1, + 168, -1, 170, 171, 172, 173, 174, 175, 176, 177, + 178, -1, 180, -1, 182, 183, 184, 185, -1, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, -1, 200, 201, 202, 203, 204, 205, 206, -1, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + -1, 219, -1, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, -1, -1, 234, 235, 236, 237, + -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, -1, 276, 277, + 278, 279, -1, 281, 282, 283, 284, 285, 286, -1, + 288, 289, -1, -1, 292, 293, 294, -1, -1, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, -1, 330, 331, 332, 333, 334, 335, -1, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, -1, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, -1, + 428, 429, 430, -1, -1, 433, 434, 435, 436, 437, + -1, 439, 440, 441, 442, 443, 444, 445, 446, -1, + -1, 449, 450, 451, 452, 453, 454, 455, 456, -1, + 458, 459, 460, 461, 462, 463, 464, -1, 466, 467, + 468, 469, 470, 471, 472, 473, 474, -1, -1, 477, + -1, 479, 480, 481, 482, 483, 484, 485, 486, 487, + 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, -1, 3, 503, 5, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 517, + -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, @@ -14866,196 +13555,247 @@ static const yytype_int16 yycheck[] = 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, + -1, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, -1, 172, 173, 174, 175, 176, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233, 234, 235, 236, -1, 238, + 159, -1, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, 172, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, -1, 275, 276, 277, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, + 269, 270, 271, 272, 273, 274, -1, 276, 277, 278, + 279, -1, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, 291, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 514, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, 171, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, 390, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, - 414, 415, 416, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, 449, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 500, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 514, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, 171, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, + 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, 416, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - 449, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, 476, 477, 478, + 379, 380, 381, 382, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, -1, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, 452, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, 500, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 514, -1, -1, 22, 23, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, -1, 3, 503, 5, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 517, -1, + -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, + -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, + -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, + 60, 61, 62, 63, 64, -1, 66, 67, 68, 69, + 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, + -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, + -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, + 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, + 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, + 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + -1, 161, -1, 163, 164, 165, 166, -1, 168, -1, + 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, + 180, -1, 182, 183, 184, 185, -1, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, -1, + 200, 201, 202, 203, 204, 205, 206, -1, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, -1, 219, + -1, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, -1, 234, 235, 236, 237, -1, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, -1, 276, 277, 278, 279, + -1, 281, 282, 283, 284, 285, 286, -1, 288, 289, + -1, 291, 292, 293, 294, -1, -1, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, -1, -1, -1, -1, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, -1, + 330, 331, 332, 333, 334, 335, -1, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, -1, -1, 384, 385, 386, 387, 388, 389, + 390, 391, 392, -1, 394, 395, 396, 397, 398, -1, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, -1, -1, 417, 418, -1, + 420, 421, 422, 423, 424, 425, 426, -1, 428, 429, + 430, -1, -1, 433, 434, 435, 436, 437, -1, 439, + 440, 441, 442, 443, 444, 445, 446, -1, -1, 449, + 450, 451, -1, 453, 454, 455, 456, -1, 458, 459, + 460, 461, 462, 463, 464, -1, 466, 467, 468, 469, + 470, 471, 472, 473, 474, -1, -1, 477, -1, -1, + 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, + 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 517, -1, -1, + 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, + 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, + 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, -1, 59, 60, 61, + 62, 63, 64, -1, 66, 67, 68, 69, 70, 71, + 72, 73, -1, 75, 76, 77, 78, 79, -1, 81, + -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, -1, 118, -1, 120, 121, + 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, + -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, + 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, -1, 161, + -1, 163, 164, 165, 166, -1, 168, -1, 170, 171, + -1, 173, 174, 175, 176, 177, 178, -1, 180, -1, + 182, 183, 184, 185, -1, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, -1, 200, 201, + 202, 203, 204, 205, 206, -1, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, -1, 219, -1, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + -1, -1, 234, 235, 236, 237, -1, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, -1, 276, 277, 278, 279, -1, 281, + 282, 283, 284, 285, 286, -1, 288, 289, -1, -1, + 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, -1, -1, -1, -1, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, -1, 330, 331, + 332, 333, 334, 335, -1, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + -1, -1, 384, 385, 386, 387, 388, 389, 390, 391, + 392, -1, 394, 395, 396, 397, 398, -1, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, -1, -1, 417, 418, -1, 420, 421, + 422, 423, 424, 425, 426, -1, 428, 429, 430, -1, + -1, 433, 434, 435, 436, 437, -1, 439, 440, 441, + 442, 443, 444, 445, 446, -1, -1, 449, 450, 451, + -1, 453, 454, 455, 456, -1, 458, 459, 460, 461, + 462, 463, 464, -1, 466, 467, 468, 469, 470, 471, + 472, 473, 474, -1, -1, 477, -1, -1, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 498, 499, 500, 3, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 517, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, + -1, -1, -1, -1, -1, -1, -1, -1, 42, 43, + 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, + 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, + -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, + 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, 171, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, + 154, 155, 156, 157, 158, 159, -1, 161, -1, 163, + 164, 165, 166, -1, 168, -1, 170, 171, -1, 173, + 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, + 184, 185, -1, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, -1, 200, 201, 202, 203, + 204, 205, 206, -1, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, -1, 219, -1, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, -1, -1, + 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, -1, 276, 277, 278, 279, -1, 281, 282, 283, + 284, 285, 286, -1, 288, 289, -1, -1, 292, 293, + 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, + 314, -1, -1, -1, -1, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, -1, 330, 331, 332, 333, + 334, 335, -1, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, 416, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, 449, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, 476, 477, 478, 479, 480, 481, 482, 483, + 374, 375, 376, 377, 378, 379, 380, 381, -1, -1, + 384, 385, 386, 387, 388, 389, 390, 391, 392, -1, + 394, 395, 396, 397, 398, -1, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, -1, -1, 417, 418, -1, 420, 421, 422, 423, + 424, 425, 426, -1, 428, 429, 430, -1, -1, 433, + 434, 435, 436, 437, -1, 439, 440, 441, 442, 443, + 444, 445, 446, -1, -1, 449, 450, 451, -1, 453, + 454, 455, 456, -1, 458, 459, 460, 461, 462, 463, + 464, -1, 466, 467, 468, 469, 470, 471, 472, 473, + 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, -1, 3, 500, 5, -1, -1, + 494, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 514, -1, -1, -1, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, + -1, -1, -1, 517, -1, -1, 22, 23, 24, 25, + 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, + 46, 47, 48, -1, 50, 51, 52, 53, 54, -1, + 56, 57, -1, 59, 60, 61, 62, 63, 64, -1, + -1, 67, 68, 69, 70, 71, 72, 73, -1, 75, + 76, 77, 78, 79, -1, -1, -1, 83, 84, 85, + 86, 87, 88, -1, 90, 91, 92, -1, 94, 95, + 96, 97, 98, 99, -1, -1, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, -1, 118, -1, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, -1, -1, 134, 135, + 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, + 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, -1, 161, -1, 163, 164, 165, + 166, -1, 168, -1, 170, -1, 172, -1, 174, 175, + 176, -1, 178, -1, 180, -1, 182, 183, 184, 185, + -1, 187, 188, 189, 190, 191, 192, 193, -1, 195, + 196, 197, 198, -1, 200, 201, 202, 203, 204, 205, + 206, -1, 208, -1, 210, 211, 212, 213, 214, 215, + 216, 217, -1, 219, -1, 221, -1, -1, 224, -1, + 226, 227, 228, 229, 230, 231, -1, -1, 234, -1, + 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, -1, 270, 271, 272, 273, 274, -1, + 276, 277, -1, 279, -1, 281, 282, 283, 284, 285, + 286, -1, 288, 289, -1, -1, 292, 293, 294, -1, + -1, 297, 298, 299, -1, 301, -1, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, -1, 319, 320, 321, -1, 323, 324, 325, + 326, 327, 328, -1, 330, 331, 332, 333, 334, 335, + -1, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, -1, 362, 363, -1, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, + 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + -1, 417, 418, 419, 420, -1, 422, 423, 424, 425, + 426, -1, 428, 429, 430, -1, -1, 433, 434, 435, + 436, 437, -1, 439, 440, 441, 442, 443, 444, 445, + 446, -1, -1, 449, 450, 451, 452, 453, 454, 455, + 456, -1, 458, 459, 460, 461, 462, 463, 464, -1, + 466, -1, 468, 469, 470, 471, 472, 473, 474, -1, + -1, 477, -1, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 3, -1, 503, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 517, -1, -1, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, 67, @@ -15068,141 +13808,142 @@ static const yytype_int16 yycheck[] = 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, -1, 160, -1, 162, 163, 164, 165, -1, 167, - -1, 169, -1, -1, -1, 173, 174, 175, -1, 177, - -1, 179, -1, 181, 182, 183, 184, -1, 186, 187, - 188, 189, 190, 191, 192, -1, 194, 195, 196, 197, - -1, 199, 200, 201, 202, 203, 204, 205, -1, 207, - -1, 209, 210, 211, 212, 213, 214, 215, 216, -1, - 218, -1, 220, -1, -1, 223, -1, 225, 226, 227, - 228, 229, 230, -1, -1, 233, -1, 235, -1, -1, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 158, 159, -1, 161, -1, 163, 164, 165, 166, -1, + 168, -1, 170, -1, 172, -1, 174, 175, 176, -1, + 178, -1, 180, -1, 182, 183, 184, 185, -1, 187, + 188, 189, 190, 191, 192, 193, -1, 195, 196, 197, + 198, -1, 200, 201, 202, 203, 204, 205, 206, -1, + 208, -1, 210, 211, 212, 213, 214, 215, 216, 217, + -1, 219, -1, 221, -1, -1, 224, -1, 226, 227, + 228, 229, 230, 231, -1, -1, 234, -1, 236, -1, + -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - -1, 269, 270, 271, 272, 273, -1, 275, 276, -1, - 278, -1, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, 291, 292, 293, -1, -1, 296, 297, - 298, -1, 300, -1, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, -1, -1, -1, -1, - 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, - -1, 329, 330, 331, 332, 333, 334, -1, 336, 337, - 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, + 268, -1, 270, 271, 272, 273, 274, -1, 276, 277, + -1, 279, -1, 281, 282, 283, 284, 285, 286, -1, + 288, 289, -1, -1, 292, 293, 294, -1, -1, 297, + 298, 299, -1, 301, -1, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + -1, 319, 320, 321, -1, 323, 324, 325, 326, 327, + 328, -1, 330, 331, 332, 333, 334, 335, -1, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - -1, 359, 360, -1, 362, 363, 364, 365, 366, 367, + 358, 359, 360, -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, -1, -1, 381, 382, 383, 384, 385, 386, 387, - 388, 389, -1, -1, 392, 393, 394, 395, -1, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, -1, -1, 414, 415, -1, 417, - -1, 419, 420, 421, 422, 423, -1, 425, 426, 427, - -1, -1, 430, 431, 432, 433, 434, -1, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, 447, - 448, -1, 450, 451, 452, 453, -1, 455, 456, 457, - 458, 459, 460, 461, -1, 463, -1, 465, 466, 467, - 468, 469, 470, 471, -1, -1, 474, -1, -1, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 514, -1, -1, 22, - 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, - 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, - 53, 54, -1, 56, 57, -1, 59, 60, 61, 62, - 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, - 73, -1, 75, 76, 77, 78, 79, -1, -1, -1, - 83, 84, 85, 86, 87, 88, -1, 90, 91, 92, - -1, 94, 95, 96, 97, 98, 99, -1, -1, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, - 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, - -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, - -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, -1, 160, -1, 162, - 163, 164, 165, -1, 167, -1, 169, -1, -1, -1, - 173, 174, 175, -1, 177, -1, 179, -1, 181, 182, - 183, 184, -1, 186, 187, 188, 189, 190, 191, 192, - -1, 194, 195, 196, 197, -1, 199, 200, 201, 202, - 203, 204, 205, -1, 207, -1, 209, 210, 211, 212, - 213, 214, 215, 216, -1, 218, -1, 220, -1, -1, - 223, -1, 225, 226, 227, 228, 229, 230, -1, -1, - 233, -1, 235, -1, -1, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, -1, 269, 270, 271, 272, - 273, -1, 275, 276, -1, 278, -1, 280, 281, 282, - 283, 284, 285, -1, 287, 288, -1, -1, 291, 292, - 293, -1, -1, 296, 297, 298, -1, 300, -1, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, -1, -1, -1, -1, 318, 319, 320, -1, 322, - 323, 324, 325, 326, 327, -1, 329, 330, 331, 332, - 333, 334, -1, 336, 337, 338, 339, 340, 341, 342, - 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, -1, 359, 360, -1, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 377, 378, -1, -1, 381, 382, - 383, 384, 385, 386, 387, 388, 389, -1, -1, 392, - 393, 394, 395, -1, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, - -1, 414, 415, -1, 417, -1, 419, 420, 421, 422, - 423, -1, 425, 426, 427, -1, -1, 430, 431, 432, - 433, 434, -1, 436, 437, 438, 439, 440, 441, 442, - 443, -1, -1, 446, 447, 448, -1, 450, 451, 452, - 453, -1, 455, 456, 457, 458, 459, 460, 461, -1, - 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, - -1, 474, -1, -1, 477, 478, 479, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 494, 495, 496, 497, 3, -1, 5, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 514, -1, -1, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 43, 44, -1, 46, 47, - 48, -1, 50, 51, 52, 53, 54, -1, 56, 57, - -1, 59, 60, 61, 62, 63, 64, -1, -1, 67, - 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, - 78, 79, -1, -1, -1, 83, 84, 85, 86, 87, - 88, -1, 90, 91, 92, -1, 94, 95, 96, 97, - 98, 99, -1, -1, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, - 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, - 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, - 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, -1, 160, -1, 162, 163, 164, 165, -1, 167, - -1, 169, -1, -1, -1, 173, 174, 175, -1, 177, - -1, 179, -1, 181, 182, 183, 184, -1, 186, 187, - 188, 189, 190, 191, 192, -1, 194, 195, 196, 197, - -1, 199, 200, 201, 202, 203, 204, 205, -1, 207, - -1, 209, 210, 211, 212, 213, 214, 215, 216, -1, - 218, -1, 220, -1, -1, 223, -1, 225, 226, 227, - 228, 229, 230, -1, -1, 233, -1, 235, -1, -1, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - -1, 269, 270, 271, 272, 273, -1, 275, 276, -1, - 278, -1, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, 291, 292, 293, -1, -1, 296, 297, - 298, -1, 300, -1, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, -1, -1, -1, -1, - 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, - -1, 329, 330, 331, 332, 333, 334, -1, 336, 337, - 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - -1, 359, 360, -1, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, -1, -1, 381, 382, 383, 384, 385, 386, 387, - 388, 389, -1, -1, 392, 393, 394, 395, -1, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, -1, -1, 414, 415, -1, 417, - -1, 419, 420, 421, 422, 423, -1, 425, 426, 427, - -1, -1, 430, 431, 432, 433, 434, -1, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, 447, - 448, -1, 450, 451, 452, 453, -1, 455, 456, 457, - 458, 459, 460, 461, -1, 463, -1, 465, 466, 467, - 468, 469, 470, 471, -1, -1, 474, -1, -1, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, + 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, + 388, 389, 390, 391, 392, -1, -1, 395, 396, 397, + 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, -1, -1, 417, + 418, 419, 420, -1, 422, 423, 424, 425, 426, -1, + 428, 429, 430, -1, -1, 433, 434, 435, 436, 437, + -1, 439, 440, 441, 442, 443, 444, 445, 446, -1, + -1, 449, 450, 451, 452, 453, 454, 455, 456, -1, + 458, 459, 460, 461, 462, 463, 464, -1, 466, -1, + 468, 469, 470, 471, 472, 473, 474, -1, -1, 477, + -1, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 3, -1, 503, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 517, + -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, + -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 43, 44, -1, 46, 47, 48, -1, + 50, 51, 52, 53, 54, -1, 56, 57, -1, 59, + 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, + 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, + -1, -1, -1, 83, 84, 85, 86, 87, 88, -1, + 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, + -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, + 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, + 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, + 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + -1, 161, -1, 163, 164, 165, 166, -1, 168, -1, + 170, -1, 172, -1, 174, 175, 176, -1, 178, -1, + 180, -1, 182, 183, 184, 185, -1, 187, 188, 189, + 190, 191, 192, 193, -1, 195, 196, 197, 198, -1, + 200, 201, 202, 203, 204, 205, 206, -1, 208, -1, + 210, 211, 212, 213, 214, 215, 216, 217, -1, 219, + -1, 221, -1, -1, 224, -1, 226, 227, 228, 229, + 230, 231, -1, -1, 234, -1, 236, -1, -1, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, + 270, 271, 272, 273, 274, -1, 276, 277, -1, 279, + -1, 281, 282, 283, 284, 285, 286, -1, 288, 289, + -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, + -1, 301, -1, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, + 320, 321, -1, 323, 324, 325, 326, 327, 328, -1, + 330, 331, 332, 333, 334, 335, -1, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, -1, 362, 363, -1, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, -1, 384, 385, 386, 387, 388, 389, + 390, 391, 392, -1, -1, 395, 396, 397, 398, -1, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, -1, -1, 417, 418, 419, + 420, -1, 422, 423, 424, 425, 426, -1, 428, 429, + 430, -1, -1, 433, 434, 435, 436, 437, -1, 439, + 440, 441, 442, 443, 444, 445, 446, -1, -1, 449, + 450, 451, 452, 453, 454, 455, 456, -1, 458, 459, + 460, 461, 462, 463, 464, -1, 466, -1, 468, 469, + 470, 471, 472, 473, 474, -1, -1, 477, -1, 479, + 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, + 500, -1, 3, 503, 5, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 517, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, + 51, 52, 53, 54, -1, 56, 57, -1, 59, 60, + 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + -1, -1, 83, 84, 85, 86, 87, 88, -1, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, -1, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + -1, -1, -1, 174, 175, 176, -1, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, -1, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, -1, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, -1, -1, 224, -1, 226, 227, 228, 229, 230, + 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, + 271, 272, 273, 274, -1, 276, 277, -1, 279, -1, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, -1, + 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, -1, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, -1, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, -1, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 514, -1, -1, 22, + -1, -1, -1, -1, -1, -1, 517, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, @@ -15216,191 +13957,242 @@ static const yytype_int16 yycheck[] = 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, -1, 160, -1, 162, - 163, 164, 165, -1, 167, -1, 169, -1, -1, -1, - 173, 174, 175, -1, 177, -1, 179, -1, 181, 182, - 183, 184, -1, 186, 187, 188, 189, 190, 191, 192, - -1, 194, 195, 196, 197, -1, 199, 200, 201, 202, - 203, 204, 205, -1, 207, -1, 209, 210, 211, 212, - 213, 214, 215, 216, -1, 218, -1, 220, -1, -1, - 223, -1, 225, 226, 227, 228, 229, 230, -1, -1, - 233, -1, 235, -1, -1, 238, 239, 240, 241, 242, + 153, 154, 155, 156, 157, 158, 159, -1, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, -1, -1, + -1, 174, 175, 176, -1, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, -1, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, -1, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, -1, + -1, 224, -1, 226, 227, 228, 229, 230, 231, -1, + -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, -1, 269, 270, 271, 272, - 273, -1, 275, 276, -1, 278, -1, 280, 281, 282, - 283, 284, 285, -1, 287, 288, -1, -1, 291, 292, - 293, -1, -1, 296, 297, 298, -1, 300, -1, 302, + 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, + 273, 274, -1, 276, 277, -1, 279, -1, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, -1, -1, -1, -1, 318, 319, 320, -1, 322, - 323, 324, 325, 326, 327, -1, 329, 330, 331, 332, - 333, 334, -1, 336, 337, 338, 339, 340, 341, 342, - 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, -1, 359, 360, -1, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 377, 378, -1, -1, 381, 382, - 383, 384, 385, 386, 387, 388, 389, -1, -1, 392, - 393, 394, 395, -1, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, - -1, 414, 415, -1, 417, -1, 419, 420, 421, 422, - 423, -1, 425, 426, 427, -1, -1, 430, 431, 432, - 433, 434, -1, 436, 437, 438, 439, 440, 441, 442, - 443, -1, -1, 446, 447, 448, -1, 450, 451, 452, - 453, -1, 455, 456, 457, 458, 459, 460, 461, -1, - 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, - -1, 474, -1, -1, 477, 478, 479, 480, 481, 482, + 313, 314, -1, -1, -1, -1, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, -1, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, -1, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, -1, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, -1, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 494, 495, 496, 497, 3, -1, 5, -1, -1, + 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, + 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 517, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, + -1, 46, 47, 48, -1, 50, 51, 52, 53, 54, + -1, 56, 57, -1, 59, 60, 61, 62, 63, 64, + -1, -1, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, -1, -1, 83, 84, + 85, 86, 87, 88, -1, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, -1, -1, -1, 174, + 175, 176, -1, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, -1, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, -1, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, -1, -1, 224, + -1, 226, 227, 228, 229, 230, 231, -1, -1, 234, + -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, + -1, 276, 277, -1, 279, -1, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, -1, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, -1, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, -1, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, -1, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, -1, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 514, -1, -1, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 43, 44, -1, 46, 47, - 48, -1, 50, 51, 52, 53, 54, -1, 56, 57, - -1, 59, 60, 61, 62, 63, 64, -1, -1, 67, - 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, - 78, 79, -1, -1, -1, 83, 84, 85, 86, 87, - 88, -1, 90, 91, 92, -1, 94, 95, 96, 97, - 98, 99, -1, -1, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, - 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, - 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, - 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, -1, 160, -1, 162, 163, 164, 165, -1, 167, - -1, 169, -1, -1, -1, 173, 174, 175, -1, 177, - -1, 179, -1, 181, 182, 183, 184, -1, 186, 187, - 188, 189, 190, 191, 192, -1, 194, 195, 196, 197, - -1, 199, 200, 201, 202, 203, 204, 205, -1, 207, - -1, 209, 210, 211, 212, 213, 214, 215, 216, -1, - 218, -1, 220, -1, -1, 223, -1, 225, 226, 227, - 228, 229, 230, -1, -1, 233, -1, 235, -1, -1, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - -1, 269, 270, 271, 272, 273, -1, 275, 276, -1, - 278, -1, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, 291, 292, 293, -1, -1, 296, 297, - 298, -1, 300, -1, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, -1, -1, -1, -1, - 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, - -1, 329, 330, 331, 332, 333, 334, -1, 336, 337, - 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - -1, 359, 360, -1, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, -1, -1, 381, 382, 383, 384, 385, 386, 387, - 388, 389, -1, -1, 392, 393, 394, 395, -1, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, -1, -1, 414, 415, -1, 417, - -1, 419, 420, 421, 422, 423, -1, 425, 426, 427, - -1, -1, 430, 431, 432, 433, 434, -1, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, 447, - 448, -1, 450, 451, 452, 453, -1, 455, 456, 457, - 458, 459, 460, 461, -1, 463, -1, 465, 466, 467, - 468, 469, 470, 471, -1, -1, 474, -1, -1, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 514, -1, -1, 22, - 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, - 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, - 53, 54, -1, 56, 57, -1, 59, 60, 61, 62, - 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, - 73, -1, 75, 76, 77, 78, 79, -1, -1, -1, - 83, 84, 85, 86, 87, 88, -1, 90, 91, 92, - -1, 94, 95, 96, 97, 98, 99, -1, -1, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, - 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, - -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, - -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, -1, 160, -1, 162, - 163, 164, 165, -1, 167, -1, 169, -1, -1, -1, - 173, 174, 175, -1, 177, -1, 179, -1, 181, 182, - 183, 184, -1, 186, 187, 188, 189, 190, 191, 192, - -1, 194, 195, 196, 197, -1, 199, 200, 201, 202, - 203, 204, 205, -1, 207, -1, 209, 210, 211, 212, - 213, 214, 215, 216, -1, 218, -1, 220, -1, -1, - 223, -1, 225, 226, 227, 228, 229, 230, -1, -1, - 233, -1, 235, -1, -1, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, -1, 269, 270, 271, 272, - 273, -1, 275, 276, -1, 278, -1, 280, 281, 282, - 283, 284, 285, -1, 287, 288, -1, -1, 291, 292, - 293, -1, -1, 296, 297, 298, -1, 300, -1, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, -1, -1, -1, -1, 318, 319, 320, -1, 322, - 323, 324, 325, 326, 327, -1, 329, 330, 331, 332, - 333, 334, -1, 336, 337, 338, 339, 340, 341, 342, - 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, -1, 359, 360, -1, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 377, 378, -1, -1, 381, 382, - 383, 384, 385, 386, 387, 388, 389, -1, -1, 392, - 393, 394, 395, -1, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, - -1, 414, 415, -1, 417, -1, 419, 420, 421, 422, - 423, -1, 425, 426, 427, -1, -1, 430, 431, 432, - 433, 434, -1, 436, 437, 438, 439, 440, 441, 442, - 443, -1, -1, 446, 447, 448, -1, 450, 451, 452, - 453, -1, 455, 456, 457, 458, 459, 460, 461, -1, - 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, - -1, 474, -1, -1, 477, 478, 479, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, + -1, -1, 517, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, + 47, 48, -1, 50, 51, 52, 53, 54, -1, 56, + 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, -1, -1, 83, 84, 85, 86, + 87, 88, -1, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, -1, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, -1, -1, -1, 174, 175, 176, + -1, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, -1, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, -1, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, -1, -1, 224, -1, 226, + 227, 228, 229, 230, 231, -1, -1, 234, -1, 236, + -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, -1, 270, 271, 272, 273, 274, -1, 276, + 277, -1, 279, -1, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, -1, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, -1, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, -1, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, -1, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, -1, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + -1, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 514, -1, -1, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 43, 44, -1, 46, 47, - 48, -1, 50, 51, 52, 53, 54, -1, 56, 57, - -1, 59, 60, 61, 62, 63, 64, -1, -1, 67, - 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, - 78, 79, -1, -1, -1, 83, 84, 85, 86, 87, - 88, -1, 90, 91, 92, -1, 94, 95, 96, 97, - 98, 99, -1, -1, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, - 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, - 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, - 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, -1, 160, -1, 162, 163, 164, 165, -1, 167, - -1, 169, -1, -1, -1, 173, 174, 175, -1, 177, - -1, 179, -1, 181, 182, 183, 184, -1, 186, 187, - 188, 189, 190, 191, 192, -1, 194, 195, 196, 197, - -1, 199, 200, 201, 202, 203, 204, 205, -1, 207, - -1, 209, 210, 211, 212, 213, 214, 215, 216, -1, - 218, -1, 220, -1, -1, 223, -1, 225, 226, 227, - 228, 229, 230, -1, -1, 233, -1, 235, -1, -1, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - -1, 269, 270, 271, 272, 273, -1, 275, 276, -1, - 278, -1, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, 291, 292, 293, -1, -1, 296, 297, - 298, -1, 300, -1, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, -1, -1, -1, -1, - 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, - -1, 329, 330, 331, 332, 333, 334, -1, 336, 337, - 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - -1, 359, 360, -1, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, -1, -1, 381, 382, 383, 384, 385, 386, 387, - 388, 389, -1, -1, 392, 393, 394, 395, -1, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, -1, -1, 414, 415, -1, 417, - -1, 419, 420, 421, 422, 423, -1, 425, 426, 427, - -1, -1, 430, 431, 432, 433, 434, -1, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, 447, - 448, -1, 450, 451, 452, 453, -1, 455, 456, 457, - 458, 459, 460, 461, -1, 463, -1, 465, 466, 467, - 468, 469, 470, 471, -1, -1, 474, -1, -1, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 517, -1, -1, 22, 23, 24, 25, 26, 27, 28, + 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, + -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, + 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, + 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, + 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, + -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, + 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, + -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, + 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, + -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, -1, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, -1, -1, -1, 174, 175, 176, -1, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, -1, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + -1, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, -1, -1, 224, -1, 226, 227, 228, + 229, 230, 231, -1, -1, 234, -1, 236, -1, -1, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + -1, 270, 271, 272, 273, 274, -1, 276, 277, -1, + 279, -1, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, -1, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, -1, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, -1, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, -1, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, -1, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 517, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, + 51, 52, 53, 54, -1, 56, 57, -1, 59, 60, + 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + -1, -1, 83, 84, 85, 86, 87, 88, -1, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, -1, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + -1, -1, -1, 174, 175, 176, -1, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, -1, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, -1, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, -1, -1, 224, -1, 226, 227, 228, 229, 230, + 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, + 271, 272, 273, 274, -1, 276, 277, -1, 279, -1, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, -1, + 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, -1, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, -1, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, -1, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 514, -1, -1, 22, + -1, -1, -1, -1, -1, -1, 517, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, @@ -15414,196 +14206,247 @@ static const yytype_int16 yycheck[] = 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, -1, 160, -1, 162, - 163, 164, 165, -1, 167, -1, 169, -1, -1, -1, - 173, 174, 175, -1, 177, -1, 179, -1, 181, 182, - 183, 184, -1, 186, 187, 188, 189, 190, 191, 192, - -1, 194, 195, 196, 197, -1, 199, 200, 201, 202, - 203, 204, 205, -1, 207, -1, 209, 210, 211, 212, - 213, 214, 215, 216, -1, 218, -1, 220, -1, -1, - 223, -1, 225, 226, 227, 228, 229, 230, -1, -1, - 233, -1, 235, -1, -1, 238, 239, 240, 241, 242, + 153, 154, 155, 156, 157, 158, 159, -1, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, -1, -1, + -1, 174, 175, 176, -1, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, -1, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, -1, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, -1, + -1, 224, -1, 226, 227, 228, 229, 230, 231, -1, + -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, -1, 269, 270, 271, 272, - 273, -1, 275, 276, -1, 278, -1, 280, 281, 282, - 283, 284, 285, -1, 287, 288, -1, -1, 291, 292, - 293, -1, -1, 296, 297, 298, -1, 300, -1, 302, + 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, + 273, 274, -1, 276, 277, -1, 279, -1, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, -1, -1, -1, -1, 318, 319, 320, -1, 322, - 323, 324, 325, 326, 327, -1, 329, 330, 331, 332, - 333, 334, -1, 336, 337, 338, 339, 340, 341, 342, - 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, -1, 359, 360, -1, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 377, 378, -1, -1, 381, 382, - 383, 384, 385, 386, 387, 388, 389, -1, -1, 392, - 393, 394, 395, -1, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, -1, - -1, 414, 415, -1, 417, -1, 419, 420, 421, 422, - 423, -1, 425, 426, 427, -1, -1, 430, 431, 432, - 433, 434, -1, 436, 437, 438, 439, 440, 441, 442, - 443, -1, -1, 446, 447, 448, -1, 450, 451, 452, - 453, -1, 455, 456, 457, 458, 459, 460, 461, -1, - 463, -1, 465, 466, 467, 468, 469, 470, 471, -1, - -1, 474, -1, -1, 477, 478, 479, 480, 481, 482, + 313, 314, -1, -1, -1, -1, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, -1, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, -1, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, -1, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, -1, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 494, 495, 496, 497, 3, -1, -1, -1, -1, + 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 514, -1, -1, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 43, 44, -1, 46, 47, - 48, -1, 50, 51, 52, 53, 54, -1, 56, 57, - -1, 59, 60, 61, 62, 63, 64, -1, -1, 67, - 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, - 78, 79, -1, -1, -1, 83, 84, 85, 86, 87, - 88, -1, 90, 91, 92, -1, 94, 95, 96, 97, - 98, 99, -1, -1, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, - 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, - 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, - 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, -1, 160, -1, 162, 163, 164, 165, -1, 167, - -1, 169, -1, -1, -1, 173, 174, 175, -1, 177, - -1, 179, -1, 181, 182, 183, 184, -1, 186, 187, - 188, 189, 190, 191, 192, -1, 194, 195, 196, 197, - -1, 199, 200, 201, 202, 203, 204, 205, -1, 207, - -1, 209, 210, 211, 212, 213, 214, 215, 216, -1, - 218, -1, 220, -1, -1, 223, -1, 225, 226, 227, - 228, 229, 230, -1, -1, 233, -1, 235, -1, -1, + -1, -1, -1, -1, 517, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, + -1, 46, 47, 48, -1, 50, 51, 52, 53, 54, + -1, 56, 57, -1, 59, 60, 61, 62, 63, 64, + -1, -1, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, -1, -1, 83, 84, + 85, 86, 87, 88, -1, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, -1, -1, -1, 174, + 175, 176, -1, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, -1, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, -1, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, -1, -1, 224, + -1, 226, 227, 228, 229, 230, 231, -1, -1, 234, + -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, + -1, 276, 277, -1, 279, -1, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, -1, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, -1, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, -1, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, -1, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, -1, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 517, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, + 47, 48, -1, 50, 51, 52, 53, 54, -1, 56, + 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, -1, -1, 83, 84, 85, 86, + 87, 88, -1, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, -1, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, -1, -1, -1, 174, 175, 176, + -1, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, -1, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, -1, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, -1, -1, 224, -1, 226, + 227, 228, 229, 230, 231, -1, -1, 234, -1, 236, + -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, -1, 270, 271, 272, 273, 274, -1, 276, + 277, -1, 279, -1, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, -1, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, -1, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, -1, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, -1, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, -1, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + -1, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, -1, 3, 4, 5, -1, -1, + 8, 9, -1, -1, -1, -1, -1, 15, 16, -1, + 517, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, -1, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, -1, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, -1, 153, 154, 155, 156, 157, + 158, -1, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, -1, -1, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, -1, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - -1, 269, 270, 271, 272, 273, -1, 275, 276, -1, - 278, -1, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, 291, 292, 293, -1, -1, 296, 297, - 298, -1, 300, -1, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, -1, -1, -1, -1, - 318, 319, 320, -1, 322, 323, 324, 325, 326, 327, - -1, 329, 330, 331, 332, 333, 334, -1, 336, 337, - 338, 339, 340, 341, 342, 343, -1, 345, 346, 347, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, -1, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, -1, 300, 301, 302, -1, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, -1, 322, 323, 324, -1, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - -1, 359, 360, -1, 362, 363, 364, 365, 366, 367, + 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, -1, -1, 381, 382, 383, 384, 385, 386, 387, - 388, 389, -1, -1, 392, 393, 394, 395, -1, 397, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, -1, -1, 414, 415, -1, 417, - -1, 419, 420, 421, 422, 423, -1, 425, 426, 427, - -1, -1, 430, 431, 432, 433, 434, -1, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, 447, - 448, -1, 450, 451, 452, 453, -1, 455, 456, 457, - 458, 459, 460, 461, -1, 463, -1, 465, 466, 467, - 468, 469, 470, 471, -1, -1, 474, -1, -1, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, - 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - -1, 3, 4, 5, -1, -1, 8, 9, -1, -1, - -1, -1, -1, 15, 16, -1, 514, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, -1, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, -1, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - -1, 153, 154, 155, 156, 157, -1, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, -1, - -1, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, -1, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, -1, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, -1, 299, 300, 301, - -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, -1, 321, - 322, 323, -1, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, - 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, -1, - 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - -1, 433, -1, 435, 436, 437, 438, 439, 440, 441, - 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, -1, 461, - 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 494, 495, 496, 497, -1, 3, -1, 501, - 502, 503, 8, 505, 506, 507, 508, 509, 510, 15, - 16, -1, -1, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, - 46, 47, 48, -1, 50, 51, 52, 53, 54, -1, - 56, 57, -1, 59, 60, 61, 62, 63, 64, -1, - -1, 67, 68, 69, 70, 71, 72, 73, -1, 75, - 76, 77, 78, 79, -1, -1, -1, 83, 84, 85, - 86, 87, 88, -1, 90, 91, 92, -1, 94, 95, - 96, 97, 98, 99, -1, -1, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, -1, 118, -1, 120, 121, 122, 123, 124, 125, - -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, - 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, - 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, -1, 160, -1, 162, 163, 164, 165, - -1, 167, -1, 169, -1, -1, -1, 173, 174, 175, - -1, 177, -1, 179, -1, 181, 182, 183, 184, -1, - 186, 187, 188, 189, 190, 191, 192, -1, 194, 195, - 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, - -1, 207, -1, 209, 210, 211, 212, 213, 214, 215, - 216, -1, 218, -1, 220, -1, -1, 223, -1, 225, - 226, 227, 228, 229, 230, -1, -1, 233, -1, 235, - -1, -1, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, -1, 269, 270, 271, 272, 273, -1, 275, - 276, -1, 278, -1, 280, 281, 282, 283, 284, 285, - -1, 287, 288, -1, -1, 291, 292, 293, -1, -1, - 296, 297, 298, -1, 300, -1, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, -1, -1, - -1, -1, 318, 319, 320, -1, 322, 323, 324, 325, - 326, 327, -1, 329, 330, 331, 332, 333, 334, -1, - 336, 337, 338, 339, 340, 341, 342, 343, -1, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, -1, 359, 360, -1, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, -1, -1, 381, 382, 383, 384, 385, - 386, 387, 388, 389, -1, -1, 392, 393, 394, 395, - -1, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, -1, -1, 414, 415, - -1, 417, -1, 419, 420, 421, 422, 423, -1, 425, - 426, 427, -1, -1, 430, 431, 432, 433, 434, -1, - 436, 437, 438, 439, 440, 441, 442, 443, -1, -1, - 446, 447, 448, -1, 450, 451, 452, 453, -1, 455, - 456, 457, 458, 459, 460, 461, -1, 463, -1, 465, - 466, 467, 468, 469, 470, 471, -1, -1, 474, -1, - -1, 477, 478, 479, 480, 481, 482, 483, 484, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, - 496, 497, -1, -1, -1, 501, 502, 503, -1, 505, - 506, 507, 508, 509, 510, 8, -1, -1, 11, -1, - -1, -1, 15, 16, 17, 18, 19, 20, 21, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 46, 8, -1, -1, 11, -1, -1, - 53, 15, 16, 17, 18, 19, 20, 21, -1, -1, + 408, 409, 410, 411, 412, 413, -1, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 430, 431, 432, 433, 434, -1, 436, -1, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, -1, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 497, + 498, 499, 500, -1, 3, -1, 504, 505, 506, 8, + 508, 509, 510, 511, 512, 513, 15, 16, -1, -1, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, + -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, + 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, + 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, + 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, + -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, + 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, + -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, + 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, + -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, -1, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, -1, -1, -1, 174, 175, 176, -1, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, -1, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + -1, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, -1, -1, 224, -1, 226, 227, 228, + 229, 230, 231, -1, -1, 234, -1, 236, -1, -1, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + -1, 270, 271, 272, 273, 274, -1, 276, 277, -1, + 279, -1, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, -1, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, -1, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, -1, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, -1, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, -1, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, -1, -1, -1, 504, 505, 506, -1, 508, + 509, 510, 511, 512, 513, 8, -1, -1, 11, -1, + -1, -1, 15, 16, 17, 18, 19, 20, 21, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 46, 8, -1, -1, 11, -1, -1, + 53, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, 80, -1, -1, -1, -1, 46, 8, -1, -1, 11, -1, -1, 53, @@ -15615,132 +14458,131 @@ static const yytype_int16 yycheck[] = 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, 8, - -1, -1, 11, 176, -1, 53, 15, 16, 17, 18, + -1, -1, 11, -1, 177, 53, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, - 193, -1, -1, -1, -1, 198, -1, 36, -1, -1, + -1, 194, -1, -1, -1, -1, 199, 36, -1, -1, -1, -1, 80, -1, -1, -1, -1, 46, -1, -1, - -1, -1, 176, -1, 53, -1, -1, -1, 221, 222, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 193, - -1, -1, -1, 236, 198, -1, -1, -1, -1, -1, + -1, -1, -1, 177, 53, -1, -1, -1, -1, 222, + 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 194, -1, -1, -1, 237, 199, -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 176, -1, -1, -1, -1, -1, 221, 222, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 193, -1, - -1, 274, 236, 198, 277, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 291, -1, - -1, 294, -1, -1, -1, -1, 221, 222, 176, -1, + -1, -1, 177, -1, -1, -1, -1, -1, 222, 223, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 194, + -1, -1, 275, 237, 199, 278, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 292, + -1, -1, 295, -1, -1, -1, -1, 222, 223, 177, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 275, 237, -1, 278, -1, 194, -1, -1, -1, + -1, 199, -1, -1, -1, -1, -1, -1, 292, -1, + -1, 295, -1, -1, -1, -1, -1, -1, 177, -1, + -1, -1, -1, -1, 222, 223, -1, -1, -1, -1, + 275, -1, -1, 278, -1, 194, -1, -1, -1, 237, + 199, -1, -1, -1, -1, -1, -1, 292, -1, -1, + 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 222, 223, -1, -1, -1, -1, -1, + -1, 394, -1, -1, -1, -1, -1, 275, 237, -1, + 278, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 292, -1, -1, 295, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 394, -1, -1, -1, -1, -1, 275, -1, -1, 278, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 292, -1, -1, 295, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 394, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 501, -1, + -1, 504, 505, 506, -1, 508, 509, 510, 511, 512, + 513, -1, -1, -1, -1, 518, 394, -1, -1, -1, + -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, + 16, 17, 18, 19, 20, 21, -1, 501, -1, -1, + 504, 505, 506, -1, 508, 509, 510, 511, 512, 513, + 36, -1, -1, -1, 518, 394, -1, -1, -1, -1, + 46, -1, -1, -1, -1, -1, -1, 53, -1, -1, + -1, -1, -1, -1, -1, -1, 501, -1, -1, 504, + 505, 506, -1, 508, 509, 510, 511, 512, 513, -1, + -1, -1, -1, 518, 80, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, + -1, 11, -1, -1, -1, 15, 16, 17, 18, 19, + 20, 21, -1, 501, -1, -1, 504, 505, 506, -1, + 508, 509, 510, 511, 512, 513, 36, -1, -1, -1, + 518, -1, -1, -1, -1, -1, 46, 8, -1, -1, + 11, -1, -1, 53, 15, 16, 17, 18, 19, 20, + 21, -1, 501, -1, -1, 504, 505, 506, -1, 508, + 509, 510, 511, 512, 513, 36, -1, -1, -1, 518, + 80, -1, -1, -1, -1, 46, 8, -1, -1, 11, + -1, 177, 53, 15, 16, 17, 18, 19, 20, 21, + -1, -1, -1, -1, -1, -1, -1, -1, 194, -1, + -1, -1, -1, 199, 36, -1, -1, -1, -1, 80, + -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, + -1, 53, -1, -1, -1, -1, 222, 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 274, 236, -1, 277, -1, 193, -1, -1, -1, -1, - 198, -1, -1, -1, -1, -1, -1, 291, -1, -1, - 294, -1, -1, -1, -1, -1, -1, 176, -1, -1, - -1, -1, -1, 221, 222, -1, -1, -1, -1, 274, - -1, -1, 277, -1, 193, -1, -1, -1, 236, 198, - -1, -1, -1, -1, -1, -1, 291, -1, -1, 294, + -1, 237, -1, -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 221, 222, -1, -1, -1, -1, 391, -1, - -1, -1, -1, -1, -1, -1, 274, 236, -1, 277, + -1, -1, 8, -1, -1, 11, -1, 177, -1, 15, + 16, 17, 18, 19, 20, 21, -1, -1, -1, 275, + -1, -1, 278, -1, 194, -1, -1, -1, -1, 199, + 36, -1, -1, -1, -1, -1, 292, -1, -1, 295, + 46, -1, -1, -1, -1, -1, 177, 53, -1, -1, + -1, -1, 222, 223, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 194, -1, -1, -1, 237, 199, -1, + -1, -1, -1, -1, 80, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 177, -1, -1, -1, -1, + -1, 222, 223, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 194, -1, -1, 275, 237, 199, 278, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 292, -1, -1, 295, -1, -1, -1, -1, + 222, 223, -1, -1, -1, -1, -1, -1, 394, -1, + -1, -1, -1, -1, 275, 237, -1, 278, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 291, -1, -1, 294, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 391, -1, -1, - -1, -1, -1, -1, -1, 274, -1, -1, 277, -1, + -1, 292, -1, -1, 295, -1, -1, -1, -1, -1, + -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 275, -1, -1, 278, -1, 194, -1, + -1, -1, -1, 199, -1, -1, -1, -1, -1, -1, + 292, -1, -1, 295, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 222, 223, -1, -1, + -1, -1, -1, -1, 394, -1, -1, -1, -1, -1, + -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 501, -1, -1, 504, 505, + 506, -1, 508, 509, 510, 511, 512, 513, -1, -1, + -1, -1, 518, 394, -1, -1, -1, -1, -1, 275, + -1, -1, 278, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 292, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 291, -1, -1, 294, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 391, -1, -1, -1, + -1, -1, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 498, -1, -1, 501, 502, - 503, -1, 505, 506, 507, 508, 509, 510, -1, -1, - -1, -1, 515, 391, -1, -1, -1, -1, -1, 8, - -1, -1, 11, -1, -1, -1, 15, 16, 17, 18, - 19, 20, 21, -1, 498, -1, -1, 501, 502, 503, - -1, 505, 506, 507, 508, 509, 510, 36, -1, -1, - -1, 515, 391, -1, -1, -1, -1, 46, -1, -1, - -1, -1, -1, -1, 53, -1, -1, -1, -1, -1, - -1, -1, -1, 498, -1, -1, 501, 502, 503, -1, - 505, 506, 507, 508, 509, 510, -1, -1, -1, -1, - 515, 80, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 501, -1, -1, 504, 505, 506, -1, 508, 509, + 510, 511, 512, 513, -1, -1, -1, -1, 518, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, 18, 19, 20, 21, -1, - 498, -1, -1, 501, 502, 503, -1, 505, 506, 507, - 508, 509, 510, 36, -1, -1, -1, 515, -1, -1, - -1, -1, -1, 46, 8, -1, -1, 11, -1, -1, - 53, 15, 16, 17, 18, 19, 20, 21, -1, 498, - -1, -1, 501, 502, 503, -1, 505, 506, 507, 508, - 509, 510, 36, -1, -1, -1, 515, 80, -1, -1, - -1, -1, 46, 8, -1, -1, 11, 176, -1, 53, - 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, - -1, -1, -1, -1, 193, -1, -1, -1, -1, 198, - -1, 36, -1, -1, -1, -1, 80, -1, -1, -1, - -1, 46, -1, -1, -1, -1, -1, -1, 53, -1, - -1, -1, 221, 222, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, - -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, - -1, -1, 11, 176, -1, -1, 15, 16, 17, 18, - 19, 20, 21, -1, -1, 274, -1, -1, 277, -1, - 193, -1, -1, -1, -1, 198, -1, 36, -1, -1, - -1, -1, 291, -1, -1, 294, -1, 46, -1, -1, - -1, -1, 176, -1, 53, -1, -1, -1, 221, 222, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 193, - -1, -1, -1, 236, 198, -1, -1, -1, -1, -1, - -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 176, -1, -1, -1, -1, -1, 221, 222, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 193, -1, - -1, 274, 236, 198, 277, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 291, -1, - -1, 294, -1, -1, -1, -1, 221, 222, -1, -1, - -1, -1, 391, -1, -1, -1, -1, -1, -1, -1, - 274, 236, -1, 277, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 291, -1, -1, - 294, -1, -1, -1, -1, -1, -1, 176, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 274, - -1, -1, 277, -1, 193, -1, -1, -1, -1, 198, - -1, -1, -1, -1, -1, -1, 291, -1, -1, 294, + 501, -1, -1, 504, 505, 506, -1, 508, 509, 510, + 511, 512, 513, 36, -1, 516, -1, -1, 394, -1, + -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, + 53, -1, -1, -1, -1, -1, -1, -1, -1, 501, + -1, -1, 504, 505, 506, -1, 508, 509, 510, 511, + 512, 513, -1, -1, 516, -1, -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 221, 222, -1, -1, -1, -1, 391, -1, - -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 498, - -1, -1, 501, 502, 503, -1, 505, 506, 507, 508, - 509, 510, -1, -1, -1, -1, 515, 391, -1, -1, - -1, -1, -1, -1, -1, 274, -1, 8, 277, -1, - 11, -1, -1, -1, 15, 16, 17, 18, 19, 20, - 21, -1, 291, -1, -1, 294, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 36, 391, -1, -1, -1, - -1, -1, -1, -1, -1, 46, -1, -1, -1, -1, - -1, -1, 53, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 498, -1, -1, 501, 502, - 503, -1, 505, 506, 507, 508, 509, 510, -1, 80, - -1, -1, 515, -1, -1, -1, -1, -1, -1, 8, - -1, -1, 11, -1, -1, -1, 15, 16, 17, 18, - 19, 20, 21, -1, 498, -1, -1, 501, 502, 503, - -1, 505, 506, 507, 508, 509, 510, 36, -1, -1, - -1, 515, 391, -1, -1, -1, -1, 46, -1, -1, - -1, -1, -1, -1, 53, -1, -1, -1, -1, -1, - -1, -1, -1, 498, -1, -1, 501, 502, 503, -1, - 505, 506, 507, 508, 509, 510, -1, -1, 513, -1, - -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 176, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 193, -1, -1, -1, -1, 198, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 221, 222, -1, -1, -1, -1, -1, -1, -1, 498, - -1, -1, 501, 502, 503, 236, 505, 506, 507, 508, - 509, 510, -1, -1, 513, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 176, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 274, 193, -1, 277, -1, -1, 198, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 291, -1, -1, 294, -1, -1, -1, -1, -1, -1, - -1, -1, 221, 222, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, + -1, -1, -1, -1, -1, 501, -1, -1, 504, 505, + 506, -1, 508, 509, 510, 511, 512, 513, -1, -1, + 516, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 194, -1, -1, -1, -1, 199, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 222, + 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 274, -1, -1, 277, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 291, -1, -1, 294, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 391, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 275, -1, -1, 278, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 292, + -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -15748,68 +14590,120 @@ static const yytype_int16 yycheck[] = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 391, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 498, -1, -1, - 501, 502, 503, -1, 505, 506, 507, 508, 509, 510, - -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 3, -1, -1, 498, - -1, -1, 501, 502, 503, -1, 505, 506, 507, 508, - 509, 510, -1, -1, 513, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, - 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, - 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 3, -1, -1, -1, -1, -1, -1, -1, -1, - 507, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 3, -1, -1, 501, -1, + -1, 504, 505, 506, -1, 508, 509, 510, 511, 512, + 513, -1, -1, 516, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, + 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, + -1, -1, 510, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, + -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 43, 44, -1, 46, 47, 48, -1, + 50, 51, 52, 53, 54, -1, 56, 57, -1, 59, + 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, + 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, + -1, -1, -1, 83, 84, 85, 86, 87, 88, -1, + 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, + -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, + 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, + 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, + 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + -1, 161, -1, 163, 164, 165, 166, -1, 168, -1, + 170, -1, -1, -1, 174, 175, 176, -1, 178, -1, + 180, -1, 182, 183, 184, 185, -1, 187, 188, 189, + 190, 191, 192, 193, -1, 195, 196, 197, 198, -1, + 200, 201, 202, 203, 204, 205, 206, -1, 208, -1, + 210, 211, 212, 213, 214, 215, 216, 217, -1, 219, + -1, 221, -1, -1, 224, -1, 226, 227, 228, 229, + 230, 231, -1, -1, 234, -1, 236, -1, -1, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, + 270, 271, 272, 273, 274, -1, 276, 277, -1, 279, + -1, 281, 282, 283, 284, 285, 286, -1, 288, 289, + -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, + -1, 301, -1, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, -1, -1, -1, -1, 319, + 320, 321, -1, 323, 324, 325, 326, 327, 328, -1, + 330, 331, 332, 333, 334, 335, -1, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, -1, 362, 363, -1, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, -1, -1, 384, 385, 386, 387, 388, 389, + 390, 391, 392, -1, -1, 395, 396, 397, 398, -1, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, -1, -1, 417, 418, -1, + 420, -1, 422, 423, 424, 425, 426, -1, 428, 429, + 430, -1, -1, 433, 434, 435, 436, 437, -1, 439, + 440, 441, 442, 443, 444, 445, 446, -1, -1, 449, + 450, 451, -1, 453, 454, 455, 456, -1, 458, 459, + 460, 461, 462, 463, 464, -1, 466, -1, 468, 469, + 470, 471, 472, 473, 474, -1, -1, 477, -1, -1, + 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, + 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, + 510, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, 51, @@ -15823,504 +14717,448 @@ static const yytype_int16 yycheck[] = 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, -1, 160, -1, - 162, 163, 164, 165, -1, 167, -1, 169, -1, -1, - -1, 173, 174, 175, -1, 177, -1, 179, -1, 181, - 182, 183, 184, -1, 186, 187, 188, 189, 190, 191, - 192, -1, 194, 195, 196, 197, -1, 199, 200, 201, - 202, 203, 204, 205, -1, 207, -1, 209, 210, 211, - 212, 213, 214, 215, 216, -1, 218, -1, 220, -1, - -1, 223, -1, 225, 226, 227, 228, 229, 230, -1, - -1, 233, -1, 235, -1, -1, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, -1, 269, 270, 271, - 272, 273, -1, 275, 276, -1, 278, -1, 280, 281, - 282, 283, 284, 285, -1, 287, 288, -1, -1, 291, - 292, 293, -1, -1, 296, 297, 298, -1, 300, -1, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, -1, -1, -1, -1, 318, 319, 320, -1, - 322, 323, 324, 325, 326, 327, -1, 329, 330, 331, - 332, 333, 334, -1, 336, 337, 338, 339, 340, 341, - 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, -1, 359, 360, -1, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, -1, -1, 381, - 382, 383, 384, 385, 386, 387, 388, 389, -1, -1, - 392, 393, 394, 395, -1, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - -1, -1, 414, 415, -1, 417, -1, 419, 420, 421, - 422, 423, -1, 425, 426, 427, -1, -1, 430, 431, - 432, 433, 434, -1, 436, 437, 438, 439, 440, 441, - 442, 443, -1, -1, 446, 447, 448, -1, 450, 451, - 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, - -1, 463, -1, 465, 466, 467, 468, 469, 470, 471, - -1, -1, 474, -1, -1, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 3, -1, -1, -1, - -1, -1, -1, -1, -1, 507, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, - 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, - 47, 48, -1, 50, 51, 52, 53, 54, -1, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, - 77, 78, 79, -1, -1, -1, 83, 84, 85, 86, - 87, 88, -1, 90, 91, 92, -1, 94, 95, 96, - 97, 98, 99, -1, -1, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, - -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, - 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, - -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, -1, 160, -1, 162, 163, 164, 165, -1, - 167, -1, 169, -1, -1, -1, 173, 174, 175, -1, - 177, -1, 179, -1, 181, 182, 183, 184, -1, 186, - 187, 188, 189, 190, 191, 192, -1, 194, 195, 196, - 197, -1, 199, 200, 201, 202, 203, 204, 205, -1, - 207, -1, 209, 210, 211, 212, 213, 214, 215, 216, - -1, 218, -1, 220, -1, -1, 223, -1, 225, 226, - 227, 228, 229, 230, -1, -1, 233, -1, 235, -1, - -1, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, -1, 269, 270, 271, 272, 273, -1, 275, 276, - -1, 278, -1, 280, 281, 282, 283, 284, 285, -1, - 287, 288, -1, -1, 291, 292, 293, -1, -1, 296, - 297, 298, -1, 300, -1, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, -1, -1, -1, - -1, 318, 319, 320, -1, 322, 323, 324, 325, 326, - 327, -1, 329, 330, 331, 332, 333, 334, -1, 336, - 337, 338, 339, 340, 341, 342, 343, -1, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, -1, 359, 360, -1, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, -1, -1, 381, 382, 383, 384, 385, 386, - 387, 388, 389, -1, -1, 392, 393, 394, 395, -1, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, -1, -1, 414, 415, -1, - 417, -1, 419, 420, 421, 422, 423, -1, 425, 426, - 427, -1, -1, 430, 431, 432, 433, 434, -1, 436, - 437, 438, 439, 440, 441, 442, 443, -1, -1, 446, - 447, 448, -1, 450, 451, 452, 453, -1, 455, 456, - 457, 458, 459, 460, 461, -1, 463, -1, 465, 466, - 467, 468, 469, 470, 471, -1, -1, 474, -1, -1, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 3, 4, 5, -1, -1, -1, 9, -1, -1, - 507, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, - 32, 33, -1, -1, -1, 37, -1, -1, -1, -1, - 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 60, 61, - 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, - 72, 73, -1, 75, 76, 77, 78, 79, -1, 81, - -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, -1, 94, 95, 96, 97, 98, 99, -1, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, -1, 118, -1, 120, 121, - 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, - -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, - 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, -1, - 162, 163, 164, 165, -1, 167, -1, 169, 170, -1, - 172, 173, 174, 175, 176, 177, -1, 179, -1, 181, - 182, 183, 184, -1, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, - 202, 203, 204, 205, -1, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, -1, 218, -1, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, -1, - -1, 233, 234, 235, 236, -1, 238, 239, 240, 241, + 152, 153, 154, 155, 156, 157, 158, 159, -1, 161, + -1, 163, 164, 165, 166, -1, 168, -1, 170, -1, + -1, -1, 174, 175, 176, -1, 178, -1, 180, -1, + 182, 183, 184, 185, -1, 187, 188, 189, 190, 191, + 192, 193, -1, 195, 196, 197, 198, -1, 200, 201, + 202, 203, 204, 205, 206, -1, 208, -1, 210, 211, + 212, 213, 214, 215, 216, 217, -1, 219, -1, 221, + -1, -1, 224, -1, 226, 227, 228, 229, 230, 231, + -1, -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, -1, 275, 276, 277, 278, -1, 280, 281, - 282, 283, 284, 285, -1, 287, 288, 289, -1, 291, - 292, 293, -1, -1, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, -1, -1, -1, -1, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, -1, 329, 330, 331, - 332, 333, 334, -1, 336, 337, 338, 339, 340, 341, - 342, 343, -1, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, -1, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, -1, 380, 381, - 382, 383, 384, 385, 386, 387, 388, 389, -1, 391, - 392, 393, 394, 395, -1, 397, 398, 399, 400, 401, + 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, + 272, 273, 274, -1, 276, 277, -1, 279, -1, 281, + 282, 283, 284, 285, 286, -1, 288, 289, -1, -1, + 292, 293, 294, -1, -1, 297, 298, 299, -1, 301, + -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, -1, -1, -1, -1, 319, 320, 321, + -1, 323, 324, 325, 326, 327, 328, -1, 330, 331, + 332, 333, 334, 335, -1, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, + 362, 363, -1, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + -1, -1, 384, 385, 386, 387, 388, 389, 390, 391, + 392, -1, -1, 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - -1, -1, 414, 415, -1, 417, 418, 419, 420, 421, - 422, 423, -1, 425, 426, 427, -1, -1, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, -1, -1, 446, 447, 448, -1, 450, 451, - 452, 453, -1, 455, 456, 457, 458, 459, 460, 461, - -1, 463, 464, 465, 466, 467, 468, 469, 470, 471, - -1, -1, 474, -1, -1, 477, 478, 479, 480, 481, + 412, 413, 414, -1, -1, 417, 418, -1, 420, -1, + 422, 423, 424, 425, 426, -1, 428, 429, 430, -1, + -1, 433, 434, 435, 436, 437, -1, 439, 440, 441, + 442, 443, 444, 445, 446, -1, -1, 449, 450, 451, + -1, 453, 454, 455, 456, -1, 458, 459, 460, 461, + 462, 463, 464, -1, 466, -1, 468, 469, 470, 471, + 472, 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, -1, -1, 8, -1, - -1, 11, -1, 505, 506, 15, 16, 17, 18, 19, + 492, 493, 494, 495, 496, 497, 498, 499, 500, 3, + 4, 5, -1, -1, -1, 9, -1, -1, 510, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, + 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, + -1, -1, -1, 37, -1, -1, -1, -1, 42, 43, + 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, + 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, + -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, + 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, + 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, + 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, + 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, + 164, 165, 166, -1, 168, -1, 170, 171, -1, 173, + 174, 175, 176, 177, 178, -1, 180, -1, 182, 183, + 184, 185, -1, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, -1, 200, 201, 202, 203, + 204, 205, 206, -1, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, -1, 219, -1, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, -1, -1, + 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, -1, 276, 277, 278, 279, -1, 281, 282, 283, + 284, 285, 286, -1, 288, 289, 290, -1, 292, 293, + 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, -1, -1, -1, -1, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, -1, 330, 331, 332, 333, + 334, 335, -1, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, -1, 383, + 384, 385, 386, 387, 388, 389, 390, 391, 392, -1, + 394, 395, 396, 397, 398, -1, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, -1, -1, 417, 418, -1, 420, 421, 422, 423, + 424, 425, 426, -1, 428, 429, 430, -1, -1, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, -1, -1, 449, 450, 451, -1, 453, + 454, 455, 456, -1, 458, 459, 460, 461, 462, 463, + 464, -1, 466, 467, 468, 469, 470, 471, 472, 473, + 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, + 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, -1, -1, 8, + -1, -1, 11, -1, 508, 509, 15, 16, 17, 18, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 46, 8, -1, + -1, 11, -1, -1, 53, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, - -1, 41, -1, -1, -1, -1, 46, 8, -1, -1, + -1, 80, -1, -1, -1, -1, 46, 8, -1, -1, 11, -1, -1, 53, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, - 80, -1, -1, -1, -1, 46, 8, -1, -1, 11, - -1, -1, 53, 15, 16, 17, 18, 19, 20, 21, + -1, -1, -1, -1, -1, 36, -1, -1, -1, 40, + 80, -1, -1, -1, -1, 46, -1, -1, -1, -1, + -1, -1, 53, -1, -1, -1, 8, -1, -1, 11, + -1, -1, -1, 15, 16, 17, 18, 19, 20, 21, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, + -1, -1, -1, -1, 36, -1, -1, -1, 167, -1, + -1, -1, -1, 172, 46, -1, -1, -1, 177, -1, + -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 194, -1, -1, -1, -1, + 199, -1, -1, -1, -1, -1, 166, -1, 80, -1, + -1, -1, -1, -1, -1, -1, -1, 177, -1, -1, + -1, -1, -1, 222, 223, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 194, -1, -1, -1, 237, 199, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 36, -1, -1, -1, -1, 80, - -1, -1, -1, -1, 46, -1, 126, -1, -1, -1, - -1, 53, -1, -1, 8, -1, -1, 11, -1, -1, - -1, 15, 16, 17, 18, 19, 20, 21, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 80, -1, - -1, -1, 36, -1, -1, -1, 40, -1, -1, -1, - -1, -1, 46, -1, 8, -1, 176, 11, -1, 53, - -1, 15, 16, 17, 18, 19, 20, 21, -1, -1, - -1, -1, -1, 193, -1, -1, -1, -1, 198, -1, - -1, -1, 36, -1, -1, 166, 80, -1, -1, -1, - 171, -1, 46, -1, -1, 176, -1, -1, -1, 53, - -1, 221, 222, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 193, -1, -1, -1, 236, 198, -1, -1, - -1, -1, -1, 165, -1, -1, 80, -1, -1, -1, - -1, -1, -1, -1, 176, -1, -1, -1, -1, -1, - 221, 222, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 193, -1, -1, 274, 236, 198, 277, -1, -1, + -1, -1, -1, -1, -1, -1, 177, -1, -1, -1, + -1, -1, 222, 223, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 194, -1, -1, 275, 237, 199, 278, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 291, -1, -1, 294, -1, -1, -1, -1, 221, - 222, -1, 176, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 274, 236, -1, 277, -1, -1, 193, - -1, -1, -1, -1, 198, -1, -1, -1, -1, -1, - 291, -1, -1, 294, -1, -1, -1, -1, -1, -1, - -1, -1, 176, -1, -1, -1, -1, 221, 222, -1, - -1, -1, 274, -1, -1, 277, -1, -1, -1, 193, - -1, -1, 236, -1, 198, -1, -1, -1, -1, 291, - -1, -1, 294, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 221, 222, -1, - -1, 391, -1, -1, -1, -1, -1, -1, -1, -1, - 274, 323, 236, 277, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 291, -1, -1, - 294, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 391, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 274, -1, -1, 277, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 454, -1, -1, 291, -1, -1, - 294, -1, -1, -1, -1, -1, -1, -1, -1, 391, + -1, -1, -1, 292, -1, -1, 295, -1, -1, -1, + -1, 222, 223, -1, -1, 177, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 275, 237, -1, 278, -1, + -1, -1, 194, -1, -1, -1, -1, 199, -1, -1, + -1, -1, 292, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 317, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 498, -1, - -1, 501, 502, 503, -1, 505, 506, 507, 508, 509, - 510, -1, -1, -1, -1, -1, -1, 391, -1, -1, - -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, - 16, 17, 18, 19, 20, 21, -1, 498, -1, -1, - 501, 502, 503, -1, 505, 506, 507, 508, 509, 510, - 36, -1, -1, -1, 40, -1, -1, 391, -1, -1, - 46, -1, -1, -1, -1, -1, -1, 53, -1, -1, - -1, -1, -1, -1, -1, -1, 498, -1, -1, 501, - 502, 503, -1, 505, 506, 507, 508, 509, 510, -1, - -1, -1, -1, -1, 80, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, - -1, -1, 11, -1, -1, -1, 15, 16, 17, 18, - 19, 20, 21, -1, 498, -1, -1, 501, 502, 503, - -1, 505, 506, 507, 508, 509, 510, 36, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 46, -1, -1, - -1, -1, -1, -1, 53, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 498, -1, -1, 501, 502, 503, - -1, 505, 506, 507, 508, 509, 510, -1, -1, -1, - -1, 80, -1, -1, -1, -1, 8, -1, -1, 11, - 176, -1, -1, 15, 16, 17, 18, 19, 20, 21, - -1, -1, -1, -1, -1, -1, -1, 193, -1, -1, - -1, -1, 198, -1, 36, -1, -1, -1, 40, -1, - -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, - -1, 53, -1, -1, -1, 221, 222, -1, -1, -1, + 222, 223, -1, -1, 275, -1, -1, 278, -1, -1, + -1, -1, -1, -1, 324, 237, -1, -1, -1, -1, + -1, 292, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 236, -1, -1, -1, -1, -1, -1, -1, 80, -1, + -1, -1, -1, -1, -1, 394, -1, -1, -1, -1, + -1, -1, -1, 275, -1, -1, 278, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 292, -1, -1, 295, -1, -1, -1, -1, -1, 8, + -1, -1, 11, -1, 394, -1, 15, 16, 17, 18, + 19, 20, 21, -1, -1, -1, 318, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, + -1, 40, -1, -1, -1, -1, -1, 46, -1, -1, + -1, -1, -1, 394, 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 171, 8, -1, -1, 11, 176, -1, -1, - 15, 16, 17, 18, 19, 20, 21, -1, 274, -1, - -1, 277, -1, -1, 193, -1, -1, -1, -1, 198, - -1, 36, -1, -1, -1, 291, -1, -1, 294, -1, - -1, 46, -1, -1, -1, -1, -1, -1, 53, -1, - -1, -1, 221, 222, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 236, -1, -1, - -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, - -1, -1, -1, -1, 176, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 193, -1, -1, -1, 274, 198, -1, 277, -1, + -1, 80, 501, -1, -1, 504, 505, 506, -1, 508, + 509, 510, 511, 512, 513, -1, -1, -1, -1, -1, + -1, -1, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 291, -1, -1, 294, -1, -1, -1, 221, - 222, -1, -1, -1, -1, 391, -1, -1, 8, -1, - -1, 11, -1, -1, 236, 15, 16, 17, 18, 19, + -1, 501, -1, -1, 504, 505, 506, -1, 508, 509, + 510, 511, 512, 513, -1, -1, -1, -1, 8, -1, + -1, 11, -1, -1, -1, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 166, -1, -1, -1, -1, 36, -1, -1, -1, - -1, 176, -1, -1, -1, -1, 46, -1, -1, -1, - -1, -1, 274, 53, -1, 277, -1, -1, 193, -1, - -1, -1, -1, 198, -1, -1, -1, -1, -1, 291, - -1, -1, 294, -1, -1, -1, -1, -1, -1, -1, - 80, -1, -1, -1, -1, -1, 221, 222, -1, -1, - -1, -1, 391, -1, -1, -1, -1, -1, -1, -1, - -1, 236, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 498, -1, -1, 501, 502, 503, -1, 505, - 506, 507, 508, 509, 510, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 274, - -1, -1, 277, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 291, -1, -1, 294, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 391, - -1, -1, -1, -1, -1, -1, 176, -1, -1, -1, + 501, -1, -1, 504, 505, 506, 36, 508, 509, 510, + 511, 512, 513, -1, -1, -1, 46, -1, 177, -1, + -1, -1, -1, 53, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 194, -1, -1, -1, -1, + 199, -1, -1, -1, -1, -1, -1, -1, -1, 501, + 80, -1, 504, 505, 506, -1, 508, 509, 510, 511, + 512, 513, -1, 222, 223, -1, -1, -1, -1, -1, + -1, -1, -1, 8, -1, -1, 11, -1, 237, -1, + 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 193, -1, -1, -1, -1, 198, 498, - -1, -1, 501, 502, 503, -1, 505, 506, 507, 508, - 509, 510, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 221, 222, -1, -1, -1, -1, -1, -1, -1, - 8, -1, -1, 11, -1, -1, 236, 15, 16, 17, - 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 391, -1, 36, -1, - -1, -1, 40, -1, -1, -1, -1, -1, 46, -1, - -1, -1, -1, -1, 274, 53, 498, 277, -1, 501, - 502, 503, -1, 505, 506, 507, 508, 509, 510, -1, - -1, 291, -1, -1, 294, -1, -1, -1, -1, -1, - -1, -1, 80, -1, 8, -1, -1, 11, -1, -1, - -1, 15, 16, 17, 18, 19, 20, 21, -1, -1, + -1, 36, -1, -1, -1, 40, -1, -1, -1, -1, + -1, 46, -1, -1, -1, -1, 275, -1, 53, 278, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 46, -1, -1, -1, -1, -1, -1, 53, + -1, -1, -1, 292, -1, -1, 295, -1, -1, -1, + -1, -1, 172, -1, -1, 80, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 498, -1, -1, 501, 502, 503, -1, - 505, 506, 507, 508, 509, 510, 80, -1, -1, -1, + -1, -1, -1, -1, 194, -1, -1, -1, -1, 199, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 391, -1, 8, -1, -1, 11, -1, 176, -1, - 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, - -1, -1, -1, -1, -1, 193, -1, -1, -1, -1, - 198, 36, -1, -1, 424, -1, -1, -1, -1, -1, - -1, 46, -1, -1, -1, -1, -1, -1, 53, -1, - -1, -1, -1, 221, 222, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 236, -1, - -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, - -1, -1, 176, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 193, - -1, -1, -1, -1, 198, -1, 274, -1, 498, 277, - -1, 501, 502, 503, -1, 505, 506, 507, 508, 509, - 510, -1, -1, 291, -1, -1, 294, 221, 222, -1, - -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, - -1, -1, 236, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, - -1, 176, -1, -1, 46, -1, -1, -1, -1, -1, - 274, 53, -1, 277, -1, -1, -1, -1, 193, -1, - -1, -1, -1, 198, -1, -1, -1, 291, -1, -1, - 294, -1, -1, -1, -1, -1, -1, -1, 80, -1, - -1, -1, -1, -1, -1, -1, 221, 222, -1, -1, - -1, -1, -1, 391, -1, -1, -1, -1, -1, -1, - -1, 236, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, - 16, -1, -1, 19, 20, 21, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 274, - 36, -1, 277, -1, -1, -1, -1, -1, -1, -1, - 46, -1, -1, -1, -1, -1, 291, 53, -1, 294, - -1, -1, -1, -1, -1, -1, -1, 391, -1, -1, - -1, -1, -1, -1, 176, -1, -1, -1, -1, -1, + -1, -1, 222, 223, -1, -1, -1, -1, -1, -1, + -1, -1, 8, -1, -1, 11, -1, 237, -1, 15, + 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 36, -1, -1, -1, -1, 394, -1, -1, -1, -1, + 46, -1, 177, -1, -1, 275, -1, 53, 278, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 194, + -1, -1, 292, -1, 199, 295, -1, -1, -1, -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, -1, - -1, 193, -1, -1, -1, -1, 198, -1, -1, -1, - 498, -1, -1, 501, 502, 503, -1, 505, 506, 507, - 508, 509, 510, -1, -1, 8, -1, -1, 11, 221, - 222, -1, 15, 16, -1, -1, 19, 20, 21, -1, - -1, -1, -1, -1, 236, -1, -1, -1, -1, -1, - -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 46, -1, 8, 391, -1, 11, -1, - 53, -1, 15, 16, -1, -1, 19, 20, 21, -1, - -1, -1, 274, -1, 498, 277, -1, 501, 502, 503, - 176, 505, 506, 507, 508, 509, 510, 80, -1, 291, - -1, -1, 294, 46, -1, -1, -1, 193, -1, -1, - 53, -1, 198, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 222, 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 221, 222, 80, -1, -1, + -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 236, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 498, -1, -1, 501, 502, 503, -1, - 505, 506, 507, 508, 509, 510, -1, -1, 274, -1, - -1, 277, -1, 176, -1, -1, -1, -1, -1, 391, - -1, -1, -1, -1, -1, 291, -1, -1, 294, -1, - 193, -1, -1, -1, -1, 198, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 176, -1, -1, -1, -1, 221, 222, + 275, -1, 501, 278, -1, 504, 505, 506, -1, 508, + 509, 510, 511, 512, 513, -1, -1, 292, -1, -1, + 295, 167, -1, -1, 394, -1, 8, -1, -1, 11, + -1, 177, -1, 15, 16, 17, 18, 19, 20, 21, + -1, -1, -1, -1, -1, -1, -1, -1, 194, -1, + -1, -1, -1, 199, 36, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, + -1, 53, -1, -1, -1, -1, 222, 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 193, -1, -1, 236, -1, 198, -1, -1, -1, -1, + -1, 237, -1, -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 221, 222, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 394, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 275, + -1, 501, 278, -1, 504, 505, 506, -1, 508, 509, + 510, 511, 512, 513, -1, -1, 292, -1, -1, 295, + -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, + -1, -1, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 274, -1, 236, 277, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 391, 498, -1, 291, 501, - 502, 503, -1, 505, 506, 507, 508, 509, 510, -1, + -1, -1, -1, 36, -1, -1, -1, 40, -1, -1, + -1, -1, -1, 46, -1, 177, -1, -1, -1, -1, + 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 194, -1, -1, -1, -1, 199, -1, -1, + -1, -1, -1, -1, -1, -1, 501, 80, -1, 504, + 505, 506, -1, 508, 509, 510, 511, 512, 513, -1, + 222, 223, -1, -1, -1, -1, -1, -1, 394, -1, + 8, -1, -1, 11, -1, 237, -1, 15, 16, 17, + 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 46, -1, + -1, -1, -1, 275, -1, 53, 278, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 274, -1, -1, 277, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 291, -1, + 292, -1, -1, 295, -1, -1, -1, -1, -1, -1, + -1, -1, 80, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 194, -1, -1, -1, -1, 199, -1, -1, -1, + -1, -1, -1, -1, -1, 501, -1, -1, 504, 505, + 506, -1, 508, 509, 510, 511, 512, 513, -1, 222, + 223, -1, -1, -1, -1, -1, -1, -1, -1, 8, + -1, -1, 11, -1, 237, -1, 15, 16, 17, 18, + 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, + -1, -1, 394, -1, -1, -1, -1, 46, -1, 177, + -1, -1, 275, -1, 53, 278, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 194, -1, -1, 292, + -1, 199, 295, -1, -1, 427, -1, -1, -1, -1, + -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 222, 223, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 275, -1, 501, + 278, -1, 504, 505, 506, -1, 508, 509, 510, 511, + 512, 513, -1, -1, 292, -1, -1, 295, -1, -1, + -1, 394, -1, 8, -1, -1, 11, -1, 177, -1, + 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, + -1, -1, -1, -1, -1, 194, -1, -1, -1, -1, + 199, 36, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 46, -1, -1, -1, -1, -1, -1, 53, -1, + -1, -1, -1, 222, 223, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 237, -1, + -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, + -1, -1, -1, 15, 16, -1, 394, 19, 20, 21, + -1, -1, -1, -1, -1, -1, 275, -1, 501, 278, + -1, 504, 505, 506, 36, 508, 509, 510, 511, 512, + 513, -1, -1, 292, 46, -1, 295, -1, -1, -1, + -1, 53, -1, 8, -1, -1, 11, -1, -1, -1, + 15, 16, -1, -1, 19, 20, 21, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 391, -1, - -1, -1, 498, -1, -1, 501, 502, 503, -1, 505, - 506, 507, 508, 509, 510, -1, -1, -1, -1, -1, + -1, 46, 177, -1, -1, -1, -1, -1, 53, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 194, + -1, -1, -1, -1, 199, -1, -1, -1, -1, -1, + -1, -1, -1, 501, -1, 80, 504, 505, 506, -1, + 508, 509, 510, 511, 512, 513, -1, 222, 223, -1, + -1, -1, -1, -1, -1, 394, -1, -1, -1, -1, + -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 391, -1, + -1, -1, -1, -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 275, -1, 194, 278, -1, -1, -1, 199, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 292, -1, -1, + 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 222, 223, 177, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 237, -1, -1, -1, 194, + -1, -1, -1, -1, 199, -1, -1, -1, -1, -1, + -1, -1, 501, -1, -1, 504, 505, 506, -1, 508, + 509, 510, 511, 512, 513, -1, -1, 222, 223, -1, + -1, -1, -1, 275, -1, -1, 278, -1, -1, -1, + -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, + 292, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 278, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 498, -1, -1, 501, 502, - 503, -1, 505, 506, 507, 508, 509, 510, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, - -1, 5, -1, -1, -1, 498, -1, -1, 501, 502, - 503, -1, 505, 506, 507, 508, 509, 510, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, - 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, - 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, + -1, -1, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, - 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, - 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, + -1, -1, -1, -1, -1, -1, 501, -1, -1, 504, + 505, 506, -1, 508, 509, 510, 511, 512, 513, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, - 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, - 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 501, + -1, -1, 504, 505, 506, -1, 508, 509, 510, 511, + 512, 513, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 3, -1, 5, -1, -1, -1, 501, -1, -1, 504, + 505, 506, -1, 508, 509, 510, 511, 512, 513, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, + 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, @@ -16369,162 +15207,213 @@ static const yytype_int16 yycheck[] = 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, - 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, - 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, - 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, 37, -1, - -1, -1, -1, 42, 43, 44, -1, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, -1, 172, 173, 174, 175, 176, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233, 234, 235, 236, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, -1, 275, 276, 277, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - 289, -1, 291, 292, 293, -1, -1, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, + -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, 37, -1, -1, -1, -1, 42, + 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, -1, 59, 60, 61, 62, + 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, 171, -1, + 173, 174, 175, 176, 177, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, -1, + -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, -1, 276, 277, 278, 279, -1, 281, 282, + 283, 284, 285, 286, -1, 288, 289, 290, -1, 292, + 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, 421, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, 467, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - 34, 35, -1, 37, -1, -1, -1, -1, 42, 43, - 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, 170, -1, 172, 173, - 174, 175, 176, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, -1, -1, 233, - 234, 235, 236, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - -1, 275, 276, 277, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, 380, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, 391, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, 418, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - 464, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, 34, + 35, -1, 37, -1, -1, -1, -1, 42, 43, 44, + -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, -1, 59, 60, 61, 62, 63, 64, + -1, -1, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, 171, -1, 173, 174, + 175, 176, 177, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, -1, -1, 234, + 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + -1, 276, 277, 278, 279, -1, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, 394, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, 421, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, -1, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, 467, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, -1, -1, -1, 42, 43, 44, -1, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, -1, 59, 60, 61, 62, 63, 64, -1, 66, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, 171, -1, 173, 174, 175, 176, + 177, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, -1, -1, 234, 235, 236, + 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, -1, 276, + 277, 278, 279, -1, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, 394, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, 421, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, -1, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + 467, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, 66, 67, 68, + 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, @@ -16534,1179 +15423,240 @@ static const yytype_int16 yycheck[] = 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, -1, 172, 173, 174, 175, 176, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233, 234, 235, 236, -1, 238, + 159, -1, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, -1, 173, 174, 175, 176, 177, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, -1, -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, -1, 275, 276, 277, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, + 269, 270, 271, 272, 273, 274, -1, 276, 277, 278, + 279, -1, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, 42, 43, - 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, 81, -1, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, 170, -1, 172, 173, - 174, 175, 176, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, -1, -1, 233, - 234, 235, 236, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - -1, 275, 276, 277, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, 391, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, 418, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - 464, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, -1, -1, 82, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, 168, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, 445, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, 168, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, 236, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, 445, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, 34, 35, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, 290, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, 290, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - 4, -1, -1, -1, -1, 9, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, 416, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, 40, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, + 51, 52, 53, 54, -1, 56, 57, -1, 59, 60, + 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, -1, + -1, 82, 83, 84, 85, 86, 87, 88, -1, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, -1, + 161, -1, 163, 164, 165, 166, -1, 168, 169, 170, + -1, -1, -1, 174, 175, 176, -1, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, -1, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, -1, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, -1, -1, 224, -1, 226, 227, 228, 229, 230, + 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, + 271, 272, 273, 274, -1, 276, 277, -1, 279, -1, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, -1, + 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, -1, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, -1, 439, 440, + 441, 442, 443, 444, 445, 446, -1, 448, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, -1, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, + 53, 54, -1, 56, 57, -1, 59, 60, 61, 62, + 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, -1, -1, -1, + 83, 84, 85, 86, 87, 88, -1, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, -1, -1, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, -1, 161, -1, + 163, 164, 165, 166, -1, 168, 169, 170, -1, -1, + -1, 174, 175, 176, -1, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, -1, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, -1, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, -1, + -1, 224, -1, 226, 227, 228, 229, 230, 231, -1, + -1, 234, -1, 236, 237, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, + 273, 274, -1, 276, 277, -1, 279, -1, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, -1, 301, -1, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, -1, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, -1, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, -1, 439, 440, 441, 442, + 443, 444, 445, 446, -1, 448, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, -1, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, + 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, 34, + 35, -1, -1, -1, -1, -1, -1, -1, 43, 44, + -1, 46, 47, 48, -1, 50, 51, 52, 53, 54, + -1, 56, 57, -1, 59, 60, 61, 62, 63, 64, + -1, -1, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, -1, -1, 83, 84, + 85, 86, 87, 88, -1, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, -1, -1, -1, 174, + 175, 176, -1, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, -1, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, -1, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, -1, -1, 224, + -1, 226, 227, 228, 229, 230, 231, -1, -1, 234, + -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, + -1, 276, 277, -1, 279, -1, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, -1, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, -1, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, -1, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, -1, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, -1, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, + 47, 48, -1, 50, 51, 52, 53, 54, -1, 56, + 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, -1, -1, 83, 84, 85, 86, + 87, 88, -1, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, -1, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, -1, -1, -1, 174, 175, 176, + -1, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, -1, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, -1, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, -1, -1, 224, -1, 226, + 227, 228, 229, 230, 231, -1, -1, 234, -1, 236, + -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, -1, 270, 271, 272, 273, 274, -1, 276, + 277, -1, 279, -1, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, -1, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, -1, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, -1, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, -1, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, -1, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + -1, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, @@ -17722,189 +15672,240 @@ static const yytype_int16 yycheck[] = 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, + 159, -1, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, -1, -1, -1, 174, 175, 176, -1, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, -1, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + -1, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, -1, -1, 224, -1, 226, 227, 228, + 229, 230, 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + -1, 270, 271, 272, 273, 274, -1, 276, 277, -1, + 279, -1, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, 291, 292, 293, 294, -1, -1, 297, 298, + 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, -1, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, -1, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, -1, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, -1, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, - -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, 5, -1, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, + 51, 52, 53, 54, -1, 56, 57, -1, 59, 60, + 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + -1, -1, 83, 84, 85, 86, 87, 88, -1, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, -1, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + -1, -1, -1, 174, 175, 176, -1, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, -1, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, -1, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, -1, -1, 224, -1, 226, 227, 228, 229, 230, + 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, + 271, 272, 273, 274, -1, 276, 277, -1, 279, -1, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + 291, 292, 293, 294, -1, -1, 297, 298, 299, -1, + 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, -1, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, -1, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, -1, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, + 53, 54, -1, 56, 57, -1, 59, 60, 61, 62, + 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, -1, -1, + 83, 84, 85, 86, 87, 88, -1, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, -1, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, -1, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, -1, -1, + -1, 174, 175, 176, -1, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, -1, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, -1, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, -1, + -1, 224, -1, 226, 227, 228, 229, 230, 231, -1, + -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, + 273, 274, -1, 276, 277, -1, 279, -1, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, -1, 301, -1, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, -1, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, -1, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, -1, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, -1, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, + 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, + -1, 46, 47, 48, -1, 50, 51, 52, 53, 54, + -1, 56, 57, -1, 59, 60, 61, 62, 63, 64, + -1, -1, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, -1, -1, 83, 84, + 85, 86, 87, 88, -1, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, -1, -1, -1, 174, + 175, 176, -1, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, -1, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, -1, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, -1, -1, 224, + -1, 226, 227, 228, 229, 230, 231, -1, -1, 234, + -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, + -1, 276, 277, -1, 279, -1, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, 291, 292, 293, 294, + -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, -1, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, -1, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, -1, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, -1, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, -1, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 3, 4, -1, -1, + -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, + 47, 48, -1, 50, 51, 52, 53, 54, -1, 56, + 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, -1, -1, 83, 84, 85, 86, + 87, 88, -1, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, -1, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, -1, -1, -1, 174, 175, 176, + -1, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, -1, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, -1, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, -1, -1, 224, -1, 226, + 227, 228, 229, 230, 231, -1, -1, 234, -1, 236, + -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, -1, 270, 271, 272, 273, 274, -1, 276, + 277, -1, 279, -1, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, -1, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, -1, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, -1, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, -1, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, -1, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + -1, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, @@ -17920,138 +15921,240 @@ static const yytype_int16 yycheck[] = 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, + 159, -1, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, -1, -1, -1, 174, 175, 176, -1, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, -1, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + -1, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, -1, -1, 224, -1, 226, 227, 228, + 229, 230, 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + -1, 270, 271, 272, 273, 274, -1, 276, 277, -1, + 279, -1, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, -1, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, -1, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + 419, 420, -1, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, -1, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, 37, -1, -1, 40, -1, 42, 43, - 44, -1, 46, 47, 48, 49, 50, 51, 52, -1, - 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, -1, -1, 81, -1, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, - 154, 155, 156, 157, -1, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, 170, -1, 172, 173, - 174, 175, 176, 177, -1, 179, -1, -1, -1, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, 208, -1, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, -1, -1, 233, - 234, 235, 236, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, -1, - -1, 275, 276, 277, 278, -1, -1, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, -1, 299, 300, 301, -1, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, -1, 321, 322, 323, - -1, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, 380, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, 391, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, -1, -1, -1, - 414, 415, -1, 417, 418, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, -1, 433, - -1, -1, 436, 437, 438, 439, 440, 441, 442, 443, - 444, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, -1, 461, -1, 463, - 464, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 3, - -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, - 494, 495, 496, 497, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, + 51, 52, 53, 54, -1, 56, 57, -1, 59, 60, + 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + -1, -1, 83, 84, 85, 86, 87, 88, -1, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, -1, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + -1, -1, -1, 174, 175, 176, -1, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, -1, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, -1, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, -1, -1, 224, -1, 226, 227, 228, 229, 230, + 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, + 271, 272, 273, 274, -1, 276, 277, -1, 279, -1, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, -1, + 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, -1, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, -1, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, -1, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, + 53, 54, -1, 56, 57, -1, 59, 60, 61, 62, + 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, -1, -1, + 83, 84, 85, 86, 87, 88, -1, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, -1, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, -1, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, -1, -1, + -1, 174, 175, 176, -1, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, -1, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, -1, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, -1, + -1, 224, -1, 226, 227, 228, 229, 230, 231, -1, + -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, + 273, 274, -1, 276, 277, -1, 279, -1, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, -1, 301, -1, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, -1, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, -1, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, -1, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, -1, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, + -1, 46, 47, 48, -1, 50, 51, 52, 53, 54, + -1, 56, 57, -1, 59, 60, 61, 62, 63, 64, + -1, -1, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, -1, -1, 83, 84, + 85, 86, 87, 88, -1, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, -1, -1, -1, 174, + 175, 176, -1, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, -1, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, -1, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, -1, -1, 224, + -1, 226, 227, 228, 229, 230, 231, -1, -1, 234, + -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, + -1, 276, 277, -1, 279, -1, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, -1, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, -1, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, -1, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, -1, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, -1, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 3, -1, 5, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, + 47, 48, -1, 50, 51, 52, 53, 54, -1, 56, + 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, -1, -1, 83, 84, 85, 86, + 87, 88, -1, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, -1, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, -1, -1, -1, 174, 175, 176, + -1, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, -1, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, -1, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, -1, -1, 224, -1, 226, + 227, 228, 229, 230, 231, -1, -1, 234, -1, 236, + -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, -1, 270, 271, 272, 273, 274, -1, 276, + 277, -1, 279, -1, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, -1, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, -1, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, -1, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, -1, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, -1, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + -1, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, @@ -18067,90 +16170,240 @@ static const yytype_int16 yycheck[] = 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, + 159, -1, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, -1, -1, -1, 174, 175, 176, -1, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, -1, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + -1, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, -1, -1, 224, -1, 226, 227, 228, + 229, 230, 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + -1, 270, 271, 272, 273, 274, -1, 276, 277, -1, + 279, -1, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, -1, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, -1, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, -1, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, -1, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, + 51, 52, 53, 54, -1, 56, 57, -1, 59, 60, + 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + -1, -1, 83, 84, 85, 86, 87, 88, -1, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, -1, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + -1, -1, -1, 174, 175, 176, -1, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, -1, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, -1, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, -1, -1, 224, -1, 226, 227, 228, 229, 230, + 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, + 271, 272, 273, 274, -1, 276, 277, -1, 279, -1, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, -1, + 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, -1, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, -1, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, -1, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, + 53, 54, -1, 56, 57, -1, 59, 60, 61, 62, + 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, -1, -1, + 83, 84, 85, 86, 87, 88, -1, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, -1, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, -1, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, -1, -1, + -1, 174, 175, 176, -1, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, -1, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, -1, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, -1, + -1, 224, -1, 226, 227, 228, 229, 230, 231, -1, + -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, + 273, 274, -1, 276, 277, -1, 279, -1, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, -1, 301, -1, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, -1, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, -1, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, -1, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, -1, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, + 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, + -1, 46, 47, 48, -1, 50, 51, 52, 53, 54, + -1, 56, 57, -1, 59, 60, 61, 62, 63, 64, + -1, -1, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, -1, -1, 83, 84, + 85, 86, 87, 88, -1, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, -1, -1, -1, 174, + 175, 176, -1, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, -1, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, -1, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, -1, -1, 224, + -1, 226, 227, 228, 229, 230, 231, -1, -1, 234, + -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, + -1, 276, 277, -1, 279, -1, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, -1, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, -1, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, -1, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, -1, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, -1, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 3, -1, 5, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, + 47, 48, -1, 50, 51, 52, 53, 54, -1, 56, + 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, -1, -1, 83, 84, 85, 86, + 87, 88, -1, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, -1, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, -1, -1, -1, 174, 175, 176, + -1, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, -1, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, -1, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, -1, -1, 224, -1, 226, + 227, 228, 229, 230, 231, -1, -1, 234, -1, 236, + -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, -1, 270, 271, 272, 273, 274, -1, 276, + 277, -1, 279, -1, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, -1, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, -1, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, -1, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, -1, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, -1, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + -1, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, @@ -18166,90 +16419,240 @@ static const yytype_int16 yycheck[] = 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, + 159, -1, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, -1, -1, -1, 174, 175, 176, -1, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, -1, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + -1, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, -1, -1, 224, -1, 226, 227, 228, + 229, 230, 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + -1, 270, 271, 272, 273, 274, -1, 276, 277, -1, + 279, -1, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, -1, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, -1, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, -1, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, -1, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, - 54, -1, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, 79, -1, -1, -1, 83, - 84, 85, 86, 87, 88, -1, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, -1, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, -1, 40, + -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, + 51, 52, 53, 54, -1, 56, 57, -1, 59, 60, + 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + -1, -1, 83, 84, 85, 86, 87, 88, -1, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, -1, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + -1, -1, -1, 174, 175, 176, -1, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, -1, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, -1, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, -1, -1, 224, -1, 226, 227, 228, 229, 230, + 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, + 271, 272, 273, 274, -1, 276, 277, -1, 279, -1, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, -1, + 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, -1, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, -1, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, -1, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, -1, -1, -1, 40, -1, -1, + 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, + 53, 54, -1, 56, 57, -1, 59, 60, 61, 62, + 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, -1, -1, + 83, 84, 85, 86, 87, 88, -1, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, -1, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, -1, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, -1, -1, + -1, 174, 175, 176, -1, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, -1, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, -1, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, -1, + -1, 224, -1, 226, 227, 228, 229, 230, 231, -1, + -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, + 273, 274, -1, 276, 277, -1, 279, -1, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, -1, 301, -1, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, -1, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, -1, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, -1, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, -1, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, + -1, 46, 47, 48, -1, 50, 51, 52, 53, 54, + -1, 56, 57, -1, 59, 60, 61, 62, 63, 64, + -1, -1, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, -1, -1, 83, 84, + 85, 86, 87, 88, -1, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, -1, -1, -1, 174, + 175, 176, -1, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, -1, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, -1, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, -1, -1, 224, + -1, 226, 227, 228, 229, 230, 231, -1, -1, 234, + -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, + -1, 276, 277, -1, 279, -1, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, -1, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, -1, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, -1, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, -1, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, -1, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 3, -1, 5, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, + 47, 48, -1, 50, 51, 52, 53, 54, -1, 56, + 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, -1, -1, 83, 84, 85, 86, + 87, 88, -1, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, -1, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, -1, -1, -1, 174, 175, 176, + -1, 178, -1, 180, -1, 182, 183, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, -1, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, -1, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, -1, -1, 224, -1, 226, + 227, 228, 229, 230, 231, -1, -1, 234, -1, 236, + -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, -1, 270, 271, 272, 273, 274, -1, 276, + 277, -1, 279, -1, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, -1, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, -1, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, -1, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, -1, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, -1, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + -1, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, @@ -18265,42 +16668,240 @@ static const yytype_int16 yycheck[] = 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, + 159, -1, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, -1, -1, -1, 174, 175, 176, -1, 178, + -1, 180, -1, 182, 183, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, -1, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + -1, 210, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, -1, -1, 224, -1, 226, 227, 228, + 229, 230, 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + -1, 270, 271, 272, 273, 274, -1, 276, 277, -1, + 279, -1, 281, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, 321, -1, 323, 324, 325, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, + 379, 380, 381, -1, -1, 384, 385, 386, 387, 388, + 389, 390, 391, 392, -1, -1, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, -1, -1, 417, 418, + -1, 420, -1, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, 435, 436, 437, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, 463, 464, -1, 466, -1, 468, + 469, 470, 471, 472, 473, 474, -1, -1, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 3, -1, 5, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, + 51, 52, 53, 54, -1, 56, 57, -1, 59, 60, + 61, 62, 63, 64, -1, -1, 67, 68, 69, 70, + 71, 72, 73, -1, 75, 76, 77, 78, 79, -1, + -1, -1, 83, 84, 85, 86, 87, 88, -1, 90, + 91, 92, -1, 94, 95, 96, 97, 98, 99, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, -1, 118, -1, 120, + 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, + 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, + 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, -1, + 161, -1, 163, 164, 165, 166, -1, 168, -1, 170, + -1, -1, -1, 174, 175, 176, -1, 178, -1, 180, + -1, 182, 183, 184, 185, -1, 187, 188, 189, 190, + 191, 192, 193, -1, 195, 196, 197, 198, -1, 200, + 201, 202, 203, 204, 205, 206, -1, 208, -1, 210, + 211, 212, 213, 214, 215, 216, 217, -1, 219, -1, + 221, -1, -1, 224, -1, 226, 227, 228, 229, 230, + 231, -1, -1, 234, -1, 236, -1, -1, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, -1, 270, + 271, 272, 273, 274, -1, 276, 277, -1, 279, -1, + 281, 282, 283, 284, 285, 286, -1, 288, 289, -1, + -1, 292, 293, 294, -1, -1, 297, 298, 299, -1, + 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, -1, -1, -1, -1, 319, 320, + 321, -1, 323, 324, 325, 326, 327, 328, -1, 330, + 331, 332, 333, 334, 335, -1, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, -1, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + -1, 362, 363, -1, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, -1, -1, 384, 385, 386, 387, 388, 389, 390, + 391, 392, -1, -1, 395, 396, 397, 398, -1, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, -1, -1, 417, 418, -1, 420, + -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, + -1, -1, 433, 434, 435, 436, 437, -1, 439, 440, + 441, 442, 443, 444, 445, 446, -1, -1, 449, 450, + 451, -1, 453, 454, 455, 456, -1, 458, 459, 460, + 461, 462, 463, 464, -1, 466, -1, 468, 469, 470, + 471, 472, 473, 474, -1, -1, 477, -1, -1, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, + 53, 54, -1, 56, 57, -1, 59, 60, 61, 62, + 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, 79, -1, -1, -1, + 83, 84, 85, 86, 87, 88, -1, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, -1, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, -1, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, -1, -1, + -1, 174, 175, 176, -1, 178, -1, 180, -1, 182, + 183, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, -1, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, -1, 210, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, -1, + -1, 224, -1, 226, 227, 228, 229, 230, 231, -1, + -1, 234, -1, 236, -1, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, -1, 270, 271, 272, + 273, 274, -1, 276, 277, -1, 279, -1, 281, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, 299, -1, 301, -1, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, 321, -1, + 323, 324, 325, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, -1, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, -1, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, -1, -1, 417, 418, -1, 420, -1, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, 435, 436, 437, -1, 439, 440, 441, 442, + 443, 444, 445, 446, -1, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + 463, 464, -1, 466, -1, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, + 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, + -1, 46, 47, 48, -1, 50, 51, 52, 53, 54, + -1, 56, 57, -1, 59, 60, 61, 62, 63, 64, + -1, -1, 67, 68, 69, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, -1, -1, -1, 83, 84, + 85, 86, 87, 88, -1, 90, 91, 92, -1, 94, + 95, 96, 97, 98, 99, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, -1, 118, -1, 120, 121, 122, 123, 124, + 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, + 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, + 145, 146, -1, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, -1, 161, -1, 163, 164, + 165, 166, -1, 168, -1, 170, -1, -1, -1, 174, + 175, 176, -1, 178, -1, 180, -1, 182, 183, 184, + 185, -1, 187, 188, 189, 190, 191, 192, 193, -1, + 195, 196, 197, 198, -1, 200, 201, 202, 203, 204, + 205, 206, -1, 208, -1, 210, 211, 212, 213, 214, + 215, 216, 217, -1, 219, -1, 221, -1, -1, 224, + -1, 226, 227, 228, 229, 230, 231, -1, -1, 234, + -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, -1, 270, 271, 272, 273, 274, + -1, 276, 277, -1, 279, -1, 281, 282, 283, 284, + 285, 286, -1, 288, 289, -1, -1, 292, 293, 294, + -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + -1, -1, -1, -1, 319, 320, 321, -1, 323, 324, + 325, 326, 327, 328, -1, 330, 331, 332, 333, 334, + 335, -1, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, -1, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, -1, 362, 363, -1, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, -1, -1, 384, + 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, + 395, 396, 397, 398, -1, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + -1, -1, 417, 418, -1, 420, -1, 422, 423, 424, + 425, 426, -1, 428, 429, 430, -1, -1, 433, 434, + 435, 436, 437, -1, 439, 440, 441, 442, 443, 444, + 445, 446, -1, -1, 449, 450, 451, -1, 453, 454, + 455, 456, -1, 458, 459, 460, 461, 462, 463, 464, + -1, 466, -1, 468, 469, 470, 471, 472, 473, 474, + -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + 37, -1, -1, 40, -1, 42, 43, 44, -1, 46, + 47, 48, 49, 50, 51, 52, -1, 54, 55, 56, + 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, -1, -1, 81, -1, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, -1, 153, 154, 155, 156, + 157, 158, -1, -1, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, 171, -1, 173, 174, 175, 176, + 177, 178, -1, 180, -1, -1, -1, 184, 185, -1, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, 209, -1, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, -1, -1, 234, 235, 236, + 237, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, -1, -1, 276, + 277, 278, 279, -1, -1, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, -1, 300, 301, 302, -1, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, -1, 322, 323, 324, -1, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, 394, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, -1, -1, -1, + 417, 418, -1, 420, 421, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, -1, 436, + -1, -1, 439, 440, 441, 442, 443, 444, 445, 446, + 447, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, -1, 464, -1, 466, + 467, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 3, + -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, + 497, 498, 499, 500, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, @@ -18314,90 +16915,240 @@ static const yytype_int16 yycheck[] = 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, + 154, 155, 156, 157, 158, 159, -1, 161, -1, 163, + 164, 165, 166, -1, 168, -1, 170, -1, -1, -1, + 174, 175, 176, -1, 178, -1, 180, -1, 182, 183, + 184, 185, -1, 187, 188, 189, 190, 191, 192, 193, + -1, 195, 196, 197, 198, -1, 200, 201, 202, 203, + 204, 205, 206, -1, 208, -1, 210, 211, 212, 213, + 214, 215, 216, 217, -1, 219, -1, 221, -1, -1, + 224, -1, 226, 227, 228, 229, 230, 231, -1, -1, + 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, + 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, + 274, -1, 276, 277, -1, 279, -1, 281, 282, 283, + 284, 285, 286, -1, 288, 289, -1, -1, 292, 293, + 294, -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, + 314, -1, -1, -1, -1, 319, 320, 321, -1, 323, + 324, 325, 326, 327, 328, -1, 330, 331, 332, 333, + 334, 335, -1, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, + -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, -1, -1, + 384, 385, 386, 387, 388, 389, 390, 391, 392, -1, + -1, 395, 396, 397, 398, -1, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, -1, -1, 417, 418, -1, 420, -1, 422, 423, + 424, 425, 426, -1, 428, 429, 430, -1, -1, 433, + 434, 435, 436, 437, -1, 439, 440, 441, 442, 443, + 444, 445, 446, -1, -1, 449, 450, 451, -1, 453, + 454, 455, 456, -1, 458, 459, 460, 461, 462, 463, + 464, -1, 466, -1, 468, 469, 470, 471, 472, 473, + 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, + 494, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, 40, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, -1, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, + -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, + 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, + 46, 47, 48, -1, 50, 51, 52, 53, 54, -1, + 56, 57, -1, 59, 60, 61, 62, 63, 64, -1, + -1, 67, 68, 69, 70, 71, 72, 73, -1, 75, + 76, 77, 78, 79, -1, -1, -1, 83, 84, 85, + 86, 87, 88, -1, 90, 91, 92, -1, 94, 95, + 96, 97, 98, 99, -1, -1, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, -1, 118, -1, 120, 121, 122, 123, 124, 125, + -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, + 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, + 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, -1, 161, -1, 163, 164, 165, + 166, -1, 168, -1, 170, -1, -1, -1, 174, 175, + 176, -1, 178, -1, 180, -1, 182, 183, 184, 185, + -1, 187, 188, 189, 190, 191, 192, 193, -1, 195, + 196, 197, 198, -1, 200, 201, 202, 203, 204, 205, + 206, -1, 208, -1, 210, 211, 212, 213, 214, 215, + 216, 217, -1, 219, -1, 221, -1, -1, 224, -1, + 226, 227, 228, 229, 230, 231, -1, -1, 234, -1, + 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, -1, 270, 271, 272, 273, 274, -1, + 276, 277, -1, 279, -1, 281, 282, 283, 284, 285, + 286, -1, 288, 289, -1, -1, 292, 293, 294, -1, + -1, 297, 298, 299, -1, 301, -1, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, -1, + -1, -1, -1, 319, 320, 321, -1, 323, 324, 325, + 326, 327, 328, -1, 330, 331, 332, 333, 334, 335, + -1, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, -1, 362, 363, -1, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, -1, -1, 384, 385, + 386, 387, 388, 389, 390, 391, 392, -1, -1, 395, + 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, -1, + -1, 417, 418, -1, 420, -1, 422, 423, 424, 425, + 426, -1, 428, 429, 430, -1, -1, 433, 434, 435, + 436, 437, -1, 439, 440, 441, 442, 443, 444, 445, + 446, -1, -1, 449, 450, 451, -1, 453, 454, 455, + 456, -1, 458, 459, 460, 461, 462, 463, 464, -1, + 466, -1, 468, 469, 470, 471, 472, 473, 474, -1, + -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, + 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 43, 44, -1, 46, 47, + 48, -1, 50, 51, 52, 53, 54, -1, 56, 57, + -1, 59, 60, 61, 62, 63, 64, -1, -1, 67, + 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, + 78, 79, -1, -1, -1, 83, 84, 85, 86, 87, + 88, -1, 90, 91, 92, -1, 94, 95, 96, 97, + 98, 99, -1, -1, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, + 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, + 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, + 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, -1, 161, -1, 163, 164, 165, 166, -1, + 168, -1, 170, -1, -1, -1, 174, 175, 176, -1, + 178, -1, 180, -1, 182, 183, 184, 185, -1, 187, + 188, 189, 190, 191, 192, 193, -1, 195, 196, 197, + 198, -1, 200, 201, 202, 203, 204, 205, 206, -1, + 208, -1, 210, 211, 212, 213, 214, 215, 216, 217, + -1, 219, -1, 221, -1, -1, 224, -1, 226, 227, + 228, 229, 230, 231, -1, -1, 234, -1, 236, -1, + -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, -1, 270, 271, 272, 273, 274, -1, 276, 277, + -1, 279, -1, 281, 282, 283, 284, 285, 286, -1, + 288, 289, -1, -1, 292, 293, 294, -1, -1, 297, + 298, 299, -1, 301, -1, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, -1, -1, -1, + -1, 319, 320, 321, -1, 323, 324, 325, 326, 327, + 328, -1, 330, 331, 332, 333, 334, 335, -1, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, -1, 362, 363, -1, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, -1, -1, 384, 385, 386, 387, + 388, 389, 390, 391, 392, -1, -1, 395, 396, 397, + 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, -1, -1, 417, + 418, -1, 420, -1, 422, 423, 424, 425, 426, -1, + 428, 429, 430, -1, -1, 433, 434, 435, 436, 437, + -1, 439, 440, 441, 442, 443, 444, 445, 446, -1, + -1, 449, 450, 451, -1, 453, 454, 455, 456, -1, + 458, 459, 460, 461, 462, 463, 464, -1, 466, -1, + 468, 469, 470, 471, 472, 473, 474, -1, -1, 477, + -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, + 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, + -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 43, 44, -1, 46, 47, 48, -1, + 50, 51, 52, 53, 54, -1, 56, 57, -1, 59, + 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, + 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, + -1, -1, -1, 83, 84, 85, 86, 87, 88, -1, + 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, + -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, + 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, + 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, + 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + -1, 161, -1, 163, 164, 165, 166, -1, 168, -1, + 170, -1, -1, -1, 174, 175, 176, -1, 178, -1, + 180, -1, 182, 183, 184, 185, -1, 187, 188, 189, + 190, 191, 192, 193, -1, 195, 196, 197, 198, -1, + 200, 201, 202, 203, 204, 205, 206, -1, 208, -1, + 210, 211, 212, 213, 214, 215, 216, 217, -1, 219, + -1, 221, -1, -1, 224, -1, 226, 227, 228, 229, + 230, 231, -1, -1, 234, -1, 236, -1, -1, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, + 270, 271, 272, 273, 274, -1, 276, 277, -1, 279, + -1, 281, 282, 283, 284, 285, 286, -1, 288, 289, + -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, + -1, 301, -1, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, -1, -1, -1, -1, 319, + 320, 321, -1, 323, 324, 325, 326, 327, 328, -1, + 330, 331, 332, 333, 334, 335, -1, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, -1, 362, 363, -1, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, -1, -1, 384, 385, 386, 387, 388, 389, + 390, 391, 392, -1, -1, 395, 396, 397, 398, -1, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, -1, -1, 417, 418, -1, + 420, -1, 422, 423, 424, 425, 426, -1, 428, 429, + 430, -1, -1, 433, 434, 435, 436, 437, -1, 439, + 440, 441, 442, 443, 444, 445, 446, -1, -1, 449, + 450, 451, -1, 453, 454, 455, 456, -1, 458, 459, + 460, 461, 462, 463, 464, -1, 466, -1, 468, 469, + 470, 471, 472, 473, 474, -1, -1, 477, -1, -1, + 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, + 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, + 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 43, 44, -1, 46, 47, 48, -1, 50, 51, + 52, 53, 54, -1, 56, 57, -1, 59, 60, 61, + 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, + 72, 73, -1, 75, 76, 77, 78, 79, -1, -1, + -1, 83, 84, 85, 86, 87, 88, -1, 90, 91, + 92, -1, 94, 95, 96, 97, 98, 99, -1, -1, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, -1, 118, -1, 120, 121, + 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, + -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, + 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, -1, 161, + -1, 163, 164, 165, 166, -1, 168, -1, 170, -1, + -1, -1, 174, 175, 176, -1, 178, -1, 180, -1, + 182, 183, 184, 185, -1, 187, 188, 189, 190, 191, + 192, 193, -1, 195, 196, 197, 198, -1, 200, 201, + 202, 203, 204, 205, 206, -1, 208, -1, 210, 211, + 212, 213, 214, 215, 216, 217, -1, 219, -1, 221, + -1, -1, 224, -1, 226, 227, 228, 229, 230, 231, + -1, -1, 234, -1, 236, -1, -1, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, + 272, 273, 274, -1, 276, 277, -1, 279, -1, 281, + 282, 283, 284, 285, 286, -1, 288, 289, -1, -1, + 292, 293, 294, -1, -1, 297, 298, 299, -1, 301, + -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, -1, -1, -1, -1, 319, 320, 321, + -1, 323, 324, 325, 326, 327, 328, -1, 330, 331, + 332, 333, 334, 335, -1, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, + 362, 363, -1, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + -1, -1, 384, 385, 386, 387, 388, 389, 390, 391, + 392, -1, -1, 395, 396, 397, 398, -1, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, -1, -1, 417, 418, -1, 420, -1, + 422, 423, 424, 425, 426, -1, 428, 429, 430, -1, + -1, 433, 434, 435, 436, 437, -1, 439, 440, 441, + 442, 443, 444, 445, 446, -1, -1, 449, 450, 451, + -1, 453, 454, 455, 456, -1, 458, 459, 460, 461, + 462, 463, 464, -1, 466, -1, 468, 469, 470, 471, + 472, 473, 474, -1, -1, 477, -1, -1, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, @@ -18413,90 +17164,240 @@ static const yytype_int16 yycheck[] = 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, + 154, 155, 156, 157, 158, 159, -1, 161, -1, 163, + 164, 165, 166, -1, 168, -1, 170, -1, -1, -1, + 174, 175, 176, -1, 178, -1, 180, -1, 182, 183, + 184, 185, -1, 187, 188, 189, 190, 191, 192, 193, + -1, 195, 196, 197, 198, -1, 200, 201, 202, 203, + 204, 205, 206, -1, 208, -1, 210, 211, 212, 213, + 214, 215, 216, 217, -1, 219, -1, 221, -1, -1, + 224, -1, 226, 227, 228, 229, 230, 231, -1, -1, + 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, + 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, + 274, -1, 276, 277, -1, 279, -1, 281, 282, 283, + 284, 285, 286, -1, 288, 289, -1, -1, 292, 293, + 294, -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, + 314, -1, -1, -1, -1, 319, 320, 321, -1, 323, + 324, 325, 326, 327, 328, -1, 330, 331, 332, 333, + 334, 335, -1, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, + -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, -1, -1, + 384, 385, 386, 387, 388, 389, 390, 391, 392, -1, + -1, 395, 396, 397, 398, -1, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, -1, -1, 417, 418, -1, 420, -1, 422, 423, + 424, 425, 426, -1, 428, 429, 430, -1, -1, 433, + 434, 435, 436, 437, -1, 439, 440, 441, 442, 443, + 444, 445, 446, -1, -1, 449, 450, 451, -1, 453, + 454, 455, 456, -1, 458, 459, 460, 461, 462, 463, + 464, -1, 466, -1, 468, 469, 470, 471, 472, 473, + 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, + 494, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, + -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, + 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 43, 44, -1, + 46, 47, 48, -1, 50, 51, 52, 53, 54, -1, + 56, 57, -1, 59, 60, 61, 62, 63, 64, -1, + -1, 67, 68, 69, 70, 71, 72, 73, -1, 75, + 76, 77, 78, 79, -1, -1, -1, 83, 84, 85, + 86, 87, 88, -1, 90, 91, 92, -1, 94, 95, + 96, 97, 98, 99, -1, -1, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, -1, 118, -1, 120, 121, 122, 123, 124, 125, + -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, + 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, + 146, -1, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, -1, 161, -1, 163, 164, 165, + 166, -1, 168, -1, 170, -1, -1, -1, 174, 175, + 176, -1, 178, -1, 180, -1, 182, 183, 184, 185, + -1, 187, 188, 189, 190, 191, 192, 193, -1, 195, + 196, 197, 198, -1, 200, 201, 202, 203, 204, 205, + 206, -1, 208, -1, 210, 211, 212, 213, 214, 215, + 216, 217, -1, 219, -1, 221, -1, -1, 224, -1, + 226, 227, 228, 229, 230, 231, -1, -1, 234, -1, + 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, -1, 270, 271, 272, 273, 274, -1, + 276, 277, -1, 279, -1, 281, 282, 283, 284, 285, + 286, -1, 288, 289, -1, -1, 292, 293, 294, -1, + -1, 297, 298, 299, -1, 301, -1, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, -1, + -1, -1, -1, 319, 320, 321, -1, 323, 324, 325, + 326, 327, 328, -1, 330, 331, 332, 333, 334, 335, + -1, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, -1, 362, 363, -1, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, -1, -1, 384, 385, + 386, 387, 388, 389, 390, 391, 392, -1, -1, 395, + 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, -1, + -1, 417, 418, -1, 420, -1, 422, 423, 424, 425, + 426, -1, 428, 429, 430, -1, -1, 433, 434, 435, + 436, 437, -1, 439, 440, 441, 442, 443, 444, 445, + 446, -1, -1, 449, 450, 451, -1, 453, 454, 455, + 456, -1, 458, 459, 460, 461, 462, 463, 464, -1, + 466, -1, 468, 469, 470, 471, 472, 473, 474, -1, + -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, + 28, 29, -1, 31, 32, 33, -1, -1, -1, -1, + -1, -1, 40, -1, -1, 43, 44, -1, 46, 47, + 48, -1, 50, 51, 52, 53, 54, -1, 56, 57, + -1, 59, 60, 61, 62, 63, 64, -1, -1, 67, + 68, 69, 70, 71, 72, 73, -1, 75, 76, 77, + 78, 79, -1, -1, -1, 83, 84, 85, 86, 87, + 88, -1, 90, 91, 92, -1, 94, 95, 96, 97, + 98, 99, -1, -1, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, -1, + 118, -1, 120, 121, 122, 123, 124, 125, -1, -1, + 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, + 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, -1, 161, -1, 163, 164, 165, 166, -1, + 168, -1, 170, -1, -1, -1, 174, 175, 176, -1, + 178, -1, 180, -1, 182, 183, 184, 185, -1, 187, + 188, 189, 190, 191, 192, 193, -1, 195, 196, 197, + 198, -1, 200, 201, 202, 203, 204, 205, 206, -1, + 208, -1, 210, 211, 212, 213, 214, 215, 216, 217, + -1, 219, -1, 221, -1, -1, 224, -1, 226, 227, + 228, 229, 230, 231, -1, -1, 234, -1, 236, -1, + -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, -1, 270, 271, 272, 273, 274, -1, 276, 277, + -1, 279, -1, 281, 282, 283, 284, 285, 286, -1, + 288, 289, -1, -1, 292, 293, 294, -1, -1, 297, + 298, 299, -1, 301, -1, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, -1, -1, -1, + -1, 319, 320, 321, -1, 323, 324, 325, 326, 327, + 328, -1, 330, 331, 332, 333, 334, 335, -1, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, -1, 362, 363, -1, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, -1, -1, 384, 385, 386, 387, + 388, -1, 390, 391, 392, -1, -1, 395, 396, 397, + 398, -1, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, -1, -1, 417, + 418, -1, 420, -1, 422, 423, 424, 425, 426, -1, + 428, 429, 430, -1, -1, 433, 434, 435, 436, 437, + -1, 439, 440, 441, 442, 443, 444, 445, 446, -1, + -1, 449, 450, 451, -1, 453, 454, 455, 456, -1, + 458, 459, 460, 461, 462, 463, 464, -1, 466, -1, + 468, 469, 470, 471, 472, 473, 474, -1, -1, 477, + -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, + 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, + -1, 31, 32, 33, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 43, 44, -1, 46, 47, 48, -1, + 50, 51, 52, 53, 54, -1, 56, 57, -1, 59, + 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, + 70, 71, 72, 73, -1, 75, 76, 77, 78, 79, + -1, -1, -1, 83, 84, 85, 86, 87, 88, -1, + 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, + -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, + 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, + 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, + 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + -1, 161, -1, 163, 164, 165, 166, -1, 168, -1, + 170, -1, -1, -1, 174, 175, 176, -1, 178, -1, + 180, -1, 182, 183, 184, 185, -1, 187, 188, 189, + 190, 191, 192, 193, -1, 195, 196, 197, 198, -1, + 200, 201, 202, 203, 204, 205, 206, -1, 208, -1, + 210, 211, 212, 213, 214, 215, 216, 217, -1, 219, + -1, 221, -1, -1, 224, -1, 226, 227, 228, 229, + 230, 231, -1, -1, 234, -1, 236, -1, -1, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, -1, + 270, 271, 272, 273, 274, -1, 276, 277, -1, 279, + -1, 281, 282, 283, 284, 285, 286, -1, 288, 289, + -1, -1, 292, 293, 294, -1, -1, 297, 298, 299, + -1, 301, -1, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, -1, -1, -1, -1, 319, + 320, 321, -1, 323, 324, 325, 326, 327, 328, -1, + 330, 331, 332, 333, 334, 335, -1, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, -1, 362, 363, -1, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, -1, -1, 384, 385, 386, 387, 388, 389, + 390, 391, 392, -1, -1, 395, 396, 397, 398, -1, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, -1, -1, 417, 418, -1, + 420, -1, 422, 423, 424, 425, 426, -1, 428, 429, + 430, -1, -1, 433, 434, 435, 436, 437, -1, 439, + 440, 441, 442, 443, 444, 445, 446, -1, -1, 449, + 450, 451, -1, 453, 454, 455, 456, -1, 458, 459, + 460, 461, 462, 463, 464, -1, 466, -1, 468, 469, + 470, 471, 472, 473, 474, -1, -1, 477, -1, -1, + 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, + 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, + 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 43, 44, -1, 46, 47, 48, -1, 50, 51, + 52, 53, 54, -1, 56, 57, -1, 59, 60, 61, + 62, 63, 64, -1, -1, 67, 68, 69, 70, 71, + 72, 73, -1, 75, 76, 77, 78, 79, -1, -1, + -1, 83, 84, 85, 86, 87, 88, -1, 90, 91, + 92, -1, 94, 95, 96, 97, 98, 99, -1, -1, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, -1, 118, -1, 120, 121, + 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, + -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, + 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, -1, 161, + -1, 163, 164, 165, 166, -1, 168, -1, 170, -1, + -1, -1, 174, 175, 176, -1, 178, -1, 180, -1, + 182, 183, 184, 185, -1, 187, 188, 189, 190, 191, + 192, 193, -1, 195, 196, 197, 198, -1, 200, 201, + 202, 203, 204, 205, 206, -1, 208, -1, 210, 211, + 212, 213, 214, 215, 216, 217, -1, 219, -1, 221, + -1, -1, 224, -1, 226, 227, 228, 229, 230, 231, + -1, -1, 234, -1, 236, -1, -1, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, -1, 270, 271, + 272, 273, 274, -1, 276, 277, -1, 279, -1, 281, + 282, 283, 284, 285, 286, -1, 288, 289, -1, -1, + 292, 293, 294, -1, -1, 297, 298, 299, -1, 301, + -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, -1, -1, -1, -1, 319, 320, 321, + -1, 323, 324, 325, 326, 327, 328, -1, 330, 331, + 332, 333, 334, 335, -1, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, -1, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, + 362, 363, -1, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + -1, -1, 384, 385, 386, 387, 388, 389, 390, 391, + 392, -1, -1, 395, 396, 397, 398, -1, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, -1, -1, 417, 418, -1, 420, -1, + 422, 423, 424, 425, 426, -1, 428, 429, 430, -1, + -1, 433, 434, 435, 436, 437, -1, 439, 440, 441, + 442, 443, 444, 445, 446, -1, -1, 449, 450, 451, + -1, 453, 454, 455, 456, -1, 458, 459, 460, 461, + 462, 463, 464, -1, 466, -1, 468, 469, 470, 471, + 472, 473, 474, -1, -1, 477, -1, -1, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, @@ -18512,41 +17413,236 @@ static const yytype_int16 yycheck[] = 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, -1, -1, -1, 173, - 174, 175, -1, 177, -1, 179, -1, 181, 182, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, -1, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, -1, 209, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, -1, -1, 223, - -1, 225, 226, 227, 228, 229, 230, -1, -1, 233, - -1, 235, -1, -1, 238, 239, 240, 241, 242, 243, + 154, 155, 156, 157, 158, 159, -1, 161, -1, 163, + 164, 165, 166, -1, 168, -1, 170, -1, -1, -1, + 174, 175, 176, -1, 178, -1, 180, -1, 182, 183, + 184, 185, -1, 187, 188, 189, 190, 191, 192, 193, + -1, 195, 196, 197, 198, -1, 200, 201, 202, 203, + 204, 205, 206, -1, 208, -1, 210, 211, 212, 213, + 214, 215, 216, 217, -1, 219, -1, 221, -1, -1, + 224, -1, 226, 227, 228, 229, 230, 231, -1, -1, + 234, -1, 236, -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, -1, 269, 270, 271, 272, 273, - -1, 275, 276, -1, 278, -1, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, 298, -1, 300, -1, 302, 303, + 264, 265, 266, 267, 268, -1, 270, 271, 272, 273, + 274, -1, 276, 277, -1, 279, -1, 281, 282, 283, + 284, 285, 286, -1, 288, 289, -1, -1, 292, 293, + 294, -1, -1, 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, 320, -1, 322, 323, - 324, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, -1, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, -1, 381, 382, 383, - 384, 385, 386, 387, 388, 389, -1, -1, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, -1, -1, - 414, 415, -1, 417, -1, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, 432, 433, - 434, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, 460, 461, -1, 463, - -1, 465, 466, 467, 468, 469, 470, 471, -1, -1, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 483, + 314, -1, -1, -1, -1, 319, 320, 321, -1, 323, + 324, 325, 326, 327, 328, -1, 330, 331, 332, 333, + 334, 335, -1, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, -1, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, -1, 362, 363, + -1, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, -1, -1, + 384, 385, 386, 387, 388, 389, 390, 391, 392, -1, + -1, 395, 396, 397, 398, -1, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, -1, -1, 417, 418, -1, 420, -1, 422, 423, + 424, 425, 426, -1, 428, 429, 430, -1, -1, 433, + 434, 435, 436, 437, -1, 439, 440, 441, 442, 443, + 444, 445, 446, -1, -1, 449, 450, 451, -1, 453, + 454, 455, 456, -1, 458, 459, 460, 461, 462, 463, + 464, -1, 466, -1, 468, 469, 470, 471, 472, 473, + 474, -1, -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 3, -1, -1, -1, -1, -1, + 494, 495, 496, 497, 498, 499, 500, 3, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, + 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, + -1, 37, -1, -1, -1, -1, 42, 43, 44, -1, + 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, + 56, 57, -1, 59, 60, 61, 62, 63, 64, -1, + -1, 67, 68, 69, 70, 71, 72, 73, -1, 75, + 76, 77, 78, -1, -1, 81, -1, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, + 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, -1, 118, -1, 120, 121, 122, 123, 124, 125, + -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, + 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, + 146, -1, 148, 149, 150, 151, -1, 153, 154, 155, + 156, 157, 158, -1, -1, 161, -1, 163, 164, 165, + 166, -1, 168, -1, 170, 171, -1, 173, 174, 175, + -1, 177, 178, -1, 180, -1, -1, -1, 184, 185, + -1, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, -1, 200, 201, 202, 203, 204, 205, + 206, -1, 208, 209, -1, 211, 212, 213, 214, 215, + 216, 217, -1, 219, -1, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, -1, -1, 234, 235, + 236, 237, -1, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, -1, -1, + 276, 277, 278, 279, -1, -1, 282, 283, 284, 285, + 286, -1, 288, 289, -1, -1, 292, 293, 294, -1, + -1, 297, 298, -1, 300, 301, 302, -1, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, -1, + -1, -1, -1, 319, 320, -1, 322, 323, 324, -1, + 326, 327, 328, -1, 330, 331, 332, 333, 334, 335, + -1, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, -1, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, -1, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, -1, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, -1, 394, 395, + 396, 397, 398, -1, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, -1, -1, + -1, 417, 418, -1, 420, 421, 422, 423, 424, 425, + 426, -1, 428, 429, 430, -1, -1, 433, 434, -1, + 436, -1, -1, 439, 440, 441, 442, 443, 444, 445, + 446, 447, -1, 449, 450, 451, -1, 453, 454, 455, + 456, -1, 458, 459, 460, 461, 462, -1, 464, -1, + 466, 467, 468, 469, 470, 471, 472, 473, 474, -1, + -1, 477, -1, -1, 480, 481, 482, 483, 484, 485, + 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 497, 498, 499, 500, -1, -1, -1, -1, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, + 33, -1, -1, -1, 37, -1, -1, -1, -1, 42, + 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, + -1, 54, 55, 56, 57, -1, 59, 60, 61, 62, + 63, 64, -1, -1, 67, 68, 69, 70, 71, 72, + 73, -1, 75, 76, 77, 78, -1, -1, 81, -1, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + -1, 94, 95, 96, 97, 98, 99, -1, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, -1, 118, -1, 120, 121, 122, + 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, + -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, + -1, 144, 145, 146, -1, 148, 149, 150, 151, -1, + 153, 154, 155, 156, 157, 158, -1, -1, 161, -1, + 163, 164, 165, 166, -1, 168, -1, 170, 171, -1, + 173, 174, 175, -1, 177, 178, -1, 180, -1, -1, + -1, 184, 185, -1, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, -1, 200, 201, 202, + 203, 204, 205, 206, -1, 208, 209, -1, 211, 212, + 213, 214, 215, 216, 217, -1, 219, -1, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, -1, + -1, 234, 235, 236, 237, -1, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, -1, -1, 276, 277, 278, 279, -1, -1, 282, + 283, 284, 285, 286, -1, 288, 289, -1, -1, 292, + 293, 294, -1, -1, 297, 298, -1, 300, 301, 302, + -1, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, -1, -1, -1, -1, 319, 320, -1, 322, + 323, 324, -1, 326, 327, 328, -1, 330, 331, 332, + 333, 334, 335, -1, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, -1, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, -1, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, -1, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + -1, 394, 395, 396, 397, 398, -1, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, -1, -1, -1, 417, 418, -1, 420, 421, 422, + 423, 424, 425, 426, -1, 428, 429, 430, -1, -1, + 433, 434, -1, 436, -1, -1, 439, 440, 441, 442, + 443, 444, 445, 446, 447, -1, 449, 450, 451, -1, + 453, 454, 455, 456, -1, 458, 459, 460, 461, 462, + -1, 464, -1, 466, 467, 468, 469, 470, 471, 472, + 473, 474, -1, -1, 477, -1, -1, 480, 481, 482, + 483, 484, 485, 3, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 497, 498, 499, 500, -1, -1, + -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, + -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, + -1, -1, 42, 43, 44, -1, 46, 47, 48, 49, + 50, 51, 52, -1, 54, 55, 56, 57, -1, 59, + 60, 61, 62, 63, 64, -1, -1, 67, 68, 69, + 70, 71, 72, 73, -1, 75, 76, 77, 78, -1, + -1, 81, -1, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, -1, 94, 95, 96, 97, 98, 99, + -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, -1, 118, -1, + 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, + 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, + 140, 141, 142, -1, 144, 145, 146, -1, 148, 149, + 150, 151, -1, 153, 154, 155, 156, 157, 158, -1, + -1, 161, -1, 163, 164, 165, 166, -1, 168, -1, + 170, 171, -1, 173, 174, 175, 176, 177, 178, -1, + 180, -1, -1, -1, 184, 185, -1, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, -1, + 200, 201, 202, 203, 204, 205, 206, -1, 208, 209, + -1, 211, 212, 213, 214, 215, 216, 217, -1, 219, + -1, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, -1, -1, 234, 235, 236, 237, -1, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, -1, -1, 276, 277, 278, 279, + -1, -1, 282, 283, 284, 285, 286, -1, 288, 289, + -1, -1, 292, 293, 294, -1, -1, 297, 298, -1, + 300, 301, 302, -1, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, -1, -1, -1, -1, 319, + 320, -1, 322, 323, 324, -1, 326, 327, 328, -1, + 330, 331, 332, 333, 334, 335, -1, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, -1, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, -1, 362, 363, 364, 365, 366, 367, -1, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, -1, 383, 384, 385, 386, 387, 388, 389, + -1, 391, 392, -1, 394, 395, 396, 397, 398, -1, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, -1, -1, -1, 417, 418, -1, + 420, 421, 422, 423, 424, 425, 426, -1, 428, 429, + 430, -1, -1, 433, 434, -1, 436, -1, -1, 439, + 440, 441, 442, 443, 444, 445, 446, -1, -1, 449, + 450, 451, -1, 453, 454, 455, 456, -1, 458, 459, + 460, 461, 462, -1, 464, -1, 466, 467, 468, 469, + 470, 471, 472, 473, 474, -1, -1, 477, -1, -1, + 480, 481, 482, 483, 484, 485, 3, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 497, 498, 499, + 500, -1, -1, -1, -1, 22, 23, 24, 25, 26, + 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 43, 44, -1, 46, + 47, 48, -1, 50, 51, 52, 53, 54, -1, 56, + 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, + 67, 68, 69, 70, 71, 72, 73, -1, 75, 76, + 77, 78, 79, -1, -1, -1, 83, 84, 85, 86, + 87, 88, -1, 90, 91, 92, -1, 94, 95, 96, + 97, 98, 99, -1, -1, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + -1, 118, -1, 120, 121, 122, 123, 124, 125, -1, + -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, + 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, + -1, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, -1, 161, -1, 163, 164, 165, 166, + -1, 168, -1, 170, -1, -1, -1, 174, 175, 176, + -1, 178, -1, 180, -1, 182, 183, -1, 185, -1, + 187, 188, 189, 190, 191, 192, 193, -1, 195, 196, + 197, 198, -1, 200, 201, 202, 203, 204, 205, 206, + -1, 208, -1, 210, 211, 212, 213, 214, 215, 216, + 217, -1, 219, -1, 221, -1, -1, 224, -1, 226, + 227, 228, 229, 230, 231, -1, -1, 234, -1, 236, + -1, -1, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, -1, 270, 271, 272, 273, 274, -1, 276, + 277, -1, 279, -1, 281, 282, 283, 284, 285, 286, + -1, 288, 289, -1, -1, 292, 293, 294, -1, -1, + 297, 298, 299, -1, 301, -1, 303, 304, 305, 306, + 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, + -1, -1, 319, 320, 321, -1, 323, 324, 325, 326, + 327, 328, -1, 330, 331, 332, 333, 334, 335, -1, + 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, + -1, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, -1, 362, 363, -1, 365, 366, + 367, 368, -1, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, -1, -1, 384, 385, 386, + 387, 388, 389, 390, 391, 392, -1, -1, 395, 396, + 397, 398, -1, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, -1, -1, + 417, 418, -1, 420, -1, 422, 423, 424, 425, 426, + -1, 428, 429, 430, -1, -1, 433, 434, 435, 436, + 437, -1, 439, 440, 441, 442, 443, 444, 445, 446, + -1, -1, 449, 450, 451, -1, 453, 454, 455, 456, + -1, 458, 459, 460, 461, 462, 463, 464, -1, 466, + -1, 468, 469, 470, 471, 472, 473, 474, -1, -1, + 477, -1, -1, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, -1, -1, -1, 37, -1, @@ -18561,733 +17657,952 @@ static const yytype_int16 yycheck[] = -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, -1, 153, 154, 155, 156, 157, -1, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, -1, 172, 173, 174, -1, 176, 177, -1, - 179, -1, -1, -1, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - -1, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233, 234, 235, 236, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, -1, -1, 275, 276, 277, 278, - -1, -1, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, -1, - 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, -1, 321, 322, 323, -1, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, -1, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, -1, 433, -1, -1, 436, 437, 438, - 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, -1, 461, -1, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 3, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 494, 495, 496, 497, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, 37, -1, - -1, -1, -1, 42, 43, 44, -1, 46, 47, 48, - 49, 50, 51, 52, -1, 54, 55, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - -1, -1, 81, -1, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, -1, 153, 154, 155, 156, 157, -1, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, -1, 172, 173, 174, -1, 176, 177, -1, - 179, -1, -1, -1, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - -1, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233, 234, 235, 236, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, -1, -1, 275, 276, 277, 278, - -1, -1, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, -1, - 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, -1, 321, 322, 323, -1, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, -1, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, -1, 433, -1, -1, 436, 437, 438, - 439, 440, 441, 442, 443, 444, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, -1, 461, -1, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 3, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 494, 495, 496, 497, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, 37, -1, - -1, -1, -1, 42, 43, 44, -1, 46, 47, 48, - 49, 50, 51, 52, -1, 54, 55, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - -1, -1, 81, -1, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, -1, 153, 154, 155, 156, 157, -1, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, 170, -1, 172, 173, 174, 175, 176, 177, -1, - 179, -1, -1, -1, 183, 184, -1, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, - -1, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, -1, -1, 233, 234, 235, 236, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 149, 150, 151, -1, 153, 154, 155, 156, 157, 158, + -1, -1, 161, -1, 163, 164, 165, 166, -1, 168, + -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, + -1, 180, -1, -1, -1, 184, 185, -1, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + -1, 200, 201, 202, 203, 204, 205, 206, -1, 208, + 209, -1, 211, 212, 213, 214, 215, 216, 217, -1, + 219, -1, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, -1, -1, 234, 235, 236, 237, -1, + 239, 240, 241, 242, 243, 244, 245, 246, -1, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, -1, -1, 275, 276, 277, 278, - -1, -1, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, -1, - 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, -1, 321, 322, 323, -1, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, 361, 362, 363, 364, -1, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, 380, 381, 382, 383, 384, 385, 386, -1, 388, - 389, -1, 391, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, -1, -1, -1, 414, 415, -1, 417, 418, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, -1, 433, -1, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, -1, 461, -1, 463, 464, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 3, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 494, 495, 496, 497, -1, - -1, -1, -1, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, 32, 33, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, 44, -1, 46, 47, 48, - -1, 50, 51, 52, 53, 54, -1, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, 68, - 69, 70, 71, 72, 73, -1, 75, 76, 77, 78, - 79, -1, -1, -1, 83, 84, 85, 86, 87, 88, - -1, 90, 91, 92, -1, 94, 95, 96, 97, 98, - 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, -1, 118, - -1, 120, 121, 122, 123, 124, 125, -1, -1, 128, - 129, 130, 131, -1, -1, 134, 135, 136, 137, 138, - -1, 140, 141, 142, -1, 144, 145, 146, -1, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - -1, 160, -1, 162, 163, 164, 165, -1, 167, -1, - 169, -1, -1, -1, 173, 174, 175, -1, 177, -1, - 179, -1, 181, 182, -1, 184, -1, 186, 187, 188, - 189, 190, 191, 192, -1, 194, 195, 196, 197, -1, - 199, 200, 201, 202, 203, 204, 205, -1, 207, -1, - 209, 210, 211, 212, 213, 214, 215, 216, -1, 218, - -1, 220, -1, -1, 223, -1, 225, 226, 227, 228, - 229, 230, -1, -1, 233, -1, 235, -1, -1, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, -1, - 269, 270, 271, 272, 273, -1, 275, 276, -1, 278, - -1, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, 291, 292, 293, -1, -1, 296, 297, 298, - -1, 300, -1, 302, 303, 304, 305, 306, 307, 308, - -1, 310, 311, 312, 313, -1, -1, -1, -1, 318, - 319, 320, -1, 322, 323, 324, 325, 326, 327, -1, - 329, 330, 331, 332, 333, 334, -1, 336, -1, 338, - 339, 340, 341, 342, 343, -1, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, -1, - 359, 360, -1, 362, 363, 364, 365, -1, 367, 368, + 269, 270, 271, 272, 273, -1, -1, 276, 277, 278, + 279, -1, -1, 282, 283, 284, 285, 286, -1, 288, + 289, -1, -1, 292, 293, 294, -1, -1, 297, 298, + -1, 300, 301, 302, -1, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, -1, -1, -1, -1, + 319, 320, -1, 322, 323, 324, -1, 326, 327, 328, + -1, 330, 331, 332, 333, 334, 335, -1, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, -1, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, 362, 363, 364, 365, 366, 367, -1, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, -1, -1, 392, 393, 394, 395, -1, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, -1, -1, 414, 415, -1, 417, -1, - 419, 420, 421, 422, 423, -1, 425, 426, 427, -1, - -1, 430, 431, 432, 433, 434, -1, 436, 437, 438, - 439, 440, 441, 442, 443, -1, -1, 446, 447, 448, - -1, 450, 451, 452, 453, -1, 455, 456, 457, 458, - 459, 460, 461, -1, 463, -1, 465, 466, 467, 468, - 469, 470, 471, -1, -1, 474, -1, -1, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 3, + 379, 380, 381, -1, 383, 384, 385, 386, 387, 388, + 389, -1, 391, 392, -1, 394, 395, 396, 397, 398, + -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, -1, 413, -1, -1, -1, 417, 418, + -1, 420, 421, 422, 423, 424, 425, 426, -1, 428, + 429, 430, -1, -1, 433, 434, -1, 436, -1, -1, + 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, + 449, 450, 451, -1, 453, 454, 455, 456, -1, 458, + 459, 460, 461, 462, -1, 464, -1, 466, 467, 468, + 469, 470, 471, 472, 473, 474, -1, 22, 477, -1, + -1, 480, 481, 482, 483, 484, 485, 32, -1, 34, + 35, -1, -1, -1, -1, 22, -1, -1, 497, 498, + 499, 500, -1, -1, -1, 32, -1, 52, -1, -1, + -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, + -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, + 75, -1, -1, -1, 61, -1, -1, -1, -1, -1, + -1, 86, -1, -1, -1, -1, -1, -1, 75, -1, + -1, -1, -1, 98, -1, 100, -1, -1, -1, 86, + -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, + -1, 98, -1, 100, -1, -1, -1, -1, -1, -1, + -1, 126, 127, -1, 111, -1, -1, -1, -1, -1, + -1, -1, 137, -1, -1, -1, -1, -1, 143, 126, + 127, -1, -1, -1, -1, -1, 151, -1, -1, -1, + 137, -1, -1, -1, -1, -1, 143, -1, -1, -1, + -1, -1, -1, 168, 151, -1, -1, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, 32, 33, - -1, -1, -1, 37, -1, -1, -1, -1, 42, 43, - 44, -1, 46, 47, 48, 49, 50, 51, 52, -1, - 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, - 64, -1, -1, 67, 68, 69, 70, 71, 72, 73, - -1, 75, 76, 77, 78, -1, -1, 81, -1, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, - 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, -1, 118, -1, 120, 121, 122, 123, - 124, 125, -1, -1, 128, 129, 130, 131, -1, -1, - 134, 135, 136, 137, 138, -1, 140, 141, 142, -1, - 144, 145, 146, -1, 148, 149, 150, 151, -1, 153, - 154, 155, 156, 157, -1, -1, 160, -1, 162, 163, - 164, 165, -1, 167, -1, 169, 170, -1, 172, 173, - 174, -1, 176, 177, -1, 179, -1, -1, -1, 183, - 184, -1, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, 207, 208, -1, 210, 211, 212, 213, - 214, 215, 216, -1, 218, -1, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, -1, -1, 233, - 234, 235, 236, -1, 238, 239, 240, 241, 242, 243, - 244, 245, -1, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, -1, - -1, 275, 276, 277, 278, -1, -1, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, 291, 292, 293, - -1, -1, 296, 297, -1, 299, 300, 301, -1, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - -1, -1, -1, -1, 318, 319, -1, 321, 322, 323, - -1, 325, 326, 327, -1, 329, 330, 331, 332, 333, - 334, -1, 336, 337, 338, 339, 340, 341, 342, 343, - -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, -1, 359, 360, 361, 362, 363, - 364, -1, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, -1, 380, 381, 382, 383, - 384, 385, 386, -1, 388, 389, -1, 391, 392, 393, - 394, 395, -1, 397, 398, 399, 400, 401, 402, 403, - 404, 405, 406, 407, 408, -1, 410, -1, -1, -1, - 414, 415, -1, 417, 418, 419, 420, 421, 422, 423, - -1, 425, 426, 427, -1, -1, 430, 431, -1, 433, - -1, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, 447, 448, -1, 450, 451, 452, 453, - -1, 455, 456, 457, 458, 459, -1, 461, -1, 463, - 464, 465, 466, 467, 468, 469, 470, 471, -1, 22, - 474, -1, -1, 477, 478, 479, 480, 481, 482, 32, - -1, 34, 35, -1, -1, -1, -1, 22, -1, -1, - 494, 495, 496, 497, -1, -1, -1, 32, -1, 52, - -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, - -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, - -1, -1, 75, -1, -1, -1, 61, -1, -1, -1, - -1, -1, -1, 86, -1, -1, -1, -1, -1, -1, - 75, -1, -1, -1, -1, 98, -1, 100, -1, -1, - -1, 86, -1, -1, -1, -1, -1, -1, 111, -1, - -1, -1, -1, 98, -1, 100, -1, -1, -1, -1, - -1, -1, -1, 126, 127, -1, 111, -1, -1, -1, - -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, - 143, 126, 127, -1, -1, -1, -1, -1, 151, -1, - -1, -1, 137, -1, -1, -1, -1, -1, 143, -1, - -1, -1, -1, -1, 167, -1, 151, -1, 171, -1, + -1, 168, -1, -1, -1, 172, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 214, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 167, -1, -1, -1, 171, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 214, -1, -1, + -1, -1, -1, -1, -1, 240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 213, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 213, -1, - -1, -1, -1, -1, -1, -1, 239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 315, 316, 317, -1, -1, -1, -1, -1, 323, -1, + -1, 326, -1, -1, -1, -1, -1, -1, 315, 316, + 317, -1, -1, -1, -1, -1, 323, -1, -1, 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 357, -1, -1, -1, -1, -1, -1, -1, + -1, 366, -1, -1, -1, -1, -1, -1, -1, -1, + 357, -1, -1, -1, -1, -1, -1, 382, -1, 366, + -1, -1, -1, -1, 389, -1, -1, -1, 393, -1, + -1, -1, -1, -1, -1, 382, -1, -1, 403, -1, + -1, -1, 389, -1, -1, -1, 393, -1, -1, -1, + 415, -1, -1, -1, 419, -1, 403, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 415, -1, + -1, -1, 419, -1, 439, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 452, -1, -1, + -1, -1, 439, 458, -1, -1, -1, -1, 463, -1, + -1, -1, 467, -1, -1, 452, -1, -1, -1, -1, + -1, 458, -1, -1, 479, -1, 463, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 314, 315, 316, -1, -1, -1, -1, -1, 322, - -1, -1, 325, -1, -1, -1, -1, -1, -1, 314, - 315, 316, -1, -1, -1, -1, -1, 322, -1, -1, - 325, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 354, -1, -1, -1, -1, -1, -1, -1, -1, - 363, -1, -1, -1, -1, -1, -1, -1, -1, 354, - -1, -1, -1, -1, -1, -1, 379, -1, 363, -1, - -1, -1, -1, 386, -1, -1, -1, 390, -1, -1, - -1, -1, -1, -1, 379, -1, -1, 400, -1, -1, - -1, 386, -1, -1, -1, 390, -1, -1, -1, 412, - -1, -1, -1, 416, -1, 400, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 412, -1, -1, - -1, 416, -1, 436, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 449, -1, -1, -1, - -1, 436, 455, -1, -1, -1, -1, 460, -1, -1, - -1, 464, -1, -1, 449, -1, -1, -1, -1, -1, - 455, -1, -1, 476, -1, 460, -1, -1, -1, -1, + -1, -1, 479, -1, -1, -1, -1, -1, 503, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 476, -1, -1, -1, -1, -1, 500, -1, -1, + -1, -1, 517, -1, -1, -1, 503, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 514, -1, -1, -1, 500, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 514 + 517 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint16 yystos[] = +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_int16 yystos[] = { 0, 22, 32, 34, 35, 47, 52, 61, 75, 84, 86, 98, 100, 111, 126, 127, 128, 137, 143, 151, - 153, 154, 167, 171, 197, 213, 239, 314, 315, 316, - 322, 325, 354, 363, 379, 386, 390, 400, 412, 416, - 436, 449, 452, 455, 460, 476, 500, 514, 526, 527, - 528, 529, 540, 549, 551, 556, 572, 575, 576, 578, - 582, 586, 593, 595, 597, 598, 646, 652, 655, 656, - 674, 675, 676, 677, 679, 681, 682, 686, 739, 740, - 908, 911, 914, 921, 922, 924, 927, 928, 929, 936, - 940, 946, 949, 954, 958, 959, 960, 963, 966, 967, - 968, 972, 973, 975, 430, 479, 596, 202, 370, 381, - 416, 466, 108, 191, 961, 596, 3, 22, 23, 24, - 25, 26, 27, 28, 29, 31, 32, 33, 42, 43, - 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 59, 60, 61, 62, 63, 64, 67, - 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, - 79, 81, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 94, 95, 96, 97, 98, 99, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 118, 120, 121, 122, 123, 124, - 125, 128, 129, 130, 131, 134, 135, 136, 137, 138, - 140, 141, 142, 144, 145, 146, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 160, 162, 163, - 164, 165, 167, 169, 170, 172, 173, 174, 175, 176, - 177, 179, 181, 182, 183, 184, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 199, 200, - 201, 202, 203, 204, 205, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 218, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 233, 234, 235, - 236, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 275, 276, 277, - 278, 280, 281, 282, 283, 284, 285, 287, 288, 291, - 292, 293, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 329, 330, 331, 332, 333, 334, 336, 337, 338, 339, - 340, 341, 342, 343, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 381, 382, 383, - 384, 385, 386, 387, 388, 389, 391, 392, 393, 394, - 395, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 414, 415, 417, 418, - 419, 420, 421, 422, 423, 425, 426, 427, 430, 431, - 432, 433, 434, 436, 437, 438, 439, 440, 441, 442, - 443, 446, 447, 448, 450, 451, 452, 453, 455, 456, - 457, 458, 459, 460, 461, 463, 464, 465, 466, 467, - 468, 469, 470, 471, 474, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 542, 817, 897, 901, - 978, 979, 980, 3, 175, 246, 409, 542, 923, 978, - 289, 596, 55, 171, 514, 669, 177, 240, 294, 313, - 370, 420, 422, 439, 445, 448, 580, 644, 920, 5, - 30, 325, 542, 543, 896, 3, 30, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 45, 49, 53, 54, - 55, 56, 57, 58, 65, 66, 71, 72, 74, 79, - 80, 81, 82, 83, 89, 93, 100, 101, 108, 112, - 115, 117, 119, 126, 127, 132, 133, 139, 143, 147, - 152, 158, 159, 161, 164, 166, 168, 170, 171, 172, - 175, 176, 178, 180, 181, 182, 185, 193, 198, 206, - 208, 209, 215, 216, 217, 218, 219, 221, 222, 224, - 231, 232, 234, 236, 237, 246, 267, 268, 269, 273, - 274, 277, 279, 280, 282, 286, 289, 290, 294, 295, - 298, 299, 301, 302, 314, 315, 316, 317, 320, 321, - 324, 328, 335, 339, 344, 358, 361, 365, 379, 380, - 387, 390, 391, 394, 396, 409, 411, 412, 413, 416, - 418, 424, 426, 427, 428, 429, 432, 434, 435, 438, - 444, 445, 449, 454, 460, 461, 462, 464, 472, 473, - 475, 476, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 548, 978, 982, 984, 24, 81, 97, - 146, 156, 168, 173, 202, 245, 249, 319, 334, 367, - 370, 381, 384, 402, 416, 422, 423, 433, 439, 466, - 580, 647, 648, 651, 596, 896, 100, 137, 464, 514, - 529, 540, 549, 551, 572, 575, 576, 582, 586, 595, - 598, 646, 652, 655, 656, 674, 908, 911, 914, 921, - 922, 932, 936, 940, 946, 949, 954, 963, 966, 972, - 973, 975, 108, 75, 213, 66, 79, 81, 158, 231, - 280, 290, 302, 320, 366, 411, 432, 434, 438, 460, - 514, 541, 542, 543, 675, 740, 742, 744, 754, 761, - 762, 817, 819, 820, 108, 5, 542, 544, 947, 947, - 542, 896, 30, 177, 240, 385, 426, 430, 542, 964, - 965, 970, 596, 30, 132, 695, 696, 177, 240, 370, - 385, 426, 941, 942, 970, 596, 542, 674, 686, 971, - 542, 761, 416, 692, 541, 172, 514, 951, 514, 342, - 687, 688, 896, 687, 675, 676, 966, 0, 517, 122, - 212, 451, 147, 217, 295, 444, 698, 699, 744, 744, - 675, 677, 679, 518, 464, 930, 30, 426, 430, 674, - 971, 191, 541, 896, 191, 541, 191, 761, 191, 541, - 274, 544, 512, 516, 545, 546, 514, 82, 108, 173, - 202, 245, 370, 381, 416, 439, 466, 926, 108, 674, - 541, 420, 422, 420, 422, 352, 191, 541, 541, 377, - 173, 245, 342, 381, 416, 466, 653, 202, 30, 896, - 191, 548, 251, 433, 107, 416, 416, 466, 374, 377, - 191, 542, 649, 903, 191, 893, 896, 191, 896, 514, - 585, 294, 422, 932, 3, 460, 933, 935, 936, 938, - 939, 978, 982, 930, 542, 544, 923, 947, 514, 514, - 166, 514, 675, 762, 514, 514, 541, 514, 514, 171, - 514, 514, 514, 514, 675, 740, 744, 754, 507, 545, - 40, 542, 755, 756, 755, 379, 518, 678, 37, 42, - 101, 172, 208, 224, 234, 268, 314, 321, 361, 380, - 449, 758, 756, 40, 542, 755, 757, 500, 766, 544, - 171, 503, 514, 514, 909, 965, 965, 965, 497, 223, - 516, 289, 4, 6, 7, 8, 9, 10, 39, 54, - 56, 57, 65, 71, 72, 83, 112, 115, 117, 136, - 152, 159, 164, 181, 182, 215, 216, 218, 246, 267, - 269, 274, 279, 282, 291, 339, 365, 394, 426, 427, - 435, 461, 498, 505, 506, 507, 512, 514, 519, 520, - 522, 523, 542, 544, 675, 729, 778, 781, 784, 785, - 786, 788, 789, 790, 791, 793, 794, 809, 811, 812, - 813, 814, 815, 816, 817, 818, 820, 821, 836, 837, - 848, 870, 875, 883, 884, 885, 897, 898, 899, 882, - 884, 941, 941, 544, 941, 497, 171, 428, 503, 516, - 545, 761, 955, 3, 170, 172, 464, 936, 950, 952, - 170, 953, 809, 854, 855, 687, 518, 514, 905, 515, - 515, 515, 528, 171, 294, 559, 955, 30, 132, 693, - 693, 59, 693, 161, 166, 237, 286, 704, 706, 707, - 732, 734, 735, 736, 180, 289, 454, 289, 698, 699, - 514, 541, 417, 969, 497, 223, 152, 26, 32, 137, - 293, 350, 354, 386, 457, 534, 537, 538, 350, 152, - 40, 60, 106, 201, 250, 260, 272, 304, 350, 356, - 381, 386, 400, 537, 587, 590, 152, 350, 386, 537, - 152, 350, 386, 537, 152, 40, 962, 809, 876, 547, - 548, 546, 3, 30, 37, 42, 49, 55, 81, 83, - 89, 101, 132, 170, 172, 175, 176, 193, 208, 221, - 222, 224, 234, 236, 246, 268, 277, 299, 301, 321, - 361, 380, 391, 409, 418, 438, 462, 464, 515, 809, - 857, 858, 900, 906, 978, 983, 809, 416, 541, 542, - 515, 514, 633, 370, 580, 644, 274, 912, 40, 191, - 542, 579, 466, 191, 541, 191, 541, 977, 191, 541, - 191, 541, 89, 917, 152, 480, 90, 129, 307, 421, - 191, 542, 152, 516, 904, 63, 357, 518, 650, 152, - 518, 650, 152, 289, 583, 584, 809, 906, 352, 515, - 518, 4, 159, 289, 435, 505, 506, 544, 589, 592, - 899, 931, 933, 934, 937, 932, 428, 514, 664, 668, - 171, 809, 855, 514, 3, 68, 69, 109, 110, 113, - 114, 188, 189, 252, 253, 254, 255, 256, 257, 258, - 259, 262, 263, 375, 376, 470, 471, 494, 495, 544, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, - 806, 807, 860, 861, 756, 757, 809, 541, 809, 862, - 505, 506, 542, 810, 811, 837, 848, 864, 514, 809, - 854, 865, 809, 58, 171, 232, 429, 809, 855, 868, - 809, 515, 543, 514, 418, 712, 713, 713, 695, 696, - 744, 219, 690, 224, 37, 224, 380, 758, 224, 299, - 759, 744, 759, 224, 758, 514, 224, 759, 224, 148, - 199, 746, 224, 713, 514, 543, 514, 713, 296, 542, - 544, 948, 809, 943, 945, 857, 3, 37, 42, 49, - 54, 55, 56, 57, 71, 72, 81, 83, 89, 101, - 112, 115, 164, 170, 172, 176, 193, 208, 215, 216, - 218, 221, 222, 224, 234, 236, 246, 267, 268, 269, - 277, 282, 299, 301, 321, 339, 361, 365, 380, 387, - 391, 394, 409, 418, 426, 427, 438, 444, 461, 464, - 772, 774, 775, 777, 779, 781, 783, 785, 786, 787, - 789, 790, 793, 794, 859, 902, 978, 981, 40, 235, - 542, 514, 512, 675, 463, 792, 809, 874, 792, 792, - 514, 514, 780, 780, 324, 675, 514, 782, 520, 71, - 72, 792, 809, 780, 514, 514, 478, 500, 514, 795, - 514, 795, 809, 809, 809, 148, 886, 887, 809, 855, - 856, 675, 809, 854, 543, 838, 839, 840, 9, 548, - 516, 545, 877, 545, 514, 544, 514, 514, 544, 899, - 3, 8, 11, 15, 16, 17, 18, 19, 20, 21, - 36, 40, 46, 53, 80, 176, 193, 198, 221, 222, - 236, 274, 277, 291, 294, 391, 498, 501, 502, 503, - 505, 506, 507, 508, 509, 510, 846, 847, 848, 850, - 880, 477, 822, 301, 809, 518, 690, 514, 544, 690, - 3, 117, 240, 544, 589, 794, 944, 104, 945, 945, - 542, 40, 542, 515, 518, 930, 518, 515, 688, 893, - 894, 40, 955, 192, 352, 219, 386, 677, 677, 30, - 700, 701, 809, 59, 677, 694, 163, 271, 720, 226, - 272, 338, 389, 451, 4, 9, 30, 715, 809, 505, - 506, 716, 717, 809, 811, 732, 733, 707, 706, 704, - 705, 166, 735, 284, 737, 59, 683, 684, 685, 747, - 810, 884, 884, 704, 732, 855, 905, 235, 541, 74, - 82, 93, 168, 191, 328, 445, 542, 615, 625, 640, - 82, 93, 550, 93, 550, 514, 428, 514, 613, 244, - 448, 613, 93, 518, 428, 541, 3, 777, 589, 59, - 591, 589, 589, 106, 250, 260, 59, 428, 476, 500, - 588, 265, 370, 588, 590, 761, 93, 428, 550, 370, - 541, 428, 370, 961, 542, 664, 513, 524, 857, 857, - 858, 518, 698, 699, 13, 14, 221, 221, 428, 428, - 542, 632, 637, 476, 667, 541, 377, 342, 381, 416, - 466, 653, 152, 100, 576, 598, 913, 914, 973, 144, - 774, 274, 198, 581, 541, 274, 577, 587, 274, 514, - 633, 40, 274, 633, 274, 514, 654, 191, 542, 627, - 918, 548, 152, 171, 594, 649, 547, 516, 903, 893, - 896, 896, 903, 515, 518, 13, 932, 938, 4, 899, - 4, 899, 544, 548, 666, 673, 55, 102, 123, 141, - 145, 167, 170, 186, 279, 287, 309, 336, 670, 948, - 40, 515, 809, 515, 171, 518, 515, 317, 863, 515, - 810, 810, 11, 15, 16, 19, 20, 21, 198, 221, - 291, 501, 502, 503, 505, 506, 507, 508, 509, 510, - 848, 810, 515, 763, 764, 819, 166, 171, 866, 867, - 518, 515, 40, 868, 855, 868, 868, 171, 515, 40, - 755, 514, 894, 4, 9, 542, 708, 710, 711, 884, - 882, 177, 240, 416, 420, 422, 448, 541, 691, 473, - 767, 744, 744, 224, 744, 289, 454, 760, 744, 224, - 884, 744, 744, 281, 281, 514, 744, 543, 768, 769, - 514, 543, 768, 518, 515, 518, 516, 514, 777, 514, - 514, 516, 39, 776, 514, 796, 797, 798, 799, 800, - 801, 802, 803, 804, 805, 806, 807, 808, 515, 518, - 780, 551, 655, 656, 674, 910, 954, 966, 855, 856, - 514, 472, 871, 872, 809, 856, 899, 809, 841, 842, - 843, 844, 792, 792, 8, 15, 16, 19, 20, 21, - 501, 502, 503, 505, 506, 507, 508, 509, 510, 542, - 846, 851, 515, 855, 426, 426, 899, 899, 514, 542, - 352, 891, 166, 513, 515, 518, 524, 518, 521, 507, - 546, 855, 899, 809, 808, 808, 774, 809, 809, 809, - 809, 809, 809, 809, 809, 5, 548, 907, 426, 45, - 413, 881, 903, 809, 809, 514, 675, 869, 132, 159, - 274, 279, 284, 435, 446, 809, 279, 514, 809, 428, - 53, 176, 193, 198, 236, 391, 809, 809, 809, 809, - 809, 809, 809, 809, 809, 809, 30, 38, 396, 845, - 512, 516, 879, 180, 162, 823, 365, 514, 837, 885, - 171, 741, 857, 741, 514, 544, 542, 541, 950, 541, - 958, 809, 518, 515, 249, 274, 689, 454, 957, 541, - 553, 514, 542, 558, 568, 569, 571, 41, 126, 702, - 518, 454, 702, 265, 677, 365, 366, 505, 506, 717, - 719, 811, 389, 226, 290, 312, 312, 518, 509, 4, - 718, 899, 718, 365, 366, 719, 541, 892, 278, 393, - 738, 514, 894, 895, 518, 180, 454, 198, 180, 219, - 733, 705, 515, 350, 537, 514, 191, 625, 896, 226, - 274, 226, 454, 514, 618, 773, 774, 896, 542, 191, - 896, 191, 542, 26, 137, 386, 533, 536, 548, 609, - 623, 896, 548, 617, 636, 896, 534, 896, 350, 386, - 537, 587, 589, 903, 896, 589, 903, 896, 589, 350, - 386, 537, 896, 896, 896, 896, 350, 386, 537, 896, - 896, 544, 506, 809, 876, 698, 698, 698, 462, 858, - 192, 355, 697, 809, 809, 279, 544, 925, 279, 925, - 542, 333, 663, 515, 518, 287, 171, 428, 658, 912, - 579, 466, 541, 541, 977, 541, 541, 541, 294, 644, - 514, 675, 152, 3, 514, 514, 152, 152, 236, 542, - 615, 625, 628, 631, 641, 643, 476, 478, 620, 151, - 674, 152, 476, 919, 152, 515, 857, 40, 274, 289, - 542, 3, 650, 547, 650, 289, 650, 583, 809, 664, - 507, 512, 514, 589, 665, 815, 816, 937, 515, 518, - 40, 662, 544, 662, 274, 279, 336, 662, 59, 662, - 774, 515, 809, 809, 809, 866, 774, 810, 810, 810, - 810, 810, 810, 132, 274, 284, 810, 810, 810, 810, - 810, 810, 810, 810, 810, 810, 515, 518, 40, 765, - 809, 809, 867, 866, 774, 515, 515, 515, 855, 774, - 894, 515, 312, 509, 312, 366, 509, 514, 514, 690, - 420, 422, 420, 422, 541, 692, 692, 692, 809, 180, - 721, 760, 760, 744, 809, 514, 744, 166, 760, 514, - 543, 751, 760, 774, 515, 518, 768, 515, 943, 3, - 859, 39, 776, 542, 771, 771, 3, 512, 512, 899, - 428, 428, 428, 428, 774, 515, 513, 855, 809, 139, - 872, 873, 515, 515, 515, 524, 518, 521, 516, 515, - 515, 497, 497, 515, 515, 894, 514, 809, 888, 542, - 809, 809, 838, 887, 515, 515, 515, 497, 810, 810, - 145, 855, 171, 132, 159, 279, 284, 435, 446, 514, - 145, 851, 809, 413, 881, 809, 869, 809, 428, 514, - 675, 809, 876, 547, 514, 514, 155, 824, 742, 743, - 767, 698, 767, 899, 808, 905, 905, 249, 514, 743, - 473, 956, 40, 59, 554, 564, 571, 877, 518, 741, - 503, 499, 703, 701, 291, 846, 849, 703, 4, 899, - 719, 290, 451, 716, 518, 243, 894, 683, 59, 884, - 514, 543, 59, 265, 428, 809, 274, 640, 514, 152, - 514, 618, 202, 637, 638, 599, 40, 175, 608, 634, - 599, 26, 137, 354, 356, 386, 530, 531, 532, 538, - 539, 152, 650, 152, 650, 609, 623, 609, 515, 518, - 544, 602, 503, 516, 515, 518, 428, 370, 93, 428, - 550, 370, 428, 428, 428, 370, 962, 524, 513, 524, - 697, 697, 697, 858, 281, 281, 515, 514, 657, 3, - 403, 404, 544, 672, 632, 663, 581, 541, 577, 514, - 40, 633, 654, 912, 352, 416, 544, 573, 574, 579, - 673, 637, 541, 541, 977, 541, 515, 518, 287, 613, - 287, 289, 612, 896, 476, 976, 541, 613, 40, 541, - 515, 416, 809, 152, 541, 594, 903, 660, 671, 937, - 666, 544, 544, 279, 637, 507, 637, 544, 507, 637, - 544, 515, 515, 867, 171, 132, 284, 514, 766, 763, - 514, 515, 515, 515, 542, 708, 767, 692, 692, 692, - 692, 541, 541, 541, 59, 185, 730, 760, 894, 514, - 748, 749, 750, 812, 814, 894, 166, 80, 770, 769, - 515, 515, 512, 774, 515, 518, 515, 899, 513, 899, - 515, 797, 799, 800, 801, 800, 801, 801, 515, 424, - 809, 143, 809, 841, 851, 795, 795, 515, 809, 888, - 889, 890, 40, 198, 515, 891, 808, 809, 36, 36, - 809, 515, 809, 171, 514, 859, 809, 515, 145, 810, - 810, 145, 145, 809, 809, 513, 524, 514, 878, 699, - 473, 809, 300, 828, 518, 721, 697, 721, 515, 910, - 809, 358, 562, 542, 265, 320, 117, 303, 514, 552, - 674, 515, 518, 558, 956, 809, 163, 230, 514, 703, - 290, 541, 515, 895, 180, 675, 676, 884, 895, 896, - 896, 515, 152, 638, 625, 638, 599, 627, 518, 515, - 119, 206, 272, 274, 624, 514, 33, 59, 645, 634, - 74, 80, 93, 117, 119, 206, 274, 279, 328, 344, - 445, 454, 604, 605, 619, 175, 117, 190, 274, 613, - 588, 107, 117, 175, 274, 402, 405, 590, 613, 386, - 532, 439, 896, 542, 536, 3, 37, 42, 49, 55, - 81, 83, 89, 101, 170, 172, 175, 176, 193, 208, - 221, 222, 224, 234, 236, 246, 268, 273, 277, 291, - 299, 301, 321, 361, 380, 387, 391, 409, 418, 438, - 444, 464, 505, 506, 544, 589, 600, 639, 774, 849, - 900, 978, 984, 548, 636, 896, 896, 896, 896, 896, - 896, 896, 896, 896, 896, 664, 876, 876, 515, 515, - 515, 698, 107, 370, 516, 588, 672, 514, 514, 631, - 674, 919, 40, 644, 191, 541, 515, 518, 581, 515, - 515, 577, 514, 40, 622, 620, 628, 86, 585, 107, - 272, 633, 674, 654, 674, 627, 454, 916, 650, 515, - 518, 637, 810, 171, 514, 859, 768, 515, 518, 515, - 721, 541, 541, 541, 541, 30, 103, 181, 364, 514, - 722, 723, 724, 725, 726, 727, 728, 809, 809, 475, - 825, 515, 811, 852, 853, 198, 180, 745, 749, 515, - 751, 752, 753, 903, 776, 899, 776, 542, 776, 513, - 513, 809, 518, 515, 542, 809, 811, 809, 809, 809, - 859, 515, 809, 36, 36, 809, 809, 145, 515, 506, - 876, 515, 857, 515, 809, 515, 514, 542, 829, 730, - 515, 730, 544, 515, 883, 460, 415, 453, 563, 542, - 557, 567, 289, 560, 503, 571, 562, 851, 59, 515, - 515, 459, 460, 680, 599, 625, 515, 515, 476, 630, - 120, 194, 204, 119, 456, 809, 117, 40, 514, 903, - 896, 810, 120, 194, 119, 279, 226, 541, 630, 88, - 645, 191, 279, 589, 809, 645, 279, 505, 506, 592, - 542, 774, 650, 650, 3, 246, 409, 900, 904, 503, - 428, 428, 513, 513, 697, 515, 515, 542, 664, 454, - 659, 661, 673, 637, 515, 976, 40, 416, 809, 416, - 274, 514, 544, 514, 919, 631, 151, 674, 149, 200, - 612, 122, 137, 327, 976, 107, 919, 476, 974, 40, - 289, 542, 915, 514, 671, 810, 859, 515, 515, 9, - 351, 714, 730, 514, 388, 514, 515, 518, 542, 826, - 827, 335, 731, 518, 515, 514, 543, 59, 515, 198, - 515, 752, 513, 774, 888, 513, 191, 515, 809, 809, - 809, 524, 513, 524, 515, 515, 542, 830, 825, 544, - 825, 518, 459, 877, 515, 518, 91, 562, 809, 515, - 895, 895, 344, 630, 514, 621, 599, 515, 190, 514, - 809, 274, 605, 630, 633, 896, 40, 152, 770, 904, - 509, 600, 896, 896, 515, 588, 124, 515, 515, 620, - 674, 674, 541, 152, 673, 40, 515, 896, 976, 30, - 85, 94, 118, 190, 203, 402, 405, 616, 616, 366, - 366, 40, 64, 74, 240, 416, 809, 541, 514, 542, - 561, 570, 819, 515, 515, 514, 825, 855, 514, 855, - 724, 40, 518, 809, 454, 709, 811, 884, 894, 756, - 514, 756, 809, 876, 876, 309, 831, 731, 731, 674, - 303, 674, 557, 289, 514, 555, 541, 599, 548, 626, - 629, 406, 468, 606, 607, 514, 601, 809, 515, 248, - 642, 190, 454, 535, 509, 439, 664, 544, 919, 612, - 974, 514, 541, 515, 674, 620, 585, 674, 74, 292, - 74, 674, 916, 809, 80, 565, 515, 518, 565, 9, - 731, 515, 723, 515, 829, 827, 368, 515, 884, 513, - 513, 513, 59, 698, 709, 709, 563, 93, 570, 133, - 633, 503, 515, 518, 587, 515, 272, 614, 172, 308, - 392, 289, 610, 611, 635, 601, 809, 439, 40, 514, - 974, 612, 976, 974, 292, 292, 514, 515, 903, 566, - 903, 919, 561, 566, 515, 709, 515, 711, 515, 854, - 183, 337, 366, 832, 459, 896, 515, 275, 451, 642, - 600, 629, 515, 607, 204, 122, 451, 289, 635, 289, - 610, 674, 570, 565, 702, 767, 702, 53, 104, 441, - 809, 833, 834, 833, 833, 515, 674, 767, 386, 611, - 63, 272, 357, 386, 603, 603, 974, 515, 566, 703, - 703, 834, 365, 165, 323, 165, 323, 148, 835, 835, - 835, 569, 599, 25, 117, 279, 919, 702, 36, 104, - 180, 272, 425, 767, 767, 703, 834, 365, 297 + 153, 154, 168, 172, 198, 240, 315, 316, 317, 323, + 326, 357, 366, 382, 389, 393, 403, 415, 419, 439, + 452, 455, 458, 463, 479, 503, 517, 529, 530, 531, + 532, 533, 540, 551, 552, 553, 556, 557, 559, 570, + 588, 636, 646, 649, 652, 656, 658, 661, 662, 666, + 672, 674, 678, 685, 689, 690, 691, 698, 703, 719, + 720, 723, 724, 727, 729, 730, 731, 732, 734, 736, + 737, 741, 794, 795, 964, 966, 967, 968, 969, 974, + 977, 983, 984, 985, 989, 433, 482, 965, 203, 373, + 384, 419, 469, 108, 192, 554, 965, 3, 22, 23, + 24, 25, 26, 27, 28, 29, 31, 32, 33, 42, + 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 59, 60, 61, 62, 63, 64, + 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, + 78, 79, 81, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 94, 95, 96, 97, 98, 99, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 118, 120, 121, 122, 123, + 124, 125, 128, 129, 130, 131, 134, 135, 136, 137, + 138, 140, 141, 142, 144, 145, 146, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 161, + 163, 164, 165, 166, 168, 170, 171, 173, 174, 175, + 176, 177, 178, 180, 182, 183, 184, 185, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 200, 201, 202, 203, 204, 205, 206, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 219, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 234, + 235, 236, 237, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 276, + 277, 278, 279, 281, 282, 283, 284, 285, 286, 288, + 289, 292, 293, 294, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 330, 331, 332, 333, 334, 335, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 394, 395, 396, 397, 398, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 417, 418, 420, 421, 422, 423, 424, 425, 426, 428, + 429, 430, 433, 434, 435, 436, 437, 439, 440, 441, + 442, 443, 444, 445, 446, 449, 450, 451, 453, 454, + 455, 456, 458, 459, 460, 461, 462, 463, 464, 466, + 467, 468, 469, 470, 471, 472, 473, 474, 477, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 563, 639, 640, 641, 873, 953, 957, 3, 176, 247, + 412, 558, 563, 639, 290, 965, 55, 172, 517, 583, + 178, 241, 295, 314, 373, 423, 425, 442, 448, 451, + 634, 654, 697, 5, 30, 326, 563, 564, 952, 3, + 30, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 45, 49, 53, 54, 55, 56, 57, 58, 65, 66, + 71, 72, 74, 79, 80, 81, 82, 83, 89, 93, + 100, 101, 108, 112, 115, 117, 119, 126, 127, 132, + 133, 139, 143, 147, 152, 159, 160, 162, 165, 167, + 169, 171, 172, 173, 176, 177, 179, 181, 182, 183, + 186, 194, 199, 207, 209, 210, 216, 217, 218, 219, + 220, 222, 223, 225, 232, 233, 235, 237, 238, 247, + 268, 269, 270, 274, 275, 278, 280, 281, 283, 287, + 290, 291, 295, 296, 299, 300, 302, 303, 315, 316, + 317, 318, 321, 322, 325, 329, 336, 342, 347, 361, + 364, 368, 382, 383, 390, 393, 394, 397, 399, 412, + 414, 415, 416, 419, 421, 427, 429, 430, 431, 432, + 435, 437, 438, 441, 447, 448, 452, 457, 463, 464, + 465, 467, 475, 476, 478, 479, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 569, 639, 643, + 645, 24, 81, 97, 146, 156, 169, 174, 203, 246, + 250, 320, 335, 370, 373, 384, 387, 405, 419, 425, + 426, 436, 442, 469, 654, 667, 668, 671, 965, 952, + 100, 137, 467, 517, 532, 533, 540, 556, 557, 570, + 588, 636, 646, 649, 656, 658, 661, 662, 666, 674, + 681, 685, 691, 698, 719, 723, 724, 727, 729, 964, + 966, 967, 969, 974, 977, 983, 989, 108, 75, 66, + 79, 81, 159, 232, 281, 291, 303, 321, 369, 414, + 435, 437, 441, 463, 517, 562, 563, 564, 730, 795, + 797, 799, 809, 816, 817, 873, 875, 876, 108, 5, + 563, 565, 721, 563, 952, 30, 178, 241, 388, 429, + 433, 563, 975, 976, 987, 965, 30, 132, 750, 751, + 178, 241, 373, 388, 429, 978, 979, 987, 965, 563, + 729, 741, 988, 563, 816, 419, 747, 562, 173, 517, + 971, 517, 345, 742, 743, 952, 742, 730, 731, 983, + 0, 520, 467, 679, 122, 213, 454, 214, 147, 218, + 296, 447, 753, 754, 799, 799, 730, 732, 734, 521, + 30, 429, 433, 729, 988, 192, 562, 952, 192, 562, + 192, 816, 192, 562, 275, 565, 515, 519, 566, 567, + 517, 82, 108, 174, 203, 246, 373, 384, 419, 442, + 469, 561, 108, 729, 562, 423, 425, 423, 425, 355, + 192, 562, 562, 174, 246, 345, 384, 419, 469, 647, + 380, 203, 30, 952, 192, 569, 252, 436, 107, 419, + 419, 469, 377, 380, 192, 563, 669, 959, 192, 949, + 952, 192, 952, 517, 677, 295, 425, 681, 3, 463, + 639, 643, 682, 684, 685, 687, 688, 679, 563, 565, + 558, 517, 517, 167, 517, 730, 817, 517, 517, 562, + 517, 517, 172, 517, 517, 517, 517, 730, 795, 799, + 809, 510, 566, 40, 563, 810, 811, 810, 382, 521, + 733, 37, 42, 101, 173, 209, 225, 235, 269, 315, + 322, 364, 383, 452, 813, 811, 40, 563, 810, 812, + 503, 821, 565, 506, 517, 517, 725, 976, 976, 976, + 500, 224, 519, 290, 4, 6, 7, 8, 9, 10, + 39, 54, 56, 57, 65, 71, 72, 83, 112, 115, + 117, 136, 152, 160, 165, 182, 183, 216, 217, 219, + 247, 268, 270, 275, 280, 283, 292, 342, 368, 397, + 429, 430, 438, 464, 501, 508, 509, 510, 515, 517, + 522, 523, 525, 526, 563, 565, 730, 784, 833, 836, + 839, 840, 841, 843, 844, 845, 846, 848, 849, 865, + 867, 868, 869, 870, 871, 872, 873, 874, 876, 877, + 892, 893, 904, 926, 931, 939, 940, 941, 953, 954, + 955, 938, 940, 978, 978, 565, 978, 500, 172, 431, + 506, 519, 566, 663, 816, 3, 171, 173, 467, 685, + 970, 972, 171, 973, 865, 910, 911, 742, 521, 517, + 961, 518, 518, 518, 531, 562, 172, 295, 706, 157, + 663, 721, 30, 132, 748, 748, 59, 748, 162, 167, + 238, 287, 759, 761, 762, 787, 789, 790, 791, 181, + 290, 457, 290, 753, 754, 517, 420, 986, 500, 224, + 152, 26, 32, 137, 294, 353, 357, 389, 460, 545, + 548, 549, 353, 152, 40, 60, 106, 202, 251, 261, + 273, 305, 353, 359, 384, 389, 403, 534, 537, 548, + 152, 353, 389, 548, 152, 353, 389, 548, 152, 40, + 555, 865, 932, 568, 569, 567, 3, 30, 37, 42, + 49, 55, 81, 83, 89, 101, 132, 171, 173, 176, + 177, 194, 209, 222, 223, 225, 235, 237, 247, 269, + 278, 300, 302, 322, 364, 383, 394, 412, 421, 441, + 465, 467, 518, 639, 644, 865, 913, 914, 956, 962, + 865, 419, 562, 563, 518, 517, 623, 373, 634, 654, + 275, 650, 40, 469, 192, 562, 192, 562, 638, 192, + 562, 192, 562, 192, 563, 653, 89, 694, 152, 483, + 90, 129, 308, 424, 192, 563, 152, 519, 960, 63, + 360, 521, 670, 152, 521, 670, 152, 290, 675, 676, + 865, 962, 355, 518, 521, 4, 160, 290, 438, 508, + 509, 536, 539, 565, 680, 682, 683, 686, 955, 681, + 431, 517, 578, 582, 865, 911, 517, 3, 68, 69, + 109, 110, 113, 114, 189, 190, 253, 254, 255, 256, + 257, 258, 259, 260, 263, 264, 337, 338, 378, 379, + 473, 474, 497, 498, 565, 851, 852, 853, 854, 855, + 856, 857, 858, 859, 860, 861, 862, 863, 916, 917, + 811, 812, 865, 562, 865, 918, 508, 509, 563, 866, + 867, 893, 904, 920, 517, 865, 910, 921, 865, 58, + 172, 233, 432, 865, 911, 924, 865, 518, 564, 517, + 421, 767, 768, 768, 750, 751, 799, 220, 745, 37, + 225, 383, 813, 225, 300, 814, 799, 814, 225, 813, + 517, 225, 814, 148, 200, 801, 225, 768, 517, 564, + 517, 768, 297, 865, 980, 982, 913, 3, 37, 42, + 49, 54, 55, 56, 57, 71, 72, 81, 83, 89, + 101, 112, 115, 165, 171, 173, 177, 194, 209, 216, + 217, 219, 222, 223, 225, 235, 237, 247, 268, 269, + 270, 278, 283, 300, 302, 322, 342, 364, 368, 383, + 390, 394, 397, 412, 421, 429, 430, 441, 447, 464, + 467, 639, 642, 827, 829, 830, 832, 834, 836, 838, + 840, 841, 842, 844, 845, 848, 849, 915, 958, 40, + 236, 563, 517, 515, 730, 466, 847, 865, 930, 847, + 847, 517, 517, 835, 835, 325, 730, 517, 837, 523, + 71, 72, 847, 865, 835, 517, 517, 481, 503, 517, + 850, 517, 850, 865, 865, 865, 148, 942, 943, 865, + 911, 912, 730, 865, 910, 564, 894, 895, 896, 9, + 569, 519, 566, 933, 566, 517, 565, 517, 517, 565, + 955, 3, 8, 11, 15, 16, 17, 18, 19, 20, + 21, 36, 40, 46, 53, 80, 177, 194, 199, 222, + 223, 237, 275, 278, 292, 295, 394, 501, 504, 505, + 506, 508, 509, 510, 511, 512, 513, 902, 903, 904, + 906, 936, 480, 878, 302, 865, 521, 745, 517, 565, + 745, 3, 117, 241, 536, 565, 849, 981, 104, 982, + 982, 563, 40, 563, 518, 521, 679, 521, 518, 743, + 949, 950, 40, 961, 663, 193, 355, 220, 623, 389, + 172, 468, 722, 732, 732, 30, 755, 756, 865, 59, + 732, 749, 164, 272, 775, 227, 273, 341, 392, 454, + 4, 9, 30, 770, 865, 508, 509, 771, 772, 865, + 867, 787, 788, 762, 761, 759, 760, 167, 790, 285, + 792, 59, 738, 739, 740, 802, 866, 940, 940, 759, + 787, 911, 236, 562, 74, 82, 93, 169, 192, 329, + 448, 563, 605, 615, 630, 82, 93, 728, 93, 728, + 517, 431, 517, 603, 245, 451, 603, 93, 521, 431, + 562, 3, 832, 536, 59, 538, 536, 536, 106, 251, + 261, 59, 431, 479, 503, 535, 266, 373, 535, 537, + 816, 93, 431, 728, 373, 562, 431, 373, 554, 563, + 578, 516, 527, 913, 913, 914, 521, 753, 754, 13, + 14, 222, 222, 431, 431, 563, 622, 627, 479, 581, + 562, 345, 384, 419, 469, 647, 380, 152, 100, 588, + 651, 656, 691, 989, 144, 829, 562, 275, 534, 657, + 275, 517, 623, 40, 275, 623, 275, 517, 648, 275, + 199, 655, 192, 563, 617, 695, 569, 152, 172, 673, + 669, 568, 519, 959, 949, 952, 952, 959, 518, 521, + 13, 681, 687, 4, 955, 4, 955, 565, 569, 580, + 587, 55, 102, 123, 141, 145, 168, 171, 187, 280, + 288, 310, 339, 584, 40, 518, 865, 518, 172, 521, + 518, 318, 919, 518, 866, 866, 11, 15, 16, 19, + 20, 21, 199, 222, 292, 504, 505, 506, 508, 509, + 510, 511, 512, 513, 904, 866, 518, 818, 819, 875, + 167, 172, 922, 923, 521, 518, 40, 924, 911, 924, + 924, 172, 518, 40, 810, 517, 950, 4, 9, 563, + 763, 765, 766, 940, 938, 178, 241, 419, 423, 425, + 451, 562, 746, 476, 822, 799, 225, 799, 290, 457, + 815, 799, 225, 940, 799, 282, 282, 517, 799, 564, + 823, 824, 517, 564, 823, 521, 518, 521, 519, 517, + 832, 517, 517, 519, 39, 831, 517, 851, 852, 853, + 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, + 864, 518, 521, 835, 570, 662, 698, 703, 726, 729, + 966, 983, 911, 912, 517, 475, 927, 928, 865, 912, + 955, 865, 897, 898, 899, 900, 847, 847, 8, 15, + 16, 19, 20, 21, 504, 505, 506, 508, 509, 510, + 511, 512, 513, 563, 902, 907, 518, 911, 429, 429, + 955, 955, 517, 563, 355, 947, 167, 516, 518, 521, + 527, 521, 524, 510, 567, 911, 955, 865, 864, 864, + 829, 865, 865, 865, 865, 865, 865, 865, 865, 5, + 569, 963, 429, 45, 416, 937, 959, 865, 865, 517, + 730, 925, 132, 160, 275, 280, 285, 438, 449, 865, + 280, 517, 865, 431, 53, 177, 194, 199, 237, 394, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 30, 38, 399, 901, 515, 519, 935, 181, 163, 879, + 368, 517, 893, 941, 172, 796, 913, 796, 517, 565, + 563, 562, 970, 551, 562, 865, 521, 518, 250, 275, + 744, 457, 665, 562, 700, 517, 563, 705, 715, 716, + 718, 563, 565, 563, 565, 41, 126, 757, 521, 457, + 757, 266, 732, 368, 369, 508, 509, 772, 774, 867, + 392, 227, 291, 313, 313, 521, 512, 4, 773, 955, + 773, 368, 369, 774, 562, 948, 279, 396, 793, 517, + 950, 951, 521, 181, 457, 199, 181, 220, 788, 760, + 518, 353, 548, 517, 192, 615, 952, 227, 275, 227, + 457, 517, 608, 828, 829, 952, 563, 192, 952, 192, + 563, 26, 137, 389, 544, 547, 569, 599, 613, 952, + 569, 607, 626, 952, 545, 952, 353, 389, 534, 548, + 536, 959, 952, 536, 959, 952, 536, 353, 389, 548, + 952, 952, 952, 952, 353, 389, 548, 952, 952, 565, + 509, 865, 932, 753, 753, 753, 465, 914, 193, 358, + 752, 865, 865, 280, 560, 565, 280, 560, 563, 334, + 577, 518, 521, 288, 172, 431, 572, 650, 469, 562, + 562, 638, 562, 562, 653, 562, 295, 634, 517, 730, + 517, 152, 152, 237, 563, 605, 615, 618, 621, 631, + 633, 479, 481, 610, 151, 729, 152, 479, 696, 152, + 518, 913, 40, 152, 3, 517, 275, 290, 563, 3, + 670, 568, 670, 290, 670, 675, 865, 578, 510, 515, + 517, 536, 579, 686, 871, 872, 518, 521, 40, 576, + 565, 576, 275, 280, 339, 576, 59, 576, 829, 518, + 865, 865, 865, 922, 829, 866, 866, 866, 866, 866, + 866, 132, 275, 285, 866, 866, 866, 866, 866, 866, + 866, 866, 866, 866, 518, 521, 40, 820, 865, 865, + 923, 922, 829, 518, 518, 518, 911, 829, 950, 518, + 313, 512, 313, 369, 512, 517, 517, 745, 423, 425, + 423, 425, 562, 747, 747, 747, 865, 181, 776, 815, + 799, 865, 517, 799, 167, 517, 564, 806, 815, 829, + 518, 521, 823, 518, 980, 3, 915, 39, 831, 563, + 826, 826, 3, 515, 515, 955, 431, 431, 431, 431, + 829, 454, 518, 516, 911, 865, 139, 928, 929, 518, + 518, 518, 527, 521, 524, 519, 518, 518, 500, 500, + 518, 518, 950, 517, 865, 944, 563, 865, 865, 894, + 943, 518, 518, 518, 500, 866, 866, 145, 911, 172, + 132, 160, 280, 285, 438, 449, 517, 145, 907, 865, + 416, 937, 865, 925, 865, 431, 517, 730, 865, 932, + 568, 517, 517, 155, 880, 797, 798, 822, 753, 822, + 955, 864, 961, 961, 250, 517, 798, 476, 664, 40, + 59, 701, 711, 718, 933, 521, 796, 506, 722, 722, + 502, 758, 756, 292, 902, 905, 758, 4, 955, 774, + 291, 454, 771, 521, 244, 950, 738, 59, 940, 517, + 564, 59, 266, 431, 865, 275, 630, 517, 152, 517, + 608, 203, 627, 628, 589, 40, 176, 598, 624, 589, + 26, 137, 357, 359, 389, 541, 542, 543, 549, 550, + 152, 670, 152, 670, 599, 613, 599, 518, 521, 565, + 592, 506, 519, 518, 521, 431, 373, 93, 431, 728, + 373, 431, 431, 431, 373, 555, 527, 516, 527, 752, + 752, 752, 914, 282, 282, 518, 517, 571, 3, 406, + 407, 565, 586, 622, 577, 562, 657, 517, 40, 623, + 648, 655, 650, 355, 419, 565, 659, 660, 627, 562, + 562, 638, 562, 518, 521, 288, 603, 288, 290, 602, + 952, 479, 637, 562, 603, 40, 562, 518, 419, 865, + 653, 587, 152, 562, 673, 959, 574, 585, 686, 580, + 565, 565, 280, 627, 510, 627, 565, 510, 627, 565, + 518, 518, 923, 172, 132, 285, 517, 821, 818, 517, + 518, 518, 518, 563, 763, 822, 747, 747, 747, 747, + 562, 562, 562, 59, 186, 785, 815, 950, 517, 803, + 804, 805, 868, 870, 950, 167, 80, 825, 824, 518, + 518, 515, 829, 518, 521, 518, 955, 516, 955, 518, + 852, 854, 855, 856, 855, 856, 856, 518, 427, 865, + 143, 865, 897, 907, 850, 850, 518, 865, 944, 945, + 946, 40, 199, 518, 947, 864, 865, 36, 36, 865, + 518, 865, 172, 517, 915, 865, 518, 145, 866, 866, + 145, 145, 865, 865, 516, 527, 517, 934, 754, 476, + 865, 301, 884, 521, 776, 752, 776, 518, 726, 865, + 361, 709, 563, 266, 321, 117, 304, 517, 699, 729, + 518, 521, 705, 664, 865, 164, 231, 517, 758, 291, + 562, 518, 951, 181, 730, 731, 940, 951, 952, 952, + 518, 152, 628, 615, 628, 589, 617, 521, 518, 119, + 207, 273, 275, 614, 517, 33, 59, 635, 624, 74, + 80, 93, 117, 119, 207, 275, 280, 329, 347, 448, + 457, 594, 595, 609, 176, 117, 191, 275, 603, 535, + 107, 117, 176, 275, 405, 408, 537, 603, 389, 543, + 442, 952, 563, 547, 3, 37, 42, 49, 55, 81, + 83, 89, 101, 171, 173, 176, 177, 194, 209, 222, + 223, 225, 235, 237, 247, 269, 274, 278, 292, 300, + 302, 322, 364, 383, 390, 394, 412, 421, 441, 447, + 467, 508, 509, 536, 565, 590, 629, 639, 645, 829, + 905, 956, 569, 626, 952, 952, 952, 952, 952, 952, + 952, 952, 952, 952, 578, 932, 932, 518, 518, 518, + 753, 107, 373, 519, 535, 586, 517, 621, 729, 696, + 40, 517, 634, 192, 562, 518, 521, 518, 657, 517, + 40, 612, 610, 618, 86, 677, 107, 273, 623, 729, + 648, 729, 655, 518, 617, 457, 693, 670, 518, 521, + 627, 866, 172, 517, 915, 823, 518, 521, 518, 776, + 562, 562, 562, 562, 30, 103, 182, 367, 517, 777, + 778, 779, 780, 781, 782, 783, 865, 865, 478, 881, + 518, 867, 908, 909, 199, 181, 800, 804, 518, 806, + 807, 808, 959, 831, 955, 831, 563, 831, 516, 516, + 865, 521, 518, 563, 865, 867, 865, 865, 865, 915, + 518, 865, 36, 36, 865, 865, 145, 518, 509, 932, + 518, 913, 518, 865, 518, 517, 563, 885, 785, 518, + 785, 565, 518, 939, 463, 418, 456, 710, 563, 704, + 714, 290, 707, 506, 718, 709, 907, 59, 518, 518, + 462, 463, 735, 589, 615, 518, 518, 479, 620, 120, + 195, 205, 119, 459, 865, 117, 40, 517, 959, 952, + 866, 120, 195, 119, 280, 227, 562, 620, 88, 635, + 192, 280, 536, 865, 635, 280, 508, 509, 539, 563, + 829, 670, 670, 3, 247, 412, 956, 960, 506, 431, + 431, 516, 516, 752, 518, 518, 563, 578, 457, 573, + 575, 627, 518, 637, 40, 419, 865, 587, 419, 275, + 517, 565, 696, 621, 151, 729, 149, 201, 602, 122, + 137, 328, 637, 107, 696, 479, 990, 40, 517, 290, + 563, 692, 517, 585, 866, 915, 518, 518, 9, 354, + 769, 785, 517, 391, 517, 518, 521, 563, 882, 883, + 336, 786, 521, 518, 517, 564, 59, 518, 199, 518, + 807, 516, 829, 944, 516, 192, 518, 865, 865, 865, + 527, 516, 527, 518, 518, 563, 886, 881, 565, 881, + 521, 462, 933, 518, 521, 91, 709, 865, 518, 951, + 951, 347, 620, 517, 611, 589, 518, 191, 517, 865, + 275, 595, 620, 623, 952, 40, 152, 825, 960, 512, + 590, 952, 952, 518, 535, 124, 518, 610, 729, 729, + 518, 562, 152, 40, 518, 952, 637, 30, 85, 94, + 118, 191, 204, 405, 408, 606, 606, 369, 369, 40, + 64, 74, 241, 419, 865, 587, 562, 517, 563, 708, + 717, 875, 518, 518, 517, 881, 911, 517, 911, 779, + 40, 521, 865, 457, 764, 867, 940, 950, 811, 517, + 811, 865, 932, 932, 310, 887, 786, 786, 729, 304, + 729, 704, 290, 517, 702, 562, 589, 569, 616, 619, + 409, 471, 596, 597, 517, 591, 865, 518, 249, 632, + 191, 457, 546, 512, 442, 578, 565, 696, 602, 990, + 517, 562, 729, 610, 677, 729, 74, 293, 74, 729, + 518, 693, 865, 80, 712, 518, 521, 712, 9, 786, + 518, 778, 518, 885, 883, 371, 518, 940, 516, 516, + 516, 59, 753, 764, 764, 710, 93, 717, 133, 623, + 506, 518, 521, 534, 518, 273, 604, 173, 309, 395, + 290, 600, 601, 625, 591, 865, 442, 40, 517, 990, + 602, 637, 990, 293, 293, 517, 518, 959, 713, 959, + 696, 708, 713, 518, 764, 518, 766, 518, 910, 184, + 340, 369, 888, 462, 952, 518, 276, 454, 632, 590, + 619, 518, 597, 205, 122, 454, 290, 625, 290, 600, + 729, 717, 712, 757, 822, 757, 53, 104, 444, 865, + 889, 890, 889, 889, 518, 729, 822, 389, 601, 63, + 273, 360, 389, 593, 593, 990, 518, 713, 758, 758, + 890, 368, 166, 324, 166, 324, 148, 891, 891, 891, + 716, 589, 25, 117, 280, 696, 757, 36, 104, 181, + 273, 428, 822, 822, 758, 890, 368, 298 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_int16 yyr1[] = +{ + 0, 528, 529, 530, 530, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 540, 540, 540, + 540, 540, 540, 540, 540, 541, 541, 542, 542, 543, + 543, 543, 543, 544, 544, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 546, 546, 547, 547, 547, 547, + 548, 548, 549, 550, 550, 550, 661, 661, 661, 661, + 562, 562, 563, 563, 563, 564, 564, 565, 566, 566, + 567, 568, 569, 569, 569, 569, 727, 727, 727, 727, + 727, 727, 727, 727, 727, 727, 727, 727, 727, 728, + 728, 698, 699, 699, 699, 699, 699, 700, 700, 701, + 701, 701, 702, 702, 702, 703, 703, 704, 705, 705, + 706, 706, 706, 707, 707, 707, 708, 708, 708, 709, + 709, 710, 710, 711, 711, 712, 712, 713, 713, 714, + 714, 715, 715, 716, 716, 717, 717, 718, 658, 658, + 658, 659, 659, 660, 660, 723, 723, 723, 656, 656, + 656, 657, 657, 652, 652, 652, 653, 653, 654, 654, + 654, 655, 655, 967, 674, 674, 674, 675, 675, 676, + 676, 677, 677, 533, 533, 534, 534, 535, 535, 535, + 536, 536, 536, 536, 537, 537, 537, 537, 537, 537, + 537, 537, 537, 537, 537, 537, 537, 537, 538, 538, + 539, 539, 539, 672, 672, 673, 673, 964, 964, 964, + 964, 964, 964, 965, 965, 965, 968, 588, 588, 588, + 589, 589, 590, 590, 590, 590, 590, 590, 591, 591, + 592, 593, 593, 593, 593, 593, 594, 594, 594, 594, + 595, 595, 595, 595, 595, 595, 595, 595, 596, 596, + 597, 597, 598, 598, 598, 599, 600, 601, 601, 601, + 601, 601, 602, 602, 602, 602, 603, 604, 604, 605, + 605, 606, 606, 606, 606, 606, 606, 606, 606, 607, + 607, 608, 609, 609, 609, 609, 610, 610, 610, 610, + 611, 612, 612, 612, 613, 614, 614, 614, 614, 614, + 614, 615, 615, 616, 616, 617, 618, 618, 618, 619, + 619, 620, 620, 621, 621, 621, 622, 623, 623, 624, + 624, 625, 626, 626, 626, 626, 627, 627, 628, 628, + 629, 629, 629, 630, 630, 630, 630, 630, 630, 631, + 631, 632, 632, 632, 632, 633, 634, 634, 634, 634, + 634, 634, 634, 634, 635, 635, 666, 666, 666, 666, + 666, 666, 667, 667, 667, 667, 667, 667, 667, 667, + 667, 667, 667, 667, 667, 667, 667, 667, 667, 667, + 668, 668, 668, 668, 668, 668, 669, 669, 670, 670, + 670, 671, 671, 671, 646, 646, 646, 646, 646, 646, + 647, 647, 648, 648, 966, 570, 570, 570, 571, 571, + 571, 572, 572, 573, 573, 574, 574, 575, 575, 576, + 576, 577, 577, 578, 578, 579, 579, 579, 579, 579, + 579, 579, 580, 581, 581, 582, 582, 583, 583, 584, + 584, 584, 584, 584, 584, 584, 584, 584, 584, 584, + 584, 584, 584, 584, 584, 585, 586, 586, 586, 586, + 586, 587, 587, 729, 729, 730, 730, 730, 731, 731, + 731, 731, 731, 731, 731, 731, 732, 732, 733, 733, + 734, 734, 734, 734, 734, 734, 734, 734, 734, 734, + 734, 734, 734, 734, 734, 734, 734, 734, 734, 735, + 735, 736, 736, 737, 737, 738, 738, 738, 739, 739, + 740, 740, 741, 741, 741, 742, 742, 743, 744, 744, + 744, 745, 745, 746, 746, 746, 746, 746, 746, 746, + 746, 746, 747, 747, 748, 748, 748, 749, 750, 750, + 751, 751, 752, 752, 752, 753, 753, 754, 754, 755, + 755, 756, 756, 757, 757, 757, 758, 758, 758, 759, + 759, 759, 759, 760, 760, 761, 761, 761, 761, 762, + 762, 763, 763, 763, 763, 763, 763, 764, 764, 765, + 765, 766, 766, 766, 766, 767, 768, 768, 769, 769, + 770, 770, 770, 770, 770, 771, 772, 772, 772, 773, + 773, 774, 774, 775, 775, 776, 776, 776, 777, 777, + 778, 778, 779, 779, 779, 779, 779, 780, 781, 782, + 783, 784, 784, 785, 785, 786, 786, 787, 787, 788, + 788, 789, 789, 790, 791, 791, 791, 791, 792, 792, + 793, 793, 793, 794, 794, 795, 795, 796, 796, 797, + 797, 798, 798, 799, 799, 799, 799, 799, 799, 799, + 799, 799, 799, 800, 800, 801, 801, 801, 802, 802, + 803, 803, 803, 803, 804, 804, 805, 805, 806, 806, + 807, 808, 808, 809, 809, 809, 809, 809, 809, 809, + 809, 809, 809, 809, 810, 810, 810, 810, 811, 811, + 812, 812, 812, 812, 812, 813, 813, 813, 813, 813, + 813, 814, 814, 815, 815, 816, 816, 816, 816, 817, + 817, 818, 819, 819, 820, 820, 821, 821, 822, 822, + 823, 823, 824, 825, 825, 826, 826, 827, 827, 828, + 828, 829, 829, 829, 829, 829, 829, 829, 829, 829, + 829, 830, 830, 831, 831, 831, 832, 832, 832, 832, + 832, 832, 832, 833, 833, 833, 833, 834, 835, 835, + 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, + 836, 837, 837, 838, 838, 839, 839, 840, 841, 842, + 842, 843, 843, 844, 845, 846, 846, 846, 846, 846, + 846, 847, 847, 848, 848, 848, 848, 849, 850, 850, + 850, 851, 851, 852, 852, 853, 853, 854, 854, 855, + 855, 856, 856, 857, 857, 858, 858, 859, 859, 860, + 860, 861, 861, 862, 862, 863, 863, 864, 864, 864, + 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + 864, 864, 864, 864, 864, 864, 864, 864, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 866, 866, + 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, + 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, + 866, 866, 866, 867, 867, 868, 868, 868, 868, 868, + 868, 869, 869, 869, 870, 870, 870, 870, 870, 870, + 870, 870, 870, 870, 870, 870, 871, 872, 873, 873, + 873, 873, 873, 873, 874, 874, 875, 875, 876, 876, + 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, + 876, 876, 877, 877, 878, 878, 879, 879, 879, 880, + 880, 881, 881, 882, 882, 883, 884, 884, 884, 885, + 886, 886, 887, 887, 888, 888, 888, 888, 889, 889, + 890, 890, 890, 890, 890, 891, 891, 891, 891, 891, + 892, 892, 893, 893, 894, 895, 895, 896, 896, 897, + 898, 898, 899, 899, 900, 900, 901, 901, 901, 902, + 902, 903, 903, 903, 903, 903, 903, 903, 903, 903, + 903, 903, 903, 903, 903, 904, 904, 905, 905, 906, + 906, 906, 906, 906, 906, 906, 906, 907, 907, 908, + 908, 909, 909, 910, 910, 911, 911, 912, 912, 913, + 913, 914, 914, 914, 915, 915, 916, 916, 917, 917, + 917, 917, 917, 917, 917, 917, 917, 917, 917, 917, + 917, 917, 917, 918, 918, 919, 920, 920, 921, 921, + 921, 921, 921, 921, 922, 923, 924, 924, 924, 925, + 925, 926, 927, 927, 928, 929, 929, 930, 930, 931, + 931, 567, 567, 567, 567, 932, 932, 933, 933, 934, + 934, 934, 935, 935, 935, 935, 935, 936, 936, 937, + 937, 938, 938, 939, 939, 940, 940, 941, 941, 941, + 942, 942, 943, 943, 944, 945, 945, 946, 946, 947, + 947, 947, 948, 948, 949, 949, 950, 950, 951, 951, + 952, 953, 953, 954, 954, 954, 954, 954, 954, 954, + 954, 954, 954, 954, 954, 954, 954, 955, 956, 956, + 956, 957, 957, 957, 958, 958, 958, 959, 959, 960, + 960, 961, 961, 962, 963, 963, 724, 725, 725, 726, + 726, 726, 726, 726, 726, 649, 649, 649, 650, 650, + 651, 651, 651, 651, 691, 691, 692, 693, 693, 694, + 694, 695, 695, 696, 696, 697, 697, 532, 532, 532, + 532, 532, 532, 557, 557, 558, 558, 559, 559, 560, + 560, 561, 561, 561, 561, 561, 561, 561, 561, 561, + 561, 689, 689, 690, 678, 678, 678, 678, 679, 679, + 680, 680, 680, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 682, 682, 682, 683, 683, 684, + 684, 685, 685, 686, 686, 686, 686, 687, 688, 688, + 977, 977, 977, 977, 978, 978, 978, 978, 979, 979, + 980, 981, 981, 981, 981, 981, 981, 981, 982, 982, + 719, 719, 719, 719, 720, 720, 721, 721, 722, 722, + 722, 969, 969, 969, 969, 969, 970, 970, 970, 970, + 970, 971, 971, 972, 972, 973, 973, 662, 662, 663, + 663, 663, 664, 664, 665, 665, 551, 551, 552, 552, + 553, 553, 553, 554, 554, 555, 555, 974, 974, 974, + 974, 975, 975, 976, 976, 976, 983, 983, 983, 983, + 983, 983, 983, 983, 984, 984, 985, 985, 986, 986, + 987, 987, 988, 988, 556, 989, 989, 989, 989, 989, + 990, 990, 990, 990, 636, 636, 636, 637, 637, 637, + 638, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 640, 640, 640, 640, 640, 640, + 640, 640, 640, 640, 640, 640, 640, 640, 640, 640, + 640, 640, 640, 640, 640, 640, 640, 640, 640, 640, + 640, 640, 640, 640, 640, 640, 640, 640, 640, 640, + 640, 640, 640, 640, 640, 640, 640, 640, 640, 640, + 640, 640, 640, 640, 640, 640, 640, 640, 641, 641, + 641, 641, 641, 641, 641, 641, 641, 641, 641, 641, + 641, 641, 641, 641, 641, 641, 641, 641, 641, 641, + 641, 641, 641, 641, 641, 641, 642, 642, 642, 642, + 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 642, 642, 642, 642, 642, 643, 643, 643, 643, 643, + 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, + 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, + 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, + 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, + 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, + 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, + 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, + 643, 643, 643, 643, 643, 643, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + 645, 645, 645 +}; +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 1, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 4, 6, 4, + 6, 4, 6, 4, 6, 1, 2, 3, 2, 1, + 3, 2, 3, 1, 3, 2, 5, 3, 6, 4, + 6, 6, 6, 5, 5, 6, 9, 4, 5, 7, + 6, 4, 8, 4, 2, 4, 3, 6, 4, 2, + 2, 2, 2, 1, 2, 0, 1, 2, 2, 2, + 1, 3, 4, 2, 1, 0, 2, 3, 2, 3, + 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 1, 1, 1, 1, 1, 6, 6, 8, 6, + 8, 6, 8, 6, 8, 8, 10, 8, 10, 1, + 0, 9, 1, 4, 4, 7, 2, 1, 3, 2, + 2, 0, 4, 3, 0, 1, 0, 2, 3, 5, + 2, 2, 0, 8, 5, 0, 5, 5, 7, 2, + 0, 1, 1, 1, 3, 2, 0, 1, 0, 1, + 3, 1, 3, 1, 2, 1, 3, 2, 6, 8, + 5, 1, 0, 1, 3, 2, 4, 5, 5, 8, + 7, 1, 0, 8, 11, 10, 0, 1, 0, 1, + 1, 0, 2, 4, 3, 9, 12, 1, 3, 1, + 3, 3, 0, 4, 6, 1, 2, 1, 1, 0, + 1, 2, 2, 1, 2, 2, 1, 2, 3, 2, + 2, 2, 2, 3, 3, 3, 1, 3, 1, 0, + 1, 2, 2, 5, 7, 0, 2, 2, 2, 2, + 2, 2, 2, 1, 1, 0, 2, 9, 12, 11, + 0, 2, 1, 1, 1, 1, 1, 1, 3, 0, + 1, 2, 1, 1, 2, 2, 3, 1, 1, 2, + 2, 1, 2, 3, 5, 3, 2, 5, 1, 1, + 1, 0, 5, 7, 5, 2, 3, 1, 1, 2, + 2, 0, 3, 4, 4, 0, 3, 2, 0, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 3, 1, 2, 2, 2, 2, 2, 2, 0, + 3, 3, 3, 0, 1, 2, 1, 2, 2, 2, + 2, 3, 4, 1, 3, 1, 1, 1, 1, 3, + 1, 2, 0, 1, 2, 0, 1, 3, 0, 2, + 0, 3, 3, 1, 5, 3, 1, 3, 1, 2, + 1, 4, 5, 5, 6, 3, 7, 4, 11, 1, + 3, 2, 2, 2, 0, 3, 1, 1, 2, 2, + 2, 2, 1, 0, 1, 2, 6, 4, 6, 4, + 6, 8, 1, 1, 1, 1, 2, 1, 2, 1, + 2, 1, 1, 1, 1, 3, 3, 3, 3, 1, + 2, 2, 1, 3, 1, 1, 1, 3, 1, 1, + 0, 1, 1, 1, 8, 11, 10, 7, 10, 9, + 1, 1, 2, 3, 8, 11, 9, 7, 0, 3, + 3, 1, 1, 3, 0, 1, 3, 1, 0, 1, + 0, 1, 0, 1, 3, 1, 1, 1, 1, 3, + 1, 0, 2, 2, 0, 2, 0, 1, 0, 1, + 1, 1, 3, 3, 1, 1, 3, 3, 3, 3, + 3, 3, 4, 3, 2, 1, 1, 1, 1, 3, + 1, 1, 3, 1, 1, 3, 3, 3, 1, 2, + 4, 4, 2, 3, 5, 5, 1, 1, 3, 0, + 11, 11, 10, 12, 1, 2, 5, 4, 4, 4, + 4, 7, 5, 4, 7, 6, 9, 9, 4, 1, + 1, 1, 1, 1, 1, 1, 5, 1, 1, 3, + 1, 2, 2, 2, 3, 1, 3, 7, 1, 2, + 0, 2, 0, 3, 3, 4, 4, 4, 4, 3, + 2, 1, 1, 0, 1, 1, 0, 2, 1, 5, + 1, 0, 2, 2, 0, 1, 0, 3, 5, 1, + 3, 4, 3, 1, 1, 0, 2, 2, 0, 2, + 2, 1, 1, 1, 0, 2, 4, 5, 4, 2, + 3, 2, 2, 2, 2, 1, 2, 3, 0, 1, + 0, 5, 1, 4, 6, 2, 1, 0, 4, 0, + 1, 1, 2, 2, 2, 1, 1, 2, 2, 1, + 1, 1, 1, 1, 1, 3, 3, 0, 1, 3, + 1, 2, 1, 1, 1, 1, 1, 2, 4, 4, + 5, 1, 1, 2, 0, 2, 0, 1, 3, 1, + 0, 1, 2, 3, 2, 4, 2, 3, 2, 0, + 1, 2, 0, 4, 5, 1, 2, 2, 0, 1, + 3, 1, 2, 3, 3, 3, 3, 3, 3, 1, + 4, 9, 9, 3, 0, 2, 2, 0, 5, 3, + 0, 1, 1, 3, 5, 3, 1, 2, 1, 3, + 5, 1, 2, 3, 4, 5, 4, 5, 4, 6, + 5, 4, 5, 5, 5, 2, 4, 1, 1, 0, + 1, 4, 5, 4, 0, 2, 2, 2, 1, 1, + 1, 1, 0, 4, 2, 1, 2, 2, 4, 2, + 6, 2, 1, 3, 4, 0, 2, 0, 2, 0, + 1, 3, 3, 2, 0, 2, 4, 1, 1, 1, + 0, 2, 3, 5, 6, 2, 3, 1, 5, 5, + 5, 3, 3, 3, 4, 0, 1, 1, 1, 1, + 1, 2, 4, 1, 1, 1, 1, 2, 3, 0, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, + 1, 3, 0, 1, 1, 1, 1, 5, 2, 1, + 1, 1, 1, 4, 1, 2, 2, 1, 3, 3, + 2, 1, 0, 5, 2, 5, 2, 1, 3, 3, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 3, 3, 3, 3, 3, 3, 0, 1, 3, + 3, 5, 2, 2, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, + 2, 3, 3, 2, 2, 3, 3, 5, 4, 6, + 3, 5, 4, 6, 4, 6, 5, 7, 3, 2, + 4, 3, 2, 3, 3, 3, 3, 4, 3, 4, + 3, 4, 5, 6, 6, 7, 6, 7, 6, 7, + 3, 4, 4, 6, 1, 4, 3, 5, 1, 3, + 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 2, 2, 5, + 6, 6, 7, 1, 2, 1, 1, 1, 2, 2, + 4, 3, 1, 1, 1, 1, 1, 4, 1, 1, + 1, 1, 2, 4, 2, 2, 3, 3, 3, 6, + 7, 9, 7, 7, 5, 1, 1, 1, 5, 6, + 6, 4, 4, 4, 4, 6, 5, 5, 5, 4, + 6, 4, 7, 9, 5, 0, 5, 4, 0, 1, + 0, 2, 0, 1, 3, 3, 2, 2, 0, 6, + 1, 0, 3, 0, 3, 3, 3, 0, 1, 4, + 2, 2, 2, 2, 2, 3, 2, 2, 3, 0, + 4, 3, 1, 5, 3, 1, 3, 1, 2, 3, + 1, 3, 1, 2, 1, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 4, 1, 4, 1, + 4, 1, 2, 1, 2, 1, 2, 1, 3, 1, + 3, 1, 2, 1, 3, 1, 2, 1, 0, 1, + 3, 1, 3, 3, 1, 3, 3, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 4, 3, 2, 3, 0, 3, 3, + 2, 2, 1, 0, 2, 2, 3, 2, 1, 1, + 3, 5, 1, 2, 4, 2, 0, 1, 0, 1, + 2, 3, 5, 7, 7, 1, 0, 0, 2, 0, + 2, 3, 3, 3, 5, 7, 7, 0, 2, 1, + 0, 1, 0, 1, 3, 1, 2, 3, 2, 1, + 4, 2, 1, 0, 3, 1, 3, 1, 2, 4, + 2, 0, 1, 3, 1, 3, 1, 2, 1, 3, + 1, 1, 2, 1, 1, 2, 1, 1, 2, 7, + 2, 5, 3, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 3, 3, 0, 1, 1, 1, 5, 3, 0, 1, + 1, 1, 1, 1, 1, 4, 7, 6, 2, 0, + 1, 1, 1, 1, 13, 16, 1, 2, 0, 1, + 0, 1, 0, 2, 0, 1, 0, 6, 8, 6, + 8, 6, 8, 3, 2, 1, 0, 6, 6, 1, + 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, + 1, 4, 6, 3, 2, 4, 3, 5, 1, 0, + 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, + 2, 3, 3, 3, 1, 3, 3, 2, 3, 3, + 1, 1, 1, 3, 5, 1, 1, 1, 1, 3, + 2, 4, 6, 6, 0, 1, 1, 1, 0, 2, + 2, 4, 6, 5, 4, 6, 1, 1, 1, 1, + 1, 1, 0, 1, 3, 1, 0, 7, 3, 1, + 2, 3, 2, 0, 2, 0, 2, 4, 5, 8, + 2, 3, 5, 1, 0, 2, 0, 2, 3, 3, + 3, 1, 1, 1, 2, 3, 2, 2, 2, 2, + 3, 4, 3, 1, 1, 1, 1, 1, 1, 0, + 1, 3, 1, 3, 2, 9, 12, 11, 12, 14, + 3, 4, 4, 0, 7, 10, 9, 2, 3, 0, + 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1 +}; -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab +enum { YYENOMEM = -2 }; -#define YYRECOVERING() (!!yyerrstatus) +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (&yylloc, yyscanner, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (&yylloc, yyscanner, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) #endif +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, &yylloc, yyscanner) -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -19297,88 +18612,119 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location, yyscanner); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, core_yyscan_t yyscanner) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, yyscanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - core_yyscan_t yyscanner; -#endif +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + +/* YYLOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +# ifndef YYLOCATION_PRINT + +# if defined YY_LOCATION_PRINT + + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) + +# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + +/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ + +YY_ATTRIBUTE_UNUSED +static int +yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) { - if (!yyvaluep) - return; - YYUSE (yylocationp); - YYUSE (yyscanner); -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) + int res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) { - default: - break; + res += YYFPRINTF (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += YYFPRINTF (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += YYFPRINTF (yyo, "-%d", end_col); } + return res; } +# define YYLOCATION_PRINT yy_location_print_ + + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) + +# else + +# define YYLOCATION_PRINT(File, Loc) ((void) 0) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT YYLOCATION_PRINT + +# endif +# endif /* !defined YYLOCATION_PRINT */ + + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value, Location, yyscanner); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, core_yyscan_t yyscanner) -#else +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, core_yyscan_t yyscanner) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + YY_USE (yylocationp); + YY_USE (yyscanner); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + static void -yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, yyscanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - core_yyscan_t yyscanner; -#endif +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, core_yyscan_t yyscanner) { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - YY_LOCATION_PRINT (yyoutput, *yylocationp); - YYFPRINTF (yyoutput, ": "); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, yyscanner); - YYFPRINTF (yyoutput, ")"); + YYLOCATION_PRINT (yyo, yylocationp); + YYFPRINTF (yyo, ": "); + yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, yyscanner); + YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. @@ -19386,82 +18732,69 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, yyscanner) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, core_yyscan_t yyscanner) -#else static void -yy_reduce_print (yyvsp, yylsp, yyrule, yyscanner) - YYSTYPE *yyvsp; - YYLTYPE *yylsp; - int yyrule; - core_yyscan_t yyscanner; -#endif +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, + int yyrule, core_yyscan_t yyscanner) { + int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) , yyscanner); - fprintf (stderr, "\n"); + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], + &(yylsp[(yyi + 1) - (yynrhs)]), yyscanner); + YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, yylsp, Rule, yyscanner); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, yyscanner); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -19476,270 +18809,30 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - if (! yyres) - return yystrlen (yystr); - return yystpcpy (yyres, yystr) - yyres; -} -# endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, core_yyscan_t yyscanner) -#else static void -yydestruct (yymsg, yytype, yyvaluep, yylocationp, yyscanner) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - YYLTYPE *yylocationp; - core_yyscan_t yyscanner; -#endif +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, core_yyscan_t yyscanner) { - YYUSE (yyvaluep); - YYUSE (yylocationp); - YYUSE (yyscanner); - + YY_USE (yyvaluep); + YY_USE (yylocationp); + YY_USE (yyscanner); if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END } - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (core_yyscan_t yyscanner); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ @@ -19750,221 +18843,217 @@ int yyparse (); | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (core_yyscan_t yyscanner) -#else -int -yyparse (yyscanner) - core_yyscan_t yyscanner; -#endif -#endif { - /* The look-ahead symbol. */ +/* Lookahead token kind. */ int yychar; -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; -/* Location data for the look-ahead symbol. */ -YYLTYPE yylloc; +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif +/* Location data for the lookahead symbol. */ +static YYLTYPE yyloc_default +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + = { 1, 1, 1, 1 } +# endif +; +YYLTYPE yylloc = yyloc_default; - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. + /* Number of syntax errors so far. */ + int yynerrs = 0; (void)yynerrs; - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; + /* Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[2]; + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; - YYSIZE_T yystacksize = YYINITDEPTH; + /* The location stack: array, bottom, top. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp = yyls; + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; YYLTYPE yyloc; + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[3]; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; (void)yynerrs; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - yylsp = yyls; -#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL - /* Initialize the default location before parsing starts. */ - yylloc.first_line = yylloc.last_line = 1; - yylloc.first_column = yylloc.last_column = 0; -#endif + yychar = YYEMPTY; /* Cause a token to be read. */ + yylsp[0] = yylloc; goto yysetstate; + /*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | +| yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ - yynewstate: +yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; - yysetstate: - *yyssp = yystate; + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + YYNOMEM; +#else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYPTRDIFF_T yysize = yyssp - yyss + 1; -#ifdef yyoverflow +# if defined yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + YYLTYPE *yyls1 = yyls; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yyls1, yysize * YYSIZEOF (*yylsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + yyls = yyls1; } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - YYSTACK_RELOCATE (yyls); + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif -#endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; yylsp = yyls + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; goto yybackup; + /*-----------. | yybackup. | `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + lookahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (&yylval, &yylloc, yyscanner); } if (yychar <= YYEOF) { - yychar = yytoken = YYEOF; + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + yyerror_range[1] = yylloc; + goto yyerrlab1; + } else { yytoken = YYTRANSLATE (yychar); @@ -19979,30 +19068,27 @@ YYLTYPE yylloc; yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } - if (yyn == YYFINAL) - YYACCEPT; - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the look-ahead token. */ + /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END *++yylsp = yylloc; + + /* Discard the shifted token. */ + yychar = YYEMPTY; goto yynewstate; @@ -20017,14 +19103,14 @@ YYLTYPE yylloc; /*-----------------------------. -| yyreduce -- Do a reduction. | +| yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -20033,2101 +19119,2366 @@ YYLTYPE yylloc; GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; - /* Default location. */ + /* Default location. */ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + yyerror_range[1] = yyloc; YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -#line 503 "third_party/libpg_query/grammar/grammar.y" - { - pg_yyget_extra(yyscanner)->parsetree = (yyvsp[(1) - (1)].list); - ;} + case 2: /* stmtblock: stmtmulti */ +#line 505 "third_party/libpg_query/grammar/grammar.y" + { + pg_yyget_extra(yyscanner)->parsetree = (yyvsp[0].list); + } +#line 19134 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 3: -#line 519 "third_party/libpg_query/grammar/grammar.y" - { - if ((yyvsp[(1) - (3)].list) != NIL) + case 3: /* stmtmulti: stmtmulti ';' stmt */ +#line 521 "third_party/libpg_query/grammar/grammar.y" + { + if ((yyvsp[-2].list) != NIL) { /* update length of previous stmt */ - updateRawStmtEnd(llast_node(PGRawStmt, (yyvsp[(1) - (3)].list)), (yylsp[(2) - (3)])); + updateRawStmtEnd(llast_node(PGRawStmt, (yyvsp[-2].list)), (yylsp[-1])); } - if ((yyvsp[(3) - (3)].node) != NULL) - (yyval.list) = lappend((yyvsp[(1) - (3)].list), makeRawStmt((yyvsp[(3) - (3)].node), (yylsp[(2) - (3)]) + 1)); + if ((yyvsp[0].node) != NULL) + (yyval.list) = lappend((yyvsp[-2].list), makeRawStmt((yyvsp[0].node), (yylsp[-1]) + 1)); else - (yyval.list) = (yyvsp[(1) - (3)].list); - ;} + (yyval.list) = (yyvsp[-2].list); + } +#line 19150 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 4: -#line 531 "third_party/libpg_query/grammar/grammar.y" - { - if ((yyvsp[(1) - (1)].node) != NULL) - (yyval.list) = list_make1(makeRawStmt((yyvsp[(1) - (1)].node), 0)); + case 4: /* stmtmulti: stmt */ +#line 533 "third_party/libpg_query/grammar/grammar.y" + { + if ((yyvsp[0].node) != NULL) + (yyval.list) = list_make1(makeRawStmt((yyvsp[0].node), 0)); else (yyval.list) = NIL; - ;} + } +#line 19161 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 45: -#line 580 "third_party/libpg_query/grammar/grammar.y" - { (yyval.node) = NULL; ;} + case 46: /* stmt: %empty */ +#line 583 "third_party/libpg_query/grammar/grammar.y" + { (yyval.node) = NULL; } +#line 19167 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 46: + case 47: /* AlterTableStmt: ALTER TABLE relation_expr alter_table_cmds */ #line 10 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableStmt *n = makeNode(PGAlterTableStmt); - n->relation = (yyvsp[(3) - (4)].range); - n->cmds = (yyvsp[(4) - (4)].list); + n->relation = (yyvsp[-1].range); + n->cmds = (yyvsp[0].list); n->relkind = PG_OBJECT_TABLE; n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19180 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 47: + case 48: /* AlterTableStmt: ALTER TABLE IF_P EXISTS relation_expr alter_table_cmds */ #line 19 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableStmt *n = makeNode(PGAlterTableStmt); - n->relation = (yyvsp[(5) - (6)].range); - n->cmds = (yyvsp[(6) - (6)].list); + n->relation = (yyvsp[-1].range); + n->cmds = (yyvsp[0].list); n->relkind = PG_OBJECT_TABLE; n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 19193 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 48: + case 49: /* AlterTableStmt: ALTER INDEX qualified_name alter_table_cmds */ #line 28 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableStmt *n = makeNode(PGAlterTableStmt); - n->relation = (yyvsp[(3) - (4)].range); - n->cmds = (yyvsp[(4) - (4)].list); + n->relation = (yyvsp[-1].range); + n->cmds = (yyvsp[0].list); n->relkind = PG_OBJECT_INDEX; n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19206 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 49: + case 50: /* AlterTableStmt: ALTER INDEX IF_P EXISTS qualified_name alter_table_cmds */ #line 37 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableStmt *n = makeNode(PGAlterTableStmt); - n->relation = (yyvsp[(5) - (6)].range); - n->cmds = (yyvsp[(6) - (6)].list); + n->relation = (yyvsp[-1].range); + n->cmds = (yyvsp[0].list); n->relkind = PG_OBJECT_INDEX; n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 19219 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 50: + case 51: /* AlterTableStmt: ALTER SEQUENCE qualified_name alter_table_cmds */ #line 46 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableStmt *n = makeNode(PGAlterTableStmt); - n->relation = (yyvsp[(3) - (4)].range); - n->cmds = (yyvsp[(4) - (4)].list); + n->relation = (yyvsp[-1].range); + n->cmds = (yyvsp[0].list); n->relkind = PG_OBJECT_SEQUENCE; n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19232 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 51: + case 52: /* AlterTableStmt: ALTER SEQUENCE IF_P EXISTS qualified_name alter_table_cmds */ #line 55 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableStmt *n = makeNode(PGAlterTableStmt); - n->relation = (yyvsp[(5) - (6)].range); - n->cmds = (yyvsp[(6) - (6)].list); + n->relation = (yyvsp[-1].range); + n->cmds = (yyvsp[0].list); n->relkind = PG_OBJECT_SEQUENCE; n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 19245 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 52: + case 53: /* AlterTableStmt: ALTER VIEW qualified_name alter_table_cmds */ #line 64 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableStmt *n = makeNode(PGAlterTableStmt); - n->relation = (yyvsp[(3) - (4)].range); - n->cmds = (yyvsp[(4) - (4)].list); + n->relation = (yyvsp[-1].range); + n->cmds = (yyvsp[0].list); n->relkind = PG_OBJECT_VIEW; n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19258 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 53: + case 54: /* AlterTableStmt: ALTER VIEW IF_P EXISTS qualified_name alter_table_cmds */ #line 73 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableStmt *n = makeNode(PGAlterTableStmt); - n->relation = (yyvsp[(5) - (6)].range); - n->cmds = (yyvsp[(6) - (6)].list); + n->relation = (yyvsp[-1].range); + n->cmds = (yyvsp[0].list); n->relkind = PG_OBJECT_VIEW; n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 19271 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 54: + case 55: /* alter_identity_column_option_list: alter_identity_column_option */ #line 86 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].defelt)); ;} + { (yyval.list) = list_make1((yyvsp[0].defelt)); } +#line 19277 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 55: + case 56: /* alter_identity_column_option_list: alter_identity_column_option_list alter_identity_column_option */ #line 88 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].defelt)); ;} + { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } +#line 19283 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 56: + case 57: /* alter_column_default: SET DEFAULT a_expr */ #line 93 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.node) = (yyvsp[(3) - (3)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 19289 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 57: + case 58: /* alter_column_default: DROP DEFAULT */ #line 94 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 19295 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 58: + case 59: /* alter_identity_column_option: RESTART */ #line 100 "third_party/libpg_query/grammar/statements/alter_table.y" - { - (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); + } +#line 19303 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 59: + case 60: /* alter_identity_column_option: RESTART opt_with NumericOnly */ #line 104 "third_party/libpg_query/grammar/statements/alter_table.y" - { - (yyval.defelt) = makeDefElem("restart", (PGNode *)(yyvsp[(3) - (3)].value), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("restart", (PGNode *)(yyvsp[0].value), (yylsp[-2])); + } +#line 19311 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 60: + case 61: /* alter_identity_column_option: SET SeqOptElem */ #line 108 "third_party/libpg_query/grammar/statements/alter_table.y" - { - if (strcmp((yyvsp[(2) - (2)].defelt)->defname, "as") == 0 || - strcmp((yyvsp[(2) - (2)].defelt)->defname, "restart") == 0 || - strcmp((yyvsp[(2) - (2)].defelt)->defname, "owned_by") == 0) + { + if (strcmp((yyvsp[0].defelt)->defname, "as") == 0 || + strcmp((yyvsp[0].defelt)->defname, "restart") == 0 || + strcmp((yyvsp[0].defelt)->defname, "owned_by") == 0) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), - errmsg("sequence option \"%s\" not supported here", (yyvsp[(2) - (2)].defelt)->defname), - parser_errposition((yylsp[(2) - (2)])))); - (yyval.defelt) = (yyvsp[(2) - (2)].defelt); - ;} + errmsg("sequence option \"%s\" not supported here", (yyvsp[0].defelt)->defname), + parser_errposition((yylsp[0])))); + (yyval.defelt) = (yyvsp[0].defelt); + } +#line 19326 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 61: + case 62: /* alter_identity_column_option: SET GENERATED generated_when */ #line 119 "third_party/libpg_query/grammar/statements/alter_table.y" - { - (yyval.defelt) = makeDefElem("generated", (PGNode *) makeInteger((yyvsp[(3) - (3)].ival)), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("generated", (PGNode *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); + } +#line 19334 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 62: + case 63: /* alter_generic_option_list: alter_generic_option_elem */ #line 127 "third_party/libpg_query/grammar/statements/alter_table.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].defelt)); - ;} + { + (yyval.list) = list_make1((yyvsp[0].defelt)); + } +#line 19342 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 63: + case 64: /* alter_generic_option_list: alter_generic_option_list ',' alter_generic_option_elem */ #line 131 "third_party/libpg_query/grammar/statements/alter_table.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].defelt)); - ;} + { + (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); + } +#line 19350 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 64: + case 65: /* alter_table_cmd: ADD_P columnDef */ #line 140 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_AddColumn; - n->def = (yyvsp[(2) - (2)].node); + n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19362 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 65: + case 66: /* alter_table_cmd: ADD_P IF_P NOT EXISTS columnDef */ #line 149 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_AddColumn; - n->def = (yyvsp[(5) - (5)].node); + n->def = (yyvsp[0].node); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 19374 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 66: + case 67: /* alter_table_cmd: ADD_P COLUMN columnDef */ #line 158 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_AddColumn; - n->def = (yyvsp[(3) - (3)].node); + n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19386 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 67: + case 68: /* alter_table_cmd: ADD_P COLUMN IF_P NOT EXISTS columnDef */ #line 167 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_AddColumn; - n->def = (yyvsp[(6) - (6)].node); + n->def = (yyvsp[0].node); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 19398 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 68: + case 69: /* alter_table_cmd: ALTER opt_column ColId alter_column_default */ #line 176 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_ColumnDefault; - n->name = (yyvsp[(3) - (4)].str); - n->def = (yyvsp[(4) - (4)].node); + n->name = (yyvsp[-1].str); + n->def = (yyvsp[0].node); (yyval.node) = (PGNode *)n; - ;} + } +#line 19410 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 69: + case 70: /* alter_table_cmd: ALTER opt_column ColId DROP NOT NULL_P */ #line 185 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_DropNotNull; - n->name = (yyvsp[(3) - (6)].str); + n->name = (yyvsp[-3].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 19421 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 70: + case 71: /* alter_table_cmd: ALTER opt_column ColId SET NOT NULL_P */ #line 193 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_SetNotNull; - n->name = (yyvsp[(3) - (6)].str); + n->name = (yyvsp[-3].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 19432 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 71: + case 72: /* alter_table_cmd: ALTER opt_column ColId SET STATISTICS SignedIconst */ #line 201 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_SetStatistics; - n->name = (yyvsp[(3) - (6)].str); - n->def = (PGNode *) makeInteger((yyvsp[(6) - (6)].ival)); + n->name = (yyvsp[-3].str); + n->def = (PGNode *) makeInteger((yyvsp[0].ival)); (yyval.node) = (PGNode *)n; - ;} + } +#line 19444 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 72: + case 73: /* alter_table_cmd: ALTER opt_column ColId SET reloptions */ #line 210 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_SetOptions; - n->name = (yyvsp[(3) - (5)].str); - n->def = (PGNode *) (yyvsp[(5) - (5)].list); + n->name = (yyvsp[-2].str); + n->def = (PGNode *) (yyvsp[0].list); (yyval.node) = (PGNode *)n; - ;} + } +#line 19456 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 73: + case 74: /* alter_table_cmd: ALTER opt_column ColId RESET reloptions */ #line 219 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_ResetOptions; - n->name = (yyvsp[(3) - (5)].str); - n->def = (PGNode *) (yyvsp[(5) - (5)].list); + n->name = (yyvsp[-2].str); + n->def = (PGNode *) (yyvsp[0].list); (yyval.node) = (PGNode *)n; - ;} + } +#line 19468 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 74: + case 75: /* alter_table_cmd: ALTER opt_column ColId SET STORAGE ColId */ #line 228 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_SetStorage; - n->name = (yyvsp[(3) - (6)].str); - n->def = (PGNode *) makeString((yyvsp[(6) - (6)].str)); + n->name = (yyvsp[-3].str); + n->def = (PGNode *) makeString((yyvsp[0].str)); (yyval.node) = (PGNode *)n; - ;} + } +#line 19480 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 75: + case 76: /* alter_table_cmd: ALTER opt_column ColId ADD_P GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList */ #line 237 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); PGConstraint *c = makeNode(PGConstraint); c->contype = PG_CONSTR_IDENTITY; - c->generated_when = (yyvsp[(6) - (9)].ival); - c->options = (yyvsp[(9) - (9)].list); - c->location = (yylsp[(5) - (9)]); + c->generated_when = (yyvsp[-3].ival); + c->options = (yyvsp[0].list); + c->location = (yylsp[-4]); n->subtype = PG_AT_AddIdentity; - n->name = (yyvsp[(3) - (9)].str); + n->name = (yyvsp[-6].str); n->def = (PGNode *) c; (yyval.node) = (PGNode *)n; - ;} + } +#line 19500 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 76: + case 77: /* alter_table_cmd: ALTER opt_column ColId alter_identity_column_option_list */ #line 254 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_SetIdentity; - n->name = (yyvsp[(3) - (4)].str); - n->def = (PGNode *) (yyvsp[(4) - (4)].list); + n->name = (yyvsp[-1].str); + n->def = (PGNode *) (yyvsp[0].list); (yyval.node) = (PGNode *)n; - ;} + } +#line 19512 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 77: + case 78: /* alter_table_cmd: ALTER opt_column ColId DROP IDENTITY_P */ #line 263 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = AT_DropIdentity; - n->name = (yyvsp[(3) - (5)].str); + n->name = (yyvsp[-2].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19524 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 78: + case 79: /* alter_table_cmd: ALTER opt_column ColId DROP IDENTITY_P IF_P EXISTS */ #line 272 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = AT_DropIdentity; - n->name = (yyvsp[(3) - (7)].str); + n->name = (yyvsp[-4].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 19536 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 79: + case 80: /* alter_table_cmd: DROP opt_column IF_P EXISTS ColId opt_drop_behavior */ #line 281 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_DropColumn; - n->name = (yyvsp[(5) - (6)].str); - n->behavior = (yyvsp[(6) - (6)].dbehavior); + n->name = (yyvsp[-1].str); + n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 19549 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 80: + case 81: /* alter_table_cmd: DROP opt_column ColId opt_drop_behavior */ #line 291 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_DropColumn; - n->name = (yyvsp[(3) - (4)].str); - n->behavior = (yyvsp[(4) - (4)].dbehavior); + n->name = (yyvsp[-1].str); + n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19562 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 81: + case 82: /* alter_table_cmd: ALTER opt_column ColId opt_set_data TYPE_P Typename opt_collate_clause alter_using */ #line 304 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); PGColumnDef *def = makeNode(PGColumnDef); n->subtype = PG_AT_AlterColumnType; - n->name = (yyvsp[(3) - (8)].str); + n->name = (yyvsp[-5].str); n->def = (PGNode *) def; /* We only use these fields of the PGColumnDef node */ - def->typeName = (yyvsp[(6) - (8)].typnam); - def->collClause = (PGCollateClause *) (yyvsp[(7) - (8)].node); - def->raw_default = (yyvsp[(8) - (8)].node); - def->location = (yylsp[(3) - (8)]); + def->typeName = (yyvsp[-2].typnam); + def->collClause = (PGCollateClause *) (yyvsp[-1].node); + def->raw_default = (yyvsp[0].node); + def->location = (yylsp[-5]); (yyval.node) = (PGNode *)n; - ;} + } +#line 19580 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 82: + case 83: /* alter_table_cmd: ALTER opt_column ColId alter_generic_options */ #line 319 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_AlterColumnGenericOptions; - n->name = (yyvsp[(3) - (4)].str); - n->def = (PGNode *) (yyvsp[(4) - (4)].list); + n->name = (yyvsp[-1].str); + n->def = (PGNode *) (yyvsp[0].list); (yyval.node) = (PGNode *)n; - ;} + } +#line 19592 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 83: + case 84: /* alter_table_cmd: ADD_P TableConstraint */ #line 328 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_AddConstraint; - n->def = (yyvsp[(2) - (2)].node); + n->def = (yyvsp[0].node); (yyval.node) = (PGNode *)n; - ;} + } +#line 19603 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 84: + case 85: /* alter_table_cmd: ALTER CONSTRAINT name ConstraintAttributeSpec */ #line 336 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); PGConstraint *c = makeNode(PGConstraint); n->subtype = PG_AT_AlterConstraint; n->def = (PGNode *) c; c->contype = PG_CONSTR_FOREIGN; /* others not supported, yet */ - c->conname = (yyvsp[(3) - (4)].str); - processCASbits((yyvsp[(4) - (4)].ival), (yylsp[(4) - (4)]), "ALTER CONSTRAINT statement", + c->conname = (yyvsp[-1].str); + processCASbits((yyvsp[0].ival), (yylsp[0]), "ALTER CONSTRAINT statement", &c->deferrable, &c->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (PGNode *)n; - ;} + } +#line 19621 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 85: + case 86: /* alter_table_cmd: VALIDATE CONSTRAINT name */ #line 351 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_ValidateConstraint; - n->name = (yyvsp[(3) - (3)].str); + n->name = (yyvsp[0].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 19632 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 86: + case 87: /* alter_table_cmd: DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior */ #line 359 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_DropConstraint; - n->name = (yyvsp[(5) - (6)].str); - n->behavior = (yyvsp[(6) - (6)].dbehavior); + n->name = (yyvsp[-1].str); + n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 19645 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 87: + case 88: /* alter_table_cmd: DROP CONSTRAINT name opt_drop_behavior */ #line 369 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_DropConstraint; - n->name = (yyvsp[(3) - (4)].str); - n->behavior = (yyvsp[(4) - (4)].dbehavior); + n->name = (yyvsp[-1].str); + n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19658 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 88: + case 89: /* alter_table_cmd: SET LOGGED */ #line 379 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_SetLogged; (yyval.node) = (PGNode *)n; - ;} + } +#line 19668 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 89: + case 90: /* alter_table_cmd: SET UNLOGGED */ #line 386 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_SetUnLogged; (yyval.node) = (PGNode *)n; - ;} + } +#line 19678 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 90: + case 91: /* alter_table_cmd: SET reloptions */ #line 393 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_SetRelOptions; - n->def = (PGNode *)(yyvsp[(2) - (2)].list); + n->def = (PGNode *)(yyvsp[0].list); (yyval.node) = (PGNode *)n; - ;} + } +#line 19689 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 91: + case 92: /* alter_table_cmd: RESET reloptions */ #line 401 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_ResetRelOptions; - n->def = (PGNode *)(yyvsp[(2) - (2)].list); + n->def = (PGNode *)(yyvsp[0].list); (yyval.node) = (PGNode *)n; - ;} + } +#line 19700 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 92: + case 93: /* alter_table_cmd: alter_generic_options */ #line 408 "third_party/libpg_query/grammar/statements/alter_table.y" - { + { PGAlterTableCmd *n = makeNode(PGAlterTableCmd); n->subtype = PG_AT_GenericOptions; - n->def = (PGNode *)(yyvsp[(1) - (1)].list); + n->def = (PGNode *)(yyvsp[0].list); (yyval.node) = (PGNode *) n; - ;} + } +#line 19711 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 93: + case 94: /* alter_using: USING a_expr */ #line 418 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 19717 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 94: + case 95: /* alter_using: %empty */ #line 419 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 19723 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 95: + case 96: /* alter_generic_option_elem: generic_option_elem */ #line 425 "third_party/libpg_query/grammar/statements/alter_table.y" - { - (yyval.defelt) = (yyvsp[(1) - (1)].defelt); - ;} + { + (yyval.defelt) = (yyvsp[0].defelt); + } +#line 19731 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 96: + case 97: /* alter_generic_option_elem: SET generic_option_elem */ #line 429 "third_party/libpg_query/grammar/statements/alter_table.y" - { - (yyval.defelt) = (yyvsp[(2) - (2)].defelt); + { + (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = PG_DEFELEM_SET; - ;} + } +#line 19740 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 97: + case 98: /* alter_generic_option_elem: ADD_P generic_option_elem */ #line 434 "third_party/libpg_query/grammar/statements/alter_table.y" - { - (yyval.defelt) = (yyvsp[(2) - (2)].defelt); + { + (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = PG_DEFELEM_ADD; - ;} + } +#line 19749 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 98: + case 99: /* alter_generic_option_elem: DROP generic_option_name */ #line 439 "third_party/libpg_query/grammar/statements/alter_table.y" - { - (yyval.defelt) = makeDefElemExtended(NULL, (yyvsp[(2) - (2)].str), NULL, DEFELEM_DROP, (yylsp[(2) - (2)])); - ;} + { + (yyval.defelt) = makeDefElemExtended(NULL, (yyvsp[0].str), NULL, DEFELEM_DROP, (yylsp[0])); + } +#line 19757 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 99: + case 100: /* alter_table_cmds: alter_table_cmd */ #line 446 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 19763 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 100: + case 101: /* alter_table_cmds: alter_table_cmds ',' alter_table_cmd */ #line 447 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } +#line 19769 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 101: + case 102: /* alter_generic_options: OPTIONS '(' alter_generic_option_list ')' */ #line 452 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.list) = (yyvsp[(3) - (4)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 19775 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 102: + case 103: /* opt_set_data: SET DATA_P */ #line 456 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.ival) = 1; ;} + { (yyval.ival) = 1; } +#line 19781 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 103: + case 104: /* opt_set_data: SET */ #line 457 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.ival) = 0; ;} + { (yyval.ival) = 0; } +#line 19787 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 104: + case 105: /* opt_set_data: %empty */ #line 458 "third_party/libpg_query/grammar/statements/alter_table.y" - { (yyval.ival) = 0; ;} + { (yyval.ival) = 0; } +#line 19793 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 105: + case 106: /* DeallocateStmt: DEALLOCATE name */ #line 8 "third_party/libpg_query/grammar/statements/deallocate.y" - { + { PGDeallocateStmt *n = makeNode(PGDeallocateStmt); - n->name = (yyvsp[(2) - (2)].str); + n->name = (yyvsp[0].str); (yyval.node) = (PGNode *) n; - ;} + } +#line 19803 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 106: + case 107: /* DeallocateStmt: DEALLOCATE PREPARE name */ #line 14 "third_party/libpg_query/grammar/statements/deallocate.y" - { + { PGDeallocateStmt *n = makeNode(PGDeallocateStmt); - n->name = (yyvsp[(3) - (3)].str); + n->name = (yyvsp[0].str); (yyval.node) = (PGNode *) n; - ;} + } +#line 19813 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 107: + case 108: /* DeallocateStmt: DEALLOCATE ALL */ #line 20 "third_party/libpg_query/grammar/statements/deallocate.y" - { + { PGDeallocateStmt *n = makeNode(PGDeallocateStmt); n->name = NULL; (yyval.node) = (PGNode *) n; - ;} + } +#line 19823 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 108: + case 109: /* DeallocateStmt: DEALLOCATE PREPARE ALL */ #line 26 "third_party/libpg_query/grammar/statements/deallocate.y" - { + { PGDeallocateStmt *n = makeNode(PGDeallocateStmt); n->name = NULL; (yyval.node) = (PGNode *) n; - ;} + } +#line 19833 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 109: + case 110: /* qualified_name: ColIdOrString */ #line 10 "third_party/libpg_query/grammar/statements/common.y" - { - (yyval.range) = makeRangeVar(NULL, (yyvsp[(1) - (1)].str), (yylsp[(1) - (1)])); - ;} + { + (yyval.range) = makeRangeVar(NULL, (yyvsp[0].str), (yylsp[0])); + } +#line 19841 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 110: + case 111: /* qualified_name: ColId indirection */ #line 14 "third_party/libpg_query/grammar/statements/common.y" - { - check_qualified_name((yyvsp[(2) - (2)].list), yyscanner); - (yyval.range) = makeRangeVar(NULL, NULL, (yylsp[(1) - (2)])); - switch (list_length((yyvsp[(2) - (2)].list))) + { + check_qualified_name((yyvsp[0].list), yyscanner); + (yyval.range) = makeRangeVar(NULL, NULL, (yylsp[-1])); + switch (list_length((yyvsp[0].list))) { case 1: (yyval.range)->catalogname = NULL; - (yyval.range)->schemaname = (yyvsp[(1) - (2)].str); - (yyval.range)->relname = strVal(linitial((yyvsp[(2) - (2)].list))); + (yyval.range)->schemaname = (yyvsp[-1].str); + (yyval.range)->relname = strVal(linitial((yyvsp[0].list))); break; case 2: - (yyval.range)->catalogname = (yyvsp[(1) - (2)].str); - (yyval.range)->schemaname = strVal(linitial((yyvsp[(2) - (2)].list))); - (yyval.range)->relname = strVal(lsecond((yyvsp[(2) - (2)].list))); + (yyval.range)->catalogname = (yyvsp[-1].str); + (yyval.range)->schemaname = strVal(linitial((yyvsp[0].list))); + (yyval.range)->relname = strVal(lsecond((yyvsp[0].list))); break; case 3: default: ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("improper qualified name (too many dotted names): %s", - NameListToString(lcons(makeString((yyvsp[(1) - (2)].str)), (yyvsp[(2) - (2)].list)))), - parser_errposition((yylsp[(1) - (2)])))); + NameListToString(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)))), + parser_errposition((yylsp[-1])))); break; } - ;} + } +#line 19871 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 111: + case 112: /* ColId: IDENT */ #line 44 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 19877 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 112: + case 113: /* ColId: unreserved_keyword */ #line 45 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 19883 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 113: + case 114: /* ColId: col_name_keyword */ #line 46 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 19889 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 114: + case 115: /* ColIdOrString: ColId */ #line 50 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 19895 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 115: + case 116: /* ColIdOrString: SCONST */ #line 51 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 19901 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 116: + case 117: /* Sconst: SCONST */ #line 55 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 19907 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 117: + case 118: /* indirection: indirection_el */ #line 59 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 19913 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 118: + case 119: /* indirection: indirection indirection_el */ #line 60 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} + { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } +#line 19919 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 119: + case 120: /* indirection_el: '.' attr_name */ #line 65 "third_party/libpg_query/grammar/statements/common.y" - { - (yyval.node) = (PGNode *) makeString((yyvsp[(2) - (2)].str)); - ;} + { + (yyval.node) = (PGNode *) makeString((yyvsp[0].str)); + } +#line 19927 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 120: + case 121: /* attr_name: ColLabel */ #line 70 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 19933 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 121: + case 122: /* ColLabel: IDENT */ #line 75 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 19939 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 122: + case 123: /* ColLabel: other_keyword */ #line 76 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 19945 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 123: + case 124: /* ColLabel: unreserved_keyword */ #line 77 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 19951 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 124: + case 125: /* ColLabel: reserved_keyword */ #line 78 "third_party/libpg_query/grammar/statements/common.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 19957 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 125: + case 126: /* RenameStmt: ALTER SCHEMA name RENAME TO name */ #line 7 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_SCHEMA; - n->subname = (yyvsp[(3) - (6)].str); - n->newname = (yyvsp[(6) - (6)].str); + n->subname = (yyvsp[-3].str); + n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19970 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 126: + case 127: /* RenameStmt: ALTER TABLE relation_expr RENAME TO name */ #line 16 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_TABLE; - n->relation = (yyvsp[(3) - (6)].range); + n->relation = (yyvsp[-3].range); n->subname = NULL; - n->newname = (yyvsp[(6) - (6)].str); + n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 19984 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 127: + case 128: /* RenameStmt: ALTER TABLE IF_P EXISTS relation_expr RENAME TO name */ #line 26 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_TABLE; - n->relation = (yyvsp[(5) - (8)].range); + n->relation = (yyvsp[-3].range); n->subname = NULL; - n->newname = (yyvsp[(8) - (8)].str); + n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 19998 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 128: + case 129: /* RenameStmt: ALTER SEQUENCE qualified_name RENAME TO name */ #line 36 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_SEQUENCE; - n->relation = (yyvsp[(3) - (6)].range); + n->relation = (yyvsp[-3].range); n->subname = NULL; - n->newname = (yyvsp[(6) - (6)].str); + n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 20012 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 129: + case 130: /* RenameStmt: ALTER SEQUENCE IF_P EXISTS qualified_name RENAME TO name */ #line 46 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_SEQUENCE; - n->relation = (yyvsp[(5) - (8)].range); + n->relation = (yyvsp[-3].range); n->subname = NULL; - n->newname = (yyvsp[(8) - (8)].str); + n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 20026 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 130: + case 131: /* RenameStmt: ALTER VIEW qualified_name RENAME TO name */ #line 56 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_VIEW; - n->relation = (yyvsp[(3) - (6)].range); + n->relation = (yyvsp[-3].range); n->subname = NULL; - n->newname = (yyvsp[(6) - (6)].str); + n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 20040 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 131: + case 132: /* RenameStmt: ALTER VIEW IF_P EXISTS qualified_name RENAME TO name */ #line 66 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_VIEW; - n->relation = (yyvsp[(5) - (8)].range); + n->relation = (yyvsp[-3].range); n->subname = NULL; - n->newname = (yyvsp[(8) - (8)].str); + n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 20054 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 132: + case 133: /* RenameStmt: ALTER INDEX qualified_name RENAME TO name */ #line 76 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_INDEX; - n->relation = (yyvsp[(3) - (6)].range); + n->relation = (yyvsp[-3].range); n->subname = NULL; - n->newname = (yyvsp[(6) - (6)].str); + n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 20068 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 133: + case 134: /* RenameStmt: ALTER INDEX IF_P EXISTS qualified_name RENAME TO name */ #line 86 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_INDEX; - n->relation = (yyvsp[(5) - (8)].range); + n->relation = (yyvsp[-3].range); n->subname = NULL; - n->newname = (yyvsp[(8) - (8)].str); + n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 20082 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 134: + case 135: /* RenameStmt: ALTER TABLE relation_expr RENAME opt_column name TO name */ #line 96 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_COLUMN; n->relationType = PG_OBJECT_TABLE; - n->relation = (yyvsp[(3) - (8)].range); - n->subname = (yyvsp[(6) - (8)].str); - n->newname = (yyvsp[(8) - (8)].str); + n->relation = (yyvsp[-5].range); + n->subname = (yyvsp[-2].str); + n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 20097 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 135: + case 136: /* RenameStmt: ALTER TABLE IF_P EXISTS relation_expr RENAME opt_column name TO name */ #line 107 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_COLUMN; n->relationType = PG_OBJECT_TABLE; - n->relation = (yyvsp[(5) - (10)].range); - n->subname = (yyvsp[(8) - (10)].str); - n->newname = (yyvsp[(10) - (10)].str); + n->relation = (yyvsp[-5].range); + n->subname = (yyvsp[-2].str); + n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 20112 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 136: + case 137: /* RenameStmt: ALTER TABLE relation_expr RENAME CONSTRAINT name TO name */ #line 118 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_TABCONSTRAINT; - n->relation = (yyvsp[(3) - (8)].range); - n->subname = (yyvsp[(6) - (8)].str); - n->newname = (yyvsp[(8) - (8)].str); + n->relation = (yyvsp[-5].range); + n->subname = (yyvsp[-2].str); + n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 20126 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 137: + case 138: /* RenameStmt: ALTER TABLE IF_P EXISTS relation_expr RENAME CONSTRAINT name TO name */ #line 128 "third_party/libpg_query/grammar/statements/rename.y" - { + { PGRenameStmt *n = makeNode(PGRenameStmt); n->renameType = PG_OBJECT_TABCONSTRAINT; - n->relation = (yyvsp[(5) - (10)].range); - n->subname = (yyvsp[(8) - (10)].str); - n->newname = (yyvsp[(10) - (10)].str); + n->relation = (yyvsp[-5].range); + n->subname = (yyvsp[-2].str); + n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 20140 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 138: + case 139: /* opt_column: COLUMN */ #line 140 "third_party/libpg_query/grammar/statements/rename.y" - { (yyval.ival) = COLUMN; ;} + { (yyval.ival) = COLUMN; } +#line 20146 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 139: + case 140: /* opt_column: %empty */ #line 141 "third_party/libpg_query/grammar/statements/rename.y" - { (yyval.ival) = 0; ;} + { (yyval.ival) = 0; } +#line 20152 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 140: + case 141: /* InsertStmt: opt_with_clause INSERT opt_or_action INTO insert_target opt_by_name_or_position insert_rest opt_on_conflict returning_clause */ #line 11 "third_party/libpg_query/grammar/statements/insert.y" - { - (yyvsp[(7) - (9)].istmt)->relation = (yyvsp[(5) - (9)].range); - (yyvsp[(7) - (9)].istmt)->onConflictAlias = (yyvsp[(3) - (9)].onconflictshorthand); - (yyvsp[(7) - (9)].istmt)->onConflictClause = (yyvsp[(8) - (9)].onconflict); - (yyvsp[(7) - (9)].istmt)->returningList = (yyvsp[(9) - (9)].list); - (yyvsp[(7) - (9)].istmt)->withClause = (yyvsp[(1) - (9)].with); - (yyvsp[(7) - (9)].istmt)->insert_column_order = (yyvsp[(6) - (9)].bynameorposition); - (yyval.node) = (PGNode *) (yyvsp[(7) - (9)].istmt); - ;} - break; - - case 141: + { + (yyvsp[-2].istmt)->relation = (yyvsp[-4].range); + (yyvsp[-2].istmt)->onConflictAlias = (yyvsp[-6].onconflictshorthand); + (yyvsp[-2].istmt)->onConflictClause = (yyvsp[-1].onconflict); + (yyvsp[-2].istmt)->returningList = (yyvsp[0].list); + (yyvsp[-2].istmt)->withClause = (yyvsp[-8].with); + (yyvsp[-2].istmt)->insert_column_order = (yyvsp[-3].bynameorposition); + (yyval.node) = (PGNode *) (yyvsp[-2].istmt); + } +#line 20166 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 142: /* insert_rest: SelectStmt */ #line 24 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.istmt) = makeNode(PGInsertStmt); (yyval.istmt)->cols = NIL; - (yyval.istmt)->selectStmt = (yyvsp[(1) - (1)].node); - ;} + (yyval.istmt)->selectStmt = (yyvsp[0].node); + } +#line 20176 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 142: + case 143: /* insert_rest: OVERRIDING override_kind VALUE_P SelectStmt */ #line 30 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.istmt) = makeNode(PGInsertStmt); (yyval.istmt)->cols = NIL; - (yyval.istmt)->override = (yyvsp[(2) - (4)].override); - (yyval.istmt)->selectStmt = (yyvsp[(4) - (4)].node); - ;} + (yyval.istmt)->override = (yyvsp[-2].override); + (yyval.istmt)->selectStmt = (yyvsp[0].node); + } +#line 20187 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 143: + case 144: /* insert_rest: '(' insert_column_list ')' SelectStmt */ #line 37 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.istmt) = makeNode(PGInsertStmt); - (yyval.istmt)->cols = (yyvsp[(2) - (4)].list); - (yyval.istmt)->selectStmt = (yyvsp[(4) - (4)].node); - ;} + (yyval.istmt)->cols = (yyvsp[-2].list); + (yyval.istmt)->selectStmt = (yyvsp[0].node); + } +#line 20197 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 144: + case 145: /* insert_rest: '(' insert_column_list ')' OVERRIDING override_kind VALUE_P SelectStmt */ #line 43 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.istmt) = makeNode(PGInsertStmt); - (yyval.istmt)->cols = (yyvsp[(2) - (7)].list); - (yyval.istmt)->override = (yyvsp[(5) - (7)].override); - (yyval.istmt)->selectStmt = (yyvsp[(7) - (7)].node); - ;} + (yyval.istmt)->cols = (yyvsp[-5].list); + (yyval.istmt)->override = (yyvsp[-2].override); + (yyval.istmt)->selectStmt = (yyvsp[0].node); + } +#line 20208 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 145: + case 146: /* insert_rest: DEFAULT VALUES */ #line 50 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.istmt) = makeNode(PGInsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = NULL; - ;} + } +#line 20218 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 146: + case 147: /* insert_target: qualified_name */ #line 60 "third_party/libpg_query/grammar/statements/insert.y" - { - (yyval.range) = (yyvsp[(1) - (1)].range); - ;} + { + (yyval.range) = (yyvsp[0].range); + } +#line 20226 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 147: + case 148: /* insert_target: qualified_name AS ColId */ #line 64 "third_party/libpg_query/grammar/statements/insert.y" - { - (yyvsp[(1) - (3)].range)->alias = makeAlias((yyvsp[(3) - (3)].str), NIL); - (yyval.range) = (yyvsp[(1) - (3)].range); - ;} + { + (yyvsp[-2].range)->alias = makeAlias((yyvsp[0].str), NIL); + (yyval.range) = (yyvsp[-2].range); + } +#line 20235 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 148: + case 149: /* opt_by_name_or_position: BY NAME_P */ #line 71 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.bynameorposition) = PG_INSERT_BY_NAME; ;} + { (yyval.bynameorposition) = PG_INSERT_BY_NAME; } +#line 20241 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 149: + case 150: /* opt_by_name_or_position: BY POSITION */ #line 72 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.bynameorposition) = PG_INSERT_BY_POSITION; ;} + { (yyval.bynameorposition) = PG_INSERT_BY_POSITION; } +#line 20247 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 150: + case 151: /* opt_by_name_or_position: %empty */ #line 73 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.bynameorposition) = PG_INSERT_BY_POSITION; ;} + { (yyval.bynameorposition) = PG_INSERT_BY_POSITION; } +#line 20253 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 151: + case 152: /* opt_conf_expr: '(' index_params ')' where_clause */ #line 78 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.infer) = makeNode(PGInferClause); - (yyval.infer)->indexElems = (yyvsp[(2) - (4)].list); - (yyval.infer)->whereClause = (yyvsp[(4) - (4)].node); + (yyval.infer)->indexElems = (yyvsp[-2].list); + (yyval.infer)->whereClause = (yyvsp[0].node); (yyval.infer)->conname = NULL; - (yyval.infer)->location = (yylsp[(1) - (4)]); - ;} + (yyval.infer)->location = (yylsp[-3]); + } +#line 20265 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 152: + case 153: /* opt_conf_expr: ON CONSTRAINT name */ #line 87 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.infer) = makeNode(PGInferClause); (yyval.infer)->indexElems = NIL; (yyval.infer)->whereClause = NULL; - (yyval.infer)->conname = (yyvsp[(3) - (3)].str); - (yyval.infer)->location = (yylsp[(1) - (3)]); - ;} + (yyval.infer)->conname = (yyvsp[0].str); + (yyval.infer)->location = (yylsp[-2]); + } +#line 20277 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 153: + case 154: /* opt_conf_expr: %empty */ #line 95 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.infer) = NULL; - ;} + } +#line 20285 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 154: + case 155: /* opt_with_clause: with_clause */ #line 102 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.with) = (yyvsp[(1) - (1)].with); ;} + { (yyval.with) = (yyvsp[0].with); } +#line 20291 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 155: + case 156: /* opt_with_clause: %empty */ #line 103 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.with) = NULL; ;} + { (yyval.with) = NULL; } +#line 20297 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 156: + case 157: /* insert_column_item: ColId opt_indirection */ #line 109 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.target) = makeNode(PGResTarget); - (yyval.target)->name = (yyvsp[(1) - (2)].str); - (yyval.target)->indirection = check_indirection((yyvsp[(2) - (2)].list), yyscanner); + (yyval.target)->name = (yyvsp[-1].str); + (yyval.target)->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.target)->val = NULL; - (yyval.target)->location = (yylsp[(1) - (2)]); - ;} + (yyval.target)->location = (yylsp[-1]); + } +#line 20309 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 157: + case 158: /* set_clause: set_target '=' a_expr */ #line 121 "third_party/libpg_query/grammar/statements/insert.y" - { - (yyvsp[(1) - (3)].target)->val = (PGNode *) (yyvsp[(3) - (3)].node); - (yyval.list) = list_make1((yyvsp[(1) - (3)].target)); - ;} + { + (yyvsp[-2].target)->val = (PGNode *) (yyvsp[0].node); + (yyval.list) = list_make1((yyvsp[-2].target)); + } +#line 20318 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 158: + case 159: /* set_clause: '(' set_target_list ')' '=' a_expr */ #line 126 "third_party/libpg_query/grammar/statements/insert.y" - { - int ncolumns = list_length((yyvsp[(2) - (5)].list)); + { + int ncolumns = list_length((yyvsp[-3].list)); int i = 1; PGListCell *col_cell; /* Create a PGMultiAssignRef source for each target */ - foreach(col_cell, (yyvsp[(2) - (5)].list)) + foreach(col_cell, (yyvsp[-3].list)) { PGResTarget *res_col = (PGResTarget *) lfirst(col_cell); PGMultiAssignRef *r = makeNode(PGMultiAssignRef); - r->source = (PGNode *) (yyvsp[(5) - (5)].node); + r->source = (PGNode *) (yyvsp[0].node); r->colno = i; r->ncolumns = ncolumns; res_col->val = (PGNode *) r; i++; } - (yyval.list) = (yyvsp[(2) - (5)].list); - ;} + (yyval.list) = (yyvsp[-3].list); + } +#line 20343 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 159: + case 160: /* opt_or_action: OR REPLACE */ #line 151 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.onconflictshorthand) = PG_ONCONFLICT_ALIAS_REPLACE; - ;} + } +#line 20351 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 160: + case 161: /* opt_or_action: OR IGNORE_P */ #line 156 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.onconflictshorthand) = PG_ONCONFLICT_ALIAS_IGNORE; - ;} + } +#line 20359 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 161: + case 162: /* opt_or_action: %empty */ #line 160 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.onconflictshorthand) = PG_ONCONFLICT_ALIAS_NONE; - ;} + } +#line 20367 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 162: + case 163: /* opt_on_conflict: ON CONFLICT opt_conf_expr DO UPDATE SET set_clause_list_opt_comma where_clause */ #line 167 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.onconflict) = makeNode(PGOnConflictClause); (yyval.onconflict)->action = PG_ONCONFLICT_UPDATE; - (yyval.onconflict)->infer = (yyvsp[(3) - (8)].infer); - (yyval.onconflict)->targetList = (yyvsp[(7) - (8)].list); - (yyval.onconflict)->whereClause = (yyvsp[(8) - (8)].node); - (yyval.onconflict)->location = (yylsp[(1) - (8)]); - ;} + (yyval.onconflict)->infer = (yyvsp[-5].infer); + (yyval.onconflict)->targetList = (yyvsp[-1].list); + (yyval.onconflict)->whereClause = (yyvsp[0].node); + (yyval.onconflict)->location = (yylsp[-7]); + } +#line 20380 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 163: + case 164: /* opt_on_conflict: ON CONFLICT opt_conf_expr DO NOTHING */ #line 177 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.onconflict) = makeNode(PGOnConflictClause); (yyval.onconflict)->action = PG_ONCONFLICT_NOTHING; - (yyval.onconflict)->infer = (yyvsp[(3) - (5)].infer); + (yyval.onconflict)->infer = (yyvsp[-2].infer); (yyval.onconflict)->targetList = NIL; (yyval.onconflict)->whereClause = NULL; - (yyval.onconflict)->location = (yylsp[(1) - (5)]); - ;} + (yyval.onconflict)->location = (yylsp[-4]); + } +#line 20393 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 164: + case 165: /* opt_on_conflict: %empty */ #line 186 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.onconflict) = NULL; - ;} + } +#line 20401 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 165: + case 166: /* index_elem: ColId opt_collate opt_class opt_asc_desc opt_nulls_order */ #line 193 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.ielem) = makeNode(PGIndexElem); - (yyval.ielem)->name = (yyvsp[(1) - (5)].str); + (yyval.ielem)->name = (yyvsp[-4].str); (yyval.ielem)->expr = NULL; (yyval.ielem)->indexcolname = NULL; - (yyval.ielem)->collation = (yyvsp[(2) - (5)].list); - (yyval.ielem)->opclass = (yyvsp[(3) - (5)].list); - (yyval.ielem)->ordering = (yyvsp[(4) - (5)].sortorder); - (yyval.ielem)->nulls_ordering = (yyvsp[(5) - (5)].nullorder); - ;} + (yyval.ielem)->collation = (yyvsp[-3].list); + (yyval.ielem)->opclass = (yyvsp[-2].list); + (yyval.ielem)->ordering = (yyvsp[-1].sortorder); + (yyval.ielem)->nulls_ordering = (yyvsp[0].nullorder); + } +#line 20416 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 166: + case 167: /* index_elem: func_expr_windowless opt_collate opt_class opt_asc_desc opt_nulls_order */ #line 204 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.ielem) = makeNode(PGIndexElem); (yyval.ielem)->name = NULL; - (yyval.ielem)->expr = (yyvsp[(1) - (5)].node); + (yyval.ielem)->expr = (yyvsp[-4].node); (yyval.ielem)->indexcolname = NULL; - (yyval.ielem)->collation = (yyvsp[(2) - (5)].list); - (yyval.ielem)->opclass = (yyvsp[(3) - (5)].list); - (yyval.ielem)->ordering = (yyvsp[(4) - (5)].sortorder); - (yyval.ielem)->nulls_ordering = (yyvsp[(5) - (5)].nullorder); - ;} + (yyval.ielem)->collation = (yyvsp[-3].list); + (yyval.ielem)->opclass = (yyvsp[-2].list); + (yyval.ielem)->ordering = (yyvsp[-1].sortorder); + (yyval.ielem)->nulls_ordering = (yyvsp[0].nullorder); + } +#line 20431 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 167: + case 168: /* index_elem: '(' a_expr ')' opt_collate opt_class opt_asc_desc opt_nulls_order */ #line 215 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.ielem) = makeNode(PGIndexElem); (yyval.ielem)->name = NULL; - (yyval.ielem)->expr = (yyvsp[(2) - (7)].node); + (yyval.ielem)->expr = (yyvsp[-5].node); (yyval.ielem)->indexcolname = NULL; - (yyval.ielem)->collation = (yyvsp[(4) - (7)].list); - (yyval.ielem)->opclass = (yyvsp[(5) - (7)].list); - (yyval.ielem)->ordering = (yyvsp[(6) - (7)].sortorder); - (yyval.ielem)->nulls_ordering = (yyvsp[(7) - (7)].nullorder); - ;} + (yyval.ielem)->collation = (yyvsp[-3].list); + (yyval.ielem)->opclass = (yyvsp[-2].list); + (yyval.ielem)->ordering = (yyvsp[-1].sortorder); + (yyval.ielem)->nulls_ordering = (yyvsp[0].nullorder); + } +#line 20446 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 168: + case 169: /* returning_clause: RETURNING target_list */ #line 229 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = (yyvsp[(2) - (2)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 20452 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 169: + case 170: /* returning_clause: %empty */ #line 230 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 20458 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 170: + case 171: /* override_kind: USER */ #line 236 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.override) = PG_OVERRIDING_USER_VALUE; ;} + { (yyval.override) = PG_OVERRIDING_USER_VALUE; } +#line 20464 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 171: + case 172: /* override_kind: SYSTEM_P */ #line 237 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.override) = OVERRIDING_SYSTEM_VALUE; ;} + { (yyval.override) = OVERRIDING_SYSTEM_VALUE; } +#line 20470 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 172: + case 173: /* set_target_list: set_target */ #line 242 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].target)); ;} + { (yyval.list) = list_make1((yyvsp[0].target)); } +#line 20476 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 173: + case 174: /* set_target_list: set_target_list ',' set_target */ #line 243 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list),(yyvsp[(3) - (3)].target)); ;} + { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].target)); } +#line 20482 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 174: + case 175: /* opt_collate: COLLATE any_name */ #line 249 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = (yyvsp[(2) - (2)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 20488 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 175: + case 176: /* opt_collate: %empty */ #line 250 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 20494 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 176: + case 177: /* opt_class: any_name */ #line 254 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 20500 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 177: + case 178: /* opt_class: %empty */ #line 255 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 20506 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 178: + case 179: /* insert_column_list: insert_column_item */ #line 261 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].target)); ;} + { (yyval.list) = list_make1((yyvsp[0].target)); } +#line 20512 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 179: + case 180: /* insert_column_list: insert_column_list ',' insert_column_item */ #line 263 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].target)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } +#line 20518 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 180: + case 181: /* set_clause_list: set_clause */ #line 268 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 20524 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 181: + case 182: /* set_clause_list: set_clause_list ',' set_clause */ #line 269 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = list_concat((yyvsp[(1) - (3)].list),(yyvsp[(3) - (3)].list)); ;} + { (yyval.list) = list_concat((yyvsp[-2].list),(yyvsp[0].list)); } +#line 20530 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 182: + case 183: /* set_clause_list_opt_comma: set_clause_list */ #line 273 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 20536 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 183: + case 184: /* set_clause_list_opt_comma: set_clause_list ',' */ #line 274 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 20542 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 184: + case 185: /* index_params: index_elem */ #line 277 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].ielem)); ;} + { (yyval.list) = list_make1((yyvsp[0].ielem)); } +#line 20548 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 185: + case 186: /* index_params: index_params ',' index_elem */ #line 278 "third_party/libpg_query/grammar/statements/insert.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].ielem)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } +#line 20554 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 186: + case 187: /* set_target: ColId opt_indirection */ #line 284 "third_party/libpg_query/grammar/statements/insert.y" - { + { (yyval.target) = makeNode(PGResTarget); - (yyval.target)->name = (yyvsp[(1) - (2)].str); - (yyval.target)->indirection = check_indirection((yyvsp[(2) - (2)].list), yyscanner); + (yyval.target)->name = (yyvsp[-1].str); + (yyval.target)->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.target)->val = NULL; /* upper production sets this */ - (yyval.target)->location = (yylsp[(1) - (2)]); - ;} + (yyval.target)->location = (yylsp[-1]); + } +#line 20566 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 187: + case 188: /* CreateTypeStmt: CREATE_P TYPE_P qualified_name AS ENUM_P select_with_parens */ #line 8 "third_party/libpg_query/grammar/statements/create_type.y" - { + { PGCreateTypeStmt *n = makeNode(PGCreateTypeStmt); - n->typeName = (yyvsp[(3) - (6)].range); + n->typeName = (yyvsp[-3].range); n->kind = PG_NEWTYPE_ENUM; - n->query = (yyvsp[(6) - (6)].node); + n->query = (yyvsp[0].node); n->vals = NULL; (yyval.node) = (PGNode *)n; - ;} + } +#line 20579 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 188: + case 189: /* CreateTypeStmt: CREATE_P TYPE_P qualified_name AS ENUM_P '(' opt_enum_val_list ')' */ #line 17 "third_party/libpg_query/grammar/statements/create_type.y" - { + { PGCreateTypeStmt *n = makeNode(PGCreateTypeStmt); - n->typeName = (yyvsp[(3) - (8)].range); + n->typeName = (yyvsp[-5].range); n->kind = PG_NEWTYPE_ENUM; - n->vals = (yyvsp[(7) - (8)].list); + n->vals = (yyvsp[-1].list); n->query = NULL; (yyval.node) = (PGNode *)n; - ;} + } +#line 20592 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 189: + case 190: /* CreateTypeStmt: CREATE_P TYPE_P qualified_name AS Typename */ #line 26 "third_party/libpg_query/grammar/statements/create_type.y" - { + { PGCreateTypeStmt *n = makeNode(PGCreateTypeStmt); - n->typeName = (yyvsp[(3) - (5)].range); + n->typeName = (yyvsp[-2].range); n->query = NULL; - auto name = std::string(reinterpret_cast((yyvsp[(5) - (5)].typnam)->names->tail->data.ptr_value)->val.str); + auto name = std::string(reinterpret_cast((yyvsp[0].typnam)->names->tail->data.ptr_value)->val.str); if (name == "enum") { n->kind = PG_NEWTYPE_ENUM; - n->vals = (yyvsp[(5) - (5)].typnam)->typmods; + n->vals = (yyvsp[0].typnam)->typmods; } else { n->kind = PG_NEWTYPE_ALIAS; - n->ofType = (yyvsp[(5) - (5)].typnam); + n->ofType = (yyvsp[0].typnam); } (yyval.node) = (PGNode *)n; - ;} + } +#line 20611 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 190: + case 191: /* opt_enum_val_list: enum_val_list */ #line 46 "third_party/libpg_query/grammar/statements/create_type.y" - { (yyval.list) = (yyvsp[(1) - (1)].list);;} + { (yyval.list) = (yyvsp[0].list);} +#line 20617 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 191: + case 192: /* opt_enum_val_list: %empty */ #line 47 "third_party/libpg_query/grammar/statements/create_type.y" - {(yyval.list) = NIL;;} + {(yyval.list) = NIL;} +#line 20623 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 192: + case 193: /* enum_val_list: Sconst */ #line 51 "third_party/libpg_query/grammar/statements/create_type.y" - { - (yyval.list) = list_make1(makeStringConst((yyvsp[(1) - (1)].str), (yylsp[(1) - (1)]))); - ;} + { + (yyval.list) = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); + } +#line 20631 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 193: + case 194: /* enum_val_list: enum_val_list ',' Sconst */ #line 55 "third_party/libpg_query/grammar/statements/create_type.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), makeStringConst((yyvsp[(3) - (3)].str), (yylsp[(3) - (3)]))); - ;} + { + (yyval.list) = lappend((yyvsp[-2].list), makeStringConst((yyvsp[0].str), (yylsp[0]))); + } +#line 20639 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 194: + case 195: /* PragmaStmt: PRAGMA_P ColId */ #line 8 "third_party/libpg_query/grammar/statements/pragma.y" - { + { PGPragmaStmt *n = makeNode(PGPragmaStmt); n->kind = PG_PRAGMA_TYPE_NOTHING; - n->name = (yyvsp[(2) - (2)].str); + n->name = (yyvsp[0].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 20650 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 195: + case 196: /* PragmaStmt: PRAGMA_P ColId '=' var_list */ #line 15 "third_party/libpg_query/grammar/statements/pragma.y" - { + { PGPragmaStmt *n = makeNode(PGPragmaStmt); n->kind = PG_PRAGMA_TYPE_ASSIGNMENT; - n->name = (yyvsp[(2) - (4)].str); - n->args = (yyvsp[(4) - (4)].list); + n->name = (yyvsp[-2].str); + n->args = (yyvsp[0].list); (yyval.node) = (PGNode *)n; - ;} + } +#line 20662 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 196: + case 197: /* PragmaStmt: PRAGMA_P ColId '(' func_arg_list ')' */ #line 23 "third_party/libpg_query/grammar/statements/pragma.y" - { + { PGPragmaStmt *n = makeNode(PGPragmaStmt); n->kind = PG_PRAGMA_TYPE_CALL; - n->name = (yyvsp[(2) - (5)].str); - n->args = (yyvsp[(4) - (5)].list); + n->name = (yyvsp[-3].str); + n->args = (yyvsp[-1].list); (yyval.node) = (PGNode *)n; - ;} + } +#line 20674 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 197: + case 198: /* CreateSeqStmt: CREATE_P OptTemp SEQUENCE qualified_name OptSeqOptList */ #line 10 "third_party/libpg_query/grammar/statements/create_sequence.y" - { + { PGCreateSeqStmt *n = makeNode(PGCreateSeqStmt); - (yyvsp[(4) - (5)].range)->relpersistence = (yyvsp[(2) - (5)].ival); - n->sequence = (yyvsp[(4) - (5)].range); - n->options = (yyvsp[(5) - (5)].list); + (yyvsp[-1].range)->relpersistence = (yyvsp[-3].ival); + n->sequence = (yyvsp[-1].range); + n->options = (yyvsp[0].list); n->ownerId = InvalidOid; n->onconflict = PG_ERROR_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 20688 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 198: + case 199: /* CreateSeqStmt: CREATE_P OptTemp SEQUENCE IF_P NOT EXISTS qualified_name OptSeqOptList */ #line 20 "third_party/libpg_query/grammar/statements/create_sequence.y" - { + { PGCreateSeqStmt *n = makeNode(PGCreateSeqStmt); - (yyvsp[(7) - (8)].range)->relpersistence = (yyvsp[(2) - (8)].ival); - n->sequence = (yyvsp[(7) - (8)].range); - n->options = (yyvsp[(8) - (8)].list); + (yyvsp[-1].range)->relpersistence = (yyvsp[-6].ival); + n->sequence = (yyvsp[-1].range); + n->options = (yyvsp[0].list); n->ownerId = InvalidOid; n->onconflict = PG_IGNORE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 20702 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 199: + case 200: /* CreateSeqStmt: CREATE_P OR REPLACE OptTemp SEQUENCE qualified_name OptSeqOptList */ #line 30 "third_party/libpg_query/grammar/statements/create_sequence.y" - { + { PGCreateSeqStmt *n = makeNode(PGCreateSeqStmt); - (yyvsp[(6) - (7)].range)->relpersistence = (yyvsp[(4) - (7)].ival); - n->sequence = (yyvsp[(6) - (7)].range); - n->options = (yyvsp[(7) - (7)].list); + (yyvsp[-1].range)->relpersistence = (yyvsp[-3].ival); + n->sequence = (yyvsp[-1].range); + n->options = (yyvsp[0].list); n->ownerId = InvalidOid; n->onconflict = PG_REPLACE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 20716 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 200: + case 201: /* OptSeqOptList: SeqOptList */ #line 42 "third_party/libpg_query/grammar/statements/create_sequence.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 20722 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 201: + case 202: /* OptSeqOptList: %empty */ #line 43 "third_party/libpg_query/grammar/statements/create_sequence.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 20728 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 202: + case 203: /* CreateSecretStmt: CREATE_P opt_persist SECRET opt_secret_name opt_storage_specifier '(' copy_generic_opt_list ')' */ #line 8 "third_party/libpg_query/grammar/statements/create_secret.y" - { + { PGCreateSecretStmt *n = makeNode(PGCreateSecretStmt); - n->persist_type = (yyvsp[(2) - (8)].str); - n->secret_name = (yyvsp[(4) - (8)].str); - n->secret_storage = (yyvsp[(5) - (8)].str); - n->options = (yyvsp[(7) - (8)].list); + n->persist_type = (yyvsp[-6].str); + n->secret_name = (yyvsp[-4].str); + n->secret_storage = (yyvsp[-3].str); + n->options = (yyvsp[-1].list); n->onconflict = PG_ERROR_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 20742 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 203: + case 204: /* CreateSecretStmt: CREATE_P opt_persist SECRET IF_P NOT EXISTS opt_secret_name opt_storage_specifier '(' copy_generic_opt_list ')' */ #line 18 "third_party/libpg_query/grammar/statements/create_secret.y" - { + { PGCreateSecretStmt *n = makeNode(PGCreateSecretStmt); - n->persist_type = (yyvsp[(2) - (11)].str); - n->secret_name = (yyvsp[(7) - (11)].str); - n->secret_storage = (yyvsp[(8) - (11)].str); - n->options = (yyvsp[(10) - (11)].list); + n->persist_type = (yyvsp[-9].str); + n->secret_name = (yyvsp[-4].str); + n->secret_storage = (yyvsp[-3].str); + n->options = (yyvsp[-1].list); n->onconflict = PG_IGNORE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 20756 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 204: + case 205: /* CreateSecretStmt: CREATE_P OR REPLACE opt_persist SECRET opt_secret_name opt_storage_specifier '(' copy_generic_opt_list ')' */ #line 28 "third_party/libpg_query/grammar/statements/create_secret.y" - { + { PGCreateSecretStmt *n = makeNode(PGCreateSecretStmt); - n->persist_type = (yyvsp[(4) - (10)].str); - n->secret_name = (yyvsp[(6) - (10)].str); - n->secret_storage = (yyvsp[(7) - (10)].str); - n->options = (yyvsp[(9) - (10)].list); + n->persist_type = (yyvsp[-6].str); + n->secret_name = (yyvsp[-4].str); + n->secret_storage = (yyvsp[-3].str); + n->options = (yyvsp[-1].list); n->onconflict = PG_REPLACE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 20770 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 205: + case 206: /* opt_secret_name: %empty */ #line 40 "third_party/libpg_query/grammar/statements/create_secret.y" - { (yyval.str) = NULL; ;} + { (yyval.str) = NULL; } +#line 20776 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 206: + case 207: /* opt_secret_name: ColId */ #line 41 "third_party/libpg_query/grammar/statements/create_secret.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 20782 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 207: + case 208: /* opt_persist: %empty */ #line 45 "third_party/libpg_query/grammar/statements/create_secret.y" - { (yyval.str) = pstrdup("default"); ;} + { (yyval.str) = pstrdup("default"); } +#line 20788 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 208: + case 209: /* opt_persist: TEMPORARY */ #line 46 "third_party/libpg_query/grammar/statements/create_secret.y" - { (yyval.str) = pstrdup("temporary"); ;} + { (yyval.str) = pstrdup("temporary"); } +#line 20794 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 209: + case 210: /* opt_persist: PERSISTENT */ #line 47 "third_party/libpg_query/grammar/statements/create_secret.y" - { (yyval.str) = pstrdup("persistent"); ;} + { (yyval.str) = pstrdup("persistent"); } +#line 20800 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 210: + case 211: /* opt_storage_specifier: %empty */ #line 51 "third_party/libpg_query/grammar/statements/create_secret.y" - { (yyval.str) = pstrdup(""); ;} + { (yyval.str) = pstrdup(""); } +#line 20806 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 211: + case 212: /* opt_storage_specifier: IN_P IDENT */ #line 52 "third_party/libpg_query/grammar/statements/create_secret.y" - { (yyval.str) = (yyvsp[(2) - (2)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 20812 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 213: /* UpdateExtensionsStmt: opt_with_clause UPDATE EXTENSIONS opt_column_list */ +#line 8 "third_party/libpg_query/grammar/statements/update_extensions.y" + { + PGUpdateExtensionsStmt *n = makeNode(PGUpdateExtensionsStmt); + n->extensions = (yyvsp[0].list); + + if ((yyvsp[-3].with)) { + ereport(ERROR, + (errcode(PG_ERRCODE_SYNTAX_ERROR), + errmsg("Providing a with clause with an UPDATE EXTENSIONS statement is not allowed"), + parser_errposition((yylsp[-3])))); + break; + } + + (yyval.node) = (PGNode *)n; + } +#line 20831 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 212: + case 214: /* ExecuteStmt: EXECUTE name execute_param_clause */ #line 8 "third_party/libpg_query/grammar/statements/execute.y" - { + { PGExecuteStmt *n = makeNode(PGExecuteStmt); - n->name = (yyvsp[(2) - (3)].str); - n->params = (yyvsp[(3) - (3)].list); + n->name = (yyvsp[-1].str); + n->params = (yyvsp[0].list); (yyval.node) = (PGNode *) n; - ;} + } +#line 20842 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 213: + case 215: /* ExecuteStmt: CREATE_P OptTemp TABLE create_as_target AS EXECUTE name execute_param_clause opt_with_data */ #line 16 "third_party/libpg_query/grammar/statements/execute.y" - { + { PGCreateTableAsStmt *ctas = makeNode(PGCreateTableAsStmt); PGExecuteStmt *n = makeNode(PGExecuteStmt); - n->name = (yyvsp[(7) - (9)].str); - n->params = (yyvsp[(8) - (9)].list); + n->name = (yyvsp[-2].str); + n->params = (yyvsp[-1].list); ctas->query = (PGNode *) n; - ctas->into = (yyvsp[(4) - (9)].into); + ctas->into = (yyvsp[-5].into); ctas->relkind = PG_OBJECT_TABLE; ctas->is_select_into = false; ctas->onconflict = PG_ERROR_ON_CONFLICT; /* cram additional flags into the PGIntoClause */ - (yyvsp[(4) - (9)].into)->rel->relpersistence = (yyvsp[(2) - (9)].ival); - (yyvsp[(4) - (9)].into)->skipData = !((yyvsp[(9) - (9)].boolean)); + (yyvsp[-5].into)->rel->relpersistence = (yyvsp[-7].ival); + (yyvsp[-5].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (PGNode *) ctas; - ;} + } +#line 20862 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 214: + case 216: /* ExecuteStmt: CREATE_P OptTemp TABLE IF_P NOT EXISTS create_as_target AS EXECUTE name execute_param_clause opt_with_data */ #line 33 "third_party/libpg_query/grammar/statements/execute.y" - { + { PGCreateTableAsStmt *ctas = makeNode(PGCreateTableAsStmt); PGExecuteStmt *n = makeNode(PGExecuteStmt); - n->name = (yyvsp[(10) - (12)].str); - n->params = (yyvsp[(11) - (12)].list); + n->name = (yyvsp[-2].str); + n->params = (yyvsp[-1].list); ctas->query = (PGNode *) n; - ctas->into = (yyvsp[(7) - (12)].into); + ctas->into = (yyvsp[-5].into); ctas->relkind = PG_OBJECT_TABLE; ctas->is_select_into = false; ctas->onconflict = PG_IGNORE_ON_CONFLICT; /* cram additional flags into the PGIntoClause */ - (yyvsp[(7) - (12)].into)->rel->relpersistence = (yyvsp[(2) - (12)].ival); - (yyvsp[(7) - (12)].into)->skipData = !((yyvsp[(12) - (12)].boolean)); + (yyvsp[-5].into)->rel->relpersistence = (yyvsp[-10].ival); + (yyvsp[-5].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (PGNode *) ctas; - ;} + } +#line 20882 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 215: + case 217: /* execute_param_expr: a_expr */ #line 52 "third_party/libpg_query/grammar/statements/execute.y" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - ;} + { + (yyval.node) = (yyvsp[0].node); + } +#line 20890 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 216: + case 218: /* execute_param_expr: param_name COLON_EQUALS a_expr */ #line 56 "third_party/libpg_query/grammar/statements/execute.y" - { + { PGNamedArgExpr *na = makeNode(PGNamedArgExpr); - na->name = (yyvsp[(1) - (3)].str); - na->arg = (PGExpr *) (yyvsp[(3) - (3)].node); + na->name = (yyvsp[-2].str); + na->arg = (PGExpr *) (yyvsp[0].node); na->argnumber = -1; /* until determined */ - na->location = (yylsp[(1) - (3)]); + na->location = (yylsp[-2]); (yyval.node) = (PGNode *) na; - ;} + } +#line 20903 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 217: + case 219: /* execute_param_list: execute_param_expr */ #line 66 "third_party/libpg_query/grammar/statements/execute.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); - ;} + { + (yyval.list) = list_make1((yyvsp[0].node)); + } +#line 20911 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 218: + case 220: /* execute_param_list: execute_param_list ',' execute_param_expr */ #line 70 "third_party/libpg_query/grammar/statements/execute.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); - ;} + { + (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); + } +#line 20919 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 219: + case 221: /* execute_param_clause: '(' execute_param_list ')' */ #line 75 "third_party/libpg_query/grammar/statements/execute.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 20925 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 220: + case 222: /* execute_param_clause: %empty */ #line 76 "third_party/libpg_query/grammar/statements/execute.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 20931 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 221: + case 223: /* AlterSeqStmt: ALTER SEQUENCE qualified_name SeqOptList */ #line 10 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { + { PGAlterSeqStmt *n = makeNode(PGAlterSeqStmt); - n->sequence = (yyvsp[(3) - (4)].range); - n->options = (yyvsp[(4) - (4)].list); + n->sequence = (yyvsp[-1].range); + n->options = (yyvsp[0].list); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 20943 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 222: + case 224: /* AlterSeqStmt: ALTER SEQUENCE IF_P EXISTS qualified_name SeqOptList */ #line 18 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { + { PGAlterSeqStmt *n = makeNode(PGAlterSeqStmt); - n->sequence = (yyvsp[(5) - (6)].range); - n->options = (yyvsp[(6) - (6)].list); + n->sequence = (yyvsp[-1].range); + n->options = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 20955 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 223: + case 225: /* SeqOptList: SeqOptElem */ #line 29 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].defelt)); ;} + { (yyval.list) = list_make1((yyvsp[0].defelt)); } +#line 20961 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 224: + case 226: /* SeqOptList: SeqOptList SeqOptElem */ #line 30 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].defelt)); ;} + { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } +#line 20967 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 225: + case 227: /* opt_with: WITH */ #line 34 "third_party/libpg_query/grammar/statements/alter_sequence.y" - {;} + {} +#line 20973 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 226: + case 228: /* opt_with: WITH_LA */ #line 35 "third_party/libpg_query/grammar/statements/alter_sequence.y" - {;} + {} +#line 20979 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 227: + case 229: /* opt_with: %empty */ #line 36 "third_party/libpg_query/grammar/statements/alter_sequence.y" - {;} + {} +#line 20985 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 228: + case 230: /* NumericOnly: FCONST */ #line 41 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { (yyval.value) = makeFloat((yyvsp[(1) - (1)].str)); ;} + { (yyval.value) = makeFloat((yyvsp[0].str)); } +#line 20991 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 229: + case 231: /* NumericOnly: '+' FCONST */ #line 42 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { (yyval.value) = makeFloat((yyvsp[(2) - (2)].str)); ;} + { (yyval.value) = makeFloat((yyvsp[0].str)); } +#line 20997 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 230: + case 232: /* NumericOnly: '-' FCONST */ #line 44 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.value) = makeFloat((yyvsp[(2) - (2)].str)); + { + (yyval.value) = makeFloat((yyvsp[0].str)); doNegateFloat((yyval.value)); - ;} + } +#line 21006 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 231: + case 233: /* NumericOnly: SignedIconst */ #line 48 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { (yyval.value) = makeInteger((yyvsp[(1) - (1)].ival)); ;} + { (yyval.value) = makeInteger((yyvsp[0].ival)); } +#line 21012 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 232: + case 234: /* SeqOptElem: AS SimpleTypename */ #line 53 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("as", (PGNode *)(yyvsp[(2) - (2)].typnam), (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem("as", (PGNode *)(yyvsp[0].typnam), (yylsp[-1])); + } +#line 21020 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 233: + case 235: /* SeqOptElem: CACHE NumericOnly */ #line 57 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("cache", (PGNode *)(yyvsp[(2) - (2)].value), (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem("cache", (PGNode *)(yyvsp[0].value), (yylsp[-1])); + } +#line 21028 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 234: + case 236: /* SeqOptElem: CYCLE */ #line 61 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("cycle", (PGNode *)makeInteger(true), (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem("cycle", (PGNode *)makeInteger(true), (yylsp[0])); + } +#line 21036 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 235: + case 237: /* SeqOptElem: NO CYCLE */ #line 65 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("cycle", (PGNode *)makeInteger(false), (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem("cycle", (PGNode *)makeInteger(false), (yylsp[-1])); + } +#line 21044 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 236: + case 238: /* SeqOptElem: INCREMENT opt_by NumericOnly */ #line 69 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("increment", (PGNode *)(yyvsp[(3) - (3)].value), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("increment", (PGNode *)(yyvsp[0].value), (yylsp[-2])); + } +#line 21052 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 237: + case 239: /* SeqOptElem: MAXVALUE NumericOnly */ #line 73 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("maxvalue", (PGNode *)(yyvsp[(2) - (2)].value), (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem("maxvalue", (PGNode *)(yyvsp[0].value), (yylsp[-1])); + } +#line 21060 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 238: + case 240: /* SeqOptElem: MINVALUE NumericOnly */ #line 77 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("minvalue", (PGNode *)(yyvsp[(2) - (2)].value), (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem("minvalue", (PGNode *)(yyvsp[0].value), (yylsp[-1])); + } +#line 21068 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 239: + case 241: /* SeqOptElem: NO MAXVALUE */ #line 81 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("maxvalue", NULL, (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem("maxvalue", NULL, (yylsp[-1])); + } +#line 21076 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 240: + case 242: /* SeqOptElem: NO MINVALUE */ #line 85 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("minvalue", NULL, (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem("minvalue", NULL, (yylsp[-1])); + } +#line 21084 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 241: + case 243: /* SeqOptElem: OWNED BY any_name */ #line 89 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("owned_by", (PGNode *)(yyvsp[(3) - (3)].list), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("owned_by", (PGNode *)(yyvsp[0].list), (yylsp[-2])); + } +#line 21092 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 242: + case 244: /* SeqOptElem: SEQUENCE NAME_P any_name */ #line 93 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { + { /* not documented, only used by pg_dump */ - (yyval.defelt) = makeDefElem("sequence_name", (PGNode *)(yyvsp[(3) - (3)].list), (yylsp[(1) - (3)])); - ;} + (yyval.defelt) = makeDefElem("sequence_name", (PGNode *)(yyvsp[0].list), (yylsp[-2])); + } +#line 21101 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 243: + case 245: /* SeqOptElem: START opt_with NumericOnly */ #line 98 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("start", (PGNode *)(yyvsp[(3) - (3)].value), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("start", (PGNode *)(yyvsp[0].value), (yylsp[-2])); + } +#line 21109 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 244: + case 246: /* SeqOptElem: RESTART */ #line 102 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); + } +#line 21117 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 245: + case 247: /* SeqOptElem: RESTART opt_with NumericOnly */ #line 106 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { - (yyval.defelt) = makeDefElem("restart", (PGNode *)(yyvsp[(3) - (3)].value), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("restart", (PGNode *)(yyvsp[0].value), (yylsp[-2])); + } +#line 21125 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 246: + case 248: /* opt_by: BY */ #line 112 "third_party/libpg_query/grammar/statements/alter_sequence.y" - {;} + {} +#line 21131 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 247: + case 249: /* opt_by: %empty */ #line 113 "third_party/libpg_query/grammar/statements/alter_sequence.y" - {;} + {} +#line 21137 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 248: + case 250: /* SignedIconst: Iconst */ #line 117 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { (yyval.ival) = (yyvsp[(1) - (1)].ival); ;} + { (yyval.ival) = (yyvsp[0].ival); } +#line 21143 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 249: + case 251: /* SignedIconst: '+' Iconst */ #line 118 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { (yyval.ival) = + (yyvsp[(2) - (2)].ival); ;} + { (yyval.ival) = + (yyvsp[0].ival); } +#line 21149 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 250: + case 252: /* SignedIconst: '-' Iconst */ #line 119 "third_party/libpg_query/grammar/statements/alter_sequence.y" - { (yyval.ival) = - (yyvsp[(2) - (2)].ival); ;} + { (yyval.ival) = - (yyvsp[0].ival); } +#line 21155 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 251: + case 253: /* DropSecretStmt: DROP opt_persist SECRET ColId opt_storage_drop_specifier */ #line 8 "third_party/libpg_query/grammar/statements/drop_secret.y" - { + { PGDropSecretStmt *n = makeNode(PGDropSecretStmt); - n->persist_type = (yyvsp[(2) - (5)].str); - n->secret_name = (yyvsp[(4) - (5)].str); - n->secret_storage = (yyvsp[(5) - (5)].str); + n->persist_type = (yyvsp[-3].str); + n->secret_name = (yyvsp[-1].str); + n->secret_storage = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 21168 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 252: + case 254: /* DropSecretStmt: DROP opt_persist SECRET IF_P EXISTS ColId opt_storage_drop_specifier */ #line 17 "third_party/libpg_query/grammar/statements/drop_secret.y" - { + { PGDropSecretStmt *n = makeNode(PGDropSecretStmt); - n->persist_type = (yyvsp[(2) - (7)].str); - n->secret_name = (yyvsp[(6) - (7)].str); - n->secret_storage = (yyvsp[(7) - (7)].str); + n->persist_type = (yyvsp[-5].str); + n->secret_name = (yyvsp[-1].str); + n->secret_storage = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 21181 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 253: + case 255: /* opt_storage_drop_specifier: %empty */ #line 28 "third_party/libpg_query/grammar/statements/drop_secret.y" - { (yyval.str) = pstrdup(""); ;} + { (yyval.str) = pstrdup(""); } +#line 21187 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 254: + case 256: /* opt_storage_drop_specifier: FROM IDENT */ #line 29 "third_party/libpg_query/grammar/statements/drop_secret.y" - { (yyval.str) = (yyvsp[(2) - (2)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 21193 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 255: + case 257: /* TransactionStmt: ABORT_P opt_transaction */ #line 3 "third_party/libpg_query/grammar/statements/transaction.y" - { + { PGTransactionStmt *n = makeNode(PGTransactionStmt); n->kind = PG_TRANS_STMT_ROLLBACK; n->options = NIL; (yyval.node) = (PGNode *)n; - ;} + } +#line 21204 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 256: + case 258: /* TransactionStmt: BEGIN_P opt_transaction */ #line 10 "third_party/libpg_query/grammar/statements/transaction.y" - { + { PGTransactionStmt *n = makeNode(PGTransactionStmt); n->kind = PG_TRANS_STMT_BEGIN; (yyval.node) = (PGNode *)n; - ;} + } +#line 21214 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 257: + case 259: /* TransactionStmt: START opt_transaction */ #line 16 "third_party/libpg_query/grammar/statements/transaction.y" - { + { PGTransactionStmt *n = makeNode(PGTransactionStmt); n->kind = PG_TRANS_STMT_START; (yyval.node) = (PGNode *)n; - ;} + } +#line 21224 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 258: + case 260: /* TransactionStmt: COMMIT opt_transaction */ #line 22 "third_party/libpg_query/grammar/statements/transaction.y" - { + { PGTransactionStmt *n = makeNode(PGTransactionStmt); n->kind = PG_TRANS_STMT_COMMIT; n->options = NIL; (yyval.node) = (PGNode *)n; - ;} + } +#line 21235 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 259: + case 261: /* TransactionStmt: END_P opt_transaction */ #line 29 "third_party/libpg_query/grammar/statements/transaction.y" - { + { PGTransactionStmt *n = makeNode(PGTransactionStmt); n->kind = PG_TRANS_STMT_COMMIT; n->options = NIL; (yyval.node) = (PGNode *)n; - ;} + } +#line 21246 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 260: + case 262: /* TransactionStmt: ROLLBACK opt_transaction */ #line 36 "third_party/libpg_query/grammar/statements/transaction.y" - { + { PGTransactionStmt *n = makeNode(PGTransactionStmt); n->kind = PG_TRANS_STMT_ROLLBACK; n->options = NIL; (yyval.node) = (PGNode *)n; - ;} + } +#line 21257 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 261: + case 263: /* opt_transaction: WORK */ #line 45 "third_party/libpg_query/grammar/statements/transaction.y" - {;} + {} +#line 21263 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 262: + case 264: /* opt_transaction: TRANSACTION */ #line 46 "third_party/libpg_query/grammar/statements/transaction.y" - {;} + {} +#line 21269 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 263: + case 265: /* opt_transaction: %empty */ #line 47 "third_party/libpg_query/grammar/statements/transaction.y" - {;} + {} +#line 21275 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 264: + case 266: /* UseStmt: USE_P qualified_name */ #line 3 "third_party/libpg_query/grammar/statements/use.y" - { + { PGUseStmt *n = makeNode(PGUseStmt); - n->name = (yyvsp[(2) - (2)].range); + n->name = (yyvsp[0].range); (yyval.node) = (PGNode *) n; - ;} + } +#line 21285 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 265: + case 267: /* CreateStmt: CREATE_P OptTemp TABLE qualified_name '(' OptTableElementList ')' OptWith OnCommitOption */ #line 9 "third_party/libpg_query/grammar/statements/create.y" - { + { PGCreateStmt *n = makeNode(PGCreateStmt); - (yyvsp[(4) - (9)].range)->relpersistence = (yyvsp[(2) - (9)].ival); - n->relation = (yyvsp[(4) - (9)].range); - n->tableElts = (yyvsp[(6) - (9)].list); + (yyvsp[-5].range)->relpersistence = (yyvsp[-7].ival); + n->relation = (yyvsp[-5].range); + n->tableElts = (yyvsp[-3].list); n->ofTypename = NULL; n->constraints = NIL; - n->options = (yyvsp[(8) - (9)].list); - n->oncommit = (yyvsp[(9) - (9)].oncommit); + n->options = (yyvsp[-1].list); + n->oncommit = (yyvsp[0].oncommit); n->onconflict = PG_ERROR_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 21302 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 266: + case 268: /* CreateStmt: CREATE_P OptTemp TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptWith OnCommitOption */ #line 24 "third_party/libpg_query/grammar/statements/create.y" - { + { PGCreateStmt *n = makeNode(PGCreateStmt); - (yyvsp[(7) - (12)].range)->relpersistence = (yyvsp[(2) - (12)].ival); - n->relation = (yyvsp[(7) - (12)].range); - n->tableElts = (yyvsp[(9) - (12)].list); + (yyvsp[-5].range)->relpersistence = (yyvsp[-10].ival); + n->relation = (yyvsp[-5].range); + n->tableElts = (yyvsp[-3].list); n->ofTypename = NULL; n->constraints = NIL; - n->options = (yyvsp[(11) - (12)].list); - n->oncommit = (yyvsp[(12) - (12)].oncommit); + n->options = (yyvsp[-1].list); + n->oncommit = (yyvsp[0].oncommit); n->onconflict = PG_IGNORE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 21319 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 267: + case 269: /* CreateStmt: CREATE_P OR REPLACE OptTemp TABLE qualified_name '(' OptTableElementList ')' OptWith OnCommitOption */ #line 39 "third_party/libpg_query/grammar/statements/create.y" - { + { PGCreateStmt *n = makeNode(PGCreateStmt); - (yyvsp[(6) - (11)].range)->relpersistence = (yyvsp[(4) - (11)].ival); - n->relation = (yyvsp[(6) - (11)].range); - n->tableElts = (yyvsp[(8) - (11)].list); + (yyvsp[-5].range)->relpersistence = (yyvsp[-7].ival); + n->relation = (yyvsp[-5].range); + n->tableElts = (yyvsp[-3].list); n->ofTypename = NULL; n->constraints = NIL; - n->options = (yyvsp[(10) - (11)].list); - n->oncommit = (yyvsp[(11) - (11)].oncommit); + n->options = (yyvsp[-1].list); + n->oncommit = (yyvsp[0].oncommit); n->onconflict = PG_REPLACE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 21336 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 268: + case 270: /* ConstraintAttributeSpec: %empty */ #line 56 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = 0; ;} + { (yyval.ival) = 0; } +#line 21342 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 269: + case 271: /* ConstraintAttributeSpec: ConstraintAttributeSpec ConstraintAttributeElem */ #line 58 "third_party/libpg_query/grammar/statements/create.y" - { + { /* * We must complain about conflicting options. * We could, but choose not to, complain about redundant * options (ie, where $2's bit is already set in $1). */ - int newspec = (yyvsp[(1) - (2)].ival) | (yyvsp[(2) - (2)].ival); + int newspec = (yyvsp[-1].ival) | (yyvsp[0].ival); /* special message for this case */ if ((newspec & (CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED)) == (CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED)) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("constraint declared INITIALLY DEFERRED must be DEFERRABLE"), - parser_errposition((yylsp[(2) - (2)])))); + parser_errposition((yylsp[0])))); /* generic message for other conflicts */ if ((newspec & (CAS_NOT_DEFERRABLE | CAS_DEFERRABLE)) == (CAS_NOT_DEFERRABLE | CAS_DEFERRABLE) || (newspec & (CAS_INITIALLY_IMMEDIATE | CAS_INITIALLY_DEFERRED)) == (CAS_INITIALLY_IMMEDIATE | CAS_INITIALLY_DEFERRED)) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("conflicting constraint properties"), - parser_errposition((yylsp[(2) - (2)])))); + parser_errposition((yylsp[0])))); (yyval.ival) = newspec; - ;} + } +#line 21370 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 270: + case 272: /* def_arg: func_type */ #line 84 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (PGNode *)(yyvsp[(1) - (1)].typnam); ;} + { (yyval.node) = (PGNode *)(yyvsp[0].typnam); } +#line 21376 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 271: + case 273: /* def_arg: reserved_keyword */ #line 85 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (PGNode *)makeString(pstrdup((yyvsp[(1) - (1)].keyword))); ;} + { (yyval.node) = (PGNode *)makeString(pstrdup((yyvsp[0].keyword))); } +#line 21382 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 272: + case 274: /* def_arg: qual_all_Op */ #line 86 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (PGNode *)(yyvsp[(1) - (1)].list); ;} + { (yyval.node) = (PGNode *)(yyvsp[0].list); } +#line 21388 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 273: + case 275: /* def_arg: NumericOnly */ #line 87 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (PGNode *)(yyvsp[(1) - (1)].value); ;} + { (yyval.node) = (PGNode *)(yyvsp[0].value); } +#line 21394 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 274: + case 276: /* def_arg: Sconst */ #line 88 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (PGNode *)makeString((yyvsp[(1) - (1)].str)); ;} + { (yyval.node) = (PGNode *)makeString((yyvsp[0].str)); } +#line 21400 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 275: + case 277: /* def_arg: NONE */ #line 89 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (PGNode *)makeString(pstrdup((yyvsp[(1) - (1)].keyword))); ;} + { (yyval.node) = (PGNode *)makeString(pstrdup((yyvsp[0].keyword))); } +#line 21406 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 276: + case 278: /* OptParenthesizedSeqOptList: '(' SeqOptList ')' */ #line 93 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 21412 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 277: + case 279: /* OptParenthesizedSeqOptList: %empty */ #line 94 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 21418 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 278: + case 280: /* generic_option_arg: Sconst */ #line 99 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (PGNode *) makeString((yyvsp[(1) - (1)].str)); ;} + { (yyval.node) = (PGNode *) makeString((yyvsp[0].str)); } +#line 21424 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 279: + case 281: /* key_action: NO ACTION */ #line 104 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_FKCONSTR_ACTION_NOACTION; ;} + { (yyval.ival) = PG_FKCONSTR_ACTION_NOACTION; } +#line 21430 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 280: + case 282: /* key_action: RESTRICT */ #line 105 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_FKCONSTR_ACTION_RESTRICT; ;} + { (yyval.ival) = PG_FKCONSTR_ACTION_RESTRICT; } +#line 21436 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 281: + case 283: /* key_action: CASCADE */ #line 106 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_FKCONSTR_ACTION_CASCADE; ;} + { (yyval.ival) = PG_FKCONSTR_ACTION_CASCADE; } +#line 21442 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 282: + case 284: /* key_action: SET NULL_P */ #line 107 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_FKCONSTR_ACTION_SETNULL; ;} + { (yyval.ival) = PG_FKCONSTR_ACTION_SETNULL; } +#line 21448 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 283: + case 285: /* key_action: SET DEFAULT */ #line 108 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_FKCONSTR_ACTION_SETDEFAULT; ;} + { (yyval.ival) = PG_FKCONSTR_ACTION_SETDEFAULT; } +#line 21454 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 284: + case 286: /* ColConstraint: CONSTRAINT name ColConstraintElem */ #line 114 "third_party/libpg_query/grammar/statements/create.y" - { - PGConstraint *n = castNode(PGConstraint, (yyvsp[(3) - (3)].node)); - n->conname = (yyvsp[(2) - (3)].str); - n->location = (yylsp[(1) - (3)]); + { + PGConstraint *n = castNode(PGConstraint, (yyvsp[0].node)); + n->conname = (yyvsp[-1].str); + n->location = (yylsp[-2]); (yyval.node) = (PGNode *) n; - ;} + } +#line 21465 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 285: + case 287: /* ColConstraint: ColConstraintElem */ #line 120 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 21471 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 286: + case 288: /* ColConstraint: ConstraintAttr */ #line 121 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 21477 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 287: + case 289: /* ColConstraint: COLLATE any_name */ #line 123 "third_party/libpg_query/grammar/statements/create.y" - { + { /* * Note: the PGCollateClause is momentarily included in * the list built by ColQualList, but we split it out @@ -22135,155 +21486,169 @@ YYLTYPE yylloc; */ PGCollateClause *n = makeNode(PGCollateClause); n->arg = NULL; - n->collname = (yyvsp[(2) - (2)].list); - n->location = (yylsp[(1) - (2)]); + n->collname = (yyvsp[0].list); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *) n; - ;} + } +#line 21494 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 288: + case 290: /* ColConstraintElem: NOT NULL_P */ #line 140 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_NOTNULL; - n->location = (yylsp[(1) - (2)]); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *)n; - ;} + } +#line 21505 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 289: + case 291: /* ColConstraintElem: NULL_P */ #line 147 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_NULL; - n->location = (yylsp[(1) - (1)]); + n->location = (yylsp[0]); (yyval.node) = (PGNode *)n; - ;} + } +#line 21516 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 290: + case 292: /* ColConstraintElem: UNIQUE opt_definition */ #line 154 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_UNIQUE; - n->location = (yylsp[(1) - (2)]); + n->location = (yylsp[-1]); n->keys = NULL; - n->options = (yyvsp[(2) - (2)].list); + n->options = (yyvsp[0].list); n->indexname = NULL; (yyval.node) = (PGNode *)n; - ;} + } +#line 21530 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 291: + case 293: /* ColConstraintElem: PRIMARY KEY opt_definition */ #line 164 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_PRIMARY; - n->location = (yylsp[(1) - (3)]); + n->location = (yylsp[-2]); n->keys = NULL; - n->options = (yyvsp[(3) - (3)].list); + n->options = (yyvsp[0].list); n->indexname = NULL; (yyval.node) = (PGNode *)n; - ;} + } +#line 21544 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 292: + case 294: /* ColConstraintElem: CHECK_P '(' a_expr ')' opt_no_inherit */ #line 174 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_CHECK; - n->location = (yylsp[(1) - (5)]); - n->is_no_inherit = (yyvsp[(5) - (5)].boolean); - n->raw_expr = (yyvsp[(3) - (5)].node); + n->location = (yylsp[-4]); + n->is_no_inherit = (yyvsp[0].boolean); + n->raw_expr = (yyvsp[-2].node); n->cooked_expr = NULL; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 21560 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 293: + case 295: /* ColConstraintElem: USING COMPRESSION name */ #line 186 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_COMPRESSION; - n->location = (yylsp[(1) - (3)]); - n->compression_name = (yyvsp[(3) - (3)].str); + n->location = (yylsp[-2]); + n->compression_name = (yyvsp[0].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 21572 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 294: + case 296: /* ColConstraintElem: DEFAULT b_expr */ #line 194 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_DEFAULT; - n->location = (yylsp[(1) - (2)]); - n->raw_expr = (yyvsp[(2) - (2)].node); + n->location = (yylsp[-1]); + n->raw_expr = (yyvsp[0].node); n->cooked_expr = NULL; (yyval.node) = (PGNode *)n; - ;} + } +#line 21585 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 295: + case 297: /* ColConstraintElem: REFERENCES qualified_name opt_column_list key_match key_actions */ #line 203 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_FOREIGN; - n->location = (yylsp[(1) - (5)]); - n->pktable = (yyvsp[(2) - (5)].range); + n->location = (yylsp[-4]); + n->pktable = (yyvsp[-3].range); n->fk_attrs = NIL; - n->pk_attrs = (yyvsp[(3) - (5)].list); - n->fk_matchtype = (yyvsp[(4) - (5)].ival); - n->fk_upd_action = (char) ((yyvsp[(5) - (5)].ival) >> 8); - n->fk_del_action = (char) ((yyvsp[(5) - (5)].ival) & 0xFF); + n->pk_attrs = (yyvsp[-2].list); + n->fk_matchtype = (yyvsp[-1].ival); + n->fk_upd_action = (char) ((yyvsp[0].ival) >> 8); + n->fk_del_action = (char) ((yyvsp[0].ival) & 0xFF); n->skip_validation = false; n->initially_valid = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 21604 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 296: + case 298: /* GeneratedColumnType: VIRTUAL */ #line 220 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.constr) = PG_CONSTR_GENERATED_VIRTUAL; ;} + { (yyval.constr) = PG_CONSTR_GENERATED_VIRTUAL; } +#line 21610 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 297: + case 299: /* GeneratedColumnType: STORED */ #line 221 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.constr) = PG_CONSTR_GENERATED_STORED; ;} + { (yyval.constr) = PG_CONSTR_GENERATED_STORED; } +#line 21616 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 298: + case 300: /* opt_GeneratedColumnType: GeneratedColumnType */ #line 225 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.constr) = (yyvsp[(1) - (1)].constr); ;} + { (yyval.constr) = (yyvsp[0].constr); } +#line 21622 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 299: + case 301: /* opt_GeneratedColumnType: %empty */ #line 226 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.constr) = PG_CONSTR_GENERATED_VIRTUAL; ;} + { (yyval.constr) = PG_CONSTR_GENERATED_VIRTUAL; } +#line 21628 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 300: + case 302: /* GeneratedConstraintElem: GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList */ #line 231 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_IDENTITY; - n->generated_when = (yyvsp[(2) - (5)].ival); - n->options = (yyvsp[(5) - (5)].list); - n->location = (yylsp[(1) - (5)]); + n->generated_when = (yyvsp[-3].ival); + n->options = (yyvsp[0].list); + n->location = (yylsp[-4]); (yyval.node) = (PGNode *)n; - ;} + } +#line 21641 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 301: + case 303: /* GeneratedConstraintElem: GENERATED generated_when AS '(' a_expr ')' opt_GeneratedColumnType */ #line 240 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); - n->contype = (yyvsp[(7) - (7)].constr); - n->generated_when = (yyvsp[(2) - (7)].ival); - n->raw_expr = (yyvsp[(5) - (7)].node); + n->contype = (yyvsp[0].constr); + n->generated_when = (yyvsp[-5].ival); + n->raw_expr = (yyvsp[-2].node); n->cooked_expr = NULL; - n->location = (yylsp[(1) - (7)]); + n->location = (yylsp[-6]); /* * Can't do this in the grammar because of shift/reduce @@ -22291,293 +21656,341 @@ YYLTYPE yylloc; * DEFAULT, but generated columns only allow ALWAYS.) We * can also give a more useful error message and location. */ - if ((yyvsp[(2) - (7)].ival) != PG_ATTRIBUTE_IDENTITY_ALWAYS) + if ((yyvsp[-5].ival) != PG_ATTRIBUTE_IDENTITY_ALWAYS) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("for a generated column, GENERATED ALWAYS must be specified"), - parser_errposition((yylsp[(2) - (7)])))); + parser_errposition((yylsp[-5])))); (yyval.node) = (PGNode *)n; - ;} + } +#line 21668 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 302: + case 304: /* GeneratedConstraintElem: AS '(' a_expr ')' opt_GeneratedColumnType */ #line 263 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); - n->contype = (yyvsp[(5) - (5)].constr); + n->contype = (yyvsp[0].constr); n->generated_when = PG_ATTRIBUTE_IDENTITY_ALWAYS; - n->raw_expr = (yyvsp[(3) - (5)].node); + n->raw_expr = (yyvsp[-2].node); n->cooked_expr = NULL; - n->location = (yylsp[(1) - (5)]); + n->location = (yylsp[-4]); (yyval.node) = (PGNode *)n; - ;} + } +#line 21682 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 303: + case 305: /* generic_option_elem: generic_option_name generic_option_arg */ #line 277 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.defelt) = makeDefElem((yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); + } +#line 21690 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 304: + case 306: /* key_update: ON UPDATE key_action */ #line 283 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = (yyvsp[(3) - (3)].ival); ;} + { (yyval.ival) = (yyvsp[0].ival); } +#line 21696 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 305: + case 307: /* key_actions: key_update */ #line 289 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = ((yyvsp[(1) - (1)].ival) << 8) | (PG_FKCONSTR_ACTION_NOACTION & 0xFF); ;} + { (yyval.ival) = ((yyvsp[0].ival) << 8) | (PG_FKCONSTR_ACTION_NOACTION & 0xFF); } +#line 21702 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 306: + case 308: /* key_actions: key_delete */ #line 291 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = (PG_FKCONSTR_ACTION_NOACTION << 8) | ((yyvsp[(1) - (1)].ival) & 0xFF); ;} + { (yyval.ival) = (PG_FKCONSTR_ACTION_NOACTION << 8) | ((yyvsp[0].ival) & 0xFF); } +#line 21708 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 307: + case 309: /* key_actions: key_update key_delete */ #line 293 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = ((yyvsp[(1) - (2)].ival) << 8) | ((yyvsp[(2) - (2)].ival) & 0xFF); ;} + { (yyval.ival) = ((yyvsp[-1].ival) << 8) | ((yyvsp[0].ival) & 0xFF); } +#line 21714 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 308: + case 310: /* key_actions: key_delete key_update */ #line 295 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = ((yyvsp[(2) - (2)].ival) << 8) | ((yyvsp[(1) - (2)].ival) & 0xFF); ;} + { (yyval.ival) = ((yyvsp[0].ival) << 8) | ((yyvsp[-1].ival) & 0xFF); } +#line 21720 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 309: + case 311: /* key_actions: %empty */ #line 297 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = (PG_FKCONSTR_ACTION_NOACTION << 8) | (PG_FKCONSTR_ACTION_NOACTION & 0xFF); ;} + { (yyval.ival) = (PG_FKCONSTR_ACTION_NOACTION << 8) | (PG_FKCONSTR_ACTION_NOACTION & 0xFF); } +#line 21726 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 310: + case 312: /* OnCommitOption: ON COMMIT DROP */ #line 300 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.oncommit) = ONCOMMIT_DROP; ;} + { (yyval.oncommit) = ONCOMMIT_DROP; } +#line 21732 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 311: + case 313: /* OnCommitOption: ON COMMIT DELETE_P ROWS */ #line 301 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.oncommit) = PG_ONCOMMIT_DELETE_ROWS; ;} + { (yyval.oncommit) = PG_ONCOMMIT_DELETE_ROWS; } +#line 21738 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 312: + case 314: /* OnCommitOption: ON COMMIT PRESERVE ROWS */ #line 302 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.oncommit) = PG_ONCOMMIT_PRESERVE_ROWS; ;} + { (yyval.oncommit) = PG_ONCOMMIT_PRESERVE_ROWS; } +#line 21744 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 313: + case 315: /* OnCommitOption: %empty */ #line 303 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.oncommit) = PG_ONCOMMIT_NOOP; ;} + { (yyval.oncommit) = PG_ONCOMMIT_NOOP; } +#line 21750 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 314: + case 316: /* reloptions: '(' reloption_list ')' */ #line 308 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 21756 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 315: + case 317: /* opt_no_inherit: NO INHERIT */ #line 312 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 21762 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 316: + case 318: /* opt_no_inherit: %empty */ #line 313 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 21768 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 317: + case 319: /* TableConstraint: CONSTRAINT name ConstraintElem */ #line 319 "third_party/libpg_query/grammar/statements/create.y" - { - PGConstraint *n = castNode(PGConstraint, (yyvsp[(3) - (3)].node)); - n->conname = (yyvsp[(2) - (3)].str); - n->location = (yylsp[(1) - (3)]); + { + PGConstraint *n = castNode(PGConstraint, (yyvsp[0].node)); + n->conname = (yyvsp[-1].str); + n->location = (yylsp[-2]); (yyval.node) = (PGNode *) n; - ;} + } +#line 21779 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 318: + case 320: /* TableConstraint: ConstraintElem */ #line 325 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 21785 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 319: + case 321: /* TableLikeOption: COMMENTS */ #line 330 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_CREATE_TABLE_LIKE_COMMENTS; ;} + { (yyval.ival) = PG_CREATE_TABLE_LIKE_COMMENTS; } +#line 21791 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 320: + case 322: /* TableLikeOption: CONSTRAINTS */ #line 331 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_CREATE_TABLE_LIKE_CONSTRAINTS; ;} + { (yyval.ival) = PG_CREATE_TABLE_LIKE_CONSTRAINTS; } +#line 21797 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 321: + case 323: /* TableLikeOption: DEFAULTS */ #line 332 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_CREATE_TABLE_LIKE_DEFAULTS; ;} + { (yyval.ival) = PG_CREATE_TABLE_LIKE_DEFAULTS; } +#line 21803 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 322: + case 324: /* TableLikeOption: IDENTITY_P */ #line 333 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_CREATE_TABLE_LIKE_IDENTITY; ;} + { (yyval.ival) = PG_CREATE_TABLE_LIKE_IDENTITY; } +#line 21809 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 323: + case 325: /* TableLikeOption: INDEXES */ #line 334 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_CREATE_TABLE_LIKE_INDEXES; ;} + { (yyval.ival) = PG_CREATE_TABLE_LIKE_INDEXES; } +#line 21815 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 324: + case 326: /* TableLikeOption: STATISTICS */ #line 335 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_CREATE_TABLE_LIKE_STATISTICS; ;} + { (yyval.ival) = PG_CREATE_TABLE_LIKE_STATISTICS; } +#line 21821 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 325: + case 327: /* TableLikeOption: STORAGE */ #line 336 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_CREATE_TABLE_LIKE_STORAGE; ;} + { (yyval.ival) = PG_CREATE_TABLE_LIKE_STORAGE; } +#line 21827 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 326: + case 328: /* TableLikeOption: ALL */ #line 337 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_CREATE_TABLE_LIKE_ALL; ;} + { (yyval.ival) = PG_CREATE_TABLE_LIKE_ALL; } +#line 21833 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 327: + case 329: /* reloption_list: reloption_elem */ #line 343 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].defelt)); ;} + { (yyval.list) = list_make1((yyvsp[0].defelt)); } +#line 21839 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 328: + case 330: /* reloption_list: reloption_list ',' reloption_elem */ #line 344 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].defelt)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } +#line 21845 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 329: + case 331: /* ExistingIndex: USING INDEX index_name */ #line 348 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.str) = (yyvsp[(3) - (3)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 21851 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 330: + case 332: /* ConstraintAttr: DEFERRABLE */ #line 354 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_ATTR_DEFERRABLE; - n->location = (yylsp[(1) - (1)]); + n->location = (yylsp[0]); (yyval.node) = (PGNode *)n; - ;} + } +#line 21862 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 331: + case 333: /* ConstraintAttr: NOT DEFERRABLE */ #line 361 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_ATTR_NOT_DEFERRABLE; - n->location = (yylsp[(1) - (2)]); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *)n; - ;} + } +#line 21873 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 332: + case 334: /* ConstraintAttr: INITIALLY DEFERRED */ #line 368 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_ATTR_DEFERRED; - n->location = (yylsp[(1) - (2)]); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *)n; - ;} + } +#line 21884 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 333: + case 335: /* ConstraintAttr: INITIALLY IMMEDIATE */ #line 375 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_ATTR_IMMEDIATE; - n->location = (yylsp[(1) - (2)]); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *)n; - ;} + } +#line 21895 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 334: + case 336: /* OptWith: WITH reloptions */ #line 386 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = (yyvsp[(2) - (2)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 21901 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 335: + case 337: /* OptWith: WITH OIDS */ #line 387 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = list_make1(makeDefElem("oids", (PGNode *) makeInteger(true), (yylsp[(1) - (2)]))); ;} + { (yyval.list) = list_make1(makeDefElem("oids", (PGNode *) makeInteger(true), (yylsp[-1]))); } +#line 21907 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 336: + case 338: /* OptWith: WITHOUT OIDS */ #line 388 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = list_make1(makeDefElem("oids", (PGNode *) makeInteger(false), (yylsp[(1) - (2)]))); ;} + { (yyval.list) = list_make1(makeDefElem("oids", (PGNode *) makeInteger(false), (yylsp[-1]))); } +#line 21913 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 337: + case 339: /* OptWith: %empty */ #line 389 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 21919 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 338: + case 340: /* definition: '(' def_list ')' */ #line 393 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 21925 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 339: + case 341: /* TableLikeOptionList: TableLikeOptionList INCLUDING TableLikeOption */ #line 398 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) | (yyvsp[(3) - (3)].ival); ;} + { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } +#line 21931 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 340: + case 342: /* TableLikeOptionList: TableLikeOptionList EXCLUDING TableLikeOption */ #line 399 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) & ~(yyvsp[(3) - (3)].ival); ;} + { (yyval.ival) = (yyvsp[-2].ival) & ~(yyvsp[0].ival); } +#line 21937 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 341: + case 343: /* TableLikeOptionList: %empty */ #line 400 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = 0; ;} + { (yyval.ival) = 0; } +#line 21943 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 342: + case 344: /* generic_option_name: ColLabel */ #line 405 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 21949 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 343: + case 345: /* ConstraintAttributeElem: NOT DEFERRABLE */ #line 410 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = CAS_NOT_DEFERRABLE; ;} + { (yyval.ival) = CAS_NOT_DEFERRABLE; } +#line 21955 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 344: + case 346: /* ConstraintAttributeElem: DEFERRABLE */ #line 411 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = CAS_DEFERRABLE; ;} + { (yyval.ival) = CAS_DEFERRABLE; } +#line 21961 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 345: + case 347: /* ConstraintAttributeElem: INITIALLY IMMEDIATE */ #line 412 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = CAS_INITIALLY_IMMEDIATE; ;} + { (yyval.ival) = CAS_INITIALLY_IMMEDIATE; } +#line 21967 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 346: + case 348: /* ConstraintAttributeElem: INITIALLY DEFERRED */ #line 413 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = CAS_INITIALLY_DEFERRED; ;} + { (yyval.ival) = CAS_INITIALLY_DEFERRED; } +#line 21973 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 347: + case 349: /* ConstraintAttributeElem: NOT VALID */ #line 414 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = CAS_NOT_VALID; ;} + { (yyval.ival) = CAS_NOT_VALID; } +#line 21979 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 348: + case 350: /* ConstraintAttributeElem: NO INHERIT */ #line 415 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = CAS_NO_INHERIT; ;} + { (yyval.ival) = CAS_NO_INHERIT; } +#line 21985 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 349: + case 351: /* columnDef: ColId Typename ColQualList */ #line 421 "third_party/libpg_query/grammar/statements/create.y" - { + { PGColumnDef *n = makeNode(PGColumnDef); n->category = COL_STANDARD; - n->colname = (yyvsp[(1) - (3)].str); - n->typeName = (yyvsp[(2) - (3)].typnam); + n->colname = (yyvsp[-2].str); + n->typeName = (yyvsp[-1].typnam); n->inhcount = 0; n->is_local = true; n->is_not_null = false; @@ -22586,20 +21999,21 @@ YYLTYPE yylloc; n->raw_default = NULL; n->cooked_default = NULL; n->collOid = InvalidOid; - SplitColQualList((yyvsp[(3) - (3)].list), &n->constraints, &n->collClause, + SplitColQualList((yyvsp[0].list), &n->constraints, &n->collClause, yyscanner); - n->location = (yylsp[(1) - (3)]); + n->location = (yylsp[-2]); (yyval.node) = (PGNode *)n; - ;} + } +#line 22008 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 350: + case 352: /* columnDef: ColId opt_Typename GeneratedConstraintElem ColQualList */ #line 441 "third_party/libpg_query/grammar/statements/create.y" - { + { PGColumnDef *n = makeNode(PGColumnDef); n->category = COL_GENERATED; - n->colname = (yyvsp[(1) - (4)].str); - n->typeName = (yyvsp[(2) - (4)].typnam); + n->colname = (yyvsp[-3].str); + n->typeName = (yyvsp[-2].typnam); n->inhcount = 0; n->is_local = true; n->is_not_null = false; @@ -22609,1352 +22023,1531 @@ YYLTYPE yylloc; n->cooked_default = NULL; n->collOid = InvalidOid; // merge the constraints with the generated column constraint - auto constraints = (yyvsp[(4) - (4)].list); + auto constraints = (yyvsp[0].list); if (constraints) { - constraints = lappend(constraints, (yyvsp[(3) - (4)].node)); + constraints = lappend(constraints, (yyvsp[-1].node)); } else { - constraints = list_make1((yyvsp[(3) - (4)].node)); + constraints = list_make1((yyvsp[-1].node)); } SplitColQualList(constraints, &n->constraints, &n->collClause, yyscanner); - n->location = (yylsp[(1) - (4)]); + n->location = (yylsp[-3]); (yyval.node) = (PGNode *)n; - ;} + } +#line 22038 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 351: + case 353: /* def_list: def_elem */ #line 469 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].defelt)); ;} + { (yyval.list) = list_make1((yyvsp[0].defelt)); } +#line 22044 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 352: + case 354: /* def_list: def_list ',' def_elem */ #line 470 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].defelt)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } +#line 22050 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 353: + case 355: /* index_name: ColId */ #line 474 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 22056 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 354: + case 356: /* TableElement: columnDef */ #line 478 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 22062 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 355: + case 357: /* TableElement: TableLikeClause */ #line 479 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 22068 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 356: + case 358: /* TableElement: TableConstraint */ #line 480 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 22074 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 357: + case 359: /* def_elem: ColLabel '=' def_arg */ #line 485 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.defelt) = makeDefElem((yyvsp[(1) - (3)].str), (PGNode *) (yyvsp[(3) - (3)].node), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem((yyvsp[-2].str), (PGNode *) (yyvsp[0].node), (yylsp[-2])); + } +#line 22082 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 358: + case 360: /* def_elem: ColLabel */ #line 489 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.defelt) = makeDefElem((yyvsp[(1) - (1)].str), NULL, (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); + } +#line 22090 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 359: + case 361: /* opt_definition: WITH definition */ #line 496 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = (yyvsp[(2) - (2)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 22096 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 360: + case 362: /* opt_definition: %empty */ #line 497 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 22102 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 361: + case 363: /* OptTableElementList: TableElementList */ #line 502 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 22108 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 362: + case 364: /* OptTableElementList: TableElementList ',' */ #line 503 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 22114 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 363: + case 365: /* OptTableElementList: %empty */ #line 504 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 22120 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 364: + case 366: /* columnElem: ColId */ #line 509 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.node) = (PGNode *) makeString((yyvsp[(1) - (1)].str)); - ;} + { + (yyval.node) = (PGNode *) makeString((yyvsp[0].str)); + } +#line 22128 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 365: + case 367: /* opt_column_list: '(' columnList ')' */ #line 516 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 22134 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 366: + case 368: /* opt_column_list: %empty */ #line 517 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 22140 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 367: + case 369: /* ColQualList: ColQualList ColConstraint */ #line 522 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} + { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } +#line 22146 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 368: + case 370: /* ColQualList: %empty */ #line 523 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 22152 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 369: + case 371: /* key_delete: ON DELETE_P key_action */ #line 527 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = (yyvsp[(3) - (3)].ival); ;} + { (yyval.ival) = (yyvsp[0].ival); } +#line 22158 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 370: + case 372: /* reloption_elem: ColLabel '=' def_arg */ #line 533 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.defelt) = makeDefElem((yyvsp[(1) - (3)].str), (PGNode *) (yyvsp[(3) - (3)].node), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem((yyvsp[-2].str), (PGNode *) (yyvsp[0].node), (yylsp[-2])); + } +#line 22166 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 371: + case 373: /* reloption_elem: ColLabel */ #line 537 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.defelt) = makeDefElem((yyvsp[(1) - (1)].str), NULL, (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); + } +#line 22174 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 372: + case 374: /* reloption_elem: ColLabel '.' ColLabel '=' def_arg */ #line 541 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.defelt) = makeDefElemExtended((yyvsp[(1) - (5)].str), (yyvsp[(3) - (5)].str), (PGNode *) (yyvsp[(5) - (5)].node), - PG_DEFELEM_UNSPEC, (yylsp[(1) - (5)])); - ;} + { + (yyval.defelt) = makeDefElemExtended((yyvsp[-4].str), (yyvsp[-2].str), (PGNode *) (yyvsp[0].node), + PG_DEFELEM_UNSPEC, (yylsp[-4])); + } +#line 22183 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 373: + case 375: /* reloption_elem: ColLabel '.' ColLabel */ #line 546 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.defelt) = makeDefElemExtended((yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str), NULL, PG_DEFELEM_UNSPEC, (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElemExtended((yyvsp[-2].str), (yyvsp[0].str), NULL, PG_DEFELEM_UNSPEC, (yylsp[-2])); + } +#line 22191 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 374: + case 376: /* columnList: columnElem */ #line 553 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 22197 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 375: + case 377: /* columnList: columnList ',' columnElem */ #line 554 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } +#line 22203 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 376: + case 378: /* columnList_opt_comma: columnList */ #line 558 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 22209 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 377: + case 379: /* columnList_opt_comma: columnList ',' */ #line 559 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 22215 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 378: + case 380: /* func_type: Typename */ #line 563 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 22221 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 379: + case 381: /* func_type: type_function_name attrs '%' TYPE_P */ #line 565 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[(1) - (4)].str)), (yyvsp[(2) - (4)].list))); + { + (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[-3].str)), (yyvsp[-2].list))); (yyval.typnam)->pct_type = true; - (yyval.typnam)->location = (yylsp[(1) - (4)]); - ;} + (yyval.typnam)->location = (yylsp[-3]); + } +#line 22231 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 380: + case 382: /* func_type: SETOF type_function_name attrs '%' TYPE_P */ #line 571 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[(2) - (5)].str)), (yyvsp[(3) - (5)].list))); + { + (yyval.typnam) = makeTypeNameFromNameList(lcons(makeString((yyvsp[-3].str)), (yyvsp[-2].list))); (yyval.typnam)->pct_type = true; (yyval.typnam)->setof = true; - (yyval.typnam)->location = (yylsp[(2) - (5)]); - ;} + (yyval.typnam)->location = (yylsp[-3]); + } +#line 22242 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 381: + case 383: /* ConstraintElem: CHECK_P '(' a_expr ')' ConstraintAttributeSpec */ #line 582 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_CHECK; - n->location = (yylsp[(1) - (5)]); - n->raw_expr = (yyvsp[(3) - (5)].node); + n->location = (yylsp[-4]); + n->raw_expr = (yyvsp[-2].node); n->cooked_expr = NULL; - processCASbits((yyvsp[(5) - (5)].ival), (yylsp[(5) - (5)]), "CHECK", + processCASbits((yyvsp[0].ival), (yylsp[0]), "CHECK", NULL, NULL, &n->skip_validation, &n->is_no_inherit, yyscanner); n->initially_valid = !n->skip_validation; (yyval.node) = (PGNode *)n; - ;} + } +#line 22259 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 382: + case 384: /* ConstraintElem: UNIQUE '(' columnList_opt_comma ')' opt_definition ConstraintAttributeSpec */ #line 596 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_UNIQUE; - n->location = (yylsp[(1) - (6)]); - n->keys = (yyvsp[(3) - (6)].list); - n->options = (yyvsp[(5) - (6)].list); + n->location = (yylsp[-5]); + n->keys = (yyvsp[-3].list); + n->options = (yyvsp[-1].list); n->indexname = NULL; - processCASbits((yyvsp[(6) - (6)].ival), (yylsp[(6) - (6)]), "UNIQUE", + processCASbits((yyvsp[0].ival), (yylsp[0]), "UNIQUE", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (PGNode *)n; - ;} + } +#line 22276 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 383: + case 385: /* ConstraintElem: UNIQUE ExistingIndex ConstraintAttributeSpec */ #line 609 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_UNIQUE; - n->location = (yylsp[(1) - (3)]); + n->location = (yylsp[-2]); n->keys = NIL; n->options = NIL; - n->indexname = (yyvsp[(2) - (3)].str); + n->indexname = (yyvsp[-1].str); n->indexspace = NULL; - processCASbits((yyvsp[(3) - (3)].ival), (yylsp[(3) - (3)]), "UNIQUE", + processCASbits((yyvsp[0].ival), (yylsp[0]), "UNIQUE", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (PGNode *)n; - ;} + } +#line 22294 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 384: + case 386: /* ConstraintElem: PRIMARY KEY '(' columnList_opt_comma ')' opt_definition ConstraintAttributeSpec */ #line 624 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_PRIMARY; - n->location = (yylsp[(1) - (7)]); - n->keys = (yyvsp[(4) - (7)].list); - n->options = (yyvsp[(6) - (7)].list); + n->location = (yylsp[-6]); + n->keys = (yyvsp[-3].list); + n->options = (yyvsp[-1].list); n->indexname = NULL; - processCASbits((yyvsp[(7) - (7)].ival), (yylsp[(7) - (7)]), "PRIMARY KEY", + processCASbits((yyvsp[0].ival), (yylsp[0]), "PRIMARY KEY", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (PGNode *)n; - ;} + } +#line 22311 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 385: + case 387: /* ConstraintElem: PRIMARY KEY ExistingIndex ConstraintAttributeSpec */ #line 637 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_PRIMARY; - n->location = (yylsp[(1) - (4)]); + n->location = (yylsp[-3]); n->keys = NIL; n->options = NIL; - n->indexname = (yyvsp[(3) - (4)].str); + n->indexname = (yyvsp[-1].str); n->indexspace = NULL; - processCASbits((yyvsp[(4) - (4)].ival), (yylsp[(4) - (4)]), "PRIMARY KEY", + processCASbits((yyvsp[0].ival), (yylsp[0]), "PRIMARY KEY", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); (yyval.node) = (PGNode *)n; - ;} + } +#line 22329 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 386: + case 388: /* ConstraintElem: FOREIGN KEY '(' columnList_opt_comma ')' REFERENCES qualified_name opt_column_list key_match key_actions ConstraintAttributeSpec */ #line 652 "third_party/libpg_query/grammar/statements/create.y" - { + { PGConstraint *n = makeNode(PGConstraint); n->contype = PG_CONSTR_FOREIGN; - n->location = (yylsp[(1) - (11)]); - n->pktable = (yyvsp[(7) - (11)].range); - n->fk_attrs = (yyvsp[(4) - (11)].list); - n->pk_attrs = (yyvsp[(8) - (11)].list); - n->fk_matchtype = (yyvsp[(9) - (11)].ival); - n->fk_upd_action = (char) ((yyvsp[(10) - (11)].ival) >> 8); - n->fk_del_action = (char) ((yyvsp[(10) - (11)].ival) & 0xFF); - processCASbits((yyvsp[(11) - (11)].ival), (yylsp[(11) - (11)]), "FOREIGN KEY", + n->location = (yylsp[-10]); + n->pktable = (yyvsp[-4].range); + n->fk_attrs = (yyvsp[-7].list); + n->pk_attrs = (yyvsp[-3].list); + n->fk_matchtype = (yyvsp[-2].ival); + n->fk_upd_action = (char) ((yyvsp[-1].ival) >> 8); + n->fk_del_action = (char) ((yyvsp[-1].ival) & 0xFF); + processCASbits((yyvsp[0].ival), (yylsp[0]), "FOREIGN KEY", &n->deferrable, &n->initdeferred, &n->skip_validation, NULL, yyscanner); n->initially_valid = !n->skip_validation; (yyval.node) = (PGNode *)n; - ;} + } +#line 22351 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 387: + case 389: /* TableElementList: TableElement */ #line 674 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); - ;} + { + (yyval.list) = list_make1((yyvsp[0].node)); + } +#line 22359 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 388: + case 390: /* TableElementList: TableElementList ',' TableElement */ #line 678 "third_party/libpg_query/grammar/statements/create.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); - ;} + { + (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); + } +#line 22367 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 389: + case 391: /* key_match: MATCH FULL */ #line 685 "third_party/libpg_query/grammar/statements/create.y" - { + { (yyval.ival) = PG_FKCONSTR_MATCH_FULL; - ;} + } +#line 22375 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 390: + case 392: /* key_match: MATCH PARTIAL */ #line 689 "third_party/libpg_query/grammar/statements/create.y" - { + { ereport(ERROR, (errcode(PG_ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("MATCH PARTIAL not yet implemented"), - parser_errposition((yylsp[(1) - (2)])))); + parser_errposition((yylsp[-1])))); (yyval.ival) = PG_FKCONSTR_MATCH_PARTIAL; - ;} + } +#line 22387 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 391: + case 393: /* key_match: MATCH SIMPLE */ #line 697 "third_party/libpg_query/grammar/statements/create.y" - { + { (yyval.ival) = PG_FKCONSTR_MATCH_SIMPLE; - ;} + } +#line 22395 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 392: + case 394: /* key_match: %empty */ #line 701 "third_party/libpg_query/grammar/statements/create.y" - { + { (yyval.ival) = PG_FKCONSTR_MATCH_SIMPLE; - ;} + } +#line 22403 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 393: + case 395: /* TableLikeClause: LIKE qualified_name TableLikeOptionList */ #line 709 "third_party/libpg_query/grammar/statements/create.y" - { + { PGTableLikeClause *n = makeNode(PGTableLikeClause); - n->relation = (yyvsp[(2) - (3)].range); - n->options = (yyvsp[(3) - (3)].ival); + n->relation = (yyvsp[-1].range); + n->options = (yyvsp[0].ival); (yyval.node) = (PGNode *)n; - ;} + } +#line 22414 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 394: + case 396: /* OptTemp: TEMPORARY */ #line 718 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_RELPERSISTENCE_TEMP; ;} + { (yyval.ival) = PG_RELPERSISTENCE_TEMP; } +#line 22420 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 395: + case 397: /* OptTemp: TEMP */ #line 719 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_RELPERSISTENCE_TEMP; ;} + { (yyval.ival) = PG_RELPERSISTENCE_TEMP; } +#line 22426 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 396: + case 398: /* OptTemp: LOCAL TEMPORARY */ #line 720 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_RELPERSISTENCE_TEMP; ;} + { (yyval.ival) = PG_RELPERSISTENCE_TEMP; } +#line 22432 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 397: + case 399: /* OptTemp: LOCAL TEMP */ #line 721 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_RELPERSISTENCE_TEMP; ;} + { (yyval.ival) = PG_RELPERSISTENCE_TEMP; } +#line 22438 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 398: + case 400: /* OptTemp: GLOBAL TEMPORARY */ #line 723 "third_party/libpg_query/grammar/statements/create.y" - { + { ereport(PGWARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition((yylsp[(1) - (2)])))); + parser_errposition((yylsp[-1])))); (yyval.ival) = PG_RELPERSISTENCE_TEMP; - ;} + } +#line 22449 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 399: + case 401: /* OptTemp: GLOBAL TEMP */ #line 730 "third_party/libpg_query/grammar/statements/create.y" - { + { ereport(PGWARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition((yylsp[(1) - (2)])))); + parser_errposition((yylsp[-1])))); (yyval.ival) = PG_RELPERSISTENCE_TEMP; - ;} + } +#line 22460 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 400: + case 402: /* OptTemp: UNLOGGED */ #line 736 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_RELPERSISTENCE_UNLOGGED; ;} + { (yyval.ival) = PG_RELPERSISTENCE_UNLOGGED; } +#line 22466 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 401: + case 403: /* OptTemp: %empty */ #line 737 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = RELPERSISTENCE_PERMANENT; ;} + { (yyval.ival) = RELPERSISTENCE_PERMANENT; } +#line 22472 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 402: + case 404: /* generated_when: ALWAYS */ #line 742 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = PG_ATTRIBUTE_IDENTITY_ALWAYS; ;} + { (yyval.ival) = PG_ATTRIBUTE_IDENTITY_ALWAYS; } +#line 22478 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 403: + case 405: /* generated_when: BY DEFAULT */ #line 743 "third_party/libpg_query/grammar/statements/create.y" - { (yyval.ival) = ATTRIBUTE_IDENTITY_BY_DEFAULT; ;} + { (yyval.ival) = ATTRIBUTE_IDENTITY_BY_DEFAULT; } +#line 22484 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 404: + case 406: /* DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior */ #line 10 "third_party/libpg_query/grammar/statements/drop.y" - { + { PGDropStmt *n = makeNode(PGDropStmt); - n->removeType = (yyvsp[(2) - (6)].objtype); + n->removeType = (yyvsp[-4].objtype); n->missing_ok = true; - n->objects = (yyvsp[(5) - (6)].list); - n->behavior = (yyvsp[(6) - (6)].dbehavior); + n->objects = (yyvsp[-1].list); + n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 22498 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 405: + case 407: /* DropStmt: DROP drop_type_any_name any_name_list opt_drop_behavior */ #line 20 "third_party/libpg_query/grammar/statements/drop.y" - { + { PGDropStmt *n = makeNode(PGDropStmt); - n->removeType = (yyvsp[(2) - (4)].objtype); + n->removeType = (yyvsp[-2].objtype); n->missing_ok = false; - n->objects = (yyvsp[(3) - (4)].list); - n->behavior = (yyvsp[(4) - (4)].dbehavior); + n->objects = (yyvsp[-1].list); + n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 22512 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 406: + case 408: /* DropStmt: DROP drop_type_name IF_P EXISTS name_list opt_drop_behavior */ #line 30 "third_party/libpg_query/grammar/statements/drop.y" - { + { PGDropStmt *n = makeNode(PGDropStmt); - n->removeType = (yyvsp[(2) - (6)].objtype); + n->removeType = (yyvsp[-4].objtype); n->missing_ok = true; - n->objects = (yyvsp[(5) - (6)].list); - n->behavior = (yyvsp[(6) - (6)].dbehavior); + n->objects = (yyvsp[-1].list); + n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 22526 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 407: + case 409: /* DropStmt: DROP drop_type_name name_list opt_drop_behavior */ #line 40 "third_party/libpg_query/grammar/statements/drop.y" - { + { PGDropStmt *n = makeNode(PGDropStmt); - n->removeType = (yyvsp[(2) - (4)].objtype); + n->removeType = (yyvsp[-2].objtype); n->missing_ok = false; - n->objects = (yyvsp[(3) - (4)].list); - n->behavior = (yyvsp[(4) - (4)].dbehavior); + n->objects = (yyvsp[-1].list); + n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 22540 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 408: + case 410: /* DropStmt: DROP drop_type_name_on_any_name name ON any_name opt_drop_behavior */ #line 50 "third_party/libpg_query/grammar/statements/drop.y" - { + { PGDropStmt *n = makeNode(PGDropStmt); - n->removeType = (yyvsp[(2) - (6)].objtype); - n->objects = list_make1(lappend((yyvsp[(5) - (6)].list), makeString((yyvsp[(3) - (6)].str)))); - n->behavior = (yyvsp[(6) - (6)].dbehavior); + n->removeType = (yyvsp[-4].objtype); + n->objects = list_make1(lappend((yyvsp[-1].list), makeString((yyvsp[-3].str)))); + n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (PGNode *) n; - ;} + } +#line 22554 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 409: + case 411: /* DropStmt: DROP drop_type_name_on_any_name IF_P EXISTS name ON any_name opt_drop_behavior */ #line 60 "third_party/libpg_query/grammar/statements/drop.y" - { + { PGDropStmt *n = makeNode(PGDropStmt); - n->removeType = (yyvsp[(2) - (8)].objtype); - n->objects = list_make1(lappend((yyvsp[(7) - (8)].list), makeString((yyvsp[(5) - (8)].str)))); - n->behavior = (yyvsp[(8) - (8)].dbehavior); + n->removeType = (yyvsp[-6].objtype); + n->objects = list_make1(lappend((yyvsp[-1].list), makeString((yyvsp[-3].str)))); + n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (PGNode *) n; - ;} + } +#line 22568 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 410: + case 412: /* drop_type_any_name: TABLE */ #line 73 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_TABLE; ;} + { (yyval.objtype) = PG_OBJECT_TABLE; } +#line 22574 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 411: + case 413: /* drop_type_any_name: SEQUENCE */ #line 74 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_SEQUENCE; ;} + { (yyval.objtype) = PG_OBJECT_SEQUENCE; } +#line 22580 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 412: + case 414: /* drop_type_any_name: FUNCTION */ #line 75 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_FUNCTION; ;} + { (yyval.objtype) = PG_OBJECT_FUNCTION; } +#line 22586 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 413: + case 415: /* drop_type_any_name: MACRO */ #line 76 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_FUNCTION; ;} + { (yyval.objtype) = PG_OBJECT_FUNCTION; } +#line 22592 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 414: + case 416: /* drop_type_any_name: MACRO TABLE */ #line 77 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_TABLE_MACRO; ;} + { (yyval.objtype) = PG_OBJECT_TABLE_MACRO; } +#line 22598 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 415: + case 417: /* drop_type_any_name: VIEW */ #line 78 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_VIEW; ;} + { (yyval.objtype) = PG_OBJECT_VIEW; } +#line 22604 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 416: + case 418: /* drop_type_any_name: MATERIALIZED VIEW */ #line 79 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_MATVIEW; ;} + { (yyval.objtype) = PG_OBJECT_MATVIEW; } +#line 22610 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 417: + case 419: /* drop_type_any_name: INDEX */ #line 80 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_INDEX; ;} + { (yyval.objtype) = PG_OBJECT_INDEX; } +#line 22616 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 418: + case 420: /* drop_type_any_name: FOREIGN TABLE */ #line 81 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_FOREIGN_TABLE; ;} + { (yyval.objtype) = PG_OBJECT_FOREIGN_TABLE; } +#line 22622 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 419: + case 421: /* drop_type_any_name: COLLATION */ #line 82 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_COLLATION; ;} + { (yyval.objtype) = PG_OBJECT_COLLATION; } +#line 22628 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 420: + case 422: /* drop_type_any_name: CONVERSION_P */ #line 83 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_CONVERSION; ;} + { (yyval.objtype) = PG_OBJECT_CONVERSION; } +#line 22634 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 421: + case 423: /* drop_type_any_name: SCHEMA */ #line 84 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_SCHEMA; ;} + { (yyval.objtype) = PG_OBJECT_SCHEMA; } +#line 22640 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 422: + case 424: /* drop_type_any_name: STATISTICS */ #line 85 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_STATISTIC_EXT; ;} + { (yyval.objtype) = PG_OBJECT_STATISTIC_EXT; } +#line 22646 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 423: + case 425: /* drop_type_any_name: TEXT_P SEARCH PARSER */ #line 86 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_TSPARSER; ;} + { (yyval.objtype) = PG_OBJECT_TSPARSER; } +#line 22652 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 424: + case 426: /* drop_type_any_name: TEXT_P SEARCH DICTIONARY */ #line 87 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_TSDICTIONARY; ;} + { (yyval.objtype) = PG_OBJECT_TSDICTIONARY; } +#line 22658 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 425: + case 427: /* drop_type_any_name: TEXT_P SEARCH TEMPLATE */ #line 88 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_TSTEMPLATE; ;} + { (yyval.objtype) = PG_OBJECT_TSTEMPLATE; } +#line 22664 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 426: + case 428: /* drop_type_any_name: TEXT_P SEARCH CONFIGURATION */ #line 89 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_TSCONFIGURATION; ;} + { (yyval.objtype) = PG_OBJECT_TSCONFIGURATION; } +#line 22670 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 427: + case 429: /* drop_type_any_name: TYPE_P */ #line 90 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_TYPE; ;} + { (yyval.objtype) = PG_OBJECT_TYPE; } +#line 22676 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 428: + case 430: /* drop_type_name: ACCESS METHOD */ #line 95 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_ACCESS_METHOD; ;} + { (yyval.objtype) = PG_OBJECT_ACCESS_METHOD; } +#line 22682 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 429: + case 431: /* drop_type_name: EVENT TRIGGER */ #line 96 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_EVENT_TRIGGER; ;} + { (yyval.objtype) = PG_OBJECT_EVENT_TRIGGER; } +#line 22688 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 430: + case 432: /* drop_type_name: EXTENSION */ #line 97 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_EXTENSION; ;} + { (yyval.objtype) = PG_OBJECT_EXTENSION; } +#line 22694 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 431: + case 433: /* drop_type_name: FOREIGN DATA_P WRAPPER */ #line 98 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_FDW; ;} + { (yyval.objtype) = PG_OBJECT_FDW; } +#line 22700 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 432: + case 434: /* drop_type_name: PUBLICATION */ #line 99 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_PUBLICATION; ;} + { (yyval.objtype) = PG_OBJECT_PUBLICATION; } +#line 22706 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 433: + case 435: /* drop_type_name: SERVER */ #line 100 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_FOREIGN_SERVER; ;} + { (yyval.objtype) = PG_OBJECT_FOREIGN_SERVER; } +#line 22712 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 434: + case 436: /* any_name_list: any_name */ #line 105 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].list)); ;} + { (yyval.list) = list_make1((yyvsp[0].list)); } +#line 22718 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 435: + case 437: /* any_name_list: any_name_list ',' any_name */ #line 106 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } +#line 22724 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 436: + case 438: /* opt_drop_behavior: CASCADE */ #line 111 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.dbehavior) = PG_DROP_CASCADE; ;} + { (yyval.dbehavior) = PG_DROP_CASCADE; } +#line 22730 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 437: + case 439: /* opt_drop_behavior: RESTRICT */ #line 112 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.dbehavior) = PG_DROP_RESTRICT; ;} + { (yyval.dbehavior) = PG_DROP_RESTRICT; } +#line 22736 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 438: + case 440: /* opt_drop_behavior: %empty */ #line 113 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.dbehavior) = PG_DROP_RESTRICT; /* default */ ;} + { (yyval.dbehavior) = PG_DROP_RESTRICT; /* default */ } +#line 22742 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 439: + case 441: /* drop_type_name_on_any_name: POLICY */ #line 118 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_POLICY; ;} + { (yyval.objtype) = PG_OBJECT_POLICY; } +#line 22748 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 440: + case 442: /* drop_type_name_on_any_name: RULE */ #line 119 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_RULE; ;} + { (yyval.objtype) = PG_OBJECT_RULE; } +#line 22754 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 441: + case 443: /* drop_type_name_on_any_name: TRIGGER */ #line 120 "third_party/libpg_query/grammar/statements/drop.y" - { (yyval.objtype) = PG_OBJECT_TRIGGER; ;} + { (yyval.objtype) = PG_OBJECT_TRIGGER; } +#line 22760 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 442: + case 444: /* CreateFunctionStmt: CREATE_P OptTemp macro_alias qualified_name param_list AS TABLE SelectStmt */ #line 9 "third_party/libpg_query/grammar/statements/create_function.y" - { + { PGCreateFunctionStmt *n = makeNode(PGCreateFunctionStmt); - (yyvsp[(4) - (8)].range)->relpersistence = (yyvsp[(2) - (8)].ival); - n->name = (yyvsp[(4) - (8)].range); - n->params = (yyvsp[(5) - (8)].list); + (yyvsp[-4].range)->relpersistence = (yyvsp[-6].ival); + n->name = (yyvsp[-4].range); + n->params = (yyvsp[-3].list); n->function = NULL; - n->query = (yyvsp[(8) - (8)].node); + n->query = (yyvsp[0].node); n->onconflict = PG_ERROR_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 22775 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 443: + case 445: /* CreateFunctionStmt: CREATE_P OptTemp macro_alias IF_P NOT EXISTS qualified_name param_list AS TABLE SelectStmt */ #line 21 "third_party/libpg_query/grammar/statements/create_function.y" - { + { PGCreateFunctionStmt *n = makeNode(PGCreateFunctionStmt); - (yyvsp[(7) - (11)].range)->relpersistence = (yyvsp[(2) - (11)].ival); - n->name = (yyvsp[(7) - (11)].range); - n->params = (yyvsp[(8) - (11)].list); + (yyvsp[-4].range)->relpersistence = (yyvsp[-9].ival); + n->name = (yyvsp[-4].range); + n->params = (yyvsp[-3].list); n->function = NULL; - n->query = (yyvsp[(11) - (11)].node); + n->query = (yyvsp[0].node); n->onconflict = PG_IGNORE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 22791 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 444: + case 446: /* CreateFunctionStmt: CREATE_P OR REPLACE OptTemp macro_alias qualified_name param_list AS TABLE SelectStmt */ #line 34 "third_party/libpg_query/grammar/statements/create_function.y" - { + { PGCreateFunctionStmt *n = makeNode(PGCreateFunctionStmt); - (yyvsp[(6) - (10)].range)->relpersistence = (yyvsp[(4) - (10)].ival); - n->name = (yyvsp[(6) - (10)].range); - n->params = (yyvsp[(7) - (10)].list); + (yyvsp[-4].range)->relpersistence = (yyvsp[-6].ival); + n->name = (yyvsp[-4].range); + n->params = (yyvsp[-3].list); n->function = NULL; - n->query = (yyvsp[(10) - (10)].node); + n->query = (yyvsp[0].node); n->onconflict = PG_REPLACE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 22807 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 445: + case 447: /* CreateFunctionStmt: CREATE_P OptTemp macro_alias qualified_name param_list AS a_expr */ #line 47 "third_party/libpg_query/grammar/statements/create_function.y" - { + { PGCreateFunctionStmt *n = makeNode(PGCreateFunctionStmt); - (yyvsp[(4) - (7)].range)->relpersistence = (yyvsp[(2) - (7)].ival); - n->name = (yyvsp[(4) - (7)].range); - n->params = (yyvsp[(5) - (7)].list); - n->function = (yyvsp[(7) - (7)].node); + (yyvsp[-3].range)->relpersistence = (yyvsp[-5].ival); + n->name = (yyvsp[-3].range); + n->params = (yyvsp[-2].list); + n->function = (yyvsp[0].node); n->query = NULL; n->onconflict = PG_ERROR_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 22822 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 446: + case 448: /* CreateFunctionStmt: CREATE_P OptTemp macro_alias IF_P NOT EXISTS qualified_name param_list AS a_expr */ #line 59 "third_party/libpg_query/grammar/statements/create_function.y" - { + { PGCreateFunctionStmt *n = makeNode(PGCreateFunctionStmt); - (yyvsp[(7) - (10)].range)->relpersistence = (yyvsp[(2) - (10)].ival); - n->name = (yyvsp[(7) - (10)].range); - n->params = (yyvsp[(8) - (10)].list); - n->function = (yyvsp[(10) - (10)].node); + (yyvsp[-3].range)->relpersistence = (yyvsp[-8].ival); + n->name = (yyvsp[-3].range); + n->params = (yyvsp[-2].list); + n->function = (yyvsp[0].node); n->query = NULL; n->onconflict = PG_IGNORE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 22837 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 447: + case 449: /* CreateFunctionStmt: CREATE_P OR REPLACE OptTemp macro_alias qualified_name param_list AS a_expr */ #line 71 "third_party/libpg_query/grammar/statements/create_function.y" - { + { PGCreateFunctionStmt *n = makeNode(PGCreateFunctionStmt); - (yyvsp[(6) - (9)].range)->relpersistence = (yyvsp[(4) - (9)].ival); - n->name = (yyvsp[(6) - (9)].range); - n->params = (yyvsp[(7) - (9)].list); - n->function = (yyvsp[(9) - (9)].node); + (yyvsp[-3].range)->relpersistence = (yyvsp[-5].ival); + n->name = (yyvsp[-3].range); + n->params = (yyvsp[-2].list); + n->function = (yyvsp[0].node); n->query = NULL; n->onconflict = PG_REPLACE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 22852 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 450: + case 452: /* param_list: '(' ')' */ #line 92 "third_party/libpg_query/grammar/statements/create_function.y" - { + { (yyval.list) = NIL; - ;} + } +#line 22860 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 451: + case 453: /* param_list: '(' func_arg_list ')' */ #line 96 "third_party/libpg_query/grammar/statements/create_function.y" - { - (yyval.list) = (yyvsp[(2) - (3)].list); - ;} + { + (yyval.list) = (yyvsp[-1].list); + } +#line 22868 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 452: + case 454: /* UpdateStmt: opt_with_clause UPDATE relation_expr_opt_alias SET set_clause_list_opt_comma from_clause where_or_current_clause returning_clause */ #line 12 "third_party/libpg_query/grammar/statements/update.y" - { + { PGUpdateStmt *n = makeNode(PGUpdateStmt); - n->relation = (yyvsp[(3) - (8)].range); - n->targetList = (yyvsp[(5) - (8)].list); - n->fromClause = (yyvsp[(6) - (8)].list); - n->whereClause = (yyvsp[(7) - (8)].node); - n->returningList = (yyvsp[(8) - (8)].list); - n->withClause = (yyvsp[(1) - (8)].with); + n->relation = (yyvsp[-5].range); + n->targetList = (yyvsp[-3].list); + n->fromClause = (yyvsp[-2].list); + n->whereClause = (yyvsp[-1].node); + n->returningList = (yyvsp[0].list); + n->withClause = (yyvsp[-7].with); (yyval.node) = (PGNode *)n; - ;} + } +#line 22883 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 453: + case 455: /* CopyStmt: COPY opt_binary qualified_name opt_column_list opt_oids copy_from opt_program copy_file_name copy_delimiter opt_with copy_options */ #line 3 "third_party/libpg_query/grammar/statements/copy.y" - { + { PGCopyStmt *n = makeNode(PGCopyStmt); - n->relation = (yyvsp[(3) - (11)].range); + n->relation = (yyvsp[-8].range); n->query = NULL; - n->attlist = (yyvsp[(4) - (11)].list); - n->is_from = (yyvsp[(6) - (11)].boolean); - n->is_program = (yyvsp[(7) - (11)].boolean); - n->filename = (yyvsp[(8) - (11)].str); + n->attlist = (yyvsp[-7].list); + n->is_from = (yyvsp[-5].boolean); + n->is_program = (yyvsp[-4].boolean); + n->filename = (yyvsp[-3].str); if (n->is_program && n->filename == NULL) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("STDIN/STDOUT not allowed with PROGRAM"), - parser_errposition((yylsp[(8) - (11)])))); + parser_errposition((yylsp[-3])))); n->options = NIL; /* Concatenate user-supplied flags */ - if ((yyvsp[(2) - (11)].defelt)) - n->options = lappend(n->options, (yyvsp[(2) - (11)].defelt)); - if ((yyvsp[(5) - (11)].defelt)) - n->options = lappend(n->options, (yyvsp[(5) - (11)].defelt)); - if ((yyvsp[(9) - (11)].defelt)) - n->options = lappend(n->options, (yyvsp[(9) - (11)].defelt)); - if ((yyvsp[(11) - (11)].list)) - n->options = list_concat(n->options, (yyvsp[(11) - (11)].list)); + if ((yyvsp[-9].defelt)) + n->options = lappend(n->options, (yyvsp[-9].defelt)); + if ((yyvsp[-6].defelt)) + n->options = lappend(n->options, (yyvsp[-6].defelt)); + if ((yyvsp[-2].defelt)) + n->options = lappend(n->options, (yyvsp[-2].defelt)); + if ((yyvsp[0].list)) + n->options = list_concat(n->options, (yyvsp[0].list)); (yyval.node) = (PGNode *)n; - ;} + } +#line 22915 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 454: + case 456: /* CopyStmt: COPY '(' SelectStmt ')' TO opt_program copy_file_name opt_with copy_options */ #line 31 "third_party/libpg_query/grammar/statements/copy.y" - { + { PGCopyStmt *n = makeNode(PGCopyStmt); n->relation = NULL; - n->query = (yyvsp[(3) - (9)].node); + n->query = (yyvsp[-6].node); n->attlist = NIL; n->is_from = false; - n->is_program = (yyvsp[(6) - (9)].boolean); - n->filename = (yyvsp[(7) - (9)].str); - n->options = (yyvsp[(9) - (9)].list); + n->is_program = (yyvsp[-3].boolean); + n->filename = (yyvsp[-2].str); + n->options = (yyvsp[0].list); if (n->is_program && n->filename == NULL) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("STDIN/STDOUT not allowed with PROGRAM"), - parser_errposition((yylsp[(5) - (9)])))); + parser_errposition((yylsp[-4])))); (yyval.node) = (PGNode *)n; - ;} + } +#line 22938 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 455: + case 457: /* CopyStmt: COPY FROM DATABASE ColId TO ColId copy_database_flag */ #line 50 "third_party/libpg_query/grammar/statements/copy.y" - { + { PGCopyDatabaseStmt *n = makeNode(PGCopyDatabaseStmt); - n->from_database = (yyvsp[(4) - (7)].str); - n->to_database = (yyvsp[(6) - (7)].str); - n->copy_database_flag = (yyvsp[(7) - (7)].conststr); + n->from_database = (yyvsp[-3].str); + n->to_database = (yyvsp[-1].str); + n->copy_database_flag = (yyvsp[0].conststr); (yyval.node) = (PGNode *)n; - ;} + } +#line 22950 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 456: + case 458: /* copy_database_flag: %empty */ #line 61 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.conststr) = NULL; ;} + { (yyval.conststr) = NULL; } +#line 22956 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 457: + case 459: /* copy_database_flag: '(' SCHEMA ')' */ #line 62 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.conststr) = "schema"; ;} + { (yyval.conststr) = "schema"; } +#line 22962 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 458: + case 460: /* copy_database_flag: '(' DATA_P ')' */ #line 63 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.conststr) = "data"; ;} + { (yyval.conststr) = "data"; } +#line 22968 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 459: + case 461: /* copy_from: FROM */ #line 67 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 22974 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 460: + case 462: /* copy_from: TO */ #line 68 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 22980 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 461: + case 463: /* copy_delimiter: opt_using DELIMITERS Sconst */ #line 74 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("delimiter", (PGNode *)makeString((yyvsp[(3) - (3)].str)), (yylsp[(2) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("delimiter", (PGNode *)makeString((yyvsp[0].str)), (yylsp[-1])); + } +#line 22988 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 462: + case 464: /* copy_delimiter: %empty */ #line 77 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.defelt) = NULL; ;} + { (yyval.defelt) = NULL; } +#line 22994 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 463: + case 465: /* copy_generic_opt_arg_list: copy_generic_opt_arg_list_item */ #line 83 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); - ;} + { + (yyval.list) = list_make1((yyvsp[0].node)); + } +#line 23002 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 464: + case 466: /* copy_generic_opt_arg_list: copy_generic_opt_arg_list ',' copy_generic_opt_arg_list_item */ #line 87 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); - ;} + { + (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); + } +#line 23010 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 465: + case 467: /* opt_using: USING */ #line 94 "third_party/libpg_query/grammar/statements/copy.y" - {;} + {} +#line 23016 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 466: + case 468: /* opt_using: %empty */ #line 95 "third_party/libpg_query/grammar/statements/copy.y" - {;} + {} +#line 23022 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 467: + case 469: /* opt_as: AS */ #line 99 "third_party/libpg_query/grammar/statements/copy.y" - {;} + {} +#line 23028 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 468: + case 470: /* opt_as: %empty */ #line 100 "third_party/libpg_query/grammar/statements/copy.y" - {;} + {} +#line 23034 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 469: + case 471: /* opt_program: PROGRAM */ #line 105 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 23040 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 470: + case 472: /* opt_program: %empty */ #line 106 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 23046 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 471: + case 473: /* copy_options: copy_opt_list */ #line 110 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 23052 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 472: + case 474: /* copy_options: '(' copy_generic_opt_list ')' */ #line 111 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 23058 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 473: + case 475: /* copy_generic_opt_arg: opt_boolean_or_string */ #line 116 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.node) = (PGNode *) makeString((yyvsp[(1) - (1)].str)); ;} + { (yyval.node) = (PGNode *) makeString((yyvsp[0].str)); } +#line 23064 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 474: + case 476: /* copy_generic_opt_arg: NumericOnly */ #line 117 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.node) = (PGNode *) (yyvsp[(1) - (1)].value); ;} + { (yyval.node) = (PGNode *) (yyvsp[0].value); } +#line 23070 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 475: + case 477: /* copy_generic_opt_arg: list_expr */ #line 118 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.node) = (PGNode *) (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (PGNode *) (yyvsp[0].node); } +#line 23076 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 476: + case 478: /* copy_generic_opt_arg: '*' */ #line 119 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.node) = (PGNode *) makeNode(PGAStar); ;} + { (yyval.node) = (PGNode *) makeNode(PGAStar); } +#line 23082 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 477: + case 479: /* copy_generic_opt_arg: '(' copy_generic_opt_arg_list ')' */ #line 120 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.node) = (PGNode *) (yyvsp[(2) - (3)].list); ;} + { (yyval.node) = (PGNode *) (yyvsp[-1].list); } +#line 23088 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 478: + case 480: /* copy_generic_opt_arg: struct_expr */ #line 121 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.node) = (PGNode *) (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (PGNode *) (yyvsp[0].node); } +#line 23094 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 479: + case 481: /* copy_generic_opt_arg: %empty */ #line 122 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 23100 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 480: + case 482: /* copy_generic_opt_elem: ColLabel copy_generic_opt_arg */ #line 128 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem((yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); + } +#line 23108 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 481: + case 483: /* opt_oids: WITH OIDS */ #line 136 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("oids", (PGNode *)makeInteger(true), (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem("oids", (PGNode *)makeInteger(true), (yylsp[-1])); + } +#line 23116 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 482: + case 484: /* opt_oids: %empty */ #line 139 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.defelt) = NULL; ;} + { (yyval.defelt) = NULL; } +#line 23122 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 483: + case 485: /* copy_opt_list: copy_opt_list copy_opt_item */ #line 144 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].defelt)); ;} + { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } +#line 23128 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 484: + case 486: /* copy_opt_list: %empty */ #line 145 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 23134 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 485: + case 487: /* opt_binary: BINARY */ #line 151 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("format", (PGNode *)makeString("binary"), (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem("format", (PGNode *)makeString("binary"), (yylsp[0])); + } +#line 23142 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 486: + case 488: /* opt_binary: %empty */ #line 154 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.defelt) = NULL; ;} + { (yyval.defelt) = NULL; } +#line 23148 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 487: + case 489: /* copy_opt_item: BINARY */ #line 160 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("format", (PGNode *)makeString("binary"), (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem("format", (PGNode *)makeString("binary"), (yylsp[0])); + } +#line 23156 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 488: + case 490: /* copy_opt_item: OIDS */ #line 164 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("oids", (PGNode *)makeInteger(true), (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem("oids", (PGNode *)makeInteger(true), (yylsp[0])); + } +#line 23164 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 489: + case 491: /* copy_opt_item: FREEZE */ #line 168 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("freeze", (PGNode *)makeInteger(true), (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem("freeze", (PGNode *)makeInteger(true), (yylsp[0])); + } +#line 23172 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 490: + case 492: /* copy_opt_item: DELIMITER opt_as Sconst */ #line 172 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("delimiter", (PGNode *)makeString((yyvsp[(3) - (3)].str)), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("delimiter", (PGNode *)makeString((yyvsp[0].str)), (yylsp[-2])); + } +#line 23180 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 491: + case 493: /* copy_opt_item: NULL_P opt_as Sconst */ #line 176 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("null", (PGNode *)makeString((yyvsp[(3) - (3)].str)), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("null", (PGNode *)makeString((yyvsp[0].str)), (yylsp[-2])); + } +#line 23188 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 492: + case 494: /* copy_opt_item: CSV */ #line 180 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("format", (PGNode *)makeString("csv"), (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem("format", (PGNode *)makeString("csv"), (yylsp[0])); + } +#line 23196 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 493: + case 495: /* copy_opt_item: HEADER_P */ #line 184 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("header", (PGNode *)makeInteger(true), (yylsp[(1) - (1)])); - ;} + { + (yyval.defelt) = makeDefElem("header", (PGNode *)makeInteger(true), (yylsp[0])); + } +#line 23204 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 494: + case 496: /* copy_opt_item: QUOTE opt_as Sconst */ #line 188 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("quote", (PGNode *)makeString((yyvsp[(3) - (3)].str)), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("quote", (PGNode *)makeString((yyvsp[0].str)), (yylsp[-2])); + } +#line 23212 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 495: + case 497: /* copy_opt_item: ESCAPE opt_as Sconst */ #line 192 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("escape", (PGNode *)makeString((yyvsp[(3) - (3)].str)), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("escape", (PGNode *)makeString((yyvsp[0].str)), (yylsp[-2])); + } +#line 23220 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 496: + case 498: /* copy_opt_item: FORCE QUOTE columnList */ #line 196 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("force_quote", (PGNode *)(yyvsp[(3) - (3)].list), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("force_quote", (PGNode *)(yyvsp[0].list), (yylsp[-2])); + } +#line 23228 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 497: + case 499: /* copy_opt_item: FORCE QUOTE '*' */ #line 200 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("force_quote", (PGNode *)makeNode(PGAStar), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("force_quote", (PGNode *)makeNode(PGAStar), (yylsp[-2])); + } +#line 23236 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 498: + case 500: /* copy_opt_item: PARTITION BY columnList */ #line 204 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("partition_by", (PGNode *)(yyvsp[(3) - (3)].list), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("partition_by", (PGNode *)(yyvsp[0].list), (yylsp[-2])); + } +#line 23244 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 499: + case 501: /* copy_opt_item: PARTITION BY '*' */ #line 208 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("partition_by", (PGNode *)makeNode(PGAStar), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("partition_by", (PGNode *)makeNode(PGAStar), (yylsp[-2])); + } +#line 23252 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 500: + case 502: /* copy_opt_item: FORCE NOT NULL_P columnList */ #line 212 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("force_not_null", (PGNode *)(yyvsp[(4) - (4)].list), (yylsp[(1) - (4)])); - ;} + { + (yyval.defelt) = makeDefElem("force_not_null", (PGNode *)(yyvsp[0].list), (yylsp[-3])); + } +#line 23260 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 501: + case 503: /* copy_opt_item: FORCE NULL_P columnList */ #line 216 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("force_null", (PGNode *)(yyvsp[(3) - (3)].list), (yylsp[(1) - (3)])); - ;} + { + (yyval.defelt) = makeDefElem("force_null", (PGNode *)(yyvsp[0].list), (yylsp[-2])); + } +#line 23268 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 502: + case 504: /* copy_opt_item: ENCODING Sconst */ #line 220 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.defelt) = makeDefElem("encoding", (PGNode *)makeString((yyvsp[(2) - (2)].str)), (yylsp[(1) - (2)])); - ;} + { + (yyval.defelt) = makeDefElem("encoding", (PGNode *)makeString((yyvsp[0].str)), (yylsp[-1])); + } +#line 23276 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 503: + case 505: /* copy_generic_opt_arg_list_item: opt_boolean_or_string */ #line 227 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.node) = (PGNode *) makeString((yyvsp[(1) - (1)].str)); ;} + { (yyval.node) = (PGNode *) makeString((yyvsp[0].str)); } +#line 23282 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 504: + case 506: /* copy_file_name: Sconst */ #line 232 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 23288 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 505: + case 507: /* copy_file_name: STDIN */ #line 233 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.str) = NULL; ;} + { (yyval.str) = NULL; } +#line 23294 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 506: + case 508: /* copy_file_name: STDOUT */ #line 234 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.str) = NULL; ;} + { (yyval.str) = NULL; } +#line 23300 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 507: + case 509: /* copy_file_name: IDENT '.' ColId */ #line 235 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.str) = psprintf("%s.%s", (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str)); ;} + { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } +#line 23306 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 508: + case 510: /* copy_file_name: IDENT */ #line 236 "third_party/libpg_query/grammar/statements/copy.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 23312 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 509: + case 511: /* copy_generic_opt_list: copy_generic_opt_elem */ #line 243 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].defelt)); - ;} + { + (yyval.list) = list_make1((yyvsp[0].defelt)); + } +#line 23320 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 510: + case 512: /* copy_generic_opt_list: copy_generic_opt_list ',' copy_generic_opt_elem */ #line 247 "third_party/libpg_query/grammar/statements/copy.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].defelt)); - ;} + { + (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); + } +#line 23328 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 513: + case 515: /* select_with_parens: '(' select_no_parens ')' */ #line 52 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (3)].node); ;} + { (yyval.node) = (yyvsp[-1].node); } +#line 23334 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 514: + case 516: /* select_with_parens: '(' select_with_parens ')' */ #line 53 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (3)].node); ;} + { (yyval.node) = (yyvsp[-1].node); } +#line 23340 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 515: + case 517: /* select_with_parens: '(' VariableShowStmt ')' */ #line 55 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - ;} + { + (yyval.node) = (yyvsp[-1].node); + } +#line 23348 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 516: + case 518: /* select_no_parens: simple_select */ #line 72 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 23354 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 517: + case 519: /* select_no_parens: select_clause sort_clause */ #line 74 "third_party/libpg_query/grammar/statements/select.y" - { - insertSelectOptions((PGSelectStmt *) (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].list), NIL, + { + insertSelectOptions((PGSelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, NULL, NULL, yyscanner); - (yyval.node) = (yyvsp[(1) - (2)].node); - ;} + (yyval.node) = (yyvsp[-1].node); + } +#line 23365 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 518: + case 520: /* select_no_parens: select_clause opt_sort_clause for_locking_clause opt_select_limit */ #line 81 "third_party/libpg_query/grammar/statements/select.y" - { - insertSelectOptions((PGSelectStmt *) (yyvsp[(1) - (4)].node), (yyvsp[(2) - (4)].list), (yyvsp[(3) - (4)].list), - (PGNode*) list_nth((yyvsp[(4) - (4)].list), 0), (PGNode*) list_nth((yyvsp[(4) - (4)].list), 1), + { + insertSelectOptions((PGSelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), + (PGNode*) list_nth((yyvsp[0].list), 0), (PGNode*) list_nth((yyvsp[0].list), 1), NULL, yyscanner); - (yyval.node) = (yyvsp[(1) - (4)].node); - ;} + (yyval.node) = (yyvsp[-3].node); + } +#line 23377 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 519: + case 521: /* select_no_parens: select_clause opt_sort_clause select_limit opt_for_locking_clause */ #line 89 "third_party/libpg_query/grammar/statements/select.y" - { - insertSelectOptions((PGSelectStmt *) (yyvsp[(1) - (4)].node), (yyvsp[(2) - (4)].list), (yyvsp[(4) - (4)].list), - (PGNode*) list_nth((yyvsp[(3) - (4)].list), 0), (PGNode*) list_nth((yyvsp[(3) - (4)].list), 1), + { + insertSelectOptions((PGSelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), + (PGNode*) list_nth((yyvsp[-1].list), 0), (PGNode*) list_nth((yyvsp[-1].list), 1), NULL, yyscanner); - (yyval.node) = (yyvsp[(1) - (4)].node); - ;} + (yyval.node) = (yyvsp[-3].node); + } +#line 23389 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 520: + case 522: /* select_no_parens: with_clause select_clause */ #line 97 "third_party/libpg_query/grammar/statements/select.y" - { - insertSelectOptions((PGSelectStmt *) (yyvsp[(2) - (2)].node), NULL, NIL, + { + insertSelectOptions((PGSelectStmt *) (yyvsp[0].node), NULL, NIL, NULL, NULL, - (yyvsp[(1) - (2)].with), + (yyvsp[-1].with), yyscanner); - (yyval.node) = (yyvsp[(2) - (2)].node); - ;} + (yyval.node) = (yyvsp[0].node); + } +#line 23401 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 521: + case 523: /* select_no_parens: with_clause select_clause sort_clause */ #line 105 "third_party/libpg_query/grammar/statements/select.y" - { - insertSelectOptions((PGSelectStmt *) (yyvsp[(2) - (3)].node), (yyvsp[(3) - (3)].list), NIL, + { + insertSelectOptions((PGSelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, NULL, - (yyvsp[(1) - (3)].with), + (yyvsp[-2].with), yyscanner); - (yyval.node) = (yyvsp[(2) - (3)].node); - ;} + (yyval.node) = (yyvsp[-1].node); + } +#line 23413 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 522: + case 524: /* select_no_parens: with_clause select_clause opt_sort_clause for_locking_clause opt_select_limit */ #line 113 "third_party/libpg_query/grammar/statements/select.y" - { - insertSelectOptions((PGSelectStmt *) (yyvsp[(2) - (5)].node), (yyvsp[(3) - (5)].list), (yyvsp[(4) - (5)].list), - (PGNode*) list_nth((yyvsp[(5) - (5)].list), 0), (PGNode*) list_nth((yyvsp[(5) - (5)].list), 1), - (yyvsp[(1) - (5)].with), + { + insertSelectOptions((PGSelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[-1].list), + (PGNode*) list_nth((yyvsp[0].list), 0), (PGNode*) list_nth((yyvsp[0].list), 1), + (yyvsp[-4].with), yyscanner); - (yyval.node) = (yyvsp[(2) - (5)].node); - ;} + (yyval.node) = (yyvsp[-3].node); + } +#line 23425 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 523: + case 525: /* select_no_parens: with_clause select_clause opt_sort_clause select_limit opt_for_locking_clause */ #line 121 "third_party/libpg_query/grammar/statements/select.y" - { - insertSelectOptions((PGSelectStmt *) (yyvsp[(2) - (5)].node), (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list), - (PGNode*) list_nth((yyvsp[(4) - (5)].list), 0), (PGNode*) list_nth((yyvsp[(4) - (5)].list), 1), - (yyvsp[(1) - (5)].with), + { + insertSelectOptions((PGSelectStmt *) (yyvsp[-3].node), (yyvsp[-2].list), (yyvsp[0].list), + (PGNode*) list_nth((yyvsp[-1].list), 0), (PGNode*) list_nth((yyvsp[-1].list), 1), + (yyvsp[-4].with), yyscanner); - (yyval.node) = (yyvsp[(2) - (5)].node); - ;} + (yyval.node) = (yyvsp[-3].node); + } +#line 23437 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 524: + case 526: /* select_clause: simple_select */ #line 131 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 23443 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 525: + case 527: /* select_clause: select_with_parens */ #line 132 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 23449 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 526: + case 528: /* opt_select: SELECT opt_all_clause opt_target_list_opt_comma */ #line 160 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = (yyvsp[(3) - (3)].list); - ;} + { + (yyval.list) = (yyvsp[0].list); + } +#line 23457 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 527: + case 529: /* opt_select: %empty */ #line 164 "third_party/libpg_query/grammar/statements/select.y" - { + { PGAStar *star = makeNode(PGAStar); (yyval.list) = list_make1(star); - ;} + } +#line 23466 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 528: + case 530: /* simple_select: SELECT opt_all_clause opt_target_list_opt_comma into_clause from_clause where_clause group_clause having_clause window_clause qualify_clause sample_clause */ #line 175 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *n = makeNode(PGSelectStmt); - n->targetList = (yyvsp[(3) - (11)].list); - n->intoClause = (yyvsp[(4) - (11)].into); - n->fromClause = (yyvsp[(5) - (11)].list); - n->whereClause = (yyvsp[(6) - (11)].node); - n->groupClause = (yyvsp[(7) - (11)].list); - n->havingClause = (yyvsp[(8) - (11)].node); - n->windowClause = (yyvsp[(9) - (11)].list); - n->qualifyClause = (yyvsp[(10) - (11)].node); - n->sampleOptions = (yyvsp[(11) - (11)].node); + n->targetList = (yyvsp[-8].list); + n->intoClause = (yyvsp[-7].into); + n->fromClause = (yyvsp[-6].list); + n->whereClause = (yyvsp[-5].node); + n->groupClause = (yyvsp[-4].list); + n->havingClause = (yyvsp[-3].node); + n->windowClause = (yyvsp[-2].list); + n->qualifyClause = (yyvsp[-1].node); + n->sampleOptions = (yyvsp[0].node); (yyval.node) = (PGNode *)n; - ;} + } +#line 23484 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 529: + case 531: /* simple_select: SELECT distinct_clause target_list_opt_comma into_clause from_clause where_clause group_clause having_clause window_clause qualify_clause sample_clause */ #line 191 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *n = makeNode(PGSelectStmt); - n->distinctClause = (yyvsp[(2) - (11)].list); - n->targetList = (yyvsp[(3) - (11)].list); - n->intoClause = (yyvsp[(4) - (11)].into); - n->fromClause = (yyvsp[(5) - (11)].list); - n->whereClause = (yyvsp[(6) - (11)].node); - n->groupClause = (yyvsp[(7) - (11)].list); - n->havingClause = (yyvsp[(8) - (11)].node); - n->windowClause = (yyvsp[(9) - (11)].list); - n->qualifyClause = (yyvsp[(10) - (11)].node); - n->sampleOptions = (yyvsp[(11) - (11)].node); + n->distinctClause = (yyvsp[-9].list); + n->targetList = (yyvsp[-8].list); + n->intoClause = (yyvsp[-7].into); + n->fromClause = (yyvsp[-6].list); + n->whereClause = (yyvsp[-5].node); + n->groupClause = (yyvsp[-4].list); + n->havingClause = (yyvsp[-3].node); + n->windowClause = (yyvsp[-2].list); + n->qualifyClause = (yyvsp[-1].node); + n->sampleOptions = (yyvsp[0].node); (yyval.node) = (PGNode *)n; - ;} + } +#line 23503 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 530: + case 532: /* simple_select: FROM from_list opt_select into_clause where_clause group_clause having_clause window_clause qualify_clause sample_clause */ #line 208 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *n = makeNode(PGSelectStmt); - n->targetList = (yyvsp[(3) - (10)].list); - n->fromClause = (yyvsp[(2) - (10)].list); - n->intoClause = (yyvsp[(4) - (10)].into); - n->whereClause = (yyvsp[(5) - (10)].node); - n->groupClause = (yyvsp[(6) - (10)].list); - n->havingClause = (yyvsp[(7) - (10)].node); - n->windowClause = (yyvsp[(8) - (10)].list); - n->qualifyClause = (yyvsp[(9) - (10)].node); - n->sampleOptions = (yyvsp[(10) - (10)].node); + n->targetList = (yyvsp[-7].list); + n->fromClause = (yyvsp[-8].list); + n->intoClause = (yyvsp[-6].into); + n->whereClause = (yyvsp[-5].node); + n->groupClause = (yyvsp[-4].list); + n->havingClause = (yyvsp[-3].node); + n->windowClause = (yyvsp[-2].list); + n->qualifyClause = (yyvsp[-1].node); + n->sampleOptions = (yyvsp[0].node); (yyval.node) = (PGNode *)n; - ;} + } +#line 23521 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 531: + case 533: /* simple_select: FROM from_list SELECT distinct_clause target_list_opt_comma into_clause where_clause group_clause having_clause window_clause qualify_clause sample_clause */ #line 225 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *n = makeNode(PGSelectStmt); - n->targetList = (yyvsp[(5) - (12)].list); - n->distinctClause = (yyvsp[(4) - (12)].list); - n->fromClause = (yyvsp[(2) - (12)].list); - n->intoClause = (yyvsp[(6) - (12)].into); - n->whereClause = (yyvsp[(7) - (12)].node); - n->groupClause = (yyvsp[(8) - (12)].list); - n->havingClause = (yyvsp[(9) - (12)].node); - n->windowClause = (yyvsp[(10) - (12)].list); - n->qualifyClause = (yyvsp[(11) - (12)].node); - n->sampleOptions = (yyvsp[(12) - (12)].node); + n->targetList = (yyvsp[-7].list); + n->distinctClause = (yyvsp[-8].list); + n->fromClause = (yyvsp[-10].list); + n->intoClause = (yyvsp[-6].into); + n->whereClause = (yyvsp[-5].node); + n->groupClause = (yyvsp[-4].list); + n->havingClause = (yyvsp[-3].node); + n->windowClause = (yyvsp[-2].list); + n->qualifyClause = (yyvsp[-1].node); + n->sampleOptions = (yyvsp[0].node); (yyval.node) = (PGNode *)n; - ;} + } +#line 23540 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 532: + case 534: /* simple_select: values_clause_opt_comma */ #line 239 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 23546 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 533: + case 535: /* simple_select: TABLE relation_expr */ #line 241 "third_party/libpg_query/grammar/statements/select.y" - { + { /* same as SELECT * FROM relation_expr */ PGColumnRef *cr = makeNode(PGColumnRef); PGResTarget *rt = makeNode(PGResTarget); @@ -23969,1749 +23562,1989 @@ YYLTYPE yylloc; rt->location = -1; n->targetList = list_make1(rt); - n->fromClause = list_make1((yyvsp[(2) - (2)].range)); + n->fromClause = list_make1((yyvsp[0].range)); (yyval.node) = (PGNode *)n; - ;} + } +#line 23569 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 534: + case 536: /* simple_select: select_clause UNION all_or_distinct by_name select_clause */ #line 260 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSetOp(PG_SETOP_UNION_BY_NAME, (yyvsp[(3) - (5)].boolean), (yyvsp[(1) - (5)].node), (yyvsp[(5) - (5)].node)); - ;} + { + (yyval.node) = makeSetOp(PG_SETOP_UNION_BY_NAME, (yyvsp[-2].boolean), (yyvsp[-4].node), (yyvsp[0].node)); + } +#line 23577 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 535: + case 537: /* simple_select: select_clause UNION all_or_distinct select_clause */ #line 264 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSetOp(PG_SETOP_UNION, (yyvsp[(3) - (4)].boolean), (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node)); - ;} + { + (yyval.node) = makeSetOp(PG_SETOP_UNION, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); + } +#line 23585 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 536: + case 538: /* simple_select: select_clause INTERSECT all_or_distinct select_clause */ #line 268 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSetOp(PG_SETOP_INTERSECT, (yyvsp[(3) - (4)].boolean), (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node)); - ;} + { + (yyval.node) = makeSetOp(PG_SETOP_INTERSECT, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); + } +#line 23593 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 537: + case 539: /* simple_select: select_clause EXCEPT all_or_distinct select_clause */ #line 272 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSetOp(PG_SETOP_EXCEPT, (yyvsp[(3) - (4)].boolean), (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node)); - ;} + { + (yyval.node) = makeSetOp(PG_SETOP_EXCEPT, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); + } +#line 23601 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 538: + case 540: /* simple_select: pivot_keyword table_ref USING target_list_opt_comma */ #line 276 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); - n->source = (yyvsp[(2) - (4)].node); - n->aggrs = (yyvsp[(4) - (4)].list); - n->location = (yylsp[(1) - (4)]); + n->source = (yyvsp[-2].node); + n->aggrs = (yyvsp[0].list); + n->location = (yylsp[-3]); res->pivot = n; (yyval.node) = (PGNode *)res; - ;} + } +#line 23615 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 539: + case 541: /* simple_select: pivot_keyword table_ref USING target_list_opt_comma GROUP_P BY name_list_opt_comma_opt_bracket */ #line 286 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); - n->source = (yyvsp[(2) - (7)].node); - n->aggrs = (yyvsp[(4) - (7)].list); - n->groups = (yyvsp[(7) - (7)].list); - n->location = (yylsp[(1) - (7)]); + n->source = (yyvsp[-5].node); + n->aggrs = (yyvsp[-3].list); + n->groups = (yyvsp[0].list); + n->location = (yylsp[-6]); res->pivot = n; (yyval.node) = (PGNode *)res; - ;} + } +#line 23630 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 540: + case 542: /* simple_select: pivot_keyword table_ref GROUP_P BY name_list_opt_comma_opt_bracket */ #line 297 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); - n->source = (yyvsp[(2) - (5)].node); - n->groups = (yyvsp[(5) - (5)].list); - n->location = (yylsp[(1) - (5)]); + n->source = (yyvsp[-3].node); + n->groups = (yyvsp[0].list); + n->location = (yylsp[-4]); res->pivot = n; (yyval.node) = (PGNode *)res; - ;} + } +#line 23644 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 541: + case 543: /* simple_select: pivot_keyword table_ref ON pivot_column_list */ #line 307 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); - n->source = (yyvsp[(2) - (4)].node); - n->columns = (yyvsp[(4) - (4)].list); + n->source = (yyvsp[-2].node); + n->columns = (yyvsp[0].list); res->pivot = n; (yyval.node) = (PGNode *)res; - ;} + } +#line 23657 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 542: + case 544: /* simple_select: pivot_keyword table_ref ON pivot_column_list GROUP_P BY name_list_opt_comma_opt_bracket */ #line 316 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); - n->source = (yyvsp[(2) - (7)].node); - n->columns = (yyvsp[(4) - (7)].list); - n->groups = (yyvsp[(7) - (7)].list); - n->location = (yylsp[(1) - (7)]); + n->source = (yyvsp[-5].node); + n->columns = (yyvsp[-3].list); + n->groups = (yyvsp[0].list); + n->location = (yylsp[-6]); res->pivot = n; (yyval.node) = (PGNode *)res; - ;} + } +#line 23672 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 543: + case 545: /* simple_select: pivot_keyword table_ref ON pivot_column_list USING target_list_opt_comma */ #line 327 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); - n->source = (yyvsp[(2) - (6)].node); - n->columns = (yyvsp[(4) - (6)].list); - n->aggrs = (yyvsp[(6) - (6)].list); - n->location = (yylsp[(1) - (6)]); + n->source = (yyvsp[-4].node); + n->columns = (yyvsp[-2].list); + n->aggrs = (yyvsp[0].list); + n->location = (yylsp[-5]); res->pivot = n; (yyval.node) = (PGNode *)res; - ;} + } +#line 23687 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 544: + case 546: /* simple_select: pivot_keyword table_ref ON pivot_column_list USING target_list_opt_comma GROUP_P BY name_list_opt_comma_opt_bracket */ #line 338 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); - n->source = (yyvsp[(2) - (9)].node); - n->columns = (yyvsp[(4) - (9)].list); - n->aggrs = (yyvsp[(6) - (9)].list); - n->groups = (yyvsp[(9) - (9)].list); - n->location = (yylsp[(1) - (9)]); + n->source = (yyvsp[-7].node); + n->columns = (yyvsp[-5].list); + n->aggrs = (yyvsp[-3].list); + n->groups = (yyvsp[0].list); + n->location = (yylsp[-8]); res->pivot = n; (yyval.node) = (PGNode *)res; - ;} + } +#line 23703 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 545: + case 547: /* simple_select: unpivot_keyword table_ref ON target_list_opt_comma INTO NAME_P name value_or_values name_list_opt_comma_opt_bracket */ #line 350 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); - n->source = (yyvsp[(2) - (9)].node); - n->unpivots = (yyvsp[(9) - (9)].list); - n->location = (yylsp[(1) - (9)]); + n->source = (yyvsp[-7].node); + n->unpivots = (yyvsp[0].list); + n->location = (yylsp[-8]); PGPivot *piv = makeNode(PGPivot); - piv->unpivot_columns = list_make1(makeString((yyvsp[(7) - (9)].str))); - piv->pivot_value = (yyvsp[(4) - (9)].list); + piv->unpivot_columns = list_make1(makeString((yyvsp[-2].str))); + piv->pivot_value = (yyvsp[-5].list); n->columns = list_make1(piv); res->pivot = n; (yyval.node) = (PGNode *)res; - ;} + } +#line 23722 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 546: + case 548: /* simple_select: unpivot_keyword table_ref ON target_list_opt_comma */ #line 365 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *res = makeNode(PGSelectStmt); PGPivotStmt *n = makeNode(PGPivotStmt); - n->source = (yyvsp[(2) - (4)].node); + n->source = (yyvsp[-2].node); n->unpivots = list_make1(makeString("value")); - n->location = (yylsp[(1) - (4)]); + n->location = (yylsp[-3]); PGPivot *piv = makeNode(PGPivot); piv->unpivot_columns = list_make1(makeString("name")); - piv->pivot_value = (yyvsp[(4) - (4)].list); + piv->pivot_value = (yyvsp[0].list); n->columns = list_make1(piv); res->pivot = n; (yyval.node) = (PGNode *)res; - ;} + } +#line 23741 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 553: + case 555: /* pivot_column_entry: b_expr */ #line 395 "third_party/libpg_query/grammar/statements/select.y" - { + { PGPivot *n = makeNode(PGPivot); - n->pivot_columns = list_make1((yyvsp[(1) - (1)].node)); + n->pivot_columns = list_make1((yyvsp[0].node)); (yyval.node) = (PGNode *) n; - ;} + } +#line 23751 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 554: + case 556: /* pivot_column_entry: b_expr IN_P '(' select_no_parens ')' */ #line 401 "third_party/libpg_query/grammar/statements/select.y" - { + { PGPivot *n = makeNode(PGPivot); - n->pivot_columns = list_make1((yyvsp[(1) - (5)].node)); - n->subquery = (yyvsp[(4) - (5)].node); + n->pivot_columns = list_make1((yyvsp[-4].node)); + n->subquery = (yyvsp[-1].node); (yyval.node) = (PGNode *) n; - ;} + } +#line 23762 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 555: + case 557: /* pivot_column_entry: single_pivot_value */ #line 407 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 23768 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 556: + case 558: /* pivot_column_list_internal: pivot_column_entry */ #line 411 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 23774 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 557: + case 559: /* pivot_column_list_internal: pivot_column_list_internal ',' pivot_column_entry */ #line 412 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } +#line 23780 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 558: + case 560: /* pivot_column_list: pivot_column_list_internal */ #line 416 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 23786 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 559: + case 561: /* pivot_column_list: pivot_column_list_internal ',' */ #line 417 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 23792 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 560: + case 562: /* with_clause: WITH cte_list */ #line 432 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.with) = makeNode(PGWithClause); - (yyval.with)->ctes = (yyvsp[(2) - (2)].list); + (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = false; - (yyval.with)->location = (yylsp[(1) - (2)]); - ;} + (yyval.with)->location = (yylsp[-1]); + } +#line 23803 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 561: + case 563: /* with_clause: WITH_LA cte_list */ #line 439 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.with) = makeNode(PGWithClause); - (yyval.with)->ctes = (yyvsp[(2) - (2)].list); + (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = false; - (yyval.with)->location = (yylsp[(1) - (2)]); - ;} + (yyval.with)->location = (yylsp[-1]); + } +#line 23814 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 562: + case 564: /* with_clause: WITH RECURSIVE cte_list */ #line 446 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.with) = makeNode(PGWithClause); - (yyval.with)->ctes = (yyvsp[(3) - (3)].list); + (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = true; - (yyval.with)->location = (yylsp[(1) - (3)]); - ;} + (yyval.with)->location = (yylsp[-2]); + } +#line 23825 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 563: + case 565: /* cte_list: common_table_expr */ #line 455 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 23831 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 564: + case 566: /* cte_list: cte_list ',' common_table_expr */ #line 456 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } +#line 23837 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 565: + case 567: /* common_table_expr: name opt_name_list AS opt_materialized '(' PreparableStmt ')' */ #line 460 "third_party/libpg_query/grammar/statements/select.y" - { + { PGCommonTableExpr *n = makeNode(PGCommonTableExpr); - n->ctename = (yyvsp[(1) - (7)].str); - n->aliascolnames = (yyvsp[(2) - (7)].list); - n->ctematerialized = (yyvsp[(4) - (7)].ctematerialize); - n->ctequery = (yyvsp[(6) - (7)].node); - n->location = (yylsp[(1) - (7)]); + n->ctename = (yyvsp[-6].str); + n->aliascolnames = (yyvsp[-5].list); + n->ctematerialized = (yyvsp[-3].ctematerialize); + n->ctequery = (yyvsp[-1].node); + n->location = (yylsp[-6]); (yyval.node) = (PGNode *) n; - ;} + } +#line 23851 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 566: + case 568: /* opt_materialized: MATERIALIZED */ #line 472 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ctematerialize) = PGCTEMaterializeAlways; ;} + { (yyval.ctematerialize) = PGCTEMaterializeAlways; } +#line 23857 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 567: + case 569: /* opt_materialized: NOT MATERIALIZED */ #line 473 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ctematerialize) = PGCTEMaterializeNever; ;} + { (yyval.ctematerialize) = PGCTEMaterializeNever; } +#line 23863 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 568: + case 570: /* opt_materialized: %empty */ #line 474 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ctematerialize) = PGCTEMaterializeDefault; ;} + { (yyval.ctematerialize) = PGCTEMaterializeDefault; } +#line 23869 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 569: + case 571: /* into_clause: INTO OptTempTableName */ #line 479 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.into) = makeNode(PGIntoClause); - (yyval.into)->rel = (yyvsp[(2) - (2)].range); + (yyval.into)->rel = (yyvsp[0].range); (yyval.into)->colNames = NIL; (yyval.into)->options = NIL; (yyval.into)->onCommit = PG_ONCOMMIT_NOOP; (yyval.into)->viewQuery = NULL; (yyval.into)->skipData = false; - ;} + } +#line 23883 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 570: + case 572: /* into_clause: %empty */ #line 489 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.into) = NULL; ;} + { (yyval.into) = NULL; } +#line 23889 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 571: + case 573: /* OptTempTableName: TEMPORARY opt_table qualified_name */ #line 498 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.range) = (yyvsp[(3) - (3)].range); + { + (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_TEMP; - ;} + } +#line 23898 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 572: + case 574: /* OptTempTableName: TEMP opt_table qualified_name */ #line 503 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.range) = (yyvsp[(3) - (3)].range); + { + (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_TEMP; - ;} + } +#line 23907 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 573: + case 575: /* OptTempTableName: LOCAL TEMPORARY opt_table qualified_name */ #line 508 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.range) = (yyvsp[(4) - (4)].range); + { + (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_TEMP; - ;} + } +#line 23916 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 574: + case 576: /* OptTempTableName: LOCAL TEMP opt_table qualified_name */ #line 513 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.range) = (yyvsp[(4) - (4)].range); + { + (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_TEMP; - ;} + } +#line 23925 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 575: + case 577: /* OptTempTableName: GLOBAL TEMPORARY opt_table qualified_name */ #line 518 "third_party/libpg_query/grammar/statements/select.y" - { + { ereport(PGWARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition((yylsp[(1) - (4)])))); - (yyval.range) = (yyvsp[(4) - (4)].range); + parser_errposition((yylsp[-3])))); + (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_TEMP; - ;} + } +#line 23937 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 576: + case 578: /* OptTempTableName: GLOBAL TEMP opt_table qualified_name */ #line 526 "third_party/libpg_query/grammar/statements/select.y" - { + { ereport(PGWARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), - parser_errposition((yylsp[(1) - (4)])))); - (yyval.range) = (yyvsp[(4) - (4)].range); + parser_errposition((yylsp[-3])))); + (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_TEMP; - ;} + } +#line 23949 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 577: + case 579: /* OptTempTableName: UNLOGGED opt_table qualified_name */ #line 534 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.range) = (yyvsp[(3) - (3)].range); + { + (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = PG_RELPERSISTENCE_UNLOGGED; - ;} + } +#line 23958 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 578: + case 580: /* OptTempTableName: TABLE qualified_name */ #line 539 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.range) = (yyvsp[(2) - (2)].range); + { + (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; - ;} + } +#line 23967 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 579: + case 581: /* OptTempTableName: qualified_name */ #line 544 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.range) = (yyvsp[(1) - (1)].range); + { + (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; - ;} + } +#line 23976 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 580: + case 582: /* opt_table: TABLE */ #line 550 "third_party/libpg_query/grammar/statements/select.y" - {;} + {} +#line 23982 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 581: + case 583: /* opt_table: %empty */ #line 551 "third_party/libpg_query/grammar/statements/select.y" - {;} + {} +#line 23988 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 582: + case 584: /* all_or_distinct: ALL */ #line 555 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 23994 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 583: + case 585: /* all_or_distinct: DISTINCT */ #line 556 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 24000 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 584: + case 586: /* all_or_distinct: %empty */ #line 557 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 24006 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 585: + case 587: /* by_name: BY NAME_P */ #line 561 "third_party/libpg_query/grammar/statements/select.y" - { ;} + { } +#line 24012 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 586: + case 588: /* distinct_clause: DISTINCT */ #line 568 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(NIL); ;} + { (yyval.list) = list_make1(NIL); } +#line 24018 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 587: + case 589: /* distinct_clause: DISTINCT ON '(' expr_list_opt_comma ')' */ #line 569 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(4) - (5)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 24024 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 588: + case 590: /* opt_all_clause: ALL */ #line 573 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL;;} + { (yyval.list) = NIL;} +#line 24030 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 589: + case 591: /* opt_all_clause: %empty */ #line 574 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 24036 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 590: + case 592: /* opt_ignore_nulls: IGNORE_P NULLS_P */ #line 578 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ignorenulls) = PG_IGNORE_NULLS;;} + { (yyval.ignorenulls) = PG_IGNORE_NULLS;} +#line 24042 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 591: + case 593: /* opt_ignore_nulls: RESPECT_P NULLS_P */ #line 579 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ignorenulls) = PG_RESPECT_NULLS;;} + { (yyval.ignorenulls) = PG_RESPECT_NULLS;} +#line 24048 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 592: + case 594: /* opt_ignore_nulls: %empty */ #line 580 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ignorenulls) = PG_DEFAULT_NULLS; ;} + { (yyval.ignorenulls) = PG_DEFAULT_NULLS; } +#line 24054 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 593: + case 595: /* opt_sort_clause: sort_clause */ #line 584 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list);;} + { (yyval.list) = (yyvsp[0].list);} +#line 24060 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 594: + case 596: /* opt_sort_clause: %empty */ #line 585 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 24066 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 595: + case 597: /* sort_clause: ORDER BY sortby_list */ #line 589 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (3)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 24072 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 596: + case 598: /* sort_clause: ORDER BY ALL opt_asc_desc opt_nulls_order */ #line 591 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSortBy *sort = makeNode(PGSortBy); PGAStar *star = makeNode(PGAStar); star->columns = true; - star->location = (yylsp[(3) - (5)]); + star->location = (yylsp[-2]); sort->node = (PGNode *) star; - sort->sortby_dir = (yyvsp[(4) - (5)].sortorder); - sort->sortby_nulls = (yyvsp[(5) - (5)].nullorder); + sort->sortby_dir = (yyvsp[-1].sortorder); + sort->sortby_nulls = (yyvsp[0].nullorder); sort->useOp = NIL; sort->location = -1; /* no operator */ (yyval.list) = list_make1(sort); - ;} + } +#line 24089 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 597: + case 599: /* sortby_list: sortby */ #line 606 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].sortby)); ;} + { (yyval.list) = list_make1((yyvsp[0].sortby)); } +#line 24095 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 598: + case 600: /* sortby_list: sortby_list ',' sortby */ #line 607 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].sortby)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].sortby)); } +#line 24101 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 599: + case 601: /* sortby: a_expr USING qual_all_Op opt_nulls_order */ #line 611 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.sortby) = makeNode(PGSortBy); - (yyval.sortby)->node = (yyvsp[(1) - (4)].node); + (yyval.sortby)->node = (yyvsp[-3].node); (yyval.sortby)->sortby_dir = SORTBY_USING; - (yyval.sortby)->sortby_nulls = (yyvsp[(4) - (4)].nullorder); - (yyval.sortby)->useOp = (yyvsp[(3) - (4)].list); - (yyval.sortby)->location = (yylsp[(3) - (4)]); - ;} + (yyval.sortby)->sortby_nulls = (yyvsp[0].nullorder); + (yyval.sortby)->useOp = (yyvsp[-1].list); + (yyval.sortby)->location = (yylsp[-1]); + } +#line 24114 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 600: + case 602: /* sortby: a_expr opt_asc_desc opt_nulls_order */ #line 620 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.sortby) = makeNode(PGSortBy); - (yyval.sortby)->node = (yyvsp[(1) - (3)].node); - (yyval.sortby)->sortby_dir = (yyvsp[(2) - (3)].sortorder); - (yyval.sortby)->sortby_nulls = (yyvsp[(3) - (3)].nullorder); + (yyval.sortby)->node = (yyvsp[-2].node); + (yyval.sortby)->sortby_dir = (yyvsp[-1].sortorder); + (yyval.sortby)->sortby_nulls = (yyvsp[0].nullorder); (yyval.sortby)->useOp = NIL; (yyval.sortby)->location = -1; /* no operator */ - ;} + } +#line 24127 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 601: + case 603: /* opt_asc_desc: ASC_P */ #line 630 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.sortorder) = PG_SORTBY_ASC; ;} + { (yyval.sortorder) = PG_SORTBY_ASC; } +#line 24133 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 602: + case 604: /* opt_asc_desc: DESC_P */ #line 631 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.sortorder) = PG_SORTBY_DESC; ;} + { (yyval.sortorder) = PG_SORTBY_DESC; } +#line 24139 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 603: + case 605: /* opt_asc_desc: %empty */ #line 632 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.sortorder) = PG_SORTBY_DEFAULT; ;} + { (yyval.sortorder) = PG_SORTBY_DEFAULT; } +#line 24145 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 604: + case 606: /* opt_nulls_order: NULLS_LA FIRST_P */ #line 635 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.nullorder) = PG_SORTBY_NULLS_FIRST; ;} + { (yyval.nullorder) = PG_SORTBY_NULLS_FIRST; } +#line 24151 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 605: + case 607: /* opt_nulls_order: NULLS_LA LAST_P */ #line 636 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.nullorder) = PG_SORTBY_NULLS_LAST; ;} + { (yyval.nullorder) = PG_SORTBY_NULLS_LAST; } +#line 24157 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 606: + case 608: /* opt_nulls_order: %empty */ #line 637 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.nullorder) = PG_SORTBY_NULLS_DEFAULT; ;} + { (yyval.nullorder) = PG_SORTBY_NULLS_DEFAULT; } +#line 24163 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 607: + case 609: /* select_limit: limit_clause offset_clause */ #line 641 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make2((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].node)); ;} + { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-1].node)); } +#line 24169 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 608: + case 610: /* select_limit: offset_clause limit_clause */ #line 642 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make2((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); ;} + { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].node)); } +#line 24175 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 609: + case 611: /* select_limit: limit_clause */ #line 643 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make2(NULL, (yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make2(NULL, (yyvsp[0].node)); } +#line 24181 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 610: + case 612: /* select_limit: offset_clause */ #line 644 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make2((yyvsp[(1) - (1)].node), NULL); ;} + { (yyval.list) = list_make2((yyvsp[0].node), NULL); } +#line 24187 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 611: + case 613: /* opt_select_limit: select_limit */ #line 648 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 24193 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 612: + case 614: /* opt_select_limit: %empty */ #line 649 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make2(NULL,NULL); ;} + { (yyval.list) = list_make2(NULL,NULL); } +#line 24199 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 613: + case 615: /* limit_clause: LIMIT select_limit_value */ #line 654 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24205 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 614: + case 616: /* limit_clause: LIMIT select_limit_value ',' select_offset_value */ #line 656 "third_party/libpg_query/grammar/statements/select.y" - { + { /* Disabled because it was too confusing, bjm 2002-02-18 */ ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("LIMIT #,# syntax is not supported"), errhint("Use separate LIMIT and OFFSET clauses."), - parser_errposition((yylsp[(1) - (4)])))); - ;} + parser_errposition((yylsp[-3])))); + } +#line 24218 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 615: + case 617: /* limit_clause: FETCH first_or_next select_fetch_first_value row_or_rows ONLY */ #line 672 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(3) - (5)].node); ;} + { (yyval.node) = (yyvsp[-2].node); } +#line 24224 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 616: + case 618: /* limit_clause: FETCH first_or_next row_or_rows ONLY */ #line 674 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeIntConst(1, -1); ;} + { (yyval.node) = makeIntConst(1, -1); } +#line 24230 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 617: + case 619: /* offset_clause: OFFSET select_offset_value */ #line 679 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24236 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 618: + case 620: /* offset_clause: OFFSET select_fetch_first_value row_or_rows */ #line 682 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (3)].node); ;} + { (yyval.node) = (yyvsp[-1].node); } +#line 24242 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 619: + case 621: /* sample_count: FCONST '%' */ #line 690 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSampleSize(makeFloat((yyvsp[(1) - (2)].str)), true); - ;} + { + (yyval.node) = makeSampleSize(makeFloat((yyvsp[-1].str)), true); + } +#line 24250 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 620: + case 622: /* sample_count: ICONST '%' */ #line 694 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSampleSize(makeInteger((yyvsp[(1) - (2)].ival)), true); - ;} + { + (yyval.node) = makeSampleSize(makeInteger((yyvsp[-1].ival)), true); + } +#line 24258 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 621: + case 623: /* sample_count: FCONST PERCENT */ #line 698 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSampleSize(makeFloat((yyvsp[(1) - (2)].str)), true); - ;} + { + (yyval.node) = makeSampleSize(makeFloat((yyvsp[-1].str)), true); + } +#line 24266 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 622: + case 624: /* sample_count: ICONST PERCENT */ #line 702 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSampleSize(makeInteger((yyvsp[(1) - (2)].ival)), true); - ;} + { + (yyval.node) = makeSampleSize(makeInteger((yyvsp[-1].ival)), true); + } +#line 24274 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 623: + case 625: /* sample_count: ICONST */ #line 706 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSampleSize(makeInteger((yyvsp[(1) - (1)].ival)), false); - ;} + { + (yyval.node) = makeSampleSize(makeInteger((yyvsp[0].ival)), false); + } +#line 24282 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 624: + case 626: /* sample_count: ICONST ROWS */ #line 710 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSampleSize(makeInteger((yyvsp[(1) - (2)].ival)), false); - ;} + { + (yyval.node) = makeSampleSize(makeInteger((yyvsp[-1].ival)), false); + } +#line 24290 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 625: + case 627: /* sample_clause: USING SAMPLE tablesample_entry */ #line 717 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (yyvsp[(3) - (3)].node); - ;} + { + (yyval.node) = (yyvsp[0].node); + } +#line 24298 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 626: + case 628: /* sample_clause: %empty */ #line 721 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 24304 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 627: + case 629: /* opt_sample_func: ColId */ #line 728 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 24310 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 628: + case 630: /* opt_sample_func: %empty */ #line 729 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = NULL; ;} + { (yyval.str) = NULL; } +#line 24316 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 629: + case 631: /* tablesample_entry: opt_sample_func '(' sample_count ')' opt_repeatable_clause */ #line 734 "third_party/libpg_query/grammar/statements/select.y" - { - int seed = (yyvsp[(5) - (5)].ival); - (yyval.node) = makeSampleOptions((yyvsp[(3) - (5)].node), (yyvsp[(1) - (5)].str), &seed, (yylsp[(1) - (5)])); - ;} + { + int seed = (yyvsp[0].ival); + (yyval.node) = makeSampleOptions((yyvsp[-2].node), (yyvsp[-4].str), &seed, (yylsp[-4])); + } +#line 24325 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 630: + case 632: /* tablesample_entry: sample_count */ #line 739 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSampleOptions((yyvsp[(1) - (1)].node), NULL, NULL, (yylsp[(1) - (1)])); - ;} + { + (yyval.node) = makeSampleOptions((yyvsp[0].node), NULL, NULL, (yylsp[0])); + } +#line 24333 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 631: + case 633: /* tablesample_entry: sample_count '(' ColId ')' */ #line 743 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeSampleOptions((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].str), NULL, (yylsp[(1) - (4)])); - ;} + { + (yyval.node) = makeSampleOptions((yyvsp[-3].node), (yyvsp[-1].str), NULL, (yylsp[-3])); + } +#line 24341 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 632: + case 634: /* tablesample_entry: sample_count '(' ColId ',' ICONST ')' */ #line 747 "third_party/libpg_query/grammar/statements/select.y" - { - int seed = (yyvsp[(5) - (6)].ival); - (yyval.node) = makeSampleOptions((yyvsp[(1) - (6)].node), (yyvsp[(3) - (6)].str), &seed, (yylsp[(1) - (6)])); - ;} + { + int seed = (yyvsp[-1].ival); + (yyval.node) = makeSampleOptions((yyvsp[-5].node), (yyvsp[-3].str), &seed, (yylsp[-5])); + } +#line 24350 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 633: + case 635: /* tablesample_clause: TABLESAMPLE tablesample_entry */ #line 755 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (yyvsp[(2) - (2)].node); - ;} + { + (yyval.node) = (yyvsp[0].node); + } +#line 24358 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 634: + case 636: /* opt_tablesample_clause: tablesample_clause */ #line 761 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24364 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 635: + case 637: /* opt_tablesample_clause: %empty */ #line 762 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 24370 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 636: + case 638: /* opt_repeatable_clause: REPEATABLE '(' ICONST ')' */ #line 767 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = (yyvsp[(3) - (4)].ival); ;} + { (yyval.ival) = (yyvsp[-1].ival); } +#line 24376 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 637: + case 639: /* opt_repeatable_clause: %empty */ #line 768 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = -1; ;} + { (yyval.ival) = -1; } +#line 24382 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 638: + case 640: /* select_limit_value: a_expr */ #line 772 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24388 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 639: + case 641: /* select_limit_value: ALL */ #line 774 "third_party/libpg_query/grammar/statements/select.y" - { + { /* LIMIT ALL is represented as a NULL constant */ - (yyval.node) = makeNullAConst((yylsp[(1) - (1)])); - ;} + (yyval.node) = makeNullAConst((yylsp[0])); + } +#line 24397 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 640: + case 642: /* select_limit_value: a_expr '%' */ #line 779 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeLimitPercent((yyvsp[(1) - (2)].node)); ;} + { (yyval.node) = makeLimitPercent((yyvsp[-1].node)); } +#line 24403 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 641: + case 643: /* select_limit_value: FCONST PERCENT */ #line 781 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeLimitPercent(makeFloatConst((yyvsp[(1) - (2)].str),(yylsp[(1) - (2)]))); ;} + { (yyval.node) = makeLimitPercent(makeFloatConst((yyvsp[-1].str),(yylsp[-1]))); } +#line 24409 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 642: + case 644: /* select_limit_value: ICONST PERCENT */ #line 783 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeLimitPercent(makeIntConst((yyvsp[(1) - (2)].ival),(yylsp[(1) - (2)]))); ;} + { (yyval.node) = makeLimitPercent(makeIntConst((yyvsp[-1].ival),(yylsp[-1]))); } +#line 24415 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 643: + case 645: /* select_offset_value: a_expr */ #line 787 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24421 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 644: + case 646: /* select_fetch_first_value: c_expr */ #line 807 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24427 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 645: + case 647: /* select_fetch_first_value: '+' I_or_F_const */ #line 809 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", NULL, (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } +#line 24433 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 646: + case 648: /* select_fetch_first_value: '-' I_or_F_const */ #line 811 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = doNegate((yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} + { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } +#line 24439 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 647: + case 649: /* I_or_F_const: Iconst */ #line 815 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeIntConst((yyvsp[(1) - (1)].ival),(yylsp[(1) - (1)])); ;} + { (yyval.node) = makeIntConst((yyvsp[0].ival),(yylsp[0])); } +#line 24445 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 648: + case 650: /* I_or_F_const: FCONST */ #line 816 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeFloatConst((yyvsp[(1) - (1)].str),(yylsp[(1) - (1)])); ;} + { (yyval.node) = makeFloatConst((yyvsp[0].str),(yylsp[0])); } +#line 24451 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 649: + case 651: /* row_or_rows: ROW */ #line 820 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = 0; ;} + { (yyval.ival) = 0; } +#line 24457 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 650: + case 652: /* row_or_rows: ROWS */ #line 821 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = 0; ;} + { (yyval.ival) = 0; } +#line 24463 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 651: + case 653: /* first_or_next: FIRST_P */ #line 824 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = 0; ;} + { (yyval.ival) = 0; } +#line 24469 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 652: + case 654: /* first_or_next: NEXT */ #line 825 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = 0; ;} + { (yyval.ival) = 0; } +#line 24475 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 653: + case 655: /* group_clause: GROUP_P BY group_by_list_opt_comma */ #line 850 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (3)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 24481 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 654: + case 656: /* group_clause: GROUP_P BY ALL */ #line 852 "third_party/libpg_query/grammar/statements/select.y" - { - PGNode *node = (PGNode *) makeGroupingSet(GROUPING_SET_ALL, NIL, (yylsp[(3) - (3)])); + { + PGNode *node = (PGNode *) makeGroupingSet(GROUPING_SET_ALL, NIL, (yylsp[0])); (yyval.list) = list_make1(node); - ;} + } +#line 24490 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 655: + case 657: /* group_clause: %empty */ #line 856 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 24496 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 656: + case 658: /* group_by_list: group_by_item */ #line 860 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 24502 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 657: + case 659: /* group_by_list: group_by_list ',' group_by_item */ #line 861 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list),(yyvsp[(3) - (3)].node)); ;} + { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].node)); } +#line 24508 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 658: + case 660: /* group_by_list_opt_comma: group_by_list */ #line 865 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 24514 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 659: + case 661: /* group_by_list_opt_comma: group_by_list ',' */ #line 866 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 24520 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 660: + case 662: /* group_by_item: a_expr */ #line 870 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24526 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 661: + case 663: /* group_by_item: empty_grouping_set */ #line 871 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24532 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 662: + case 664: /* group_by_item: cube_clause */ #line 872 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24538 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 663: + case 665: /* group_by_item: rollup_clause */ #line 873 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24544 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 664: + case 666: /* group_by_item: grouping_sets_clause */ #line 874 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24550 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 665: + case 667: /* empty_grouping_set: '(' ')' */ #line 879 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_EMPTY, NIL, (yylsp[(1) - (2)])); - ;} + { + (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_EMPTY, NIL, (yylsp[-1])); + } +#line 24558 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 666: + case 668: /* rollup_clause: ROLLUP '(' expr_list_opt_comma ')' */ #line 892 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_ROLLUP, (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); - ;} + { + (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_ROLLUP, (yyvsp[-1].list), (yylsp[-3])); + } +#line 24566 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 667: + case 669: /* cube_clause: CUBE '(' expr_list_opt_comma ')' */ #line 899 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_CUBE, (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); - ;} + { + (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_CUBE, (yyvsp[-1].list), (yylsp[-3])); + } +#line 24574 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 668: + case 670: /* grouping_sets_clause: GROUPING SETS '(' group_by_list_opt_comma ')' */ #line 906 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_SETS, (yyvsp[(4) - (5)].list), (yylsp[(1) - (5)])); - ;} + { + (yyval.node) = (PGNode *) makeGroupingSet(GROUPING_SET_SETS, (yyvsp[-1].list), (yylsp[-4])); + } +#line 24582 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 669: + case 671: /* grouping_or_grouping_id: GROUPING */ #line 912 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 24588 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 670: + case 672: /* grouping_or_grouping_id: GROUPING_ID */ #line 913 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 24594 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 671: + case 673: /* having_clause: HAVING a_expr */ #line 917 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24600 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 672: + case 674: /* having_clause: %empty */ #line 918 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 24606 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 673: + case 675: /* qualify_clause: QUALIFY a_expr */ #line 922 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24612 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 674: + case 676: /* qualify_clause: %empty */ #line 923 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 24618 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 675: + case 677: /* for_locking_clause: for_locking_items */ #line 927 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 24624 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 676: + case 678: /* for_locking_clause: FOR READ_P ONLY */ #line 928 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 24630 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 677: + case 679: /* opt_for_locking_clause: for_locking_clause */ #line 932 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 24636 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 678: + case 680: /* opt_for_locking_clause: %empty */ #line 933 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 24642 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 679: + case 681: /* for_locking_items: for_locking_item */ #line 937 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 24648 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 680: + case 682: /* for_locking_items: for_locking_items for_locking_item */ #line 938 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} + { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } +#line 24654 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 681: + case 683: /* for_locking_item: for_locking_strength locked_rels_list opt_nowait_or_skip */ #line 943 "third_party/libpg_query/grammar/statements/select.y" - { + { PGLockingClause *n = makeNode(PGLockingClause); - n->lockedRels = (yyvsp[(2) - (3)].list); - n->strength = (yyvsp[(1) - (3)].lockstrength); - n->waitPolicy = (yyvsp[(3) - (3)].lockwaitpolicy); + n->lockedRels = (yyvsp[-1].list); + n->strength = (yyvsp[-2].lockstrength); + n->waitPolicy = (yyvsp[0].lockwaitpolicy); (yyval.node) = (PGNode *) n; - ;} + } +#line 24666 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 682: + case 684: /* for_locking_strength: FOR UPDATE */ #line 953 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.lockstrength) = LCS_FORUPDATE; ;} + { (yyval.lockstrength) = LCS_FORUPDATE; } +#line 24672 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 683: + case 685: /* for_locking_strength: FOR NO KEY UPDATE */ #line 954 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.lockstrength) = PG_LCS_FORNOKEYUPDATE; ;} + { (yyval.lockstrength) = PG_LCS_FORNOKEYUPDATE; } +#line 24678 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 684: + case 686: /* for_locking_strength: FOR SHARE */ #line 955 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.lockstrength) = PG_LCS_FORSHARE; ;} + { (yyval.lockstrength) = PG_LCS_FORSHARE; } +#line 24684 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 685: + case 687: /* for_locking_strength: FOR KEY SHARE */ #line 956 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.lockstrength) = PG_LCS_FORKEYSHARE; ;} + { (yyval.lockstrength) = PG_LCS_FORKEYSHARE; } +#line 24690 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 686: + case 688: /* locked_rels_list: OF qualified_name_list */ #line 960 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(2) - (2)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 24696 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 687: + case 689: /* locked_rels_list: %empty */ #line 961 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 24702 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 688: + case 690: /* opt_nowait_or_skip: NOWAIT */ #line 966 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.lockwaitpolicy) = LockWaitError; ;} + { (yyval.lockwaitpolicy) = LockWaitError; } +#line 24708 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 689: + case 691: /* opt_nowait_or_skip: SKIP LOCKED */ #line 967 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.lockwaitpolicy) = PGLockWaitSkip; ;} + { (yyval.lockwaitpolicy) = PGLockWaitSkip; } +#line 24714 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 690: + case 692: /* opt_nowait_or_skip: %empty */ #line 968 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.lockwaitpolicy) = PGLockWaitBlock; ;} + { (yyval.lockwaitpolicy) = PGLockWaitBlock; } +#line 24720 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 691: + case 693: /* values_clause: VALUES '(' expr_list_opt_comma ')' */ #line 978 "third_party/libpg_query/grammar/statements/select.y" - { + { PGSelectStmt *n = makeNode(PGSelectStmt); - n->valuesLists = list_make1((yyvsp[(3) - (4)].list)); + n->valuesLists = list_make1((yyvsp[-1].list)); (yyval.node) = (PGNode *) n; - ;} + } +#line 24730 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 692: + case 694: /* values_clause: values_clause ',' '(' expr_list_opt_comma ')' */ #line 984 "third_party/libpg_query/grammar/statements/select.y" - { - PGSelectStmt *n = (PGSelectStmt *) (yyvsp[(1) - (5)].node); - n->valuesLists = lappend(n->valuesLists, (yyvsp[(4) - (5)].list)); + { + PGSelectStmt *n = (PGSelectStmt *) (yyvsp[-4].node); + n->valuesLists = lappend(n->valuesLists, (yyvsp[-1].list)); (yyval.node) = (PGNode *) n; - ;} + } +#line 24740 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 693: + case 695: /* values_clause_opt_comma: values_clause */ #line 992 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 24746 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 694: + case 696: /* values_clause_opt_comma: values_clause ',' */ #line 993 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (2)].node); ;} + { (yyval.node) = (yyvsp[-1].node); } +#line 24752 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 695: + case 697: /* from_clause: FROM from_list_opt_comma */ #line 1006 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(2) - (2)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 24758 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 696: + case 698: /* from_clause: %empty */ #line 1007 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 24764 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 697: + case 699: /* from_list: table_ref */ #line 1011 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 24770 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 698: + case 700: /* from_list: from_list ',' table_ref */ #line 1012 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } +#line 24776 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 699: + case 701: /* from_list_opt_comma: from_list */ #line 1016 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 24782 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 700: + case 702: /* from_list_opt_comma: from_list ',' */ #line 1017 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 24788 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 701: + case 703: /* table_ref: relation_expr opt_alias_clause opt_tablesample_clause */ #line 1024 "third_party/libpg_query/grammar/statements/select.y" - { - (yyvsp[(1) - (3)].range)->alias = (yyvsp[(2) - (3)].alias); - (yyvsp[(1) - (3)].range)->sample = (yyvsp[(3) - (3)].node); - (yyval.node) = (PGNode *) (yyvsp[(1) - (3)].range); - ;} + { + (yyvsp[-2].range)->alias = (yyvsp[-1].alias); + (yyvsp[-2].range)->sample = (yyvsp[0].node); + (yyval.node) = (PGNode *) (yyvsp[-2].range); + } +#line 24798 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 702: + case 704: /* table_ref: func_table func_alias_clause opt_tablesample_clause */ #line 1030 "third_party/libpg_query/grammar/statements/select.y" - { - PGRangeFunction *n = (PGRangeFunction *) (yyvsp[(1) - (3)].node); - n->alias = (PGAlias*) linitial((yyvsp[(2) - (3)].list)); - n->coldeflist = (PGList*) lsecond((yyvsp[(2) - (3)].list)); - n->sample = (yyvsp[(3) - (3)].node); + { + PGRangeFunction *n = (PGRangeFunction *) (yyvsp[-2].node); + n->alias = (PGAlias*) linitial((yyvsp[-1].list)); + n->coldeflist = (PGList*) lsecond((yyvsp[-1].list)); + n->sample = (yyvsp[0].node); (yyval.node) = (PGNode *) n; - ;} + } +#line 24810 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 703: + case 705: /* table_ref: values_clause_opt_comma alias_clause opt_tablesample_clause */ #line 1038 "third_party/libpg_query/grammar/statements/select.y" - { + { PGRangeSubselect *n = makeNode(PGRangeSubselect); n->lateral = false; - n->subquery = (yyvsp[(1) - (3)].node); - n->alias = (yyvsp[(2) - (3)].alias); - n->sample = (yyvsp[(3) - (3)].node); + n->subquery = (yyvsp[-2].node); + n->alias = (yyvsp[-1].alias); + n->sample = (yyvsp[0].node); (yyval.node) = (PGNode *) n; - ;} + } +#line 24823 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 704: + case 706: /* table_ref: LATERAL_P func_table func_alias_clause */ #line 1047 "third_party/libpg_query/grammar/statements/select.y" - { - PGRangeFunction *n = (PGRangeFunction *) (yyvsp[(2) - (3)].node); + { + PGRangeFunction *n = (PGRangeFunction *) (yyvsp[-1].node); n->lateral = true; - n->alias = (PGAlias*) linitial((yyvsp[(3) - (3)].list)); - n->coldeflist = (PGList*) lsecond((yyvsp[(3) - (3)].list)); + n->alias = (PGAlias*) linitial((yyvsp[0].list)); + n->coldeflist = (PGList*) lsecond((yyvsp[0].list)); (yyval.node) = (PGNode *) n; - ;} + } +#line 24835 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 705: + case 707: /* table_ref: select_with_parens opt_alias_clause opt_tablesample_clause */ #line 1055 "third_party/libpg_query/grammar/statements/select.y" - { + { PGRangeSubselect *n = makeNode(PGRangeSubselect); n->lateral = false; - n->subquery = (yyvsp[(1) - (3)].node); - n->alias = (yyvsp[(2) - (3)].alias); - n->sample = (yyvsp[(3) - (3)].node); + n->subquery = (yyvsp[-2].node); + n->alias = (yyvsp[-1].alias); + n->sample = (yyvsp[0].node); (yyval.node) = (PGNode *) n; - ;} + } +#line 24848 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 706: + case 708: /* table_ref: LATERAL_P select_with_parens opt_alias_clause */ #line 1064 "third_party/libpg_query/grammar/statements/select.y" - { + { PGRangeSubselect *n = makeNode(PGRangeSubselect); n->lateral = true; - n->subquery = (yyvsp[(2) - (3)].node); - n->alias = (yyvsp[(3) - (3)].alias); + n->subquery = (yyvsp[-1].node); + n->alias = (yyvsp[0].alias); n->sample = NULL; (yyval.node) = (PGNode *) n; - ;} + } +#line 24861 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 707: + case 709: /* table_ref: joined_table */ #line 1073 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) (yyvsp[(1) - (1)].jexpr); - ;} + { + (yyval.node) = (PGNode *) (yyvsp[0].jexpr); + } +#line 24869 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 708: + case 710: /* table_ref: '(' joined_table ')' alias_clause */ #line 1077 "third_party/libpg_query/grammar/statements/select.y" - { - (yyvsp[(2) - (4)].jexpr)->alias = (yyvsp[(4) - (4)].alias); - (yyval.node) = (PGNode *) (yyvsp[(2) - (4)].jexpr); - ;} + { + (yyvsp[-2].jexpr)->alias = (yyvsp[0].alias); + (yyval.node) = (PGNode *) (yyvsp[-2].jexpr); + } +#line 24878 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 709: + case 711: /* table_ref: table_ref PIVOT '(' target_list_opt_comma FOR pivot_value_list opt_pivot_group_by ')' opt_alias_clause */ #line 1082 "third_party/libpg_query/grammar/statements/select.y" - { + { PGPivotExpr *n = makeNode(PGPivotExpr); - n->source = (yyvsp[(1) - (9)].node); - n->aggrs = (yyvsp[(4) - (9)].list); - n->pivots = (yyvsp[(6) - (9)].list); - n->groups = (yyvsp[(7) - (9)].list); - n->alias = (yyvsp[(9) - (9)].alias); - n->location = (yylsp[(2) - (9)]); + n->source = (yyvsp[-8].node); + n->aggrs = (yyvsp[-5].list); + n->pivots = (yyvsp[-3].list); + n->groups = (yyvsp[-2].list); + n->alias = (yyvsp[0].alias); + n->location = (yylsp[-7]); (yyval.node) = (PGNode *) n; - ;} + } +#line 24893 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 710: + case 712: /* table_ref: table_ref UNPIVOT opt_include_nulls '(' unpivot_header FOR unpivot_value_list ')' opt_alias_clause */ #line 1093 "third_party/libpg_query/grammar/statements/select.y" - { + { PGPivotExpr *n = makeNode(PGPivotExpr); - n->source = (yyvsp[(1) - (9)].node); - n->include_nulls = (yyvsp[(3) - (9)].boolean); - n->unpivots = (yyvsp[(5) - (9)].list); - n->pivots = (yyvsp[(7) - (9)].list); - n->alias = (yyvsp[(9) - (9)].alias); - n->location = (yylsp[(2) - (9)]); + n->source = (yyvsp[-8].node); + n->include_nulls = (yyvsp[-6].boolean); + n->unpivots = (yyvsp[-4].list); + n->pivots = (yyvsp[-2].list); + n->alias = (yyvsp[0].alias); + n->location = (yylsp[-7]); (yyval.node) = (PGNode *) n; - ;} + } +#line 24908 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 711: + case 713: /* opt_pivot_group_by: GROUP_P BY name_list_opt_comma */ #line 1106 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (3)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 24914 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 712: + case 714: /* opt_pivot_group_by: %empty */ #line 1107 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NULL; ;} + { (yyval.list) = NULL; } +#line 24920 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 713: + case 715: /* opt_include_nulls: INCLUDE_P NULLS_P */ #line 1110 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 24926 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 714: + case 716: /* opt_include_nulls: EXCLUDE NULLS_P */ #line 1111 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 24932 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 715: + case 717: /* opt_include_nulls: %empty */ #line 1112 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 24938 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 716: + case 718: /* single_pivot_value: b_expr IN_P '(' target_list_opt_comma ')' */ #line 1116 "third_party/libpg_query/grammar/statements/select.y" - { + { PGPivot *n = makeNode(PGPivot); - n->pivot_columns = list_make1((yyvsp[(1) - (5)].node)); - n->pivot_value = (yyvsp[(4) - (5)].list); + n->pivot_columns = list_make1((yyvsp[-4].node)); + n->pivot_value = (yyvsp[-1].list); (yyval.node) = (PGNode *) n; - ;} + } +#line 24949 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 717: + case 719: /* single_pivot_value: b_expr IN_P ColIdOrString */ #line 1124 "third_party/libpg_query/grammar/statements/select.y" - { + { PGPivot *n = makeNode(PGPivot); - n->pivot_columns = list_make1((yyvsp[(1) - (3)].node)); - n->pivot_enum = (yyvsp[(3) - (3)].str); + n->pivot_columns = list_make1((yyvsp[-2].node)); + n->pivot_enum = (yyvsp[0].str); (yyval.node) = (PGNode *) n; - ;} + } +#line 24960 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 719: + case 721: /* pivot_header: d_expr */ #line 1133 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 24966 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 720: + case 722: /* pivot_header: indirection_expr */ #line 1134 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 24972 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 721: + case 723: /* pivot_header: '(' c_expr_list_opt_comma ')' */ #line 1135 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 24978 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 722: + case 724: /* pivot_value: pivot_header IN_P '(' target_list_opt_comma ')' */ #line 1139 "third_party/libpg_query/grammar/statements/select.y" - { + { PGPivot *n = makeNode(PGPivot); - n->pivot_columns = (yyvsp[(1) - (5)].list); - n->pivot_value = (yyvsp[(4) - (5)].list); + n->pivot_columns = (yyvsp[-4].list); + n->pivot_value = (yyvsp[-1].list); (yyval.node) = (PGNode *) n; - ;} + } +#line 24989 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 723: + case 725: /* pivot_value: pivot_header IN_P ColIdOrString */ #line 1147 "third_party/libpg_query/grammar/statements/select.y" - { + { PGPivot *n = makeNode(PGPivot); - n->pivot_columns = (yyvsp[(1) - (3)].list); - n->pivot_enum = (yyvsp[(3) - (3)].str); + n->pivot_columns = (yyvsp[-2].list); + n->pivot_enum = (yyvsp[0].str); (yyval.node) = (PGNode *) n; - ;} + } +#line 25000 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 724: + case 726: /* pivot_value_list: pivot_value */ #line 1156 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); - ;} + { + (yyval.list) = list_make1((yyvsp[0].node)); + } +#line 25008 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 725: + case 727: /* pivot_value_list: pivot_value_list pivot_value */ #line 1160 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); - ;} + { + (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); + } +#line 25016 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 726: + case 728: /* unpivot_header: ColIdOrString */ #line 1166 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} + { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } +#line 25022 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 727: + case 729: /* unpivot_header: '(' name_list_opt_comma ')' */ #line 1167 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 25028 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 728: + case 730: /* unpivot_value: unpivot_header IN_P '(' target_list_opt_comma ')' */ #line 1172 "third_party/libpg_query/grammar/statements/select.y" - { + { PGPivot *n = makeNode(PGPivot); - n->unpivot_columns = (yyvsp[(1) - (5)].list); - n->pivot_value = (yyvsp[(4) - (5)].list); + n->unpivot_columns = (yyvsp[-4].list); + n->pivot_value = (yyvsp[-1].list); (yyval.node) = (PGNode *) n; - ;} + } +#line 25039 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 729: + case 731: /* unpivot_value_list: unpivot_value */ #line 1181 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); - ;} + { + (yyval.list) = list_make1((yyvsp[0].node)); + } +#line 25047 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 730: + case 732: /* unpivot_value_list: unpivot_value_list unpivot_value */ #line 1185 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); - ;} + { + (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); + } +#line 25055 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 731: + case 733: /* joined_table: '(' joined_table ')' */ #line 1210 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.jexpr) = (yyvsp[(2) - (3)].jexpr); - ;} + { + (yyval.jexpr) = (yyvsp[-1].jexpr); + } +#line 25063 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 732: + case 734: /* joined_table: table_ref CROSS JOIN table_ref */ #line 1214 "third_party/libpg_query/grammar/statements/select.y" - { + { /* CROSS JOIN is same as unqualified inner join */ PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = PG_JOIN_INNER; n->joinreftype = PG_JOIN_REGULAR; - n->larg = (yyvsp[(1) - (4)].node); - n->rarg = (yyvsp[(4) - (4)].node); + n->larg = (yyvsp[-3].node); + n->rarg = (yyvsp[0].node); n->usingClause = NIL; n->quals = NULL; - n->location = (yylsp[(2) - (4)]); + n->location = (yylsp[-2]); (yyval.jexpr) = n; - ;} + } +#line 25080 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 733: + case 735: /* joined_table: table_ref join_type JOIN table_ref join_qual */ #line 1227 "third_party/libpg_query/grammar/statements/select.y" - { + { PGJoinExpr *n = makeNode(PGJoinExpr); - n->jointype = (yyvsp[(2) - (5)].jtype); + n->jointype = (yyvsp[-3].jtype); n->joinreftype = PG_JOIN_REGULAR; - n->larg = (yyvsp[(1) - (5)].node); - n->rarg = (yyvsp[(4) - (5)].node); - if ((yyvsp[(5) - (5)].node) != NULL && IsA((yyvsp[(5) - (5)].node), PGList)) - n->usingClause = (PGList *) (yyvsp[(5) - (5)].node); /* USING clause */ + n->larg = (yyvsp[-4].node); + n->rarg = (yyvsp[-1].node); + if ((yyvsp[0].node) != NULL && IsA((yyvsp[0].node), PGList)) + n->usingClause = (PGList *) (yyvsp[0].node); /* USING clause */ else - n->quals = (yyvsp[(5) - (5)].node); /* ON clause */ - n->location = (yylsp[(2) - (5)]); + n->quals = (yyvsp[0].node); /* ON clause */ + n->location = (yylsp[-3]); (yyval.jexpr) = n; - ;} + } +#line 25098 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 734: + case 736: /* joined_table: table_ref JOIN table_ref join_qual */ #line 1241 "third_party/libpg_query/grammar/statements/select.y" - { + { /* letting join_type reduce to empty doesn't work */ PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = PG_JOIN_INNER; n->joinreftype = PG_JOIN_REGULAR; - n->larg = (yyvsp[(1) - (4)].node); - n->rarg = (yyvsp[(3) - (4)].node); - if ((yyvsp[(4) - (4)].node) != NULL && IsA((yyvsp[(4) - (4)].node), PGList)) - n->usingClause = (PGList *) (yyvsp[(4) - (4)].node); /* USING clause */ + n->larg = (yyvsp[-3].node); + n->rarg = (yyvsp[-1].node); + if ((yyvsp[0].node) != NULL && IsA((yyvsp[0].node), PGList)) + n->usingClause = (PGList *) (yyvsp[0].node); /* USING clause */ else - n->quals = (yyvsp[(4) - (4)].node); /* ON clause */ - n->location = (yylsp[(2) - (4)]); + n->quals = (yyvsp[0].node); /* ON clause */ + n->location = (yylsp[-2]); (yyval.jexpr) = n; - ;} + } +#line 25117 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 735: + case 737: /* joined_table: table_ref NATURAL join_type JOIN table_ref */ #line 1256 "third_party/libpg_query/grammar/statements/select.y" - { + { PGJoinExpr *n = makeNode(PGJoinExpr); - n->jointype = (yyvsp[(3) - (5)].jtype); + n->jointype = (yyvsp[-2].jtype); n->joinreftype = PG_JOIN_NATURAL; - n->larg = (yyvsp[(1) - (5)].node); - n->rarg = (yyvsp[(5) - (5)].node); + n->larg = (yyvsp[-4].node); + n->rarg = (yyvsp[0].node); n->usingClause = NIL; /* figure out which columns later... */ n->quals = NULL; /* fill later */ - n->location = (yylsp[(2) - (5)]); + n->location = (yylsp[-3]); (yyval.jexpr) = n; - ;} + } +#line 25133 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 736: + case 738: /* joined_table: table_ref NATURAL JOIN table_ref */ #line 1268 "third_party/libpg_query/grammar/statements/select.y" - { + { /* letting join_type reduce to empty doesn't work */ PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = PG_JOIN_INNER; n->joinreftype = PG_JOIN_NATURAL; - n->larg = (yyvsp[(1) - (4)].node); - n->rarg = (yyvsp[(4) - (4)].node); + n->larg = (yyvsp[-3].node); + n->rarg = (yyvsp[0].node); n->usingClause = NIL; /* figure out which columns later... */ n->quals = NULL; /* fill later */ - n->location = (yylsp[(2) - (4)]); + n->location = (yylsp[-2]); (yyval.jexpr) = n; - ;} + } +#line 25150 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 737: + case 739: /* joined_table: table_ref ASOF join_type JOIN table_ref join_qual */ #line 1281 "third_party/libpg_query/grammar/statements/select.y" - { + { PGJoinExpr *n = makeNode(PGJoinExpr); - n->jointype = (yyvsp[(3) - (6)].jtype); + n->jointype = (yyvsp[-3].jtype); n->joinreftype = PG_JOIN_ASOF; - n->larg = (yyvsp[(1) - (6)].node); - n->rarg = (yyvsp[(5) - (6)].node); - if ((yyvsp[(6) - (6)].node) != NULL && IsA((yyvsp[(6) - (6)].node), PGList)) - n->usingClause = (PGList *) (yyvsp[(6) - (6)].node); /* USING clause */ + n->larg = (yyvsp[-5].node); + n->rarg = (yyvsp[-1].node); + if ((yyvsp[0].node) != NULL && IsA((yyvsp[0].node), PGList)) + n->usingClause = (PGList *) (yyvsp[0].node); /* USING clause */ else - n->quals = (yyvsp[(6) - (6)].node); /* ON clause */ - n->location = (yylsp[(2) - (6)]); + n->quals = (yyvsp[0].node); /* ON clause */ + n->location = (yylsp[-4]); (yyval.jexpr) = n; - ;} + } +#line 25168 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 738: + case 740: /* joined_table: table_ref ASOF JOIN table_ref join_qual */ #line 1295 "third_party/libpg_query/grammar/statements/select.y" - { + { PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = PG_JOIN_INNER; n->joinreftype = PG_JOIN_ASOF; - n->larg = (yyvsp[(1) - (5)].node); - n->rarg = (yyvsp[(4) - (5)].node); - if ((yyvsp[(5) - (5)].node) != NULL && IsA((yyvsp[(5) - (5)].node), PGList)) - n->usingClause = (PGList *) (yyvsp[(5) - (5)].node); /* USING clause */ + n->larg = (yyvsp[-4].node); + n->rarg = (yyvsp[-1].node); + if ((yyvsp[0].node) != NULL && IsA((yyvsp[0].node), PGList)) + n->usingClause = (PGList *) (yyvsp[0].node); /* USING clause */ else - n->quals = (yyvsp[(5) - (5)].node); /* ON clause */ - n->location = (yylsp[(2) - (5)]); + n->quals = (yyvsp[0].node); /* ON clause */ + n->location = (yylsp[-3]); (yyval.jexpr) = n; - ;} + } +#line 25186 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 739: + case 741: /* joined_table: table_ref POSITIONAL JOIN table_ref */ #line 1309 "third_party/libpg_query/grammar/statements/select.y" - { + { /* POSITIONAL JOIN is a coordinated scan */ PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = PG_JOIN_POSITION; n->joinreftype = PG_JOIN_REGULAR; - n->larg = (yyvsp[(1) - (4)].node); - n->rarg = (yyvsp[(4) - (4)].node); + n->larg = (yyvsp[-3].node); + n->rarg = (yyvsp[0].node); n->usingClause = NIL; n->quals = NULL; - n->location = (yylsp[(2) - (4)]); + n->location = (yylsp[-2]); (yyval.jexpr) = n; - ;} + } +#line 25203 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 740: + case 742: /* joined_table: table_ref ANTI JOIN table_ref join_qual */ #line 1322 "third_party/libpg_query/grammar/statements/select.y" - { + { /* ANTI JOIN is a filter */ PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = PG_JOIN_ANTI; n->joinreftype = PG_JOIN_REGULAR; - n->larg = (yyvsp[(1) - (5)].node); - n->rarg = (yyvsp[(4) - (5)].node); - if ((yyvsp[(5) - (5)].node) != NULL && IsA((yyvsp[(5) - (5)].node), PGList)) - n->usingClause = (PGList *) (yyvsp[(5) - (5)].node); /* USING clause */ + n->larg = (yyvsp[-4].node); + n->rarg = (yyvsp[-1].node); + if ((yyvsp[0].node) != NULL && IsA((yyvsp[0].node), PGList)) + n->usingClause = (PGList *) (yyvsp[0].node); /* USING clause */ else - n->quals = (yyvsp[(5) - (5)].node); /* ON clause */ - n->location = (yylsp[(2) - (5)]); + n->quals = (yyvsp[0].node); /* ON clause */ + n->location = (yylsp[-3]); (yyval.jexpr) = n; - ;} + } +#line 25222 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 741: + case 743: /* joined_table: table_ref SEMI JOIN table_ref join_qual */ #line 1337 "third_party/libpg_query/grammar/statements/select.y" - { + { /* SEMI JOIN is also a filter */ PGJoinExpr *n = makeNode(PGJoinExpr); n->jointype = PG_JOIN_SEMI; n->joinreftype = PG_JOIN_REGULAR; - n->larg = (yyvsp[(1) - (5)].node); - n->rarg = (yyvsp[(4) - (5)].node); - if ((yyvsp[(5) - (5)].node) != NULL && IsA((yyvsp[(5) - (5)].node), PGList)) - n->usingClause = (PGList *) (yyvsp[(5) - (5)].node); /* USING clause */ + n->larg = (yyvsp[-4].node); + n->rarg = (yyvsp[-1].node); + if ((yyvsp[0].node) != NULL && IsA((yyvsp[0].node), PGList)) + n->usingClause = (PGList *) (yyvsp[0].node); /* USING clause */ else - n->quals = (yyvsp[(5) - (5)].node); /* ON clause */ - n->location = (yylsp[(2) - (5)]); - n->location = (yylsp[(2) - (5)]); + n->quals = (yyvsp[0].node); /* ON clause */ + n->location = (yylsp[-3]); + n->location = (yylsp[-3]); (yyval.jexpr) = n; - ;} + } +#line 25242 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 742: + case 744: /* alias_clause: AS ColIdOrString '(' name_list_opt_comma ')' */ #line 1356 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.alias) = makeNode(PGAlias); - (yyval.alias)->aliasname = (yyvsp[(2) - (5)].str); - (yyval.alias)->colnames = (yyvsp[(4) - (5)].list); - ;} + (yyval.alias)->aliasname = (yyvsp[-3].str); + (yyval.alias)->colnames = (yyvsp[-1].list); + } +#line 25252 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 743: + case 745: /* alias_clause: AS ColIdOrString */ #line 1362 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.alias) = makeNode(PGAlias); - (yyval.alias)->aliasname = (yyvsp[(2) - (2)].str); - ;} + (yyval.alias)->aliasname = (yyvsp[0].str); + } +#line 25261 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 744: + case 746: /* alias_clause: ColId '(' name_list_opt_comma ')' */ #line 1367 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.alias) = makeNode(PGAlias); - (yyval.alias)->aliasname = (yyvsp[(1) - (4)].str); - (yyval.alias)->colnames = (yyvsp[(3) - (4)].list); - ;} + (yyval.alias)->aliasname = (yyvsp[-3].str); + (yyval.alias)->colnames = (yyvsp[-1].list); + } +#line 25271 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 745: + case 747: /* alias_clause: ColId */ #line 1373 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.alias) = makeNode(PGAlias); - (yyval.alias)->aliasname = (yyvsp[(1) - (1)].str); - ;} + (yyval.alias)->aliasname = (yyvsp[0].str); + } +#line 25280 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 746: + case 748: /* opt_alias_clause: alias_clause */ #line 1379 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.alias) = (yyvsp[(1) - (1)].alias); ;} + { (yyval.alias) = (yyvsp[0].alias); } +#line 25286 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 747: + case 749: /* opt_alias_clause: %empty */ #line 1380 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.alias) = NULL; ;} + { (yyval.alias) = NULL; } +#line 25292 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 748: + case 750: /* func_alias_clause: alias_clause */ #line 1389 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make2((yyvsp[(1) - (1)].alias), NIL); - ;} + { + (yyval.list) = list_make2((yyvsp[0].alias), NIL); + } +#line 25300 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 749: + case 751: /* func_alias_clause: AS '(' TableFuncElementList ')' */ #line 1393 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make2(NULL, (yyvsp[(3) - (4)].list)); - ;} + { + (yyval.list) = list_make2(NULL, (yyvsp[-1].list)); + } +#line 25308 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 750: + case 752: /* func_alias_clause: AS ColIdOrString '(' TableFuncElementList ')' */ #line 1397 "third_party/libpg_query/grammar/statements/select.y" - { + { PGAlias *a = makeNode(PGAlias); - a->aliasname = (yyvsp[(2) - (5)].str); - (yyval.list) = list_make2(a, (yyvsp[(4) - (5)].list)); - ;} + a->aliasname = (yyvsp[-3].str); + (yyval.list) = list_make2(a, (yyvsp[-1].list)); + } +#line 25318 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 751: + case 753: /* func_alias_clause: ColId '(' TableFuncElementList ')' */ #line 1403 "third_party/libpg_query/grammar/statements/select.y" - { + { PGAlias *a = makeNode(PGAlias); - a->aliasname = (yyvsp[(1) - (4)].str); - (yyval.list) = list_make2(a, (yyvsp[(3) - (4)].list)); - ;} + a->aliasname = (yyvsp[-3].str); + (yyval.list) = list_make2(a, (yyvsp[-1].list)); + } +#line 25328 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 752: + case 754: /* func_alias_clause: %empty */ #line 1409 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.list) = list_make2(NULL, NIL); - ;} + } +#line 25336 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 753: + case 755: /* join_type: FULL join_outer */ #line 1414 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.jtype) = PG_JOIN_FULL; ;} + { (yyval.jtype) = PG_JOIN_FULL; } +#line 25342 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 754: + case 756: /* join_type: LEFT join_outer */ #line 1415 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.jtype) = PG_JOIN_LEFT; ;} + { (yyval.jtype) = PG_JOIN_LEFT; } +#line 25348 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 755: + case 757: /* join_type: RIGHT join_outer */ #line 1416 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.jtype) = PG_JOIN_RIGHT; ;} + { (yyval.jtype) = PG_JOIN_RIGHT; } +#line 25354 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 756: + case 758: /* join_type: SEMI */ #line 1417 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.jtype) = PG_JOIN_SEMI; ;} + { (yyval.jtype) = PG_JOIN_SEMI; } +#line 25360 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 757: + case 759: /* join_type: ANTI */ #line 1418 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.jtype) = PG_JOIN_ANTI; ;} + { (yyval.jtype) = PG_JOIN_ANTI; } +#line 25366 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 758: + case 760: /* join_type: INNER_P */ #line 1419 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.jtype) = PG_JOIN_INNER; ;} + { (yyval.jtype) = PG_JOIN_INNER; } +#line 25372 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 759: + case 761: /* join_outer: OUTER_P */ #line 1423 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 25378 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 760: + case 762: /* join_outer: %empty */ #line 1424 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 25384 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 761: + case 763: /* join_qual: USING '(' name_list_opt_comma ')' */ #line 1436 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) (yyvsp[(3) - (4)].list); ;} + { (yyval.node) = (PGNode *) (yyvsp[-1].list); } +#line 25390 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 762: + case 764: /* join_qual: ON a_expr */ #line 1437 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 25396 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 763: + case 765: /* relation_expr: qualified_name */ #line 1443 "third_party/libpg_query/grammar/statements/select.y" - { + { /* inheritance query, implicitly */ - (yyval.range) = (yyvsp[(1) - (1)].range); + (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; - ;} + } +#line 25407 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 764: + case 766: /* relation_expr: qualified_name '*' */ #line 1450 "third_party/libpg_query/grammar/statements/select.y" - { + { /* inheritance query, explicitly */ - (yyval.range) = (yyvsp[(1) - (2)].range); + (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; - ;} + } +#line 25418 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 765: + case 767: /* relation_expr: ONLY qualified_name */ #line 1457 "third_party/libpg_query/grammar/statements/select.y" - { + { /* no inheritance */ - (yyval.range) = (yyvsp[(2) - (2)].range); + (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; - ;} + } +#line 25429 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 766: + case 768: /* relation_expr: ONLY '(' qualified_name ')' */ #line 1464 "third_party/libpg_query/grammar/statements/select.y" - { + { /* no inheritance, SQL99-style syntax */ - (yyval.range) = (yyvsp[(3) - (4)].range); + (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; - ;} + } +#line 25440 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 767: + case 769: /* func_table: func_expr_windowless opt_ordinality */ #line 1496 "third_party/libpg_query/grammar/statements/select.y" - { + { PGRangeFunction *n = makeNode(PGRangeFunction); n->lateral = false; - n->ordinality = (yyvsp[(2) - (2)].boolean); + n->ordinality = (yyvsp[0].boolean); n->is_rowsfrom = false; - n->functions = list_make1(list_make2((yyvsp[(1) - (2)].node), NIL)); + n->functions = list_make1(list_make2((yyvsp[-1].node), NIL)); n->sample = NULL; /* alias and coldeflist are set by table_ref production */ (yyval.node) = (PGNode *) n; - ;} + } +#line 25455 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 768: + case 770: /* func_table: ROWS FROM '(' rowsfrom_list ')' opt_ordinality */ #line 1507 "third_party/libpg_query/grammar/statements/select.y" - { + { PGRangeFunction *n = makeNode(PGRangeFunction); n->lateral = false; - n->ordinality = (yyvsp[(6) - (6)].boolean); + n->ordinality = (yyvsp[0].boolean); n->is_rowsfrom = true; - n->functions = (yyvsp[(4) - (6)].list); + n->functions = (yyvsp[-2].list); n->sample = NULL; /* alias and coldeflist are set by table_ref production */ (yyval.node) = (PGNode *) n; - ;} + } +#line 25470 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 769: + case 771: /* rowsfrom_item: func_expr_windowless opt_col_def_list */ #line 1520 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make2((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].list)); ;} + { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].list)); } +#line 25476 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 770: + case 772: /* rowsfrom_list: rowsfrom_item */ #line 1524 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].list)); ;} + { (yyval.list) = list_make1((yyvsp[0].list)); } +#line 25482 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 771: + case 773: /* rowsfrom_list: rowsfrom_list ',' rowsfrom_item */ #line 1525 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } +#line 25488 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 772: + case 774: /* opt_col_def_list: AS '(' TableFuncElementList ')' */ #line 1528 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (4)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 25494 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 773: + case 775: /* opt_col_def_list: %empty */ #line 1529 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 25500 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 774: + case 776: /* opt_ordinality: WITH_LA ORDINALITY */ #line 1532 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 25506 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 775: + case 777: /* opt_ordinality: %empty */ #line 1533 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 25512 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 776: + case 778: /* where_clause: WHERE a_expr */ #line 1538 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 25518 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 777: + case 779: /* where_clause: %empty */ #line 1539 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 25524 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 778: + case 780: /* TableFuncElementList: TableFuncElement */ #line 1545 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); - ;} + { + (yyval.list) = list_make1((yyvsp[0].node)); + } +#line 25532 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 779: + case 781: /* TableFuncElementList: TableFuncElementList ',' TableFuncElement */ #line 1549 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); - ;} + { + (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); + } +#line 25540 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 780: + case 782: /* TableFuncElement: ColIdOrString Typename opt_collate_clause */ #line 1555 "third_party/libpg_query/grammar/statements/select.y" - { + { PGColumnDef *n = makeNode(PGColumnDef); - n->colname = (yyvsp[(1) - (3)].str); - n->typeName = (yyvsp[(2) - (3)].typnam); + n->colname = (yyvsp[-2].str); + n->typeName = (yyvsp[-1].typnam); n->inhcount = 0; n->is_local = true; n->is_not_null = false; @@ -25719,416 +25552,470 @@ YYLTYPE yylloc; n->storage = 0; n->raw_default = NULL; n->cooked_default = NULL; - n->collClause = (PGCollateClause *) (yyvsp[(3) - (3)].node); + n->collClause = (PGCollateClause *) (yyvsp[0].node); n->collOid = InvalidOid; n->constraints = NIL; - n->location = (yylsp[(1) - (3)]); + n->location = (yylsp[-2]); (yyval.node) = (PGNode *)n; - ;} + } +#line 25562 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 781: + case 783: /* opt_collate_clause: COLLATE any_name */ #line 1576 "third_party/libpg_query/grammar/statements/select.y" - { + { PGCollateClause *n = makeNode(PGCollateClause); n->arg = NULL; - n->collname = (yyvsp[(2) - (2)].list); - n->location = (yylsp[(1) - (2)]); + n->collname = (yyvsp[0].list); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *) n; - ;} + } +#line 25574 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 782: + case 784: /* opt_collate_clause: %empty */ #line 1583 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 25580 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 783: + case 785: /* colid_type_list: ColId Typename */ #line 1596 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make1(list_make2(makeString((yyvsp[(1) - (2)].str)), (yyvsp[(2) - (2)].typnam))); - ;} + { + (yyval.list) = list_make1(list_make2(makeString((yyvsp[-1].str)), (yyvsp[0].typnam))); + } +#line 25588 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 784: + case 786: /* colid_type_list: colid_type_list ',' ColId Typename */ #line 1599 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = lappend((yyvsp[(1) - (4)].list), list_make2(makeString((yyvsp[(3) - (4)].str)), (yyvsp[(4) - (4)].typnam))); - ;} + { + (yyval.list) = lappend((yyvsp[-3].list), list_make2(makeString((yyvsp[-1].str)), (yyvsp[0].typnam))); + } +#line 25596 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 787: + case 789: /* opt_Typename: Typename */ #line 1606 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 25602 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 788: + case 790: /* opt_Typename: %empty */ #line 1607 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = NULL; ;} + { (yyval.typnam) = NULL; } +#line 25608 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 789: + case 791: /* Typename: SimpleTypename opt_array_bounds */ #line 1610 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (2)].typnam); - (yyval.typnam)->arrayBounds = (yyvsp[(2) - (2)].list); - ;} + { + (yyval.typnam) = (yyvsp[-1].typnam); + (yyval.typnam)->arrayBounds = (yyvsp[0].list); + } +#line 25617 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 790: + case 792: /* Typename: SETOF SimpleTypename opt_array_bounds */ #line 1615 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(2) - (3)].typnam); - (yyval.typnam)->arrayBounds = (yyvsp[(3) - (3)].list); + { + (yyval.typnam) = (yyvsp[-1].typnam); + (yyval.typnam)->arrayBounds = (yyvsp[0].list); (yyval.typnam)->setof = true; - ;} + } +#line 25627 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 791: + case 793: /* Typename: SimpleTypename ARRAY '[' Iconst ']' */ #line 1622 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (5)].typnam); - (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[(4) - (5)].ival))); - ;} + { + (yyval.typnam) = (yyvsp[-4].typnam); + (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); + } +#line 25636 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 792: + case 794: /* Typename: SETOF SimpleTypename ARRAY '[' Iconst ']' */ #line 1627 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(2) - (6)].typnam); - (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[(5) - (6)].ival))); + { + (yyval.typnam) = (yyvsp[-4].typnam); + (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); (yyval.typnam)->setof = true; - ;} + } +#line 25646 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 793: + case 795: /* Typename: SimpleTypename ARRAY */ #line 1633 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (2)].typnam); + { + (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); - ;} + } +#line 25655 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 794: + case 796: /* Typename: SETOF SimpleTypename ARRAY */ #line 1638 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(2) - (3)].typnam); + { + (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); (yyval.typnam)->setof = true; - ;} + } +#line 25665 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 795: + case 797: /* Typename: qualified_typename */ #line 1644 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = makeTypeNameFromNameList((yyvsp[(1) - (1)].list)); - ;} + { + (yyval.typnam) = makeTypeNameFromNameList((yyvsp[0].list)); + } +#line 25673 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 796: + case 798: /* Typename: RowOrStruct '(' colid_type_list ')' opt_array_bounds */ #line 1648 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("struct"); - (yyval.typnam)->arrayBounds = (yyvsp[(5) - (5)].list); - (yyval.typnam)->typmods = (yyvsp[(3) - (5)].list); - (yyval.typnam)->location = (yylsp[(1) - (5)]); - ;} + (yyval.typnam)->arrayBounds = (yyvsp[0].list); + (yyval.typnam)->typmods = (yyvsp[-2].list); + (yyval.typnam)->location = (yylsp[-4]); + } +#line 25684 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 797: + case 799: /* Typename: MAP '(' type_list ')' opt_array_bounds */ #line 1655 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("map"); - (yyval.typnam)->arrayBounds = (yyvsp[(5) - (5)].list); - (yyval.typnam)->typmods = (yyvsp[(3) - (5)].list); - (yyval.typnam)->location = (yylsp[(1) - (5)]); - ;} + (yyval.typnam)->arrayBounds = (yyvsp[0].list); + (yyval.typnam)->typmods = (yyvsp[-2].list); + (yyval.typnam)->location = (yylsp[-4]); + } +#line 25695 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 798: + case 800: /* Typename: UNION '(' colid_type_list ')' opt_array_bounds */ #line 1662 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("union"); - (yyval.typnam)->arrayBounds = (yyvsp[(5) - (5)].list); - (yyval.typnam)->typmods = (yyvsp[(3) - (5)].list); - (yyval.typnam)->location = (yylsp[(1) - (5)]); - ;} + (yyval.typnam)->arrayBounds = (yyvsp[0].list); + (yyval.typnam)->typmods = (yyvsp[-2].list); + (yyval.typnam)->location = (yylsp[-4]); + } +#line 25706 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 799: + case 801: /* qualified_typename: IDENT '.' IDENT */ #line 1671 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make2(makeString((yyvsp[(1) - (3)].str)), makeString((yyvsp[(3) - (3)].str))); ;} + { (yyval.list) = list_make2(makeString((yyvsp[-2].str)), makeString((yyvsp[0].str))); } +#line 25712 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 800: + case 802: /* qualified_typename: qualified_typename '.' IDENT */ #line 1672 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), makeString((yyvsp[(3) - (3)].str))); ;} + { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } +#line 25718 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 801: + case 803: /* opt_array_bounds: opt_array_bounds '[' ']' */ #line 1677 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), makeInteger(-1)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), makeInteger(-1)); } +#line 25724 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 802: + case 804: /* opt_array_bounds: opt_array_bounds '[' Iconst ']' */ #line 1679 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (4)].list), makeInteger((yyvsp[(3) - (4)].ival))); ;} + { (yyval.list) = lappend((yyvsp[-3].list), makeInteger((yyvsp[-1].ival))); } +#line 25730 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 803: + case 805: /* opt_array_bounds: %empty */ #line 1681 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 25736 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 804: + case 806: /* SimpleTypename: GenericType */ #line 1685 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 25742 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 805: + case 807: /* SimpleTypename: Numeric */ #line 1686 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 25748 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 806: + case 808: /* SimpleTypename: Bit */ #line 1687 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 25754 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 807: + case 809: /* SimpleTypename: Character */ #line 1688 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 25760 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 808: + case 810: /* SimpleTypename: ConstDatetime */ #line 1689 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 25766 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 809: + case 811: /* SimpleTypename: ConstInterval opt_interval */ #line 1691 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (2)].typnam); - (yyval.typnam)->typmods = (yyvsp[(2) - (2)].list); - ;} + { + (yyval.typnam) = (yyvsp[-1].typnam); + (yyval.typnam)->typmods = (yyvsp[0].list); + } +#line 25775 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 810: + case 812: /* SimpleTypename: ConstInterval '(' Iconst ')' */ #line 1696 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (4)].typnam); + { + (yyval.typnam) = (yyvsp[-3].typnam); (yyval.typnam)->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), - makeIntConst((yyvsp[(3) - (4)].ival), (yylsp[(3) - (4)]))); - ;} + makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); + } +#line 25785 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 811: + case 813: /* ConstTypename: Numeric */ #line 1715 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 25791 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 812: + case 814: /* ConstTypename: ConstBit */ #line 1716 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 25797 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 813: + case 815: /* ConstTypename: ConstCharacter */ #line 1717 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 25803 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 814: + case 816: /* ConstTypename: ConstDatetime */ #line 1718 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.typnam) = (yyvsp[(1) - (1)].typnam); ;} + { (yyval.typnam) = (yyvsp[0].typnam); } +#line 25809 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 815: + case 817: /* GenericType: type_name_token opt_type_modifiers */ #line 1730 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = makeTypeName((yyvsp[(1) - (2)].str)); - (yyval.typnam)->typmods = (yyvsp[(2) - (2)].list); - (yyval.typnam)->location = (yylsp[(1) - (2)]); - ;} + { + (yyval.typnam) = makeTypeName((yyvsp[-1].str)); + (yyval.typnam)->typmods = (yyvsp[0].list); + (yyval.typnam)->location = (yylsp[-1]); + } +#line 25819 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 816: + case 818: /* opt_type_modifiers: '(' opt_expr_list_opt_comma ')' */ #line 1743 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 25825 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 817: + case 819: /* opt_type_modifiers: %empty */ #line 1744 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 25831 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 818: + case 820: /* Numeric: INT_P */ #line 1751 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("int4"); - (yyval.typnam)->location = (yylsp[(1) - (1)]); - ;} + (yyval.typnam)->location = (yylsp[0]); + } +#line 25840 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 819: + case 821: /* Numeric: INTEGER */ #line 1756 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("int4"); - (yyval.typnam)->location = (yylsp[(1) - (1)]); - ;} + (yyval.typnam)->location = (yylsp[0]); + } +#line 25849 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 820: + case 822: /* Numeric: SMALLINT */ #line 1761 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("int2"); - (yyval.typnam)->location = (yylsp[(1) - (1)]); - ;} + (yyval.typnam)->location = (yylsp[0]); + } +#line 25858 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 821: + case 823: /* Numeric: BIGINT */ #line 1766 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("int8"); - (yyval.typnam)->location = (yylsp[(1) - (1)]); - ;} + (yyval.typnam)->location = (yylsp[0]); + } +#line 25867 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 822: + case 824: /* Numeric: REAL */ #line 1771 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("float4"); - (yyval.typnam)->location = (yylsp[(1) - (1)]); - ;} + (yyval.typnam)->location = (yylsp[0]); + } +#line 25876 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 823: + case 825: /* Numeric: FLOAT_P opt_float */ #line 1776 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(2) - (2)].typnam); - (yyval.typnam)->location = (yylsp[(1) - (2)]); - ;} + { + (yyval.typnam) = (yyvsp[0].typnam); + (yyval.typnam)->location = (yylsp[-1]); + } +#line 25885 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 824: + case 826: /* Numeric: DOUBLE_P PRECISION */ #line 1781 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("float8"); - (yyval.typnam)->location = (yylsp[(1) - (2)]); - ;} + (yyval.typnam)->location = (yylsp[-1]); + } +#line 25894 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 825: + case 827: /* Numeric: DECIMAL_P opt_type_modifiers */ #line 1786 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("numeric"); - (yyval.typnam)->typmods = (yyvsp[(2) - (2)].list); - (yyval.typnam)->location = (yylsp[(1) - (2)]); - ;} + (yyval.typnam)->typmods = (yyvsp[0].list); + (yyval.typnam)->location = (yylsp[-1]); + } +#line 25904 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 826: + case 828: /* Numeric: DEC opt_type_modifiers */ #line 1792 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("numeric"); - (yyval.typnam)->typmods = (yyvsp[(2) - (2)].list); - (yyval.typnam)->location = (yylsp[(1) - (2)]); - ;} + (yyval.typnam)->typmods = (yyvsp[0].list); + (yyval.typnam)->location = (yylsp[-1]); + } +#line 25914 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 827: + case 829: /* Numeric: NUMERIC opt_type_modifiers */ #line 1798 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("numeric"); - (yyval.typnam)->typmods = (yyvsp[(2) - (2)].list); - (yyval.typnam)->location = (yylsp[(1) - (2)]); - ;} + (yyval.typnam)->typmods = (yyvsp[0].list); + (yyval.typnam)->location = (yylsp[-1]); + } +#line 25924 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 828: + case 830: /* Numeric: BOOLEAN_P */ #line 1804 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("bool"); - (yyval.typnam)->location = (yylsp[(1) - (1)]); - ;} + (yyval.typnam)->location = (yylsp[0]); + } +#line 25933 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 829: + case 831: /* opt_float: '(' Iconst ')' */ #line 1811 "third_party/libpg_query/grammar/statements/select.y" - { + { /* * Check FLOAT() precision limits assuming IEEE floating * types - thomas 1997-09-18 */ - if ((yyvsp[(2) - (3)].ival) < 1) + if ((yyvsp[-1].ival) < 1) ereport(ERROR, (errcode(PG_ERRCODE_INVALID_PARAMETER_VALUE), errmsg("precision for type float must be at least 1 bit"), - parser_errposition((yylsp[(2) - (3)])))); - else if ((yyvsp[(2) - (3)].ival) <= 24) + parser_errposition((yylsp[-1])))); + else if ((yyvsp[-1].ival) <= 24) (yyval.typnam) = SystemTypeName("float4"); - else if ((yyvsp[(2) - (3)].ival) <= 53) + else if ((yyvsp[-1].ival) <= 53) (yyval.typnam) = SystemTypeName("float8"); else ereport(ERROR, (errcode(PG_ERRCODE_INVALID_PARAMETER_VALUE), errmsg("precision for type float must be less than 54 bits"), - parser_errposition((yylsp[(2) - (3)])))); - ;} + parser_errposition((yylsp[-1])))); + } +#line 25958 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 830: + case 832: /* opt_float: %empty */ #line 1832 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("float4"); - ;} + } +#line 25966 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 831: + case 833: /* Bit: BitWithLength */ #line 1842 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (1)].typnam); - ;} + { + (yyval.typnam) = (yyvsp[0].typnam); + } +#line 25974 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 832: + case 834: /* Bit: BitWithoutLength */ #line 1846 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (1)].typnam); - ;} + { + (yyval.typnam) = (yyvsp[0].typnam); + } +#line 25982 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 833: + case 835: /* ConstBit: BitWithLength */ #line 1854 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (1)].typnam); - ;} + { + (yyval.typnam) = (yyvsp[0].typnam); + } +#line 25990 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 834: + case 836: /* ConstBit: BitWithoutLength */ #line 1858 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (1)].typnam); + { + (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->typmods = NIL; - ;} + } +#line 25999 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 835: + case 837: /* BitWithLength: BIT opt_varying '(' expr_list_opt_comma ')' */ #line 1866 "third_party/libpg_query/grammar/statements/select.y" - { + { const char *typname; - typname = (yyvsp[(2) - (5)].boolean) ? "varbit" : "bit"; + typname = (yyvsp[-3].boolean) ? "varbit" : "bit"; (yyval.typnam) = SystemTypeName(typname); - (yyval.typnam)->typmods = (yyvsp[(4) - (5)].list); - (yyval.typnam)->location = (yylsp[(1) - (5)]); - ;} + (yyval.typnam)->typmods = (yyvsp[-1].list); + (yyval.typnam)->location = (yylsp[-4]); + } +#line 26012 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 836: + case 838: /* BitWithoutLength: BIT opt_varying */ #line 1878 "third_party/libpg_query/grammar/statements/select.y" - { + { /* bit defaults to bit(1), varbit to no limit */ - if ((yyvsp[(2) - (2)].boolean)) + if ((yyvsp[0].boolean)) { (yyval.typnam) = SystemTypeName("varbit"); } @@ -26137,873 +26024,988 @@ YYLTYPE yylloc; (yyval.typnam) = SystemTypeName("bit"); (yyval.typnam)->typmods = list_make1(makeIntConst(1, -1)); } - (yyval.typnam)->location = (yylsp[(1) - (2)]); - ;} + (yyval.typnam)->location = (yylsp[-1]); + } +#line 26030 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 837: + case 839: /* Character: CharacterWithLength */ #line 1899 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (1)].typnam); - ;} + { + (yyval.typnam) = (yyvsp[0].typnam); + } +#line 26038 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 838: + case 840: /* Character: CharacterWithoutLength */ #line 1903 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (1)].typnam); - ;} + { + (yyval.typnam) = (yyvsp[0].typnam); + } +#line 26046 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 839: + case 841: /* ConstCharacter: CharacterWithLength */ #line 1909 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = (yyvsp[(1) - (1)].typnam); - ;} + { + (yyval.typnam) = (yyvsp[0].typnam); + } +#line 26054 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 840: + case 842: /* ConstCharacter: CharacterWithoutLength */ #line 1913 "third_party/libpg_query/grammar/statements/select.y" - { + { /* Length was not specified so allow to be unrestricted. * This handles problems with fixed-length (bpchar) strings * which in column definitions must default to a length * of one, but should not be constrained if the length * was not specified. */ - (yyval.typnam) = (yyvsp[(1) - (1)].typnam); + (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->typmods = NIL; - ;} + } +#line 26069 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 841: + case 843: /* CharacterWithLength: character '(' Iconst ')' */ #line 1926 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = SystemTypeName((yyvsp[(1) - (4)].conststr)); - (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[(3) - (4)].ival), (yylsp[(3) - (4)]))); - (yyval.typnam)->location = (yylsp[(1) - (4)]); - ;} + { + (yyval.typnam) = SystemTypeName((yyvsp[-3].conststr)); + (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); + (yyval.typnam)->location = (yylsp[-3]); + } +#line 26079 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 842: + case 844: /* CharacterWithoutLength: character */ #line 1934 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.typnam) = SystemTypeName((yyvsp[(1) - (1)].conststr)); + { + (yyval.typnam) = SystemTypeName((yyvsp[0].conststr)); /* char defaults to char(1), varchar to no limit */ - if (strcmp((yyvsp[(1) - (1)].conststr), "bpchar") == 0) + if (strcmp((yyvsp[0].conststr), "bpchar") == 0) (yyval.typnam)->typmods = list_make1(makeIntConst(1, -1)); - (yyval.typnam)->location = (yylsp[(1) - (1)]); - ;} + (yyval.typnam)->location = (yylsp[0]); + } +#line 26091 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 843: + case 845: /* character: CHARACTER opt_varying */ #line 1944 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = (yyvsp[(2) - (2)].boolean) ? "varchar": "bpchar"; ;} + { (yyval.conststr) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } +#line 26097 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 844: + case 846: /* character: CHAR_P opt_varying */ #line 1946 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = (yyvsp[(2) - (2)].boolean) ? "varchar": "bpchar"; ;} + { (yyval.conststr) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } +#line 26103 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 845: + case 847: /* character: VARCHAR */ #line 1948 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "varchar"; ;} + { (yyval.conststr) = "varchar"; } +#line 26109 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 846: + case 848: /* character: NATIONAL CHARACTER opt_varying */ #line 1950 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = (yyvsp[(3) - (3)].boolean) ? "varchar": "bpchar"; ;} + { (yyval.conststr) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } +#line 26115 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 847: + case 849: /* character: NATIONAL CHAR_P opt_varying */ #line 1952 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = (yyvsp[(3) - (3)].boolean) ? "varchar": "bpchar"; ;} + { (yyval.conststr) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } +#line 26121 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 848: + case 850: /* character: NCHAR opt_varying */ #line 1954 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = (yyvsp[(2) - (2)].boolean) ? "varchar": "bpchar"; ;} + { (yyval.conststr) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } +#line 26127 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 849: + case 851: /* opt_varying: VARYING */ #line 1958 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 26133 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 850: + case 852: /* opt_varying: %empty */ #line 1959 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 26139 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 851: + case 853: /* ConstDatetime: TIMESTAMP '(' Iconst ')' opt_timezone */ #line 1967 "third_party/libpg_query/grammar/statements/select.y" - { - if ((yyvsp[(5) - (5)].boolean)) + { + if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); else (yyval.typnam) = SystemTypeName("timestamp"); - (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[(3) - (5)].ival), (yylsp[(3) - (5)]))); - (yyval.typnam)->location = (yylsp[(1) - (5)]); - ;} + (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); + (yyval.typnam)->location = (yylsp[-4]); + } +#line 26152 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 852: + case 854: /* ConstDatetime: TIMESTAMP opt_timezone */ #line 1976 "third_party/libpg_query/grammar/statements/select.y" - { - if ((yyvsp[(2) - (2)].boolean)) + { + if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); else (yyval.typnam) = SystemTypeName("timestamp"); - (yyval.typnam)->location = (yylsp[(1) - (2)]); - ;} + (yyval.typnam)->location = (yylsp[-1]); + } +#line 26164 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 853: + case 855: /* ConstDatetime: TIME '(' Iconst ')' opt_timezone */ #line 1984 "third_party/libpg_query/grammar/statements/select.y" - { - if ((yyvsp[(5) - (5)].boolean)) + { + if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timetz"); else (yyval.typnam) = SystemTypeName("time"); - (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[(3) - (5)].ival), (yylsp[(3) - (5)]))); - (yyval.typnam)->location = (yylsp[(1) - (5)]); - ;} + (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); + (yyval.typnam)->location = (yylsp[-4]); + } +#line 26177 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 854: + case 856: /* ConstDatetime: TIME opt_timezone */ #line 1993 "third_party/libpg_query/grammar/statements/select.y" - { - if ((yyvsp[(2) - (2)].boolean)) + { + if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timetz"); else (yyval.typnam) = SystemTypeName("time"); - (yyval.typnam)->location = (yylsp[(1) - (2)]); - ;} + (yyval.typnam)->location = (yylsp[-1]); + } +#line 26189 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 855: + case 857: /* ConstInterval: INTERVAL */ #line 2004 "third_party/libpg_query/grammar/statements/select.y" - { + { (yyval.typnam) = SystemTypeName("interval"); - (yyval.typnam)->location = (yylsp[(1) - (1)]); - ;} + (yyval.typnam)->location = (yylsp[0]); + } +#line 26198 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 856: + case 858: /* opt_timezone: WITH_LA TIME ZONE */ #line 2011 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 26204 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 857: + case 859: /* opt_timezone: WITHOUT TIME ZONE */ #line 2012 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 26210 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 858: + case 860: /* opt_timezone: %empty */ #line 2013 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 26216 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 883: -#line 2054 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR), (yylsp[(1) - (1)]))); ;} + case 887: /* opt_interval: year_keyword */ +#line 2057 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR), (yylsp[0]))); } +#line 26222 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 884: -#line 2056 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MONTH), (yylsp[(1) - (1)]))); ;} + case 888: /* opt_interval: month_keyword */ +#line 2059 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MONTH), (yylsp[0]))); } +#line 26228 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 885: -#line 2058 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY), (yylsp[(1) - (1)]))); ;} + case 889: /* opt_interval: day_keyword */ +#line 2061 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY), (yylsp[0]))); } +#line 26234 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 886: -#line 2060 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR), (yylsp[(1) - (1)]))); ;} + case 890: /* opt_interval: hour_keyword */ +#line 2063 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR), (yylsp[0]))); } +#line 26240 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 887: -#line 2062 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE), (yylsp[(1) - (1)]))); ;} + case 891: /* opt_interval: minute_keyword */ +#line 2065 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE), (yylsp[0]))); } +#line 26246 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 888: -#line 2064 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[(1) - (1)]))); ;} + case 892: /* opt_interval: second_keyword */ +#line 2067 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[0]))); } +#line 26252 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 889: -#line 2066 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MILLISECOND), (yylsp[(1) - (1)]))); ;} + case 893: /* opt_interval: millisecond_keyword */ +#line 2069 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MILLISECOND), (yylsp[0]))); } +#line 26258 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 890: -#line 2068 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MICROSECOND), (yylsp[(1) - (1)]))); ;} + case 894: /* opt_interval: microsecond_keyword */ +#line 2071 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MICROSECOND), (yylsp[0]))); } +#line 26264 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 891: -#line 2070 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(WEEK), (yylsp[(1) - (1)]))); ;} + case 895: /* opt_interval: week_keyword */ +#line 2073 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(WEEK), (yylsp[0]))); } +#line 26270 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 892: -#line 2072 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DECADE), (yylsp[(1) - (1)]))); ;} + case 896: /* opt_interval: quarter_keyword */ +#line 2075 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(QUARTER), (yylsp[0]))); } +#line 26276 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 893: -#line 2074 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(CENTURY), (yylsp[(1) - (1)]))); ;} + case 897: /* opt_interval: decade_keyword */ +#line 2077 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DECADE), (yylsp[0]))); } +#line 26282 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 894: -#line 2076 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MILLENNIUM), (yylsp[(1) - (1)]))); ;} + case 898: /* opt_interval: century_keyword */ +#line 2079 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(CENTURY), (yylsp[0]))); } +#line 26288 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 895: -#line 2078 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR) | - INTERVAL_MASK(MONTH), (yylsp[(1) - (3)]))); - ;} + case 899: /* opt_interval: millennium_keyword */ +#line 2081 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MILLENNIUM), (yylsp[0]))); } +#line 26294 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 896: + case 900: /* opt_interval: year_keyword TO month_keyword */ #line 2083 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | - INTERVAL_MASK(HOUR), (yylsp[(1) - (3)]))); - ;} + { + (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR) | + INTERVAL_MASK(MONTH), (yylsp[-2]))); + } +#line 26303 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 897: + case 901: /* opt_interval: day_keyword TO hour_keyword */ #line 2088 "third_party/libpg_query/grammar/statements/select.y" - { + { + (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | + INTERVAL_MASK(HOUR), (yylsp[-2]))); + } +#line 26312 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 902: /* opt_interval: day_keyword TO minute_keyword */ +#line 2093 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | - INTERVAL_MASK(MINUTE), (yylsp[(1) - (3)]))); - ;} + INTERVAL_MASK(MINUTE), (yylsp[-2]))); + } +#line 26322 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 898: -#line 2094 "third_party/libpg_query/grammar/statements/select.y" - { + case 903: /* opt_interval: day_keyword TO second_keyword */ +#line 2099 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | - INTERVAL_MASK(SECOND), (yylsp[(1) - (3)]))); - ;} + INTERVAL_MASK(SECOND), (yylsp[-2]))); + } +#line 26333 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 899: -#line 2101 "third_party/libpg_query/grammar/statements/select.y" - { + case 904: /* opt_interval: hour_keyword TO minute_keyword */ +#line 2106 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | - INTERVAL_MASK(MINUTE), (yylsp[(1) - (3)]))); - ;} + INTERVAL_MASK(MINUTE), (yylsp[-2]))); + } +#line 26342 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 900: -#line 2106 "third_party/libpg_query/grammar/statements/select.y" - { + case 905: /* opt_interval: hour_keyword TO second_keyword */ +#line 2111 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | - INTERVAL_MASK(SECOND), (yylsp[(1) - (3)]))); - ;} + INTERVAL_MASK(SECOND), (yylsp[-2]))); + } +#line 26352 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 901: -#line 2112 "third_party/libpg_query/grammar/statements/select.y" - { + case 906: /* opt_interval: minute_keyword TO second_keyword */ +#line 2117 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE) | - INTERVAL_MASK(SECOND), (yylsp[(1) - (3)]))); - ;} + INTERVAL_MASK(SECOND), (yylsp[-2]))); + } +#line 26361 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 902: -#line 2117 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 907: /* opt_interval: %empty */ +#line 2122 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 26367 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 903: -#line 2148 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + case 908: /* a_expr: c_expr */ +#line 2153 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 26373 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 904: -#line 2151 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeTypeCast((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].typnam), 0, (yylsp[(2) - (3)])); ;} + case 909: /* a_expr: a_expr TYPECAST Typename */ +#line 2156 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), 0, (yylsp[-1])); } +#line 26379 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 905: -#line 2153 "third_party/libpg_query/grammar/statements/select.y" - { + case 910: /* a_expr: a_expr COLLATE any_name */ +#line 2158 "third_party/libpg_query/grammar/statements/select.y" + { PGCollateClause *n = makeNode(PGCollateClause); - n->arg = (yyvsp[(1) - (3)].node); - n->collname = (yyvsp[(3) - (3)].list); - n->location = (yylsp[(2) - (3)]); + n->arg = (yyvsp[-2].node); + n->collname = (yyvsp[0].list); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *) n; - ;} + } +#line 26391 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 906: -#line 2161 "third_party/libpg_query/grammar/statements/select.y" - { + case 911: /* a_expr: a_expr AT TIME ZONE a_expr */ +#line 2166 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("timezone"), - list_make2((yyvsp[(5) - (5)].node), (yyvsp[(1) - (5)].node)), - (yylsp[(2) - (5)])); - ;} - break; - - case 907: -#line 2176 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", NULL, (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} - break; - - case 908: -#line 2178 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = doNegate((yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} + list_make2((yyvsp[0].node), (yyvsp[-4].node)), + (yylsp[-3])); + } +#line 26401 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 909: -#line 2180 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 912: /* a_expr: '+' a_expr */ +#line 2181 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } +#line 26407 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 910: -#line 2182 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "-", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 913: /* a_expr: '-' a_expr */ +#line 2183 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } +#line 26413 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 911: -#line 2184 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "*", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 914: /* a_expr: a_expr '+' a_expr */ +#line 2185 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26419 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 912: -#line 2186 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "/", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 915: /* a_expr: a_expr '-' a_expr */ +#line 2187 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26425 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 913: -#line 2188 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "//", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 916: /* a_expr: a_expr '*' a_expr */ +#line 2189 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26431 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 914: -#line 2190 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "%", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 917: /* a_expr: a_expr '/' a_expr */ +#line 2191 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26437 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 915: -#line 2192 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "^", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 918: /* a_expr: a_expr INTEGER_DIVISION a_expr */ +#line 2193 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "//", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26443 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 916: -#line 2194 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "**", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 919: /* a_expr: a_expr '%' a_expr */ +#line 2195 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26449 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 917: -#line 2196 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 920: /* a_expr: a_expr '^' a_expr */ +#line 2197 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26455 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 918: -#line 2198 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 921: /* a_expr: a_expr POWER_OF a_expr */ +#line 2199 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "**", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26461 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 919: -#line 2200 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 922: /* a_expr: a_expr '<' a_expr */ +#line 2201 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26467 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 920: -#line 2202 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 923: /* a_expr: a_expr '>' a_expr */ +#line 2203 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26473 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 921: -#line 2204 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 924: /* a_expr: a_expr '=' a_expr */ +#line 2205 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26479 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 922: -#line 2206 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<>", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 925: /* a_expr: a_expr LESS_EQUALS a_expr */ +#line 2207 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26485 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 923: + case 926: /* a_expr: a_expr GREATER_EQUALS a_expr */ #line 2209 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(2) - (3)].list), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26491 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 924: + case 927: /* a_expr: a_expr NOT_EQUALS a_expr */ #line 2211 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(1) - (2)].list), NULL, (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26497 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 925: -#line 2213 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(2) - (2)].list), (yyvsp[(1) - (2)].node), NULL, (yylsp[(2) - (2)])); ;} + case 928: /* a_expr: a_expr qual_Op a_expr */ +#line 2214 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26503 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 926: + case 929: /* a_expr: qual_Op a_expr */ #line 2216 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeAndExpr((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } +#line 26509 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 927: + case 930: /* a_expr: a_expr qual_Op */ #line 2218 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeOrExpr((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[0].list), (yyvsp[-1].node), NULL, (yylsp[0])); } +#line 26515 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 928: -#line 2220 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeNotExpr((yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} + case 931: /* a_expr: a_expr AND a_expr */ +#line 2221 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = makeAndExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26521 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 929: -#line 2222 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeNotExpr((yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} + case 932: /* a_expr: a_expr OR a_expr */ +#line 2223 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = makeOrExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 26527 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 930: -#line 2224 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_GLOB, "~~~", - (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); - ;} + case 933: /* a_expr: NOT a_expr */ +#line 2225 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } +#line 26533 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 934: /* a_expr: NOT_LA a_expr */ +#line 2227 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } +#line 26539 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 931: + case 935: /* a_expr: a_expr GLOB a_expr */ #line 2229 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_LIKE, "~~", - (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); - ;} + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_GLOB, "~~~", + (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); + } +#line 26548 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 932: + case 936: /* a_expr: a_expr LIKE a_expr */ #line 2234 "third_party/libpg_query/grammar/statements/select.y" - { + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_LIKE, "~~", + (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); + } +#line 26557 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 937: /* a_expr: a_expr LIKE a_expr ESCAPE a_expr */ +#line 2239 "third_party/libpg_query/grammar/statements/select.y" + { PGFuncCall *n = makeFuncCall(SystemFuncName("like_escape"), - list_make3((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)), - (yylsp[(2) - (5)])); + list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)), + (yylsp[-3])); (yyval.node) = (PGNode *) n; - ;} + } +#line 26568 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 933: -#line 2241 "third_party/libpg_query/grammar/statements/select.y" - { + case 938: /* a_expr: a_expr NOT_LA LIKE a_expr */ +#line 2246 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_LIKE, "!~~", - (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node), (yylsp[(2) - (4)])); - ;} + (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); + } +#line 26577 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 934: -#line 2246 "third_party/libpg_query/grammar/statements/select.y" - { + case 939: /* a_expr: a_expr NOT_LA LIKE a_expr ESCAPE a_expr */ +#line 2251 "third_party/libpg_query/grammar/statements/select.y" + { PGFuncCall *n = makeFuncCall(SystemFuncName("not_like_escape"), - list_make3((yyvsp[(1) - (6)].node), (yyvsp[(4) - (6)].node), (yyvsp[(6) - (6)].node)), - (yylsp[(2) - (6)])); + list_make3((yyvsp[-5].node), (yyvsp[-2].node), (yyvsp[0].node)), + (yylsp[-4])); (yyval.node) = (PGNode *) n; - ;} + } +#line 26588 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 935: -#line 2253 "third_party/libpg_query/grammar/statements/select.y" - { + case 940: /* a_expr: a_expr ILIKE a_expr */ +#line 2258 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_ILIKE, "~~*", - (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); - ;} + (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); + } +#line 26597 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 936: -#line 2258 "third_party/libpg_query/grammar/statements/select.y" - { + case 941: /* a_expr: a_expr ILIKE a_expr ESCAPE a_expr */ +#line 2263 "third_party/libpg_query/grammar/statements/select.y" + { PGFuncCall *n = makeFuncCall(SystemFuncName("ilike_escape"), - list_make3((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)), - (yylsp[(2) - (5)])); + list_make3((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)), + (yylsp[-3])); (yyval.node) = (PGNode *) n; - ;} + } +#line 26608 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 937: -#line 2265 "third_party/libpg_query/grammar/statements/select.y" - { + case 942: /* a_expr: a_expr NOT_LA ILIKE a_expr */ +#line 2270 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_ILIKE, "!~~*", - (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node), (yylsp[(2) - (4)])); - ;} + (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); + } +#line 26617 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 938: -#line 2270 "third_party/libpg_query/grammar/statements/select.y" - { + case 943: /* a_expr: a_expr NOT_LA ILIKE a_expr ESCAPE a_expr */ +#line 2275 "third_party/libpg_query/grammar/statements/select.y" + { PGFuncCall *n = makeFuncCall(SystemFuncName("not_ilike_escape"), - list_make3((yyvsp[(1) - (6)].node), (yyvsp[(4) - (6)].node), (yyvsp[(6) - (6)].node)), - (yylsp[(2) - (6)])); + list_make3((yyvsp[-5].node), (yyvsp[-2].node), (yyvsp[0].node)), + (yylsp[-4])); (yyval.node) = (PGNode *) n; - ;} + } +#line 26628 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 939: -#line 2278 "third_party/libpg_query/grammar/statements/select.y" - { + case 944: /* a_expr: a_expr SIMILAR TO a_expr */ +#line 2283 "third_party/libpg_query/grammar/statements/select.y" + { PGFuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), - list_make2((yyvsp[(4) - (4)].node), makeNullAConst(-1)), - (yylsp[(2) - (4)])); + list_make2((yyvsp[0].node), makeNullAConst(-1)), + (yylsp[-2])); (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_SIMILAR, "~", - (yyvsp[(1) - (4)].node), (PGNode *) n, (yylsp[(2) - (4)])); - ;} + (yyvsp[-3].node), (PGNode *) n, (yylsp[-2])); + } +#line 26640 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 940: -#line 2286 "third_party/libpg_query/grammar/statements/select.y" - { + case 945: /* a_expr: a_expr SIMILAR TO a_expr ESCAPE a_expr */ +#line 2291 "third_party/libpg_query/grammar/statements/select.y" + { PGFuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), - list_make2((yyvsp[(4) - (6)].node), (yyvsp[(6) - (6)].node)), - (yylsp[(2) - (6)])); + list_make2((yyvsp[-2].node), (yyvsp[0].node)), + (yylsp[-4])); (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_SIMILAR, "~", - (yyvsp[(1) - (6)].node), (PGNode *) n, (yylsp[(2) - (6)])); - ;} + (yyvsp[-5].node), (PGNode *) n, (yylsp[-4])); + } +#line 26652 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 941: -#line 2294 "third_party/libpg_query/grammar/statements/select.y" - { + case 946: /* a_expr: a_expr NOT_LA SIMILAR TO a_expr */ +#line 2299 "third_party/libpg_query/grammar/statements/select.y" + { PGFuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), - list_make2((yyvsp[(5) - (5)].node), makeNullAConst(-1)), - (yylsp[(2) - (5)])); + list_make2((yyvsp[0].node), makeNullAConst(-1)), + (yylsp[-3])); (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_SIMILAR, "!~", - (yyvsp[(1) - (5)].node), (PGNode *) n, (yylsp[(2) - (5)])); - ;} + (yyvsp[-4].node), (PGNode *) n, (yylsp[-3])); + } +#line 26664 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 942: -#line 2302 "third_party/libpg_query/grammar/statements/select.y" - { + case 947: /* a_expr: a_expr NOT_LA SIMILAR TO a_expr ESCAPE a_expr */ +#line 2307 "third_party/libpg_query/grammar/statements/select.y" + { PGFuncCall *n = makeFuncCall(SystemFuncName("similar_escape"), - list_make2((yyvsp[(5) - (7)].node), (yyvsp[(7) - (7)].node)), - (yylsp[(2) - (7)])); + list_make2((yyvsp[-2].node), (yyvsp[0].node)), + (yylsp[-5])); (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_SIMILAR, "!~", - (yyvsp[(1) - (7)].node), (PGNode *) n, (yylsp[(2) - (7)])); - ;} + (yyvsp[-6].node), (PGNode *) n, (yylsp[-5])); + } +#line 26676 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 943: -#line 2320 "third_party/libpg_query/grammar/statements/select.y" - { + case 948: /* a_expr: a_expr IS NULL_P */ +#line 2325 "third_party/libpg_query/grammar/statements/select.y" + { PGNullTest *n = makeNode(PGNullTest); - n->arg = (PGExpr *) (yyvsp[(1) - (3)].node); + n->arg = (PGExpr *) (yyvsp[-2].node); n->nulltesttype = PG_IS_NULL; - n->location = (yylsp[(2) - (3)]); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *)n; - ;} + } +#line 26688 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 944: -#line 2328 "third_party/libpg_query/grammar/statements/select.y" - { + case 949: /* a_expr: a_expr ISNULL */ +#line 2333 "third_party/libpg_query/grammar/statements/select.y" + { PGNullTest *n = makeNode(PGNullTest); - n->arg = (PGExpr *) (yyvsp[(1) - (2)].node); + n->arg = (PGExpr *) (yyvsp[-1].node); n->nulltesttype = PG_IS_NULL; - n->location = (yylsp[(2) - (2)]); + n->location = (yylsp[0]); (yyval.node) = (PGNode *)n; - ;} + } +#line 26700 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 945: -#line 2336 "third_party/libpg_query/grammar/statements/select.y" - { + case 950: /* a_expr: a_expr IS NOT NULL_P */ +#line 2341 "third_party/libpg_query/grammar/statements/select.y" + { PGNullTest *n = makeNode(PGNullTest); - n->arg = (PGExpr *) (yyvsp[(1) - (4)].node); + n->arg = (PGExpr *) (yyvsp[-3].node); n->nulltesttype = IS_NOT_NULL; - n->location = (yylsp[(2) - (4)]); + n->location = (yylsp[-2]); (yyval.node) = (PGNode *)n; - ;} + } +#line 26712 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 946: -#line 2344 "third_party/libpg_query/grammar/statements/select.y" - { + case 951: /* a_expr: a_expr NOT NULL_P */ +#line 2349 "third_party/libpg_query/grammar/statements/select.y" + { PGNullTest *n = makeNode(PGNullTest); - n->arg = (PGExpr *) (yyvsp[(1) - (3)].node); + n->arg = (PGExpr *) (yyvsp[-2].node); n->nulltesttype = IS_NOT_NULL; - n->location = (yylsp[(2) - (3)]); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *)n; - ;} + } +#line 26724 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 947: -#line 2352 "third_party/libpg_query/grammar/statements/select.y" - { + case 952: /* a_expr: a_expr NOTNULL */ +#line 2357 "third_party/libpg_query/grammar/statements/select.y" + { PGNullTest *n = makeNode(PGNullTest); - n->arg = (PGExpr *) (yyvsp[(1) - (2)].node); + n->arg = (PGExpr *) (yyvsp[-1].node); n->nulltesttype = IS_NOT_NULL; - n->location = (yylsp[(2) - (2)]); + n->location = (yylsp[0]); (yyval.node) = (PGNode *)n; - ;} + } +#line 26736 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 948: -#line 2360 "third_party/libpg_query/grammar/statements/select.y" - { + case 953: /* a_expr: a_expr LAMBDA_ARROW a_expr */ +#line 2365 "third_party/libpg_query/grammar/statements/select.y" + { PGLambdaFunction *n = makeNode(PGLambdaFunction); - n->lhs = (yyvsp[(1) - (3)].node); - n->rhs = (yyvsp[(3) - (3)].node); - n->location = (yylsp[(2) - (3)]); + n->lhs = (yyvsp[-2].node); + n->rhs = (yyvsp[0].node); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *) n; - ;} + } +#line 26748 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 949: -#line 2368 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "->>", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); - ;} + case 954: /* a_expr: a_expr DOUBLE_ARROW a_expr */ +#line 2373 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "->>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); + } +#line 26756 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 950: -#line 2372 "third_party/libpg_query/grammar/statements/select.y" - { - if (list_length((yyvsp[(1) - (3)].list)) != 2) + case 955: /* a_expr: row OVERLAPS row */ +#line 2377 "third_party/libpg_query/grammar/statements/select.y" + { + if (list_length((yyvsp[-2].list)) != 2) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("wrong number of parameters on left side of OVERLAPS expression"), - parser_errposition((yylsp[(1) - (3)])))); - if (list_length((yyvsp[(3) - (3)].list)) != 2) + parser_errposition((yylsp[-2])))); + if (list_length((yyvsp[0].list)) != 2) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("wrong number of parameters on right side of OVERLAPS expression"), - parser_errposition((yylsp[(3) - (3)])))); + parser_errposition((yylsp[0])))); (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("overlaps"), - list_concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)), - (yylsp[(2) - (3)])); - ;} + list_concat((yyvsp[-2].list), (yyvsp[0].list)), + (yylsp[-1])); + } +#line 26776 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 951: -#line 2388 "third_party/libpg_query/grammar/statements/select.y" - { + case 956: /* a_expr: a_expr IS TRUE_P */ +#line 2393 "third_party/libpg_query/grammar/statements/select.y" + { PGBooleanTest *b = makeNode(PGBooleanTest); - b->arg = (PGExpr *) (yyvsp[(1) - (3)].node); + b->arg = (PGExpr *) (yyvsp[-2].node); b->booltesttype = PG_IS_TRUE; - b->location = (yylsp[(2) - (3)]); + b->location = (yylsp[-1]); (yyval.node) = (PGNode *)b; - ;} + } +#line 26788 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 952: -#line 2396 "third_party/libpg_query/grammar/statements/select.y" - { + case 957: /* a_expr: a_expr IS NOT TRUE_P */ +#line 2401 "third_party/libpg_query/grammar/statements/select.y" + { PGBooleanTest *b = makeNode(PGBooleanTest); - b->arg = (PGExpr *) (yyvsp[(1) - (4)].node); + b->arg = (PGExpr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_TRUE; - b->location = (yylsp[(2) - (4)]); + b->location = (yylsp[-2]); (yyval.node) = (PGNode *)b; - ;} + } +#line 26800 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 953: -#line 2404 "third_party/libpg_query/grammar/statements/select.y" - { + case 958: /* a_expr: a_expr IS FALSE_P */ +#line 2409 "third_party/libpg_query/grammar/statements/select.y" + { PGBooleanTest *b = makeNode(PGBooleanTest); - b->arg = (PGExpr *) (yyvsp[(1) - (3)].node); + b->arg = (PGExpr *) (yyvsp[-2].node); b->booltesttype = IS_FALSE; - b->location = (yylsp[(2) - (3)]); + b->location = (yylsp[-1]); (yyval.node) = (PGNode *)b; - ;} + } +#line 26812 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 954: -#line 2412 "third_party/libpg_query/grammar/statements/select.y" - { + case 959: /* a_expr: a_expr IS NOT FALSE_P */ +#line 2417 "third_party/libpg_query/grammar/statements/select.y" + { PGBooleanTest *b = makeNode(PGBooleanTest); - b->arg = (PGExpr *) (yyvsp[(1) - (4)].node); + b->arg = (PGExpr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_FALSE; - b->location = (yylsp[(2) - (4)]); + b->location = (yylsp[-2]); (yyval.node) = (PGNode *)b; - ;} + } +#line 26824 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 955: -#line 2420 "third_party/libpg_query/grammar/statements/select.y" - { + case 960: /* a_expr: a_expr IS UNKNOWN */ +#line 2425 "third_party/libpg_query/grammar/statements/select.y" + { PGBooleanTest *b = makeNode(PGBooleanTest); - b->arg = (PGExpr *) (yyvsp[(1) - (3)].node); + b->arg = (PGExpr *) (yyvsp[-2].node); b->booltesttype = IS_UNKNOWN; - b->location = (yylsp[(2) - (3)]); + b->location = (yylsp[-1]); (yyval.node) = (PGNode *)b; - ;} + } +#line 26836 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 956: -#line 2428 "third_party/libpg_query/grammar/statements/select.y" - { + case 961: /* a_expr: a_expr IS NOT UNKNOWN */ +#line 2433 "third_party/libpg_query/grammar/statements/select.y" + { PGBooleanTest *b = makeNode(PGBooleanTest); - b->arg = (PGExpr *) (yyvsp[(1) - (4)].node); + b->arg = (PGExpr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_UNKNOWN; - b->location = (yylsp[(2) - (4)]); + b->location = (yylsp[-2]); (yyval.node) = (PGNode *)b; - ;} + } +#line 26848 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 957: -#line 2436 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_DISTINCT, "=", (yyvsp[(1) - (5)].node), (yyvsp[(5) - (5)].node), (yylsp[(2) - (5)])); - ;} + case 962: /* a_expr: a_expr IS DISTINCT FROM a_expr */ +#line 2441 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); + } +#line 26856 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 958: -#line 2440 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NOT_DISTINCT, "=", (yyvsp[(1) - (6)].node), (yyvsp[(6) - (6)].node), (yylsp[(2) - (6)])); - ;} + case 963: /* a_expr: a_expr IS NOT DISTINCT FROM a_expr */ +#line 2445 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); + } +#line 26864 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 959: -#line 2444 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "=", (yyvsp[(1) - (6)].node), (PGNode *) (yyvsp[(5) - (6)].list), (yylsp[(2) - (6)])); - ;} + case 964: /* a_expr: a_expr IS OF '(' type_list ')' */ +#line 2449 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "=", (yyvsp[-5].node), (PGNode *) (yyvsp[-1].list), (yylsp[-4])); + } +#line 26872 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 960: -#line 2448 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "<>", (yyvsp[(1) - (7)].node), (PGNode *) (yyvsp[(6) - (7)].list), (yylsp[(2) - (7)])); - ;} + case 965: /* a_expr: a_expr IS NOT OF '(' type_list ')' */ +#line 2453 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "<>", (yyvsp[-6].node), (PGNode *) (yyvsp[-1].list), (yylsp[-5])); + } +#line 26880 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 961: -#line 2452 "third_party/libpg_query/grammar/statements/select.y" - { + case 966: /* a_expr: a_expr BETWEEN opt_asymmetric b_expr AND a_expr */ +#line 2457 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_BETWEEN, "BETWEEN", - (yyvsp[(1) - (6)].node), - (PGNode *) list_make2((yyvsp[(4) - (6)].node), (yyvsp[(6) - (6)].node)), - (yylsp[(2) - (6)])); - ;} + (yyvsp[-5].node), + (PGNode *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), + (yylsp[-4])); + } +#line 26892 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 962: -#line 2460 "third_party/libpg_query/grammar/statements/select.y" - { + case 967: /* a_expr: a_expr NOT_LA BETWEEN opt_asymmetric b_expr AND a_expr */ +#line 2465 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NOT_BETWEEN, "NOT BETWEEN", - (yyvsp[(1) - (7)].node), - (PGNode *) list_make2((yyvsp[(5) - (7)].node), (yyvsp[(7) - (7)].node)), - (yylsp[(2) - (7)])); - ;} + (yyvsp[-6].node), + (PGNode *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), + (yylsp[-5])); + } +#line 26904 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 963: -#line 2468 "third_party/libpg_query/grammar/statements/select.y" - { + case 968: /* a_expr: a_expr BETWEEN SYMMETRIC b_expr AND a_expr */ +#line 2473 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_BETWEEN_SYM, "BETWEEN SYMMETRIC", - (yyvsp[(1) - (6)].node), - (PGNode *) list_make2((yyvsp[(4) - (6)].node), (yyvsp[(6) - (6)].node)), - (yylsp[(2) - (6)])); - ;} + (yyvsp[-5].node), + (PGNode *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), + (yylsp[-4])); + } +#line 26916 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 964: -#line 2476 "third_party/libpg_query/grammar/statements/select.y" - { + case 969: /* a_expr: a_expr NOT_LA BETWEEN SYMMETRIC b_expr AND a_expr */ +#line 2481 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NOT_BETWEEN_SYM, "NOT BETWEEN SYMMETRIC", - (yyvsp[(1) - (7)].node), - (PGNode *) list_make2((yyvsp[(5) - (7)].node), (yyvsp[(7) - (7)].node)), - (yylsp[(2) - (7)])); - ;} + (yyvsp[-6].node), + (PGNode *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), + (yylsp[-5])); + } +#line 26928 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 965: -#line 2484 "third_party/libpg_query/grammar/statements/select.y" - { + case 970: /* a_expr: a_expr IN_P in_expr */ +#line 2489 "third_party/libpg_query/grammar/statements/select.y" + { /* in_expr returns a PGSubLink or a list of a_exprs */ - if (IsA((yyvsp[(3) - (3)].node), PGSubLink)) + if (IsA((yyvsp[0].node), PGSubLink)) { /* generate foo = ANY (subquery) */ - PGSubLink *n = (PGSubLink *) (yyvsp[(3) - (3)].node); + PGSubLink *n = (PGSubLink *) (yyvsp[0].node); n->subLinkType = PG_ANY_SUBLINK; n->subLinkId = 0; - n->testexpr = (yyvsp[(1) - (3)].node); + n->testexpr = (yyvsp[-2].node); n->operName = NIL; /* show it's IN not = ANY */ - n->location = (yylsp[(2) - (3)]); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *)n; } else { /* generate scalar IN expression */ - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_IN, "=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_IN, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } - ;} + } +#line 26952 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 966: -#line 2504 "third_party/libpg_query/grammar/statements/select.y" - { + case 971: /* a_expr: a_expr NOT_LA IN_P in_expr */ +#line 2509 "third_party/libpg_query/grammar/statements/select.y" + { /* in_expr returns a PGSubLink or a list of a_exprs */ - if (IsA((yyvsp[(4) - (4)].node), PGSubLink)) + if (IsA((yyvsp[0].node), PGSubLink)) { /* generate NOT (foo = ANY (subquery)) */ /* Make an = ANY node */ - PGSubLink *n = (PGSubLink *) (yyvsp[(4) - (4)].node); + PGSubLink *n = (PGSubLink *) (yyvsp[0].node); n->subLinkType = PG_ANY_SUBLINK; n->subLinkId = 0; - n->testexpr = (yyvsp[(1) - (4)].node); + n->testexpr = (yyvsp[-3].node); n->operName = NIL; /* show it's IN not = ANY */ - n->location = (yylsp[(2) - (4)]); + n->location = (yylsp[-2]); /* Stick a NOT on top; must have same parse location */ - (yyval.node) = makeNotExpr((PGNode *) n, (yylsp[(2) - (4)])); + (yyval.node) = makeNotExpr((PGNode *) n, (yylsp[-2])); } else { /* generate scalar NOT IN expression */ - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_IN, "<>", (yyvsp[(1) - (4)].node), (yyvsp[(4) - (4)].node), (yylsp[(2) - (4)])); + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_IN, "<>", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } - ;} + } +#line 26978 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 967: -#line 2526 "third_party/libpg_query/grammar/statements/select.y" - { + case 972: /* a_expr: a_expr subquery_Op sub_type select_with_parens */ +#line 2531 "third_party/libpg_query/grammar/statements/select.y" + { PGSubLink *n = makeNode(PGSubLink); - n->subLinkType = (yyvsp[(3) - (4)].subquerytype); + n->subLinkType = (yyvsp[-1].subquerytype); n->subLinkId = 0; - n->testexpr = (yyvsp[(1) - (4)].node); - n->operName = (yyvsp[(2) - (4)].list); - n->subselect = (yyvsp[(4) - (4)].node); - n->location = (yylsp[(2) - (4)]); + n->testexpr = (yyvsp[-3].node); + n->operName = (yyvsp[-2].list); + n->subselect = (yyvsp[0].node); + n->location = (yylsp[-2]); (yyval.node) = (PGNode *)n; - ;} + } +#line 26993 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 968: -#line 2537 "third_party/libpg_query/grammar/statements/select.y" - { - if ((yyvsp[(3) - (6)].subquerytype) == PG_ANY_SUBLINK) - (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP_ANY, (yyvsp[(2) - (6)].list), (yyvsp[(1) - (6)].node), (yyvsp[(5) - (6)].node), (yylsp[(2) - (6)])); + case 973: /* a_expr: a_expr subquery_Op sub_type '(' a_expr ')' */ +#line 2542 "third_party/libpg_query/grammar/statements/select.y" + { + if ((yyvsp[-3].subquerytype) == PG_ANY_SUBLINK) + (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP_ANY, (yyvsp[-4].list), (yyvsp[-5].node), (yyvsp[-1].node), (yylsp[-4])); else - (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP_ALL, (yyvsp[(2) - (6)].list), (yyvsp[(1) - (6)].node), (yyvsp[(5) - (6)].node), (yylsp[(2) - (6)])); - ;} + (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP_ALL, (yyvsp[-4].list), (yyvsp[-5].node), (yyvsp[-1].node), (yylsp[-4])); + } +#line 27004 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 969: -#line 2544 "third_party/libpg_query/grammar/statements/select.y" - { + case 974: /* a_expr: DEFAULT */ +#line 2549 "third_party/libpg_query/grammar/statements/select.y" + { /* * The SQL spec only allows DEFAULT in "contextually typed * expressions", but for us, it's easier to allow it in @@ -27013,220 +27015,253 @@ YYLTYPE yylloc; */ PGSetToDefault *n = makeNode(PGSetToDefault); /* parse analysis will fill in the rest */ - n->location = (yylsp[(1) - (1)]); + n->location = (yylsp[0]); (yyval.node) = (PGNode *)n; - ;} + } +#line 27022 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 970: -#line 2558 "third_party/libpg_query/grammar/statements/select.y" - { + case 975: /* a_expr: COLUMNS '(' a_expr ')' */ +#line 2563 "third_party/libpg_query/grammar/statements/select.y" + { PGAStar *star = makeNode(PGAStar); - star->expr = (yyvsp[(3) - (4)].node); + star->expr = (yyvsp[-1].node); star->columns = true; - star->location = (yylsp[(1) - (4)]); + star->location = (yylsp[-3]); (yyval.node) = (PGNode *) star; - ;} + } +#line 27034 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 971: -#line 2566 "third_party/libpg_query/grammar/statements/select.y" - { + case 976: /* a_expr: '*' opt_except_list opt_replace_list */ +#line 2571 "third_party/libpg_query/grammar/statements/select.y" + { PGAStar *star = makeNode(PGAStar); - star->except_list = (yyvsp[(2) - (3)].list); - star->replace_list = (yyvsp[(3) - (3)].list); - star->location = (yylsp[(1) - (3)]); + star->except_list = (yyvsp[-1].list); + star->replace_list = (yyvsp[0].list); + star->location = (yylsp[-2]); (yyval.node) = (PGNode *) star; - ;} + } +#line 27046 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 972: -#line 2574 "third_party/libpg_query/grammar/statements/select.y" - { + case 977: /* a_expr: ColId '.' '*' opt_except_list opt_replace_list */ +#line 2579 "third_party/libpg_query/grammar/statements/select.y" + { PGAStar *star = makeNode(PGAStar); - star->relation = (yyvsp[(1) - (5)].str); - star->except_list = (yyvsp[(4) - (5)].list); - star->replace_list = (yyvsp[(5) - (5)].list); - star->location = (yylsp[(1) - (5)]); + star->relation = (yyvsp[-4].str); + star->except_list = (yyvsp[-1].list); + star->replace_list = (yyvsp[0].list); + star->location = (yylsp[-4]); (yyval.node) = (PGNode *) star; - ;} + } +#line 27059 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 973: -#line 2594 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + case 978: /* b_expr: c_expr */ +#line 2599 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 27065 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 974: -#line 2596 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeTypeCast((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].typnam), 0, (yylsp[(2) - (3)])); ;} + case 979: /* b_expr: b_expr TYPECAST Typename */ +#line 2601 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), 0, (yylsp[-1])); } +#line 27071 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 975: -#line 2598 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", NULL, (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} + case 980: /* b_expr: '+' b_expr */ +#line 2603 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } +#line 27077 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 976: -#line 2600 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = doNegate((yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} + case 981: /* b_expr: '-' b_expr */ +#line 2605 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } +#line 27083 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 977: -#line 2602 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 982: /* b_expr: b_expr '+' b_expr */ +#line 2607 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27089 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 978: -#line 2604 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "-", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 983: /* b_expr: b_expr '-' b_expr */ +#line 2609 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27095 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 979: -#line 2606 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "*", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 984: /* b_expr: b_expr '*' b_expr */ +#line 2611 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27101 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 980: -#line 2608 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "/", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 985: /* b_expr: b_expr '/' b_expr */ +#line 2613 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27107 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 981: -#line 2610 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "//", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 986: /* b_expr: b_expr INTEGER_DIVISION b_expr */ +#line 2615 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "//", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27113 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 982: -#line 2612 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "%", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 987: /* b_expr: b_expr '%' b_expr */ +#line 2617 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27119 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 983: -#line 2614 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "^", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 988: /* b_expr: b_expr '^' b_expr */ +#line 2619 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27125 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 984: -#line 2616 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "**", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 989: /* b_expr: b_expr POWER_OF b_expr */ +#line 2621 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "**", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27131 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 985: -#line 2618 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 990: /* b_expr: b_expr '<' b_expr */ +#line 2623 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27137 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 986: -#line 2620 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 991: /* b_expr: b_expr '>' b_expr */ +#line 2625 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27143 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 987: -#line 2622 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 992: /* b_expr: b_expr '=' b_expr */ +#line 2627 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27149 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 988: -#line 2624 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 993: /* b_expr: b_expr LESS_EQUALS b_expr */ +#line 2629 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27155 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 989: -#line 2626 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">=", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 994: /* b_expr: b_expr GREATER_EQUALS b_expr */ +#line 2631 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27161 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 990: -#line 2628 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<>", (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 995: /* b_expr: b_expr NOT_EQUALS b_expr */ +#line 2633 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27167 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 991: -#line 2630 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(2) - (3)].list), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yylsp[(2) - (3)])); ;} + case 996: /* b_expr: b_expr qual_Op b_expr */ +#line 2635 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } +#line 27173 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 992: -#line 2632 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(1) - (2)].list), NULL, (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); ;} + case 997: /* b_expr: qual_Op b_expr */ +#line 2637 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } +#line 27179 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 993: -#line 2634 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[(2) - (2)].list), (yyvsp[(1) - (2)].node), NULL, (yylsp[(2) - (2)])); ;} + case 998: /* b_expr: b_expr qual_Op */ +#line 2639 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeAExpr(PG_AEXPR_OP, (yyvsp[0].list), (yyvsp[-1].node), NULL, (yylsp[0])); } +#line 27185 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 994: -#line 2636 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_DISTINCT, "=", (yyvsp[(1) - (5)].node), (yyvsp[(5) - (5)].node), (yylsp[(2) - (5)])); - ;} + case 999: /* b_expr: b_expr IS DISTINCT FROM b_expr */ +#line 2641 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); + } +#line 27193 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 995: -#line 2640 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NOT_DISTINCT, "=", (yyvsp[(1) - (6)].node), (yyvsp[(6) - (6)].node), (yylsp[(2) - (6)])); - ;} + case 1000: /* b_expr: b_expr IS NOT DISTINCT FROM b_expr */ +#line 2645 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); + } +#line 27201 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 996: -#line 2644 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "=", (yyvsp[(1) - (6)].node), (PGNode *) (yyvsp[(5) - (6)].list), (yylsp[(2) - (6)])); - ;} + case 1001: /* b_expr: b_expr IS OF '(' type_list ')' */ +#line 2649 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "=", (yyvsp[-5].node), (PGNode *) (yyvsp[-1].list), (yylsp[-4])); + } +#line 27209 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 997: -#line 2648 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "<>", (yyvsp[(1) - (7)].node), (PGNode *) (yyvsp[(6) - (7)].list), (yylsp[(2) - (7)])); - ;} + case 1002: /* b_expr: b_expr IS NOT OF '(' type_list ')' */ +#line 2653 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_OF, "<>", (yyvsp[-6].node), (PGNode *) (yyvsp[-1].list), (yylsp[-5])); + } +#line 27217 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 999: -#line 2663 "third_party/libpg_query/grammar/statements/select.y" - { - if ((yyvsp[(2) - (2)].list)) + case 1004: /* c_expr: indirection_expr_or_a_expr opt_extended_indirection */ +#line 2668 "third_party/libpg_query/grammar/statements/select.y" + { + if ((yyvsp[0].list)) { PGAIndirection *n = makeNode(PGAIndirection); - n->arg = (PGNode *) (yyvsp[(1) - (2)].node); - n->indirection = check_indirection((yyvsp[(2) - (2)].list), yyscanner); + n->arg = (PGNode *) (yyvsp[-1].node); + n->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.node) = (PGNode *) n; } else - (yyval.node) = (PGNode *) (yyvsp[(1) - (2)].node); - ;} + (yyval.node) = (PGNode *) (yyvsp[-1].node); + } +#line 27233 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1000: -#line 2676 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + case 1005: /* d_expr: columnref */ +#line 2681 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 27239 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1001: -#line 2677 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + case 1006: /* d_expr: AexprConst */ +#line 2682 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 27245 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1002: -#line 2679 "third_party/libpg_query/grammar/statements/select.y" - { + case 1007: /* d_expr: select_with_parens */ +#line 2684 "third_party/libpg_query/grammar/statements/select.y" + { PGSubLink *n = makeNode(PGSubLink); n->subLinkType = PG_EXPR_SUBLINK; n->subLinkId = 0; n->testexpr = NULL; n->operName = NIL; - n->subselect = (yyvsp[(1) - (1)].node); - n->location = (yylsp[(1) - (1)]); + n->subselect = (yyvsp[0].node); + n->location = (yylsp[0]); (yyval.node) = (PGNode *)n; - ;} + } +#line 27260 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1003: -#line 2690 "third_party/libpg_query/grammar/statements/select.y" - { + case 1008: /* d_expr: select_with_parens indirection */ +#line 2695 "third_party/libpg_query/grammar/statements/select.y" + { /* * Because the select_with_parens nonterminal is designed * to "eat" as many levels of parens as possible, the @@ -27243,254 +27278,280 @@ YYLTYPE yylloc; n->subLinkId = 0; n->testexpr = NULL; n->operName = NIL; - n->subselect = (yyvsp[(1) - (2)].node); - n->location = (yylsp[(1) - (2)]); + n->subselect = (yyvsp[-1].node); + n->location = (yylsp[-1]); a->arg = (PGNode *)n; - a->indirection = check_indirection((yyvsp[(2) - (2)].list), yyscanner); + a->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.node) = (PGNode *)a; - ;} + } +#line 27288 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1004: -#line 2714 "third_party/libpg_query/grammar/statements/select.y" - { + case 1009: /* d_expr: EXISTS select_with_parens */ +#line 2719 "third_party/libpg_query/grammar/statements/select.y" + { PGSubLink *n = makeNode(PGSubLink); n->subLinkType = PG_EXISTS_SUBLINK; n->subLinkId = 0; n->testexpr = NULL; n->operName = NIL; - n->subselect = (yyvsp[(2) - (2)].node); - n->location = (yylsp[(1) - (2)]); + n->subselect = (yyvsp[0].node); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *)n; - ;} + } +#line 27303 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1005: -#line 2725 "third_party/libpg_query/grammar/statements/select.y" - { + case 1010: /* d_expr: grouping_or_grouping_id '(' expr_list_opt_comma ')' */ +#line 2730 "third_party/libpg_query/grammar/statements/select.y" + { PGGroupingFunc *g = makeNode(PGGroupingFunc); - g->args = (yyvsp[(3) - (4)].list); - g->location = (yylsp[(1) - (4)]); + g->args = (yyvsp[-1].list); + g->location = (yylsp[-3]); (yyval.node) = (PGNode *)g; - ;} + } +#line 27314 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1006: -#line 2735 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - ;} + case 1011: /* indirection_expr_or_a_expr: '(' a_expr ')' */ +#line 2740 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (yyvsp[-1].node); + } +#line 27322 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1007: -#line 2739 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - ;} + case 1012: /* indirection_expr_or_a_expr: indirection_expr */ +#line 2744 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (yyvsp[0].node); + } +#line 27330 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1008: -#line 2742 "third_party/libpg_query/grammar/statements/select.y" - { - PGFuncCall *n = makeFuncCall(SystemFuncName("row"), (yyvsp[(1) - (1)].list), (yylsp[(1) - (1)])); + case 1013: /* indirection_expr_or_a_expr: row */ +#line 2747 "third_party/libpg_query/grammar/statements/select.y" + { + PGFuncCall *n = makeFuncCall(SystemFuncName("row"), (yyvsp[0].list), (yylsp[0])); (yyval.node) = (PGNode *) n; - ;} + } +#line 27339 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1009: -#line 2750 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeParamRef(0, (yylsp[(1) - (1)])); - ;} + case 1014: /* indirection_expr: '?' */ +#line 2755 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeParamRef(0, (yylsp[0])); + } +#line 27347 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1010: -#line 2754 "third_party/libpg_query/grammar/statements/select.y" - { + case 1015: /* indirection_expr: PARAM */ +#line 2759 "third_party/libpg_query/grammar/statements/select.y" + { PGParamRef *p = makeNode(PGParamRef); - p->number = (yyvsp[(1) - (1)].ival); - p->location = (yylsp[(1) - (1)]); + p->number = (yyvsp[0].ival); + p->location = (yylsp[0]); (yyval.node) = (PGNode *) p; - ;} + } +#line 27358 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1011: -#line 2761 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - ;} + case 1016: /* indirection_expr: struct_expr */ +#line 2766 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (yyvsp[0].node); + } +#line 27366 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1012: -#line 2765 "third_party/libpg_query/grammar/statements/select.y" - { + case 1017: /* indirection_expr: MAP '{' opt_map_arguments_opt_comma '}' */ +#line 2770 "third_party/libpg_query/grammar/statements/select.y" + { PGList *key_list = NULL; PGList *value_list = NULL; PGListCell *lc; - PGList *entry_list = (yyvsp[(3) - (4)].list); + PGList *entry_list = (yyvsp[-1].list); foreach(lc, entry_list) { PGList *l = (PGList *) lc->data.ptr_value; key_list = lappend(key_list, (PGNode *) l->head->data.ptr_value); value_list = lappend(value_list, (PGNode *) l->tail->data.ptr_value); } - PGNode *keys = (PGNode *) makeFuncCall(SystemFuncName("list_value"), key_list, (yylsp[(3) - (4)])); - PGNode *values = (PGNode *) makeFuncCall(SystemFuncName("list_value"), value_list, (yylsp[(3) - (4)])); - PGFuncCall *f = makeFuncCall(SystemFuncName("map"), list_make2(keys, values), (yylsp[(3) - (4)])); + PGNode *keys = (PGNode *) makeFuncCall(SystemFuncName("list_value"), key_list, (yylsp[-1])); + PGNode *values = (PGNode *) makeFuncCall(SystemFuncName("list_value"), value_list, (yylsp[-1])); + PGFuncCall *f = makeFuncCall(SystemFuncName("map"), list_make2(keys, values), (yylsp[-1])); (yyval.node) = (PGNode *) f; - ;} + } +#line 27387 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1013: -#line 2782 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - ;} + case 1018: /* indirection_expr: func_expr */ +#line 2787 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (yyvsp[0].node); + } +#line 27395 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1014: -#line 2786 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + case 1019: /* indirection_expr: case_expr */ +#line 2791 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 27401 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1015: -#line 2787 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - ;} + case 1020: /* indirection_expr: list_expr */ +#line 2792 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (yyvsp[0].node); + } +#line 27409 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1016: -#line 2790 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - ;} + case 1021: /* indirection_expr: list_comprehension */ +#line 2795 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (yyvsp[0].node); + } +#line 27417 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1017: -#line 2794 "third_party/libpg_query/grammar/statements/select.y" - { + case 1022: /* indirection_expr: ARRAY select_with_parens */ +#line 2799 "third_party/libpg_query/grammar/statements/select.y" + { PGSubLink *n = makeNode(PGSubLink); n->subLinkType = PG_ARRAY_SUBLINK; n->subLinkId = 0; n->testexpr = NULL; n->operName = NULL; - n->subselect = (yyvsp[(2) - (2)].node); - n->location = (yylsp[(2) - (2)]); + n->subselect = (yyvsp[0].node); + n->location = (yylsp[0]); (yyval.node) = (PGNode *)n; - ;} + } +#line 27432 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1018: -#line 2804 "third_party/libpg_query/grammar/statements/select.y" - { + case 1023: /* indirection_expr: ARRAY '[' opt_expr_list_opt_comma ']' */ +#line 2809 "third_party/libpg_query/grammar/statements/select.y" + { PGList *func_name = list_make1(makeString("construct_array")); - PGFuncCall *n = makeFuncCall(func_name, (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); + PGFuncCall *n = makeFuncCall(func_name, (yyvsp[-1].list), (yylsp[-3])); (yyval.node) = (PGNode *) n; - ;} + } +#line 27442 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1019: -#line 2810 "third_party/libpg_query/grammar/statements/select.y" - { + case 1024: /* indirection_expr: '#' ICONST */ +#line 2815 "third_party/libpg_query/grammar/statements/select.y" + { PGPositionalReference *n = makeNode(PGPositionalReference); - n->position = (yyvsp[(2) - (2)].ival); - n->location = (yylsp[(1) - (2)]); + n->position = (yyvsp[0].ival); + n->location = (yylsp[-1]); (yyval.node) = (PGNode *) n; - ;} + } +#line 27453 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1020: -#line 2817 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeNamedParamRef((yyvsp[(2) - (2)].str), (yylsp[(1) - (2)])); - ;} + case 1025: /* indirection_expr: '$' ColLabel */ +#line 2822 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeNamedParamRef((yyvsp[0].str), (yylsp[-1])); + } +#line 27461 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1021: -#line 2822 "third_party/libpg_query/grammar/statements/select.y" - { - PGFuncCall *n = makeFuncCall(SystemFuncName("list_value"), (yyvsp[(2) - (3)].list), (yylsp[(2) - (3)])); + case 1026: /* list_expr: '[' opt_expr_list_opt_comma ']' */ +#line 2827 "third_party/libpg_query/grammar/statements/select.y" + { + PGFuncCall *n = makeFuncCall(SystemFuncName("list_value"), (yyvsp[-1].list), (yylsp[-1])); (yyval.node) = (PGNode *) n; - ;} + } +#line 27470 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1022: -#line 2829 "third_party/libpg_query/grammar/statements/select.y" - { - PGFuncCall *f = makeFuncCall(SystemFuncName("struct_pack"), (yyvsp[(2) - (3)].list), (yylsp[(2) - (3)])); + case 1027: /* struct_expr: '{' dict_arguments_opt_comma '}' */ +#line 2834 "third_party/libpg_query/grammar/statements/select.y" + { + PGFuncCall *f = makeFuncCall(SystemFuncName("struct_pack"), (yyvsp[-1].list), (yylsp[-1])); (yyval.node) = (PGNode *) f; - ;} + } +#line 27479 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1023: -#line 2838 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeFuncCall((yyvsp[(1) - (3)].list), NIL, (yylsp[(1) - (3)])); - ;} + case 1028: /* func_application: func_name '(' ')' */ +#line 2843 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeFuncCall((yyvsp[-2].list), NIL, (yylsp[-2])); + } +#line 27487 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1024: -#line 2842 "third_party/libpg_query/grammar/statements/select.y" - { - PGFuncCall *n = makeFuncCall((yyvsp[(1) - (6)].list), (yyvsp[(3) - (6)].list), (yylsp[(1) - (6)])); - n->agg_order = (yyvsp[(4) - (6)].list); - n->agg_ignore_nulls = (yyvsp[(5) - (6)].ignorenulls); + case 1029: /* func_application: func_name '(' func_arg_list opt_sort_clause opt_ignore_nulls ')' */ +#line 2847 "third_party/libpg_query/grammar/statements/select.y" + { + PGFuncCall *n = makeFuncCall((yyvsp[-5].list), (yyvsp[-3].list), (yylsp[-5])); + n->agg_order = (yyvsp[-2].list); + n->agg_ignore_nulls = (yyvsp[-1].ignorenulls); (yyval.node) = (PGNode *)n; - ;} + } +#line 27498 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1025: -#line 2849 "third_party/libpg_query/grammar/statements/select.y" - { - PGFuncCall *n = makeFuncCall((yyvsp[(1) - (7)].list), list_make1((yyvsp[(4) - (7)].node)), (yylsp[(1) - (7)])); + case 1030: /* func_application: func_name '(' VARIADIC func_arg_expr opt_sort_clause opt_ignore_nulls ')' */ +#line 2854 "third_party/libpg_query/grammar/statements/select.y" + { + PGFuncCall *n = makeFuncCall((yyvsp[-6].list), list_make1((yyvsp[-3].node)), (yylsp[-6])); n->func_variadic = true; - n->agg_order = (yyvsp[(5) - (7)].list); - n->agg_ignore_nulls = (yyvsp[(6) - (7)].ignorenulls); + n->agg_order = (yyvsp[-2].list); + n->agg_ignore_nulls = (yyvsp[-1].ignorenulls); (yyval.node) = (PGNode *)n; - ;} + } +#line 27510 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1026: -#line 2857 "third_party/libpg_query/grammar/statements/select.y" - { - PGFuncCall *n = makeFuncCall((yyvsp[(1) - (9)].list), lappend((yyvsp[(3) - (9)].list), (yyvsp[(6) - (9)].node)), (yylsp[(1) - (9)])); + case 1031: /* func_application: func_name '(' func_arg_list ',' VARIADIC func_arg_expr opt_sort_clause opt_ignore_nulls ')' */ +#line 2862 "third_party/libpg_query/grammar/statements/select.y" + { + PGFuncCall *n = makeFuncCall((yyvsp[-8].list), lappend((yyvsp[-6].list), (yyvsp[-3].node)), (yylsp[-8])); n->func_variadic = true; - n->agg_order = (yyvsp[(7) - (9)].list); - n->agg_ignore_nulls = (yyvsp[(8) - (9)].ignorenulls); + n->agg_order = (yyvsp[-2].list); + n->agg_ignore_nulls = (yyvsp[-1].ignorenulls); (yyval.node) = (PGNode *)n; - ;} + } +#line 27522 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1027: -#line 2865 "third_party/libpg_query/grammar/statements/select.y" - { - PGFuncCall *n = makeFuncCall((yyvsp[(1) - (7)].list), (yyvsp[(4) - (7)].list), (yylsp[(1) - (7)])); - n->agg_order = (yyvsp[(5) - (7)].list); - n->agg_ignore_nulls = (yyvsp[(6) - (7)].ignorenulls); + case 1032: /* func_application: func_name '(' ALL func_arg_list opt_sort_clause opt_ignore_nulls ')' */ +#line 2870 "third_party/libpg_query/grammar/statements/select.y" + { + PGFuncCall *n = makeFuncCall((yyvsp[-6].list), (yyvsp[-3].list), (yylsp[-6])); + n->agg_order = (yyvsp[-2].list); + n->agg_ignore_nulls = (yyvsp[-1].ignorenulls); /* Ideally we'd mark the PGFuncCall node to indicate * "must be an aggregate", but there's no provision * for that in PGFuncCall at the moment. */ (yyval.node) = (PGNode *)n; - ;} + } +#line 27537 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1028: -#line 2876 "third_party/libpg_query/grammar/statements/select.y" - { - PGFuncCall *n = makeFuncCall((yyvsp[(1) - (7)].list), (yyvsp[(4) - (7)].list), (yylsp[(1) - (7)])); - n->agg_order = (yyvsp[(5) - (7)].list); - n->agg_ignore_nulls = (yyvsp[(6) - (7)].ignorenulls); + case 1033: /* func_application: func_name '(' DISTINCT func_arg_list opt_sort_clause opt_ignore_nulls ')' */ +#line 2881 "third_party/libpg_query/grammar/statements/select.y" + { + PGFuncCall *n = makeFuncCall((yyvsp[-6].list), (yyvsp[-3].list), (yylsp[-6])); + n->agg_order = (yyvsp[-2].list); + n->agg_ignore_nulls = (yyvsp[-1].ignorenulls); n->agg_distinct = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 27549 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1029: -#line 2896 "third_party/libpg_query/grammar/statements/select.y" - { - PGFuncCall *n = (PGFuncCall *) (yyvsp[(1) - (5)].node); + case 1034: /* func_expr: func_application within_group_clause filter_clause export_clause over_clause */ +#line 2901 "third_party/libpg_query/grammar/statements/select.y" + { + PGFuncCall *n = (PGFuncCall *) (yyvsp[-4].node); /* * The order clause for WITHIN GROUP and the one for * plain-aggregate ORDER BY share a field, so we have to @@ -27499,107 +27560,118 @@ YYLTYPE yylloc; * location. Other consistency checks are deferred to * parse analysis. */ - if ((yyvsp[(2) - (5)].list) != NIL) + if ((yyvsp[-3].list) != NIL) { if (n->agg_order != NIL) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("cannot use multiple ORDER BY clauses with WITHIN GROUP"), - parser_errposition((yylsp[(2) - (5)])))); + parser_errposition((yylsp[-3])))); if (n->agg_distinct) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("cannot use DISTINCT with WITHIN GROUP"), - parser_errposition((yylsp[(2) - (5)])))); + parser_errposition((yylsp[-3])))); if (n->func_variadic) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("cannot use VARIADIC with WITHIN GROUP"), - parser_errposition((yylsp[(2) - (5)])))); - n->agg_order = (yyvsp[(2) - (5)].list); + parser_errposition((yylsp[-3])))); + n->agg_order = (yyvsp[-3].list); n->agg_within_group = true; } - n->agg_filter = (yyvsp[(3) - (5)].node); - n->export_state = (yyvsp[(4) - (5)].boolean); - n->over = (yyvsp[(5) - (5)].windef); + n->agg_filter = (yyvsp[-2].node); + n->export_state = (yyvsp[-1].boolean); + n->over = (yyvsp[0].windef); (yyval.node) = (PGNode *) n; - ;} + } +#line 27589 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1030: -#line 2932 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + case 1035: /* func_expr: func_expr_common_subexpr */ +#line 2937 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 27595 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1031: -#line 2942 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + case 1036: /* func_expr_windowless: func_application */ +#line 2947 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 27601 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1032: -#line 2943 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + case 1037: /* func_expr_windowless: func_expr_common_subexpr */ +#line 2948 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 27607 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1033: -#line 2951 "third_party/libpg_query/grammar/statements/select.y" - { + case 1038: /* func_expr_common_subexpr: COLLATION FOR '(' a_expr ')' */ +#line 2956 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("pg_collation_for"), - list_make1((yyvsp[(4) - (5)].node)), - (yylsp[(1) - (5)])); - ;} + list_make1((yyvsp[-1].node)), + (yylsp[-4])); + } +#line 27617 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1034: -#line 2957 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeTypeCast((yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].typnam), 0, (yylsp[(1) - (6)])); ;} + case 1039: /* func_expr_common_subexpr: CAST '(' a_expr AS Typename ')' */ +#line 2962 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = makeTypeCast((yyvsp[-3].node), (yyvsp[-1].typnam), 0, (yylsp[-5])); } +#line 27623 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1035: -#line 2959 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = makeTypeCast((yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].typnam), 1, (yylsp[(1) - (6)])); ;} + case 1040: /* func_expr_common_subexpr: TRY_CAST '(' a_expr AS Typename ')' */ +#line 2964 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = makeTypeCast((yyvsp[-3].node), (yyvsp[-1].typnam), 1, (yylsp[-5])); } +#line 27629 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1036: -#line 2961 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("date_part"), (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); - ;} + case 1041: /* func_expr_common_subexpr: EXTRACT '(' extract_list ')' */ +#line 2966 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("date_part"), (yyvsp[-1].list), (yylsp[-3])); + } +#line 27637 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1037: -#line 2965 "third_party/libpg_query/grammar/statements/select.y" - { + case 1042: /* func_expr_common_subexpr: OVERLAY '(' overlay_list ')' */ +#line 2970 "third_party/libpg_query/grammar/statements/select.y" + { /* overlay(A PLACING B FROM C FOR D) is converted to * overlay(A, B, C, D) * overlay(A PLACING B FROM C) is converted to * overlay(A, B, C) */ - (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("overlay"), (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); - ;} + (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("overlay"), (yyvsp[-1].list), (yylsp[-3])); + } +#line 27650 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1038: -#line 2974 "third_party/libpg_query/grammar/statements/select.y" - { + case 1043: /* func_expr_common_subexpr: POSITION '(' position_list ')' */ +#line 2979 "third_party/libpg_query/grammar/statements/select.y" + { /* position(A in B) is converted to position_inverse(A, B) */ - (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("__internal_position_operator"), (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); - ;} + (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("__internal_position_operator"), (yyvsp[-1].list), (yylsp[-3])); + } +#line 27659 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1039: -#line 2979 "third_party/libpg_query/grammar/statements/select.y" - { + case 1044: /* func_expr_common_subexpr: SUBSTRING '(' substr_list ')' */ +#line 2984 "third_party/libpg_query/grammar/statements/select.y" + { /* substring(A from B for C) is converted to * substring(A, B, C) - thomas 2000-11-28 */ - (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("substring"), (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); - ;} + (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("substring"), (yyvsp[-1].list), (yylsp[-3])); + } +#line 27670 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1040: -#line 2986 "third_party/libpg_query/grammar/statements/select.y" - { + case 1045: /* func_expr_common_subexpr: TREAT '(' a_expr AS Typename ')' */ +#line 2991 "third_party/libpg_query/grammar/statements/select.y" + { /* TREAT(expr AS target) converts expr of a particular type to target, * which is defined to be a subtype of the original expression. * In SQL99, this is intended for use with structured UDTs, @@ -27609,288 +27681,322 @@ YYLTYPE yylloc; * Convert SystemTypeName() to SystemFuncName() even though * at the moment they result in the same thing. */ - (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName(((PGValue *)llast((yyvsp[(5) - (6)].typnam)->names))->val.str), - list_make1((yyvsp[(3) - (6)].node)), - (yylsp[(1) - (6)])); - ;} + (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName(((PGValue *)llast((yyvsp[-1].typnam)->names))->val.str), + list_make1((yyvsp[-3].node)), + (yylsp[-5])); + } +#line 27689 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1041: -#line 3001 "third_party/libpg_query/grammar/statements/select.y" - { + case 1046: /* func_expr_common_subexpr: TRIM '(' BOTH trim_list ')' */ +#line 3006 "third_party/libpg_query/grammar/statements/select.y" + { /* various trim expressions are defined in SQL * - thomas 1997-07-19 */ - (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("trim"), (yyvsp[(4) - (5)].list), (yylsp[(1) - (5)])); - ;} + (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("trim"), (yyvsp[-1].list), (yylsp[-4])); + } +#line 27700 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1042: -#line 3008 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("ltrim"), (yyvsp[(4) - (5)].list), (yylsp[(1) - (5)])); - ;} + case 1047: /* func_expr_common_subexpr: TRIM '(' LEADING trim_list ')' */ +#line 3013 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("ltrim"), (yyvsp[-1].list), (yylsp[-4])); + } +#line 27708 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1043: -#line 3012 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("rtrim"), (yyvsp[(4) - (5)].list), (yylsp[(1) - (5)])); - ;} + case 1048: /* func_expr_common_subexpr: TRIM '(' TRAILING trim_list ')' */ +#line 3017 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("rtrim"), (yyvsp[-1].list), (yylsp[-4])); + } +#line 27716 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1044: -#line 3016 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("trim"), (yyvsp[(3) - (4)].list), (yylsp[(1) - (4)])); - ;} + case 1049: /* func_expr_common_subexpr: TRIM '(' trim_list ')' */ +#line 3021 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeFuncCall(SystemFuncName("trim"), (yyvsp[-1].list), (yylsp[-3])); + } +#line 27724 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1045: -#line 3020 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NULLIF, "=", (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node), (yylsp[(1) - (6)])); - ;} + case 1050: /* func_expr_common_subexpr: NULLIF '(' a_expr ',' a_expr ')' */ +#line 3025 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (PGNode *) makeSimpleAExpr(PG_AEXPR_NULLIF, "=", (yyvsp[-3].node), (yyvsp[-1].node), (yylsp[-5])); + } +#line 27732 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1046: -#line 3024 "third_party/libpg_query/grammar/statements/select.y" - { + case 1051: /* func_expr_common_subexpr: COALESCE '(' expr_list_opt_comma ')' */ +#line 3029 "third_party/libpg_query/grammar/statements/select.y" + { PGCoalesceExpr *c = makeNode(PGCoalesceExpr); - c->args = (yyvsp[(3) - (4)].list); - c->location = (yylsp[(1) - (4)]); + c->args = (yyvsp[-1].list); + c->location = (yylsp[-3]); (yyval.node) = (PGNode *)c; - ;} + } +#line 27743 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1047: -#line 3034 "third_party/libpg_query/grammar/statements/select.y" - { + case 1052: /* list_comprehension: '[' a_expr FOR ColId IN_P a_expr ']' */ +#line 3039 "third_party/libpg_query/grammar/statements/select.y" + { PGLambdaFunction *lambda = makeNode(PGLambdaFunction); - lambda->lhs = makeColumnRef((yyvsp[(4) - (7)].str), NIL, (yylsp[(4) - (7)]), yyscanner); - lambda->rhs = (yyvsp[(2) - (7)].node); - lambda->location = (yylsp[(1) - (7)]); - PGFuncCall *n = makeFuncCall(SystemFuncName("list_apply"), list_make2((yyvsp[(6) - (7)].node), lambda), (yylsp[(1) - (7)])); + lambda->lhs = makeColumnRef((yyvsp[-3].str), NIL, (yylsp[-3]), yyscanner); + lambda->rhs = (yyvsp[-5].node); + lambda->location = (yylsp[-6]); + PGFuncCall *n = makeFuncCall(SystemFuncName("list_apply"), list_make2((yyvsp[-1].node), lambda), (yylsp[-6])); (yyval.node) = (PGNode *) n; - ;} + } +#line 27756 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1048: -#line 3043 "third_party/libpg_query/grammar/statements/select.y" - { + case 1053: /* list_comprehension: '[' a_expr FOR ColId IN_P c_expr IF_P a_expr ']' */ +#line 3048 "third_party/libpg_query/grammar/statements/select.y" + { PGLambdaFunction *lambda = makeNode(PGLambdaFunction); - lambda->lhs = makeColumnRef((yyvsp[(4) - (9)].str), NIL, (yylsp[(4) - (9)]), yyscanner); - lambda->rhs = (yyvsp[(2) - (9)].node); - lambda->location = (yylsp[(1) - (9)]); + lambda->lhs = makeColumnRef((yyvsp[-5].str), NIL, (yylsp[-5]), yyscanner); + lambda->rhs = (yyvsp[-7].node); + lambda->location = (yylsp[-8]); PGLambdaFunction *lambda_filter = makeNode(PGLambdaFunction); - lambda_filter->lhs = makeColumnRef((yyvsp[(4) - (9)].str), NIL, (yylsp[(4) - (9)]), yyscanner); - lambda_filter->rhs = (yyvsp[(8) - (9)].node); - lambda_filter->location = (yylsp[(8) - (9)]); - PGFuncCall *filter = makeFuncCall(SystemFuncName("list_filter"), list_make2((yyvsp[(6) - (9)].node), lambda_filter), (yylsp[(1) - (9)])); - PGFuncCall *n = makeFuncCall(SystemFuncName("list_apply"), list_make2(filter, lambda), (yylsp[(1) - (9)])); + lambda_filter->lhs = makeColumnRef((yyvsp[-5].str), NIL, (yylsp[-5]), yyscanner); + lambda_filter->rhs = (yyvsp[-1].node); + lambda_filter->location = (yylsp[-1]); + PGFuncCall *filter = makeFuncCall(SystemFuncName("list_filter"), list_make2((yyvsp[-3].node), lambda_filter), (yylsp[-8])); + PGFuncCall *n = makeFuncCall(SystemFuncName("list_apply"), list_make2(filter, lambda), (yylsp[-8])); (yyval.node) = (PGNode *) n; - ;} - break; - - case 1049: -#line 3064 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(4) - (5)].list); ;} - break; - - case 1050: -#line 3065 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + } +#line 27775 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1051: + case 1054: /* within_group_clause: WITHIN GROUP_P '(' sort_clause ')' */ #line 3069 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(4) - (5)].node); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 27781 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1052: + case 1055: /* within_group_clause: %empty */ #line 3070 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(3) - (4)].node); ;} + { (yyval.list) = NIL; } +#line 27787 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1053: -#line 3071 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + case 1056: /* filter_clause: FILTER '(' WHERE a_expr ')' */ +#line 3074 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[-1].node); } +#line 27793 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1054: + case 1057: /* filter_clause: FILTER '(' a_expr ')' */ #line 3075 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = true; ;} + { (yyval.node) = (yyvsp[-1].node); } +#line 27799 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1055: + case 1058: /* filter_clause: %empty */ #line 3076 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.boolean) = false; ;} + { (yyval.node) = NULL; } +#line 27805 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1056: -#line 3083 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(2) - (2)].list); ;} + case 1059: /* export_clause: EXPORT_STATE */ +#line 3080 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.boolean) = true; } +#line 27811 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1057: -#line 3084 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 1060: /* export_clause: %empty */ +#line 3081 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.boolean) = false; } +#line 27817 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1058: + case 1061: /* window_clause: WINDOW window_definition_list */ #line 3088 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].windef)); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 27823 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1062: /* window_clause: %empty */ +#line 3089 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 27829 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1059: -#line 3090 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].windef)); ;} + case 1063: /* window_definition_list: window_definition */ +#line 3093 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1((yyvsp[0].windef)); } +#line 27835 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1060: + case 1064: /* window_definition_list: window_definition_list ',' window_definition */ #line 3095 "third_party/libpg_query/grammar/statements/select.y" - { - PGWindowDef *n = (yyvsp[(3) - (3)].windef); - n->name = (yyvsp[(1) - (3)].str); + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].windef)); } +#line 27841 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1065: /* window_definition: ColId AS window_specification */ +#line 3100 "third_party/libpg_query/grammar/statements/select.y" + { + PGWindowDef *n = (yyvsp[0].windef); + n->name = (yyvsp[-2].str); (yyval.windef) = n; - ;} + } +#line 27851 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1061: -#line 3103 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.windef) = (yyvsp[(2) - (2)].windef); ;} + case 1066: /* over_clause: OVER window_specification */ +#line 3108 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.windef) = (yyvsp[0].windef); } +#line 27857 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1062: -#line 3105 "third_party/libpg_query/grammar/statements/select.y" - { + case 1067: /* over_clause: OVER ColId */ +#line 3110 "third_party/libpg_query/grammar/statements/select.y" + { PGWindowDef *n = makeNode(PGWindowDef); - n->name = (yyvsp[(2) - (2)].str); + n->name = (yyvsp[0].str); n->refname = NULL; n->partitionClause = NIL; n->orderClause = NIL; n->frameOptions = FRAMEOPTION_DEFAULTS; n->startOffset = NULL; n->endOffset = NULL; - n->location = (yylsp[(2) - (2)]); + n->location = (yylsp[0]); (yyval.windef) = n; - ;} + } +#line 27874 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1063: -#line 3118 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.windef) = NULL; ;} + case 1068: /* over_clause: %empty */ +#line 3123 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.windef) = NULL; } +#line 27880 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1064: -#line 3123 "third_party/libpg_query/grammar/statements/select.y" - { + case 1069: /* window_specification: '(' opt_existing_window_name opt_partition_clause opt_sort_clause opt_frame_clause ')' */ +#line 3128 "third_party/libpg_query/grammar/statements/select.y" + { PGWindowDef *n = makeNode(PGWindowDef); n->name = NULL; - n->refname = (yyvsp[(2) - (6)].str); - n->partitionClause = (yyvsp[(3) - (6)].list); - n->orderClause = (yyvsp[(4) - (6)].list); + n->refname = (yyvsp[-4].str); + n->partitionClause = (yyvsp[-3].list); + n->orderClause = (yyvsp[-2].list); /* copy relevant fields of opt_frame_clause */ - n->frameOptions = (yyvsp[(5) - (6)].windef)->frameOptions; - n->startOffset = (yyvsp[(5) - (6)].windef)->startOffset; - n->endOffset = (yyvsp[(5) - (6)].windef)->endOffset; - n->location = (yylsp[(1) - (6)]); + n->frameOptions = (yyvsp[-1].windef)->frameOptions; + n->startOffset = (yyvsp[-1].windef)->startOffset; + n->endOffset = (yyvsp[-1].windef)->endOffset; + n->location = (yylsp[-5]); (yyval.windef) = n; - ;} + } +#line 27898 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1065: -#line 3148 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1070: /* opt_existing_window_name: ColId */ +#line 3153 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (yyvsp[0].str); } +#line 27904 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1066: -#line 3149 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = NULL; ;} + case 1071: /* opt_existing_window_name: %empty */ +#line 3154 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = NULL; } +#line 27910 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1067: -#line 3152 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (3)].list); ;} + case 1072: /* opt_partition_clause: PARTITION BY expr_list */ +#line 3157 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 27916 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1068: -#line 3153 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 1073: /* opt_partition_clause: %empty */ +#line 3158 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 27922 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1069: -#line 3162 "third_party/libpg_query/grammar/statements/select.y" - { - PGWindowDef *n = (yyvsp[(2) - (3)].windef); + case 1074: /* opt_frame_clause: RANGE frame_extent opt_window_exclusion_clause */ +#line 3167 "third_party/libpg_query/grammar/statements/select.y" + { + PGWindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_RANGE; - n->frameOptions |= (yyvsp[(3) - (3)].ival); + n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; - ;} + } +#line 27934 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1070: -#line 3170 "third_party/libpg_query/grammar/statements/select.y" - { - PGWindowDef *n = (yyvsp[(2) - (3)].windef); + case 1075: /* opt_frame_clause: ROWS frame_extent opt_window_exclusion_clause */ +#line 3175 "third_party/libpg_query/grammar/statements/select.y" + { + PGWindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_ROWS; - n->frameOptions |= (yyvsp[(3) - (3)].ival); + n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; - ;} + } +#line 27946 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1071: -#line 3178 "third_party/libpg_query/grammar/statements/select.y" - { - PGWindowDef *n = (yyvsp[(2) - (3)].windef); + case 1076: /* opt_frame_clause: GROUPS frame_extent opt_window_exclusion_clause */ +#line 3183 "third_party/libpg_query/grammar/statements/select.y" + { + PGWindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_GROUPS; - n->frameOptions |= (yyvsp[(3) - (3)].ival); + n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; - ;} + } +#line 27958 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1072: -#line 3186 "third_party/libpg_query/grammar/statements/select.y" - { + case 1077: /* opt_frame_clause: %empty */ +#line 3191 "third_party/libpg_query/grammar/statements/select.y" + { PGWindowDef *n = makeNode(PGWindowDef); n->frameOptions = FRAMEOPTION_DEFAULTS; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; - ;} + } +#line 27971 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1073: -#line 3197 "third_party/libpg_query/grammar/statements/select.y" - { - PGWindowDef *n = (yyvsp[(1) - (1)].windef); + case 1078: /* frame_extent: frame_bound */ +#line 3202 "third_party/libpg_query/grammar/statements/select.y" + { + PGWindowDef *n = (yyvsp[0].windef); /* reject invalid cases */ if (n->frameOptions & FRAMEOPTION_START_UNBOUNDED_FOLLOWING) ereport(ERROR, (errcode(PG_ERRCODE_WINDOWING_ERROR), errmsg("frame start cannot be UNBOUNDED FOLLOWING"), - parser_errposition((yylsp[(1) - (1)])))); + parser_errposition((yylsp[0])))); if (n->frameOptions & FRAMEOPTION_START_OFFSET_FOLLOWING) ereport(ERROR, (errcode(PG_ERRCODE_WINDOWING_ERROR), errmsg("frame starting from following row cannot end with current row"), - parser_errposition((yylsp[(1) - (1)])))); + parser_errposition((yylsp[0])))); n->frameOptions |= FRAMEOPTION_END_CURRENT_ROW; (yyval.windef) = n; - ;} + } +#line 27993 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1074: -#line 3215 "third_party/libpg_query/grammar/statements/select.y" - { - PGWindowDef *n1 = (yyvsp[(2) - (4)].windef); - PGWindowDef *n2 = (yyvsp[(4) - (4)].windef); + case 1079: /* frame_extent: BETWEEN frame_bound AND frame_bound */ +#line 3220 "third_party/libpg_query/grammar/statements/select.y" + { + PGWindowDef *n1 = (yyvsp[-2].windef); + PGWindowDef *n2 = (yyvsp[0].windef); /* form merged options */ int frameOptions = n1->frameOptions; @@ -27902,631 +28008,738 @@ YYLTYPE yylloc; ereport(ERROR, (errcode(PG_ERRCODE_WINDOWING_ERROR), errmsg("frame start cannot be UNBOUNDED FOLLOWING"), - parser_errposition((yylsp[(2) - (4)])))); + parser_errposition((yylsp[-2])))); if (frameOptions & FRAMEOPTION_END_UNBOUNDED_PRECEDING) ereport(ERROR, (errcode(PG_ERRCODE_WINDOWING_ERROR), errmsg("frame end cannot be UNBOUNDED PRECEDING"), - parser_errposition((yylsp[(4) - (4)])))); + parser_errposition((yylsp[0])))); if ((frameOptions & FRAMEOPTION_START_CURRENT_ROW) && (frameOptions & FRAMEOPTION_END_OFFSET_PRECEDING)) ereport(ERROR, (errcode(PG_ERRCODE_WINDOWING_ERROR), errmsg("frame starting from current row cannot have preceding rows"), - parser_errposition((yylsp[(4) - (4)])))); + parser_errposition((yylsp[0])))); if ((frameOptions & FRAMEOPTION_START_OFFSET_FOLLOWING) && (frameOptions & (FRAMEOPTION_END_OFFSET_PRECEDING | FRAMEOPTION_END_CURRENT_ROW))) ereport(ERROR, (errcode(PG_ERRCODE_WINDOWING_ERROR), errmsg("frame starting from following row cannot have preceding rows"), - parser_errposition((yylsp[(4) - (4)])))); + parser_errposition((yylsp[0])))); n1->frameOptions = frameOptions; n1->endOffset = n2->startOffset; (yyval.windef) = n1; - ;} + } +#line 28035 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1075: -#line 3261 "third_party/libpg_query/grammar/statements/select.y" - { + case 1080: /* frame_bound: UNBOUNDED PRECEDING */ +#line 3266 "third_party/libpg_query/grammar/statements/select.y" + { PGWindowDef *n = makeNode(PGWindowDef); n->frameOptions = FRAMEOPTION_START_UNBOUNDED_PRECEDING; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; - ;} + } +#line 28048 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1076: -#line 3270 "third_party/libpg_query/grammar/statements/select.y" - { + case 1081: /* frame_bound: UNBOUNDED FOLLOWING */ +#line 3275 "third_party/libpg_query/grammar/statements/select.y" + { PGWindowDef *n = makeNode(PGWindowDef); n->frameOptions = FRAMEOPTION_START_UNBOUNDED_FOLLOWING; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; - ;} + } +#line 28061 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1077: -#line 3279 "third_party/libpg_query/grammar/statements/select.y" - { + case 1082: /* frame_bound: CURRENT_P ROW */ +#line 3284 "third_party/libpg_query/grammar/statements/select.y" + { PGWindowDef *n = makeNode(PGWindowDef); n->frameOptions = FRAMEOPTION_START_CURRENT_ROW; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; - ;} + } +#line 28074 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1078: -#line 3288 "third_party/libpg_query/grammar/statements/select.y" - { + case 1083: /* frame_bound: a_expr PRECEDING */ +#line 3293 "third_party/libpg_query/grammar/statements/select.y" + { PGWindowDef *n = makeNode(PGWindowDef); n->frameOptions = FRAMEOPTION_START_OFFSET_PRECEDING; - n->startOffset = (yyvsp[(1) - (2)].node); + n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; - ;} + } +#line 28087 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1079: -#line 3297 "third_party/libpg_query/grammar/statements/select.y" - { + case 1084: /* frame_bound: a_expr FOLLOWING */ +#line 3302 "third_party/libpg_query/grammar/statements/select.y" + { PGWindowDef *n = makeNode(PGWindowDef); n->frameOptions = FRAMEOPTION_START_OFFSET_FOLLOWING; - n->startOffset = (yyvsp[(1) - (2)].node); + n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; - ;} + } +#line 28100 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1080: -#line 3308 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = FRAMEOPTION_EXCLUDE_CURRENT_ROW; ;} + case 1085: /* opt_window_exclusion_clause: EXCLUDE CURRENT_P ROW */ +#line 3313 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.ival) = FRAMEOPTION_EXCLUDE_CURRENT_ROW; } +#line 28106 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1081: -#line 3309 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = FRAMEOPTION_EXCLUDE_GROUP; ;} + case 1086: /* opt_window_exclusion_clause: EXCLUDE GROUP_P */ +#line 3314 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.ival) = FRAMEOPTION_EXCLUDE_GROUP; } +#line 28112 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1082: -#line 3310 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = FRAMEOPTION_EXCLUDE_TIES; ;} + case 1087: /* opt_window_exclusion_clause: EXCLUDE TIES */ +#line 3315 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.ival) = FRAMEOPTION_EXCLUDE_TIES; } +#line 28118 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1083: -#line 3311 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = 0; ;} + case 1088: /* opt_window_exclusion_clause: EXCLUDE NO OTHERS */ +#line 3316 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.ival) = 0; } +#line 28124 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1084: -#line 3312 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = 0; ;} + case 1089: /* opt_window_exclusion_clause: %empty */ +#line 3317 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.ival) = 0; } +#line 28130 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1085: -#line 3326 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (4)].list); ;} + case 1090: /* qualified_row: ROW '(' expr_list_opt_comma ')' */ +#line 3331 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 28136 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1086: -#line 3327 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 1091: /* qualified_row: ROW '(' ')' */ +#line 3332 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 28142 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1087: -#line 3330 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list);;} + case 1092: /* row: qualified_row */ +#line 3335 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list);} +#line 28148 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1088: -#line 3331 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(2) - (5)].list), (yyvsp[(4) - (5)].node)); ;} + case 1093: /* row: '(' expr_list ',' a_expr ')' */ +#line 3336 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } +#line 28154 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1089: -#line 3335 "third_party/libpg_query/grammar/statements/select.y" - { + case 1094: /* dict_arg: ColIdOrString ':' a_expr */ +#line 3340 "third_party/libpg_query/grammar/statements/select.y" + { PGNamedArgExpr *na = makeNode(PGNamedArgExpr); - na->name = (yyvsp[(1) - (3)].str); - na->arg = (PGExpr *) (yyvsp[(3) - (3)].node); + na->name = (yyvsp[-2].str); + na->arg = (PGExpr *) (yyvsp[0].node); na->argnumber = -1; - na->location = (yylsp[(1) - (3)]); + na->location = (yylsp[-2]); (yyval.node) = (PGNode *) na; - ;} - break; - - case 1090: -#line 3345 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} - break; - - case 1091: -#line 3346 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} + } +#line 28167 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1092: + case 1095: /* dict_arguments: dict_arg */ #line 3350 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 28173 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1093: + case 1096: /* dict_arguments: dict_arguments ',' dict_arg */ #line 3351 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } +#line 28179 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1097: /* dict_arguments_opt_comma: dict_arguments */ +#line 3355 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 28185 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1094: + case 1098: /* dict_arguments_opt_comma: dict_arguments ',' */ #line 3356 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make2((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 28191 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1095: -#line 3362 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].list)); ;} + case 1099: /* map_arg: a_expr ':' a_expr */ +#line 3361 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = list_make2((yyvsp[-2].node), (yyvsp[0].node)); + } +#line 28199 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1096: -#line 3363 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); ;} + case 1100: /* map_arguments: map_arg */ +#line 3367 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1((yyvsp[0].list)); } +#line 28205 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1097: + case 1101: /* map_arguments: map_arguments ',' map_arg */ #line 3368 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } +#line 28211 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1098: -#line 3369 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + case 1102: /* map_arguments_opt_comma: map_arguments */ +#line 3373 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 28217 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1099: + case 1103: /* map_arguments_opt_comma: map_arguments ',' */ #line 3374 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} - break; - - case 1100: -#line 3375 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NULL; ;} - break; - - case 1101: -#line 3378 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.subquerytype) = PG_ANY_SUBLINK; ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 28223 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1102: + case 1104: /* opt_map_arguments_opt_comma: map_arguments_opt_comma */ #line 3379 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.subquerytype) = PG_ANY_SUBLINK; ;} + { (yyval.list) = (yyvsp[0].list); } +#line 28229 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1103: + case 1105: /* opt_map_arguments_opt_comma: %empty */ #line 3380 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.subquerytype) = PG_ALL_SUBLINK; ;} + { (yyval.list) = NULL; } +#line 28235 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1104: + case 1106: /* sub_type: ANY */ #line 3383 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.subquerytype) = PG_ANY_SUBLINK; } +#line 28241 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1105: + case 1107: /* sub_type: SOME */ #line 3384 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) (yyvsp[(1) - (1)].conststr); ;} + { (yyval.subquerytype) = PG_ANY_SUBLINK; } +#line 28247 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1106: -#line 3387 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "+"; ;} + case 1108: /* sub_type: ALL */ +#line 3385 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.subquerytype) = PG_ALL_SUBLINK; } +#line 28253 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1107: + case 1109: /* all_Op: Op */ #line 3388 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "-"; ;} + { (yyval.str) = (yyvsp[0].str); } +#line 28259 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1108: + case 1110: /* all_Op: MathOp */ #line 3389 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "*"; ;} - break; - - case 1109: -#line 3390 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "/"; ;} - break; - - case 1110: -#line 3391 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "//"; ;} + { (yyval.str) = (char*) (yyvsp[0].conststr); } +#line 28265 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1111: + case 1111: /* MathOp: '+' */ #line 3392 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "%"; ;} + { (yyval.conststr) = "+"; } +#line 28271 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1112: + case 1112: /* MathOp: '-' */ #line 3393 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "^"; ;} + { (yyval.conststr) = "-"; } +#line 28277 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1113: + case 1113: /* MathOp: '*' */ #line 3394 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "**"; ;} + { (yyval.conststr) = "*"; } +#line 28283 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1114: + case 1114: /* MathOp: '/' */ #line 3395 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "<"; ;} + { (yyval.conststr) = "/"; } +#line 28289 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1115: + case 1115: /* MathOp: INTEGER_DIVISION */ #line 3396 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = ">"; ;} + { (yyval.conststr) = "//"; } +#line 28295 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1116: + case 1116: /* MathOp: '%' */ #line 3397 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "="; ;} + { (yyval.conststr) = "%"; } +#line 28301 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1117: + case 1117: /* MathOp: '^' */ #line 3398 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "<="; ;} + { (yyval.conststr) = "^"; } +#line 28307 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1118: + case 1118: /* MathOp: POWER_OF */ #line 3399 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = ">="; ;} + { (yyval.conststr) = "**"; } +#line 28313 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1119: + case 1119: /* MathOp: '<' */ #line 3400 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.conststr) = "<>"; ;} + { (yyval.conststr) = "<"; } +#line 28319 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1120: -#line 3404 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} + case 1120: /* MathOp: '>' */ +#line 3401 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.conststr) = ">"; } +#line 28325 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1121: -#line 3406 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (4)].list); ;} + case 1121: /* MathOp: '=' */ +#line 3402 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.conststr) = "="; } +#line 28331 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1122: -#line 3411 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} + case 1122: /* MathOp: LESS_EQUALS */ +#line 3403 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.conststr) = "<="; } +#line 28337 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1123: -#line 3413 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (4)].list); ;} + case 1123: /* MathOp: GREATER_EQUALS */ +#line 3404 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.conststr) = ">="; } +#line 28343 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1124: -#line 3418 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} + case 1124: /* MathOp: NOT_EQUALS */ +#line 3405 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.conststr) = "<>"; } +#line 28349 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1125: -#line 3420 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (4)].list); ;} + case 1125: /* qual_Op: Op */ +#line 3409 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } +#line 28355 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1126: -#line 3422 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString("~~")); ;} + case 1126: /* qual_Op: OPERATOR '(' any_operator ')' */ +#line 3411 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 28361 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1127: -#line 3424 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString("!~~")); ;} + case 1127: /* qual_all_Op: all_Op */ +#line 3416 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } +#line 28367 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1128: -#line 3426 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString("~~~")); ;} + case 1128: /* qual_all_Op: OPERATOR '(' any_operator ')' */ +#line 3418 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 28373 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1129: -#line 3428 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString("!~~~")); ;} + case 1129: /* subquery_Op: all_Op */ +#line 3423 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } +#line 28379 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1130: -#line 3430 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString("~~*")); ;} + case 1130: /* subquery_Op: OPERATOR '(' any_operator ')' */ +#line 3425 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 28385 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1131: -#line 3432 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString("!~~*")); ;} + case 1131: /* subquery_Op: LIKE */ +#line 3427 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString("~~")); } +#line 28391 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1132: -#line 3446 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} + case 1132: /* subquery_Op: NOT_LA LIKE */ +#line 3429 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString("!~~")); } +#line 28397 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1133: -#line 3448 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lcons(makeString((yyvsp[(1) - (3)].str)), (yyvsp[(3) - (3)].list)); ;} + case 1133: /* subquery_Op: GLOB */ +#line 3431 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString("~~~")); } +#line 28403 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1134: -#line 3453 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); - ;} + case 1134: /* subquery_Op: NOT_LA GLOB */ +#line 3433 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString("!~~~")); } +#line 28409 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1135: -#line 3457 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); - ;} + case 1135: /* subquery_Op: ILIKE */ +#line 3435 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString("~~*")); } +#line 28415 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1136: -#line 3464 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = (yyvsp[(1) - (1)].list); - ;} + case 1136: /* subquery_Op: NOT_LA ILIKE */ +#line 3437 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString("!~~*")); } +#line 28421 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1137: -#line 3469 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = (yyvsp[(1) - (2)].list); - ;} + case 1137: /* any_operator: all_Op */ +#line 3451 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } +#line 28427 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1138: -#line 3475 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); - ;} + case 1138: /* any_operator: ColId '.' any_operator */ +#line 3453 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lcons(makeString((yyvsp[-2].str)), (yyvsp[0].list)); } +#line 28433 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1139: -#line 3479 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); - ;} + case 1139: /* c_expr_list: c_expr */ +#line 3458 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = list_make1((yyvsp[0].node)); + } +#line 28441 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1140: -#line 3486 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = (yyvsp[(1) - (1)].list); - ;} + case 1140: /* c_expr_list: c_expr_list ',' c_expr */ +#line 3462 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); + } +#line 28449 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1141: -#line 3491 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = (yyvsp[(1) - (2)].list); - ;} + case 1141: /* c_expr_list_opt_comma: c_expr_list */ +#line 3469 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = (yyvsp[0].list); + } +#line 28457 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1142: -#line 3498 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = (yyvsp[(1) - (1)].list); - ;} + case 1142: /* c_expr_list_opt_comma: c_expr_list ',' */ +#line 3474 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = (yyvsp[-1].list); + } +#line 28465 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1143: -#line 3502 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = NULL; - ;} + case 1143: /* expr_list: a_expr */ +#line 3480 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = list_make1((yyvsp[0].node)); + } +#line 28473 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1144: -#line 3511 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); - ;} + case 1144: /* expr_list: expr_list ',' a_expr */ +#line 3484 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); + } +#line 28481 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1145: -#line 3515 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); - ;} + case 1145: /* expr_list_opt_comma: expr_list */ +#line 3491 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = (yyvsp[0].list); + } +#line 28489 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1146: -#line 3521 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - ;} + case 1146: /* expr_list_opt_comma: expr_list ',' */ +#line 3496 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = (yyvsp[-1].list); + } +#line 28497 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1147: -#line 3525 "third_party/libpg_query/grammar/statements/select.y" - { - PGNamedArgExpr *na = makeNode(PGNamedArgExpr); - na->name = (yyvsp[(1) - (3)].str); - na->arg = (PGExpr *) (yyvsp[(3) - (3)].node); - na->argnumber = -1; /* until determined */ - na->location = (yylsp[(1) - (3)]); - (yyval.node) = (PGNode *) na; - ;} + case 1147: /* opt_expr_list_opt_comma: expr_list_opt_comma */ +#line 3503 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = (yyvsp[0].list); + } +#line 28505 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1148: -#line 3534 "third_party/libpg_query/grammar/statements/select.y" - { - PGNamedArgExpr *na = makeNode(PGNamedArgExpr); - na->name = (yyvsp[(1) - (3)].str); - na->arg = (PGExpr *) (yyvsp[(3) - (3)].node); - na->argnumber = -1; /* until determined */ - na->location = (yylsp[(1) - (3)]); - (yyval.node) = (PGNode *) na; - ;} + case 1148: /* opt_expr_list_opt_comma: %empty */ +#line 3507 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = NULL; + } +#line 28513 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1149: -#line 3544 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].typnam)); ;} + case 1149: /* func_arg_list: func_arg_expr */ +#line 3516 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = list_make1((yyvsp[0].node)); + } +#line 28521 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1150: -#line 3545 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].typnam)); ;} + case 1150: /* func_arg_list: func_arg_list ',' func_arg_expr */ +#line 3520 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); + } +#line 28529 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1151: -#line 3550 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make2(makeStringConst((yyvsp[(1) - (3)].str), (yylsp[(1) - (3)])), (yyvsp[(3) - (3)].node)); - ;} + case 1151: /* func_arg_expr: a_expr */ +#line 3526 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = (yyvsp[0].node); + } +#line 28537 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1152: -#line 3553 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 1152: /* func_arg_expr: param_name COLON_EQUALS a_expr */ +#line 3530 "third_party/libpg_query/grammar/statements/select.y" + { + PGNamedArgExpr *na = makeNode(PGNamedArgExpr); + na->name = (yyvsp[-2].str); + na->arg = (PGExpr *) (yyvsp[0].node); + na->argnumber = -1; /* until determined */ + na->location = (yylsp[-2]); + (yyval.node) = (PGNode *) na; + } +#line 28550 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1153: -#line 3560 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1153: /* func_arg_expr: param_name EQUALS_GREATER a_expr */ +#line 3539 "third_party/libpg_query/grammar/statements/select.y" + { + PGNamedArgExpr *na = makeNode(PGNamedArgExpr); + na->name = (yyvsp[-2].str); + na->arg = (PGExpr *) (yyvsp[0].node); + na->argnumber = -1; /* until determined */ + na->location = (yylsp[-2]); + (yyval.node) = (PGNode *) na; + } +#line 28563 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1154: -#line 3561 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "year"; ;} + case 1154: /* type_list: Typename */ +#line 3549 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1((yyvsp[0].typnam)); } +#line 28569 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1155: -#line 3562 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "month"; ;} + case 1155: /* type_list: type_list ',' Typename */ +#line 3550 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } +#line 28575 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1156: -#line 3563 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "day"; ;} + case 1156: /* extract_list: extract_arg FROM a_expr */ +#line 3555 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = list_make2(makeStringConst((yyvsp[-2].str), (yylsp[-2])), (yyvsp[0].node)); + } +#line 28583 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1157: -#line 3564 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "hour"; ;} + case 1157: /* extract_list: %empty */ +#line 3558 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 28589 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1158: + case 1158: /* extract_arg: IDENT */ #line 3565 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "minute"; ;} + { (yyval.str) = (yyvsp[0].str); } +#line 28595 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1159: + case 1159: /* extract_arg: year_keyword */ #line 3566 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "second"; ;} + { (yyval.str) = (char*) "year"; } +#line 28601 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1160: + case 1160: /* extract_arg: month_keyword */ #line 3567 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "millisecond"; ;} + { (yyval.str) = (char*) "month"; } +#line 28607 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1161: + case 1161: /* extract_arg: day_keyword */ #line 3568 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "microsecond"; ;} + { (yyval.str) = (char*) "day"; } +#line 28613 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1162: + case 1162: /* extract_arg: hour_keyword */ #line 3569 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "week"; ;} + { (yyval.str) = (char*) "hour"; } +#line 28619 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1163: + case 1163: /* extract_arg: minute_keyword */ #line 3570 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "decade"; ;} + { (yyval.str) = (char*) "minute"; } +#line 28625 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1164: + case 1164: /* extract_arg: second_keyword */ #line 3571 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "century"; ;} + { (yyval.str) = (char*) "second"; } +#line 28631 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1165: + case 1165: /* extract_arg: millisecond_keyword */ #line 3572 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (char*) "millennium"; ;} + { (yyval.str) = (char*) "millisecond"; } +#line 28637 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1166: + case 1166: /* extract_arg: microsecond_keyword */ #line 3573 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (char*) "microsecond"; } +#line 28643 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1167: -#line 3584 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make4((yyvsp[(1) - (4)].node), (yyvsp[(2) - (4)].node), (yyvsp[(3) - (4)].node), (yyvsp[(4) - (4)].node)); - ;} + case 1167: /* extract_arg: week_keyword */ +#line 3574 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (char*) "week"; } +#line 28649 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1168: -#line 3588 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make3((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].node), (yyvsp[(3) - (3)].node)); - ;} + case 1168: /* extract_arg: quarter_keyword */ +#line 3575 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (char*) "quarter"; } +#line 28655 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1169: /* extract_arg: decade_keyword */ +#line 3576 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (char*) "decade"; } +#line 28661 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1170: /* extract_arg: century_keyword */ +#line 3577 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (char*) "century"; } +#line 28667 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1171: /* extract_arg: millennium_keyword */ +#line 3578 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (char*) "millennium"; } +#line 28673 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1172: /* extract_arg: Sconst */ +#line 3579 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (yyvsp[0].str); } +#line 28679 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1173: /* overlay_list: a_expr overlay_placing substr_from substr_for */ +#line 3590 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = list_make4((yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); + } +#line 28687 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1169: -#line 3595 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + case 1174: /* overlay_list: a_expr overlay_placing substr_from */ +#line 3594 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = list_make3((yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); + } +#line 28695 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1170: + case 1175: /* overlay_placing: PLACING a_expr */ #line 3601 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make2((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 28701 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1171: -#line 3602 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 1176: /* position_list: b_expr IN_P b_expr */ +#line 3607 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make2((yyvsp[-2].node), (yyvsp[0].node)); } +#line 28707 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1172: -#line 3619 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make3((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].node), (yyvsp[(3) - (3)].node)); - ;} + case 1177: /* position_list: %empty */ +#line 3608 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 28713 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1173: -#line 3623 "third_party/libpg_query/grammar/statements/select.y" - { + case 1178: /* substr_list: a_expr substr_from substr_for */ +#line 3625 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = list_make3((yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); + } +#line 28721 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1179: /* substr_list: a_expr substr_for substr_from */ +#line 3629 "third_party/libpg_query/grammar/statements/select.y" + { /* not legal per SQL99, but might as well allow it */ - (yyval.list) = list_make3((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node), (yyvsp[(2) - (3)].node)); - ;} + (yyval.list) = list_make3((yyvsp[-2].node), (yyvsp[0].node), (yyvsp[-1].node)); + } +#line 28730 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1174: -#line 3628 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = list_make2((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); - ;} + case 1180: /* substr_list: a_expr substr_from */ +#line 3634 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].node)); + } +#line 28738 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1175: -#line 3632 "third_party/libpg_query/grammar/statements/select.y" - { + case 1181: /* substr_list: a_expr substr_for */ +#line 3638 "third_party/libpg_query/grammar/statements/select.y" + { /* * Since there are no cases where this syntax allows * a textual FOR value, we forcibly cast the argument @@ -28536,523 +28749,599 @@ YYLTYPE yylloc; * which it is likely to do if the second argument * is unknown or doesn't have an implicit cast to int4. */ - (yyval.list) = list_make3((yyvsp[(1) - (2)].node), makeIntConst(1, -1), - makeTypeCast((yyvsp[(2) - (2)].node), + (yyval.list) = list_make3((yyvsp[-1].node), makeIntConst(1, -1), + makeTypeCast((yyvsp[0].node), SystemTypeName("int4"), 0, -1)); - ;} + } +#line 28757 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1176: -#line 3647 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = (yyvsp[(1) - (1)].list); - ;} + case 1182: /* substr_list: expr_list */ +#line 3653 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = (yyvsp[0].list); + } +#line 28765 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1177: -#line 3651 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 1183: /* substr_list: %empty */ +#line 3657 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 28771 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1178: -#line 3655 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + case 1184: /* substr_from: FROM a_expr */ +#line 3661 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 28777 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1179: -#line 3658 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + case 1185: /* substr_for: FOR a_expr */ +#line 3664 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 28783 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1180: -#line 3661 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(3) - (3)].list), (yyvsp[(1) - (3)].node)); ;} + case 1186: /* trim_list: a_expr FROM expr_list_opt_comma */ +#line 3667 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[0].list), (yyvsp[-2].node)); } +#line 28789 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1181: -#line 3662 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(2) - (2)].list); ;} + case 1187: /* trim_list: FROM expr_list_opt_comma */ +#line 3668 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 28795 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1182: -#line 3663 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + case 1188: /* trim_list: expr_list_opt_comma */ +#line 3669 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 28801 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1183: -#line 3667 "third_party/libpg_query/grammar/statements/select.y" - { + case 1189: /* in_expr: select_with_parens */ +#line 3673 "third_party/libpg_query/grammar/statements/select.y" + { PGSubLink *n = makeNode(PGSubLink); - n->subselect = (yyvsp[(1) - (1)].node); + n->subselect = (yyvsp[0].node); /* other fields will be filled later */ (yyval.node) = (PGNode *)n; - ;} + } +#line 28812 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1184: -#line 3673 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (PGNode *)(yyvsp[(2) - (3)].list); ;} + case 1190: /* in_expr: '(' expr_list_opt_comma ')' */ +#line 3679 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (PGNode *)(yyvsp[-1].list); } +#line 28818 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1185: -#line 3684 "third_party/libpg_query/grammar/statements/select.y" - { + case 1191: /* case_expr: CASE case_arg when_clause_list case_default END_P */ +#line 3690 "third_party/libpg_query/grammar/statements/select.y" + { PGCaseExpr *c = makeNode(PGCaseExpr); c->casetype = InvalidOid; /* not analyzed yet */ - c->arg = (PGExpr *) (yyvsp[(2) - (5)].node); - c->args = (yyvsp[(3) - (5)].list); - c->defresult = (PGExpr *) (yyvsp[(4) - (5)].node); - c->location = (yylsp[(1) - (5)]); + c->arg = (PGExpr *) (yyvsp[-3].node); + c->args = (yyvsp[-2].list); + c->defresult = (PGExpr *) (yyvsp[-1].node); + c->location = (yylsp[-4]); (yyval.node) = (PGNode *)c; - ;} + } +#line 28832 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1186: -#line 3697 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + case 1192: /* when_clause_list: when_clause */ +#line 3703 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 28838 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1187: -#line 3698 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} + case 1193: /* when_clause_list: when_clause_list when_clause */ +#line 3704 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } +#line 28844 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1188: -#line 3703 "third_party/libpg_query/grammar/statements/select.y" - { + case 1194: /* when_clause: WHEN a_expr THEN a_expr */ +#line 3709 "third_party/libpg_query/grammar/statements/select.y" + { PGCaseWhen *w = makeNode(PGCaseWhen); - w->expr = (PGExpr *) (yyvsp[(2) - (4)].node); - w->result = (PGExpr *) (yyvsp[(4) - (4)].node); - w->location = (yylsp[(1) - (4)]); + w->expr = (PGExpr *) (yyvsp[-2].node); + w->result = (PGExpr *) (yyvsp[0].node); + w->location = (yylsp[-3]); (yyval.node) = (PGNode *)w; - ;} + } +#line 28856 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1189: -#line 3713 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + case 1195: /* case_default: ELSE a_expr */ +#line 3719 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 28862 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1190: -#line 3714 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + case 1196: /* case_default: %empty */ +#line 3720 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = NULL; } +#line 28868 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1191: -#line 3717 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + case 1197: /* case_arg: a_expr */ +#line 3723 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 28874 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1192: -#line 3718 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + case 1198: /* case_arg: %empty */ +#line 3724 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = NULL; } +#line 28880 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1193: -#line 3722 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeColumnRef((yyvsp[(1) - (1)].str), NIL, (yylsp[(1) - (1)]), yyscanner); - ;} + case 1199: /* columnref: ColId */ +#line 3728 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeColumnRef((yyvsp[0].str), NIL, (yylsp[0]), yyscanner); + } +#line 28888 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1194: -#line 3726 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeColumnRef((yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].list), (yylsp[(1) - (2)]), yyscanner); - ;} + case 1200: /* columnref: ColId indirection */ +#line 3732 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeColumnRef((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); + } +#line 28896 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1195: -#line 3733 "third_party/libpg_query/grammar/statements/select.y" - { + case 1201: /* indirection_el: '[' a_expr ']' */ +#line 3739 "third_party/libpg_query/grammar/statements/select.y" + { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = false; ai->lidx = NULL; - ai->uidx = (yyvsp[(2) - (3)].node); + ai->uidx = (yyvsp[-1].node); (yyval.node) = (PGNode *) ai; - ;} + } +#line 28908 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1196: -#line 3741 "third_party/libpg_query/grammar/statements/select.y" - { + case 1202: /* indirection_el: '[' opt_slice_bound ':' opt_slice_bound ']' */ +#line 3747 "third_party/libpg_query/grammar/statements/select.y" + { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; - ai->lidx = (yyvsp[(2) - (5)].node); - ai->uidx = (yyvsp[(4) - (5)].node); + ai->lidx = (yyvsp[-3].node); + ai->uidx = (yyvsp[-1].node); (yyval.node) = (PGNode *) ai; - ;} + } +#line 28920 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1197: -#line 3748 "third_party/libpg_query/grammar/statements/select.y" - { + case 1203: /* indirection_el: '[' opt_slice_bound ':' opt_slice_bound ':' opt_slice_bound ']' */ +#line 3754 "third_party/libpg_query/grammar/statements/select.y" + { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; - ai->lidx = (yyvsp[(2) - (7)].node); - ai->uidx = (yyvsp[(4) - (7)].node); - ai->step = (yyvsp[(6) - (7)].node); + ai->lidx = (yyvsp[-5].node); + ai->uidx = (yyvsp[-3].node); + ai->step = (yyvsp[-1].node); (yyval.node) = (PGNode *) ai; - ;} + } +#line 28933 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1198: -#line 3756 "third_party/libpg_query/grammar/statements/select.y" - { + case 1204: /* indirection_el: '[' opt_slice_bound ':' '-' ':' opt_slice_bound ']' */ +#line 3762 "third_party/libpg_query/grammar/statements/select.y" + { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; - ai->lidx = (yyvsp[(2) - (7)].node); - ai->step = (yyvsp[(6) - (7)].node); + ai->lidx = (yyvsp[-5].node); + ai->step = (yyvsp[-1].node); (yyval.node) = (PGNode *) ai; - ;} + } +#line 28945 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1199: -#line 3766 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + case 1205: /* opt_slice_bound: a_expr */ +#line 3772 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = (yyvsp[0].node); } +#line 28951 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1200: -#line 3767 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.node) = NULL; ;} + case 1206: /* opt_slice_bound: %empty */ +#line 3773 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.node) = NULL; } +#line 28957 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1201: -#line 3772 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 1207: /* opt_indirection: %empty */ +#line 3778 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 28963 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1202: -#line 3773 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} + case 1208: /* opt_indirection: opt_indirection indirection_el */ +#line 3779 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } +#line 28969 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1203: -#line 3777 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NULL; ;} + case 1209: /* opt_func_arguments: %empty */ +#line 3783 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NULL; } +#line 28975 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1204: -#line 3778 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(NULL); ;} + case 1210: /* opt_func_arguments: '(' ')' */ +#line 3784 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(NULL); } +#line 28981 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1205: -#line 3779 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + case 1211: /* opt_func_arguments: '(' func_arg_list ')' */ +#line 3785 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 28987 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1206: -#line 3784 "third_party/libpg_query/grammar/statements/select.y" - { - if ((yyvsp[(3) - (3)].list)) { - PGFuncCall *n = makeFuncCall(list_make1(makeString((yyvsp[(2) - (3)].str))), (yyvsp[(3) - (3)].list)->head->data.ptr_value ? (yyvsp[(3) - (3)].list) : NULL, (yylsp[(2) - (3)])); + case 1212: /* extended_indirection_el: '.' attr_name opt_func_arguments */ +#line 3790 "third_party/libpg_query/grammar/statements/select.y" + { + if ((yyvsp[0].list)) { + PGFuncCall *n = makeFuncCall(list_make1(makeString((yyvsp[-1].str))), (yyvsp[0].list)->head->data.ptr_value ? (yyvsp[0].list) : NULL, (yylsp[-1])); (yyval.node) = (PGNode *) n; } else { - (yyval.node) = (PGNode *) makeString((yyvsp[(2) - (3)].str)); + (yyval.node) = (PGNode *) makeString((yyvsp[-1].str)); } - ;} + } +#line 29000 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1207: -#line 3793 "third_party/libpg_query/grammar/statements/select.y" - { + case 1213: /* extended_indirection_el: '[' a_expr ']' */ +#line 3799 "third_party/libpg_query/grammar/statements/select.y" + { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = false; ai->lidx = NULL; - ai->uidx = (yyvsp[(2) - (3)].node); + ai->uidx = (yyvsp[-1].node); (yyval.node) = (PGNode *) ai; - ;} + } +#line 29012 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1208: -#line 3801 "third_party/libpg_query/grammar/statements/select.y" - { + case 1214: /* extended_indirection_el: '[' opt_slice_bound ':' opt_slice_bound ']' */ +#line 3807 "third_party/libpg_query/grammar/statements/select.y" + { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; - ai->lidx = (yyvsp[(2) - (5)].node); - ai->uidx = (yyvsp[(4) - (5)].node); + ai->lidx = (yyvsp[-3].node); + ai->uidx = (yyvsp[-1].node); (yyval.node) = (PGNode *) ai; - ;} + } +#line 29024 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1209: -#line 3808 "third_party/libpg_query/grammar/statements/select.y" - { + case 1215: /* extended_indirection_el: '[' opt_slice_bound ':' opt_slice_bound ':' opt_slice_bound ']' */ +#line 3814 "third_party/libpg_query/grammar/statements/select.y" + { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; - ai->lidx = (yyvsp[(2) - (7)].node); - ai->uidx = (yyvsp[(4) - (7)].node); - ai->step = (yyvsp[(6) - (7)].node); + ai->lidx = (yyvsp[-5].node); + ai->uidx = (yyvsp[-3].node); + ai->step = (yyvsp[-1].node); (yyval.node) = (PGNode *) ai; - ;} + } +#line 29037 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1210: -#line 3817 "third_party/libpg_query/grammar/statements/select.y" - { + case 1216: /* extended_indirection_el: '[' opt_slice_bound ':' '-' ':' opt_slice_bound ']' */ +#line 3823 "third_party/libpg_query/grammar/statements/select.y" + { PGAIndices *ai = makeNode(PGAIndices); ai->is_slice = true; - ai->lidx = (yyvsp[(2) - (7)].node); - ai->step = (yyvsp[(6) - (7)].node); + ai->lidx = (yyvsp[-5].node); + ai->step = (yyvsp[-1].node); (yyval.node) = (PGNode *) ai; - ;} + } +#line 29049 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1211: -#line 3832 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 1217: /* opt_extended_indirection: %empty */ +#line 3838 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 29055 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1212: -#line 3833 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); ;} + case 1218: /* opt_extended_indirection: opt_extended_indirection extended_indirection_el */ +#line 3839 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } +#line 29061 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1215: -#line 3849 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + case 1221: /* opt_target_list_opt_comma: target_list_opt_comma */ +#line 3855 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 29067 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1216: -#line 3850 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 1222: /* opt_target_list_opt_comma: %empty */ +#line 3856 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 29073 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1217: -#line 3854 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].target)); ;} + case 1223: /* target_list: target_el */ +#line 3860 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1((yyvsp[0].target)); } +#line 29079 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1218: -#line 3855 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].target)); ;} + case 1224: /* target_list: target_list ',' target_el */ +#line 3861 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } +#line 29085 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1219: -#line 3859 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + case 1225: /* target_list_opt_comma: target_list */ +#line 3865 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 29091 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1220: -#line 3860 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + case 1226: /* target_list_opt_comma: target_list ',' */ +#line 3866 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 29097 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1221: -#line 3864 "third_party/libpg_query/grammar/statements/select.y" - { + case 1227: /* target_el: a_expr AS ColLabelOrString */ +#line 3870 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.target) = makeNode(PGResTarget); - (yyval.target)->name = (yyvsp[(3) - (3)].str); + (yyval.target)->name = (yyvsp[0].str); (yyval.target)->indirection = NIL; - (yyval.target)->val = (PGNode *)(yyvsp[(1) - (3)].node); - (yyval.target)->location = (yylsp[(1) - (3)]); - ;} + (yyval.target)->val = (PGNode *)(yyvsp[-2].node); + (yyval.target)->location = (yylsp[-2]); + } +#line 29109 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1222: -#line 3880 "third_party/libpg_query/grammar/statements/select.y" - { + case 1228: /* target_el: a_expr IDENT */ +#line 3886 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.target) = makeNode(PGResTarget); - (yyval.target)->name = (yyvsp[(2) - (2)].str); + (yyval.target)->name = (yyvsp[0].str); (yyval.target)->indirection = NIL; - (yyval.target)->val = (PGNode *)(yyvsp[(1) - (2)].node); - (yyval.target)->location = (yylsp[(1) - (2)]); - ;} + (yyval.target)->val = (PGNode *)(yyvsp[-1].node); + (yyval.target)->location = (yylsp[-1]); + } +#line 29121 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1223: -#line 3888 "third_party/libpg_query/grammar/statements/select.y" - { + case 1229: /* target_el: a_expr */ +#line 3894 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.target) = makeNode(PGResTarget); (yyval.target)->name = NULL; (yyval.target)->indirection = NIL; - (yyval.target)->val = (PGNode *)(yyvsp[(1) - (1)].node); - (yyval.target)->location = (yylsp[(1) - (1)]); - ;} + (yyval.target)->val = (PGNode *)(yyvsp[0].node); + (yyval.target)->location = (yylsp[0]); + } +#line 29133 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1224: -#line 3897 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (4)].list); ;} + case 1230: /* except_list: EXCLUDE '(' name_list_opt_comma ')' */ +#line 3903 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 29139 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1225: -#line 3898 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString((yyvsp[(2) - (2)].str))); ;} + case 1231: /* except_list: EXCLUDE ColId */ +#line 3904 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } +#line 29145 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1226: -#line 3901 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + case 1232: /* opt_except_list: except_list */ +#line 3907 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 29151 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1227: -#line 3902 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NULL; ;} + case 1233: /* opt_except_list: %empty */ +#line 3908 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NULL; } +#line 29157 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1228: -#line 3905 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make2((yyvsp[(1) - (3)].node), makeString((yyvsp[(3) - (3)].str))); ;} + case 1234: /* replace_list_el: a_expr AS ColId */ +#line 3911 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make2((yyvsp[-2].node), makeString((yyvsp[0].str))); } +#line 29163 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1229: -#line 3909 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].list)); ;} + case 1235: /* replace_list: replace_list_el */ +#line 3915 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1((yyvsp[0].list)); } +#line 29169 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1230: -#line 3910 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); ;} + case 1236: /* replace_list: replace_list ',' replace_list_el */ +#line 3916 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } +#line 29175 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1231: -#line 3914 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + case 1237: /* replace_list_opt_comma: replace_list */ +#line 3920 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 29181 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1232: -#line 3915 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + case 1238: /* replace_list_opt_comma: replace_list ',' */ +#line 3921 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 29187 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1233: -#line 3918 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(3) - (4)].list); ;} + case 1239: /* opt_replace_list: REPLACE '(' replace_list_opt_comma ')' */ +#line 3924 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 29193 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1234: -#line 3919 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(2) - (2)].list)); ;} + case 1240: /* opt_replace_list: REPLACE replace_list_el */ +#line 3925 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1((yyvsp[0].list)); } +#line 29199 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1235: -#line 3920 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NULL; ;} + case 1241: /* opt_replace_list: %empty */ +#line 3926 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NULL; } +#line 29205 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1236: -#line 3930 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].range)); ;} + case 1242: /* qualified_name_list: qualified_name */ +#line 3936 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1((yyvsp[0].range)); } +#line 29211 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1237: -#line 3931 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].range)); ;} + case 1243: /* qualified_name_list: qualified_name_list ',' qualified_name */ +#line 3937 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } +#line 29217 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1238: -#line 3936 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} + case 1244: /* name_list: name */ +#line 3942 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } +#line 29223 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1239: -#line 3938 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), makeString((yyvsp[(3) - (3)].str))); ;} + case 1245: /* name_list: name_list ',' name */ +#line 3944 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } +#line 29229 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1240: -#line 3943 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + case 1246: /* name_list_opt_comma: name_list */ +#line 3949 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 29235 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1241: -#line 3944 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (2)].list); ;} + case 1247: /* name_list_opt_comma: name_list ',' */ +#line 3950 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 29241 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1242: -#line 3948 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(1) - (1)].list); ;} + case 1248: /* name_list_opt_comma_opt_bracket: name_list_opt_comma */ +#line 3954 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[0].list); } +#line 29247 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1243: -#line 3949 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + case 1249: /* name_list_opt_comma_opt_bracket: '(' name_list_opt_comma ')' */ +#line 3955 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 29253 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1244: -#line 3952 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1250: /* name: ColIdOrString */ +#line 3958 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (yyvsp[0].str); } +#line 29259 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1245: -#line 3964 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} + case 1251: /* func_name: function_name_token */ +#line 3970 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } +#line 29265 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1246: -#line 3967 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.list) = check_func_name(lcons(makeString((yyvsp[(1) - (2)].str)), (yyvsp[(2) - (2)].list)), + case 1252: /* func_name: ColId indirection */ +#line 3973 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.list) = check_func_name(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)), yyscanner); - ;} + } +#line 29274 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1247: -#line 3978 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeIntConst((yyvsp[(1) - (1)].ival), (yylsp[(1) - (1)])); - ;} + case 1253: /* AexprConst: Iconst */ +#line 3984 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeIntConst((yyvsp[0].ival), (yylsp[0])); + } +#line 29282 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1248: -#line 3982 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeFloatConst((yyvsp[(1) - (1)].str), (yylsp[(1) - (1)])); - ;} + case 1254: /* AexprConst: FCONST */ +#line 3988 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeFloatConst((yyvsp[0].str), (yylsp[0])); + } +#line 29290 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1249: -#line 3986 "third_party/libpg_query/grammar/statements/select.y" - { - if ((yyvsp[(2) - (2)].list)) + case 1255: /* AexprConst: Sconst opt_indirection */ +#line 3992 "third_party/libpg_query/grammar/statements/select.y" + { + if ((yyvsp[0].list)) { PGAIndirection *n = makeNode(PGAIndirection); - n->arg = makeStringConst((yyvsp[(1) - (2)].str), (yylsp[(1) - (2)])); - n->indirection = check_indirection((yyvsp[(2) - (2)].list), yyscanner); + n->arg = makeStringConst((yyvsp[-1].str), (yylsp[-1])); + n->indirection = check_indirection((yyvsp[0].list), yyscanner); (yyval.node) = (PGNode *) n; } else - (yyval.node) = makeStringConst((yyvsp[(1) - (2)].str), (yylsp[(1) - (2)])); - ;} + (yyval.node) = makeStringConst((yyvsp[-1].str), (yylsp[-1])); + } +#line 29306 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1250: -#line 3998 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeBitStringConst((yyvsp[(1) - (1)].str), (yylsp[(1) - (1)])); - ;} + case 1256: /* AexprConst: BCONST */ +#line 4004 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeBitStringConst((yyvsp[0].str), (yylsp[0])); + } +#line 29314 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1251: -#line 4002 "third_party/libpg_query/grammar/statements/select.y" - { + case 1257: /* AexprConst: XCONST */ +#line 4008 "third_party/libpg_query/grammar/statements/select.y" + { /* This is a bit constant per SQL99: * Without Feature F511, "BIT data type", * a shall not be a * or a . */ - (yyval.node) = makeBitStringConst((yyvsp[(1) - (1)].str), (yylsp[(1) - (1)])); - ;} + (yyval.node) = makeBitStringConst((yyvsp[0].str), (yylsp[0])); + } +#line 29327 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1252: -#line 4011 "third_party/libpg_query/grammar/statements/select.y" - { + case 1258: /* AexprConst: func_name Sconst */ +#line 4017 "third_party/libpg_query/grammar/statements/select.y" + { /* generic type 'literal' syntax */ - PGTypeName *t = makeTypeNameFromNameList((yyvsp[(1) - (2)].list)); - t->location = (yylsp[(1) - (2)]); - (yyval.node) = makeStringConstCast((yyvsp[(2) - (2)].str), (yylsp[(2) - (2)]), t); - ;} + PGTypeName *t = makeTypeNameFromNameList((yyvsp[-1].list)); + t->location = (yylsp[-1]); + (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); + } +#line 29338 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1253: -#line 4018 "third_party/libpg_query/grammar/statements/select.y" - { + case 1259: /* AexprConst: func_name '(' func_arg_list opt_sort_clause opt_ignore_nulls ')' Sconst */ +#line 4024 "third_party/libpg_query/grammar/statements/select.y" + { /* generic syntax with a type modifier */ - PGTypeName *t = makeTypeNameFromNameList((yyvsp[(1) - (7)].list)); + PGTypeName *t = makeTypeNameFromNameList((yyvsp[-6].list)); PGListCell *lc; /* @@ -29061,7 +29350,7 @@ YYLTYPE yylloc; * don't actually wish to allow PGNamedArgExpr in this * context, ORDER BY, nor IGNORE NULLS. */ - foreach(lc, (yyvsp[(3) - (7)].list)) + foreach(lc, (yyvsp[-4].list)) { PGNamedArgExpr *arg = (PGNamedArgExpr *) lfirst(lc); @@ -29071,281 +29360,315 @@ YYLTYPE yylloc; errmsg("type modifier cannot have parameter name"), parser_errposition(arg->location))); } - if ((yyvsp[(4) - (7)].list) != NIL) + if ((yyvsp[-3].list) != NIL) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("type modifier cannot have ORDER BY"), - parser_errposition((yylsp[(4) - (7)])))); - if ((yyvsp[(5) - (7)].ignorenulls) != false) + parser_errposition((yylsp[-3])))); + if ((yyvsp[-2].ignorenulls) != false) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("type modifier cannot have IGNORE NULLS"), - parser_errposition((yylsp[(5) - (7)])))); + parser_errposition((yylsp[-2])))); - t->typmods = (yyvsp[(3) - (7)].list); - t->location = (yylsp[(1) - (7)]); - (yyval.node) = makeStringConstCast((yyvsp[(7) - (7)].str), (yylsp[(7) - (7)]), t); - ;} + t->typmods = (yyvsp[-4].list); + t->location = (yylsp[-6]); + (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); + } +#line 29380 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1254: -#line 4056 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeStringConstCast((yyvsp[(2) - (2)].str), (yylsp[(2) - (2)]), (yyvsp[(1) - (2)].typnam)); - ;} + case 1260: /* AexprConst: ConstTypename Sconst */ +#line 4062 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), (yyvsp[-1].typnam)); + } +#line 29388 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1255: -#line 4060 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeIntervalNode((yyvsp[(3) - (5)].node), (yylsp[(3) - (5)]), (yyvsp[(5) - (5)].list)); - ;} + case 1261: /* AexprConst: ConstInterval '(' a_expr ')' opt_interval */ +#line 4066 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeIntervalNode((yyvsp[-2].node), (yylsp[-2]), (yyvsp[0].list)); + } +#line 29396 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1256: -#line 4064 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeIntervalNode((yyvsp[(2) - (3)].ival), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].list)); - ;} + case 1262: /* AexprConst: ConstInterval Iconst opt_interval */ +#line 4070 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeIntervalNode((yyvsp[-1].ival), (yylsp[-1]), (yyvsp[0].list)); + } +#line 29404 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1257: -#line 4068 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeIntervalNode((yyvsp[(2) - (3)].str), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].list)); - ;} + case 1263: /* AexprConst: ConstInterval Sconst opt_interval */ +#line 4074 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeIntervalNode((yyvsp[-1].str), (yylsp[-1]), (yyvsp[0].list)); + } +#line 29412 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1258: -#line 4072 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeBoolAConst(true, (yylsp[(1) - (1)])); - ;} + case 1264: /* AexprConst: TRUE_P */ +#line 4078 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeBoolAConst(true, (yylsp[0])); + } +#line 29420 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1259: -#line 4076 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeBoolAConst(false, (yylsp[(1) - (1)])); - ;} + case 1265: /* AexprConst: FALSE_P */ +#line 4082 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeBoolAConst(false, (yylsp[0])); + } +#line 29428 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1260: -#line 4080 "third_party/libpg_query/grammar/statements/select.y" - { - (yyval.node) = makeNullAConst((yylsp[(1) - (1)])); - ;} + case 1266: /* AexprConst: NULL_P */ +#line 4086 "third_party/libpg_query/grammar/statements/select.y" + { + (yyval.node) = makeNullAConst((yylsp[0])); + } +#line 29436 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1261: -#line 4085 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.ival) = (yyvsp[(1) - (1)].ival); ;} + case 1267: /* Iconst: ICONST */ +#line 4091 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.ival) = (yyvsp[0].ival); } +#line 29442 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1262: -#line 4102 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1268: /* type_function_name: IDENT */ +#line 4108 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (yyvsp[0].str); } +#line 29448 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1263: -#line 4103 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + case 1269: /* type_function_name: unreserved_keyword */ +#line 4109 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 29454 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1264: -#line 4104 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + case 1270: /* type_function_name: type_func_name_keyword */ +#line 4110 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 29460 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1265: -#line 4107 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1271: /* function_name_token: IDENT */ +#line 4113 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (yyvsp[0].str); } +#line 29466 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1266: -#line 4108 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + case 1272: /* function_name_token: unreserved_keyword */ +#line 4114 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 29472 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1267: -#line 4109 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + case 1273: /* function_name_token: func_name_keyword */ +#line 4115 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 29478 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1268: -#line 4112 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1274: /* type_name_token: IDENT */ +#line 4118 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (yyvsp[0].str); } +#line 29484 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1269: -#line 4113 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + case 1275: /* type_name_token: unreserved_keyword */ +#line 4119 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 29490 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1270: -#line 4114 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + case 1276: /* type_name_token: type_name_keyword */ +#line 4120 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 29496 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1271: -#line 4117 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString((yyvsp[(1) - (1)].str))); ;} + case 1277: /* any_name: ColId */ +#line 4123 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } +#line 29502 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1272: -#line 4118 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lcons(makeString((yyvsp[(1) - (2)].str)), (yyvsp[(2) - (2)].list)); ;} + case 1278: /* any_name: ColId attrs */ +#line 4124 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } +#line 29508 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1273: -#line 4122 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = list_make1(makeString((yyvsp[(2) - (2)].str))); ;} + case 1279: /* attrs: '.' attr_name */ +#line 4128 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } +#line 29514 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1274: -#line 4124 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), makeString((yyvsp[(3) - (3)].str))); ;} + case 1280: /* attrs: attrs '.' attr_name */ +#line 4130 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } +#line 29520 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1275: -#line 4128 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + case 1281: /* opt_name_list: '(' name_list_opt_comma ')' */ +#line 4134 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = (yyvsp[-1].list); } +#line 29526 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1276: -#line 4129 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.list) = NIL; ;} + case 1282: /* opt_name_list: %empty */ +#line 4135 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.list) = NIL; } +#line 29532 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1278: -#line 4136 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1284: /* ColLabelOrString: ColLabel */ +#line 4142 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (yyvsp[0].str); } +#line 29538 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1279: -#line 4137 "third_party/libpg_query/grammar/statements/select.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1285: /* ColLabelOrString: SCONST */ +#line 4143 "third_party/libpg_query/grammar/statements/select.y" + { (yyval.str) = (yyvsp[0].str); } +#line 29544 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1280: + case 1286: /* PrepareStmt: PREPARE name prep_type_clause AS PreparableStmt */ #line 8 "third_party/libpg_query/grammar/statements/prepare.y" - { + { PGPrepareStmt *n = makeNode(PGPrepareStmt); - n->name = (yyvsp[(2) - (5)].str); - n->argtypes = (yyvsp[(3) - (5)].list); - n->query = (yyvsp[(5) - (5)].node); + n->name = (yyvsp[-3].str); + n->argtypes = (yyvsp[-2].list); + n->query = (yyvsp[0].node); (yyval.node) = (PGNode *) n; - ;} + } +#line 29556 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1281: + case 1287: /* prep_type_clause: '(' type_list ')' */ #line 18 "third_party/libpg_query/grammar/statements/prepare.y" - { (yyval.list) = (yyvsp[(2) - (3)].list); ;} + { (yyval.list) = (yyvsp[-1].list); } +#line 29562 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1282: + case 1288: /* prep_type_clause: %empty */ #line 19 "third_party/libpg_query/grammar/statements/prepare.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 29568 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1289: + case 1295: /* CreateSchemaStmt: CREATE_P SCHEMA qualified_name OptSchemaEltList */ #line 8 "third_party/libpg_query/grammar/statements/create_schema.y" - { + { PGCreateSchemaStmt *n = makeNode(PGCreateSchemaStmt); - if ((yyvsp[(3) - (4)].range)->catalogname) { + if ((yyvsp[-1].range)->catalogname) { ereport(ERROR, (errcode(PG_ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE SCHEMA too many dots: expected \"catalog.schema\" or \"schema\""), - parser_errposition((yylsp[(3) - (4)])))); + parser_errposition((yylsp[-1])))); } - if ((yyvsp[(3) - (4)].range)->schemaname) { - n->catalogname = (yyvsp[(3) - (4)].range)->schemaname; - n->schemaname = (yyvsp[(3) - (4)].range)->relname; + if ((yyvsp[-1].range)->schemaname) { + n->catalogname = (yyvsp[-1].range)->schemaname; + n->schemaname = (yyvsp[-1].range)->relname; } else { - n->schemaname = (yyvsp[(3) - (4)].range)->relname; + n->schemaname = (yyvsp[-1].range)->relname; } - n->schemaElts = (yyvsp[(4) - (4)].list); + n->schemaElts = (yyvsp[0].list); n->onconflict = PG_ERROR_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 29591 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1290: + case 1296: /* CreateSchemaStmt: CREATE_P SCHEMA IF_P NOT EXISTS qualified_name OptSchemaEltList */ #line 27 "third_party/libpg_query/grammar/statements/create_schema.y" - { + { PGCreateSchemaStmt *n = makeNode(PGCreateSchemaStmt); - if ((yyvsp[(6) - (7)].range)->catalogname) { + if ((yyvsp[-1].range)->catalogname) { ereport(ERROR, (errcode(PG_ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE SCHEMA too many dots: expected \"catalog.schema\" or \"schema\""), - parser_errposition((yylsp[(6) - (7)])))); + parser_errposition((yylsp[-1])))); } - if ((yyvsp[(6) - (7)].range)->schemaname) { - n->catalogname = (yyvsp[(6) - (7)].range)->schemaname; - n->schemaname = (yyvsp[(6) - (7)].range)->relname; + if ((yyvsp[-1].range)->schemaname) { + n->catalogname = (yyvsp[-1].range)->schemaname; + n->schemaname = (yyvsp[-1].range)->relname; } else { - n->schemaname = (yyvsp[(6) - (7)].range)->relname; + n->schemaname = (yyvsp[-1].range)->relname; } - if ((yyvsp[(7) - (7)].list) != NIL) + if ((yyvsp[0].list) != NIL) ereport(ERROR, (errcode(PG_ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE SCHEMA IF NOT EXISTS cannot include schema elements"), - parser_errposition((yylsp[(7) - (7)])))); - n->schemaElts = (yyvsp[(7) - (7)].list); + parser_errposition((yylsp[0])))); + n->schemaElts = (yyvsp[0].list); n->onconflict = PG_IGNORE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 29619 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1291: + case 1297: /* CreateSchemaStmt: CREATE_P OR REPLACE SCHEMA qualified_name OptSchemaEltList */ #line 51 "third_party/libpg_query/grammar/statements/create_schema.y" - { + { PGCreateSchemaStmt *n = makeNode(PGCreateSchemaStmt); - if ((yyvsp[(5) - (6)].range)->catalogname) { + if ((yyvsp[-1].range)->catalogname) { ereport(ERROR, (errcode(PG_ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE SCHEMA too many dots: expected \"catalog.schema\" or \"schema\""), - parser_errposition((yylsp[(5) - (6)])))); + parser_errposition((yylsp[-1])))); } - if ((yyvsp[(5) - (6)].range)->schemaname) { - n->catalogname = (yyvsp[(5) - (6)].range)->schemaname; - n->schemaname = (yyvsp[(5) - (6)].range)->relname; + if ((yyvsp[-1].range)->schemaname) { + n->catalogname = (yyvsp[-1].range)->schemaname; + n->schemaname = (yyvsp[-1].range)->relname; } else { - n->schemaname = (yyvsp[(5) - (6)].range)->relname; + n->schemaname = (yyvsp[-1].range)->relname; } - n->schemaElts = (yyvsp[(6) - (6)].list); + n->schemaElts = (yyvsp[0].list); n->onconflict = PG_REPLACE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 29642 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1292: + case 1298: /* OptSchemaEltList: OptSchemaEltList schema_stmt */ #line 74 "third_party/libpg_query/grammar/statements/create_schema.y" - { + { if ((yyloc) < 0) /* see comments for YYLLOC_DEFAULT */ - (yyloc) = (yylsp[(2) - (2)]); - (yyval.list) = lappend((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); - ;} + (yyloc) = (yylsp[0]); + (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); + } +#line 29652 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1293: + case 1299: /* OptSchemaEltList: %empty */ #line 80 "third_party/libpg_query/grammar/statements/create_schema.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 29658 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1298: + case 1304: /* IndexStmt: CREATE_P opt_unique INDEX opt_concurrently opt_index_name ON qualified_name access_method_clause '(' index_params ')' opt_reloptions where_clause */ #line 11 "third_party/libpg_query/grammar/statements/index.y" - { + { PGIndexStmt *n = makeNode(PGIndexStmt); - n->unique = (yyvsp[(2) - (13)].boolean); - n->concurrent = (yyvsp[(4) - (13)].boolean); - n->idxname = (yyvsp[(5) - (13)].str); - n->relation = (yyvsp[(7) - (13)].range); - n->accessMethod = (yyvsp[(8) - (13)].str); - n->indexParams = (yyvsp[(10) - (13)].list); - n->options = (yyvsp[(12) - (13)].list); - n->whereClause = (yyvsp[(13) - (13)].node); + n->unique = (yyvsp[-11].boolean); + n->concurrent = (yyvsp[-9].boolean); + n->idxname = (yyvsp[-8].str); + n->relation = (yyvsp[-6].range); + n->accessMethod = (yyvsp[-5].str); + n->indexParams = (yyvsp[-3].list); + n->options = (yyvsp[-1].list); + n->whereClause = (yyvsp[0].node); n->excludeOpNames = NIL; n->idxcomment = NULL; n->indexOid = InvalidOid; @@ -29357,21 +29680,22 @@ YYLTYPE yylloc; n->transformed = false; n->onconflict = PG_ERROR_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 29685 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1299: + case 1305: /* IndexStmt: CREATE_P opt_unique INDEX opt_concurrently IF_P NOT EXISTS index_name ON qualified_name access_method_clause '(' index_params ')' opt_reloptions where_clause */ #line 36 "third_party/libpg_query/grammar/statements/index.y" - { + { PGIndexStmt *n = makeNode(PGIndexStmt); - n->unique = (yyvsp[(2) - (16)].boolean); - n->concurrent = (yyvsp[(4) - (16)].boolean); - n->idxname = (yyvsp[(8) - (16)].str); - n->relation = (yyvsp[(10) - (16)].range); - n->accessMethod = (yyvsp[(11) - (16)].str); - n->indexParams = (yyvsp[(13) - (16)].list); - n->options = (yyvsp[(15) - (16)].list); - n->whereClause = (yyvsp[(16) - (16)].node); + n->unique = (yyvsp[-14].boolean); + n->concurrent = (yyvsp[-12].boolean); + n->idxname = (yyvsp[-8].str); + n->relation = (yyvsp[-6].range); + n->accessMethod = (yyvsp[-5].str); + n->indexParams = (yyvsp[-3].list); + n->options = (yyvsp[-1].list); + n->whereClause = (yyvsp[0].node); n->excludeOpNames = NIL; n->idxcomment = NULL; n->indexOid = InvalidOid; @@ -29383,1457 +29707,1615 @@ YYLTYPE yylloc; n->transformed = false; n->onconflict = PG_IGNORE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 29712 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1300: + case 1306: /* access_method: ColId */ #line 62 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 29718 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1301: + case 1307: /* access_method_clause: USING access_method */ #line 66 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.str) = (yyvsp[(2) - (2)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 29724 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1302: + case 1308: /* access_method_clause: %empty */ #line 67 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.str) = (char*) DEFAULT_INDEX_TYPE; ;} + { (yyval.str) = (char*) DEFAULT_INDEX_TYPE; } +#line 29730 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1303: + case 1309: /* opt_concurrently: CONCURRENTLY */ #line 72 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 29736 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1304: + case 1310: /* opt_concurrently: %empty */ #line 73 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 29742 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1305: + case 1311: /* opt_index_name: index_name */ #line 78 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 29748 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1306: + case 1312: /* opt_index_name: %empty */ #line 79 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.str) = NULL; ;} + { (yyval.str) = NULL; } +#line 29754 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1307: + case 1313: /* opt_reloptions: WITH reloptions */ #line 83 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.list) = (yyvsp[(2) - (2)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 29760 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1308: + case 1314: /* opt_reloptions: %empty */ #line 84 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 29766 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1309: + case 1315: /* opt_unique: UNIQUE */ #line 89 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 29772 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1310: + case 1316: /* opt_unique: %empty */ #line 90 "third_party/libpg_query/grammar/statements/index.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 29778 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1311: + case 1317: /* AlterObjectSchemaStmt: ALTER TABLE relation_expr SET SCHEMA name */ #line 8 "third_party/libpg_query/grammar/statements/alter_schema.y" - { + { PGAlterObjectSchemaStmt *n = makeNode(PGAlterObjectSchemaStmt); n->objectType = PG_OBJECT_TABLE; - n->relation = (yyvsp[(3) - (6)].range); - n->newschema = (yyvsp[(6) - (6)].str); + n->relation = (yyvsp[-3].range); + n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 29791 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1312: + case 1318: /* AlterObjectSchemaStmt: ALTER TABLE IF_P EXISTS relation_expr SET SCHEMA name */ #line 17 "third_party/libpg_query/grammar/statements/alter_schema.y" - { + { PGAlterObjectSchemaStmt *n = makeNode(PGAlterObjectSchemaStmt); n->objectType = PG_OBJECT_TABLE; - n->relation = (yyvsp[(5) - (8)].range); - n->newschema = (yyvsp[(8) - (8)].str); + n->relation = (yyvsp[-3].range); + n->newschema = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 29804 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1313: + case 1319: /* AlterObjectSchemaStmt: ALTER SEQUENCE qualified_name SET SCHEMA name */ #line 26 "third_party/libpg_query/grammar/statements/alter_schema.y" - { + { PGAlterObjectSchemaStmt *n = makeNode(PGAlterObjectSchemaStmt); n->objectType = PG_OBJECT_SEQUENCE; - n->relation = (yyvsp[(3) - (6)].range); - n->newschema = (yyvsp[(6) - (6)].str); + n->relation = (yyvsp[-3].range); + n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 29817 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1314: + case 1320: /* AlterObjectSchemaStmt: ALTER SEQUENCE IF_P EXISTS qualified_name SET SCHEMA name */ #line 35 "third_party/libpg_query/grammar/statements/alter_schema.y" - { + { PGAlterObjectSchemaStmt *n = makeNode(PGAlterObjectSchemaStmt); n->objectType = PG_OBJECT_SEQUENCE; - n->relation = (yyvsp[(5) - (8)].range); - n->newschema = (yyvsp[(8) - (8)].str); + n->relation = (yyvsp[-3].range); + n->newschema = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 29830 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1315: + case 1321: /* AlterObjectSchemaStmt: ALTER VIEW qualified_name SET SCHEMA name */ #line 44 "third_party/libpg_query/grammar/statements/alter_schema.y" - { + { PGAlterObjectSchemaStmt *n = makeNode(PGAlterObjectSchemaStmt); n->objectType = PG_OBJECT_VIEW; - n->relation = (yyvsp[(3) - (6)].range); - n->newschema = (yyvsp[(6) - (6)].str); + n->relation = (yyvsp[-3].range); + n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (PGNode *)n; - ;} + } +#line 29843 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1316: + case 1322: /* AlterObjectSchemaStmt: ALTER VIEW IF_P EXISTS qualified_name SET SCHEMA name */ #line 53 "third_party/libpg_query/grammar/statements/alter_schema.y" - { + { PGAlterObjectSchemaStmt *n = makeNode(PGAlterObjectSchemaStmt); n->objectType = PG_OBJECT_VIEW; - n->relation = (yyvsp[(5) - (8)].range); - n->newschema = (yyvsp[(8) - (8)].str); + n->relation = (yyvsp[-3].range); + n->newschema = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (PGNode *)n; - ;} + } +#line 29856 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1317: + case 1323: /* CheckPointStmt: FORCE CHECKPOINT opt_col_id */ #line 6 "third_party/libpg_query/grammar/statements/checkpoint.y" - { + { PGCheckPointStmt *n = makeNode(PGCheckPointStmt); n->force = true; - n->name = (yyvsp[(3) - (3)].str); + n->name = (yyvsp[0].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 29867 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1318: + case 1324: /* CheckPointStmt: CHECKPOINT opt_col_id */ #line 13 "third_party/libpg_query/grammar/statements/checkpoint.y" - { + { PGCheckPointStmt *n = makeNode(PGCheckPointStmt); n->force = false; - n->name = (yyvsp[(2) - (2)].str); + n->name = (yyvsp[0].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 29878 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1319: + case 1325: /* opt_col_id: ColId */ #line 22 "third_party/libpg_query/grammar/statements/checkpoint.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 29884 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1320: + case 1326: /* opt_col_id: %empty */ #line 23 "third_party/libpg_query/grammar/statements/checkpoint.y" - { (yyval.str) = NULL; ;} + { (yyval.str) = NULL; } +#line 29890 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1321: + case 1327: /* CommentOnStmt: COMMENT ON comment_on_type_any_name qualified_name IS comment_value */ #line 8 "third_party/libpg_query/grammar/statements/comment_on.y" - { + { PGCommentOnStmt *n = makeNode(PGCommentOnStmt); - n->object_type = (yyvsp[(3) - (6)].objtype); - n->name = (yyvsp[(4) - (6)].range); - n->value = (yyvsp[(6) - (6)].node); + n->object_type = (yyvsp[-3].objtype); + n->name = (yyvsp[-2].range); + n->value = (yyvsp[0].node); (yyval.node) = (PGNode *)n; - ;} + } +#line 29902 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1322: + case 1328: /* CommentOnStmt: COMMENT ON COLUMN a_expr IS comment_value */ #line 16 "third_party/libpg_query/grammar/statements/comment_on.y" - { + { PGCommentOnStmt *n = makeNode(PGCommentOnStmt); n->object_type = PG_OBJECT_COLUMN; - n->column_expr = (yyvsp[(4) - (6)].node); - n->value = (yyvsp[(6) - (6)].node); + n->column_expr = (yyvsp[-2].node); + n->value = (yyvsp[0].node); (yyval.node) = (PGNode *)n; - ;} + } +#line 29914 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1323: + case 1329: /* comment_value: Sconst */ #line 26 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.node) = makeStringConst((yyvsp[(1) - (1)].str), (yylsp[(1) - (1)])); ;} + { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } +#line 29920 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1324: + case 1330: /* comment_value: NULL_P */ #line 27 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.node) = makeNullAConst((yylsp[(1) - (1)])); ;} + { (yyval.node) = makeNullAConst((yylsp[0])); } +#line 29926 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1325: + case 1331: /* comment_on_type_any_name: TABLE */ #line 30 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.objtype) = PG_OBJECT_TABLE; ;} + { (yyval.objtype) = PG_OBJECT_TABLE; } +#line 29932 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1326: + case 1332: /* comment_on_type_any_name: SEQUENCE */ #line 31 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.objtype) = PG_OBJECT_SEQUENCE; ;} + { (yyval.objtype) = PG_OBJECT_SEQUENCE; } +#line 29938 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1327: + case 1333: /* comment_on_type_any_name: FUNCTION */ #line 32 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.objtype) = PG_OBJECT_FUNCTION; ;} + { (yyval.objtype) = PG_OBJECT_FUNCTION; } +#line 29944 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1328: + case 1334: /* comment_on_type_any_name: MACRO */ #line 33 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.objtype) = PG_OBJECT_FUNCTION; ;} + { (yyval.objtype) = PG_OBJECT_FUNCTION; } +#line 29950 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1329: + case 1335: /* comment_on_type_any_name: MACRO TABLE */ #line 34 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.objtype) = PG_OBJECT_TABLE_MACRO; ;} + { (yyval.objtype) = PG_OBJECT_TABLE_MACRO; } +#line 29956 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1330: + case 1336: /* comment_on_type_any_name: VIEW */ #line 35 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.objtype) = PG_OBJECT_VIEW; ;} + { (yyval.objtype) = PG_OBJECT_VIEW; } +#line 29962 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1331: + case 1337: /* comment_on_type_any_name: DATABASE */ #line 36 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.objtype) = PG_OBJECT_DATABASE; ;} + { (yyval.objtype) = PG_OBJECT_DATABASE; } +#line 29968 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1332: + case 1338: /* comment_on_type_any_name: INDEX */ #line 37 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.objtype) = PG_OBJECT_INDEX; ;} + { (yyval.objtype) = PG_OBJECT_INDEX; } +#line 29974 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1333: + case 1339: /* comment_on_type_any_name: SCHEMA */ #line 38 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.objtype) = PG_OBJECT_SCHEMA; ;} + { (yyval.objtype) = PG_OBJECT_SCHEMA; } +#line 29980 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1334: + case 1340: /* comment_on_type_any_name: TYPE_P */ #line 39 "third_party/libpg_query/grammar/statements/comment_on.y" - { (yyval.objtype) = PG_OBJECT_TYPE; ;} + { (yyval.objtype) = PG_OBJECT_TYPE; } +#line 29986 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1335: + case 1341: /* ExportStmt: EXPORT_P DATABASE Sconst copy_options */ #line 8 "third_party/libpg_query/grammar/statements/export.y" - { + { PGExportStmt *n = makeNode(PGExportStmt); n->database = NULL; - n->filename = (yyvsp[(3) - (4)].str); + n->filename = (yyvsp[-1].str); n->options = NIL; - if ((yyvsp[(4) - (4)].list)) { - n->options = list_concat(n->options, (yyvsp[(4) - (4)].list)); + if ((yyvsp[0].list)) { + n->options = list_concat(n->options, (yyvsp[0].list)); } (yyval.node) = (PGNode *)n; - ;} + } +#line 30001 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1336: + case 1342: /* ExportStmt: EXPORT_P DATABASE ColId TO Sconst copy_options */ #line 20 "third_party/libpg_query/grammar/statements/export.y" - { + { PGExportStmt *n = makeNode(PGExportStmt); - n->database = (yyvsp[(3) - (6)].str); - n->filename = (yyvsp[(5) - (6)].str); + n->database = (yyvsp[-3].str); + n->filename = (yyvsp[-1].str); n->options = NIL; - if ((yyvsp[(6) - (6)].list)) { - n->options = list_concat(n->options, (yyvsp[(6) - (6)].list)); + if ((yyvsp[0].list)) { + n->options = list_concat(n->options, (yyvsp[0].list)); } (yyval.node) = (PGNode *)n; - ;} + } +#line 30016 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1337: + case 1343: /* ImportStmt: IMPORT_P DATABASE Sconst */ #line 34 "third_party/libpg_query/grammar/statements/export.y" - { + { PGImportStmt *n = makeNode(PGImportStmt); - n->filename = (yyvsp[(3) - (3)].str); + n->filename = (yyvsp[0].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 30026 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1338: + case 1344: /* ExplainStmt: EXPLAIN ExplainableStmt */ #line 10 "third_party/libpg_query/grammar/statements/explain.y" - { + { PGExplainStmt *n = makeNode(PGExplainStmt); - n->query = (yyvsp[(2) - (2)].node); + n->query = (yyvsp[0].node); n->options = NIL; (yyval.node) = (PGNode *) n; - ;} + } +#line 30037 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1339: + case 1345: /* ExplainStmt: EXPLAIN analyze_keyword opt_verbose ExplainableStmt */ #line 17 "third_party/libpg_query/grammar/statements/explain.y" - { + { PGExplainStmt *n = makeNode(PGExplainStmt); - n->query = (yyvsp[(4) - (4)].node); - n->options = list_make1(makeDefElem("analyze", NULL, (yylsp[(2) - (4)]))); - if ((yyvsp[(3) - (4)].boolean)) + n->query = (yyvsp[0].node); + n->options = list_make1(makeDefElem("analyze", NULL, (yylsp[-2]))); + if ((yyvsp[-1].boolean)) n->options = lappend(n->options, - makeDefElem("verbose", NULL, (yylsp[(3) - (4)]))); + makeDefElem("verbose", NULL, (yylsp[-1]))); (yyval.node) = (PGNode *) n; - ;} + } +#line 30051 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1340: + case 1346: /* ExplainStmt: EXPLAIN VERBOSE ExplainableStmt */ #line 27 "third_party/libpg_query/grammar/statements/explain.y" - { + { PGExplainStmt *n = makeNode(PGExplainStmt); - n->query = (yyvsp[(3) - (3)].node); - n->options = list_make1(makeDefElem("verbose", NULL, (yylsp[(2) - (3)]))); + n->query = (yyvsp[0].node); + n->options = list_make1(makeDefElem("verbose", NULL, (yylsp[-1]))); (yyval.node) = (PGNode *) n; - ;} + } +#line 30062 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1341: + case 1347: /* ExplainStmt: EXPLAIN '(' explain_option_list ')' ExplainableStmt */ #line 34 "third_party/libpg_query/grammar/statements/explain.y" - { + { PGExplainStmt *n = makeNode(PGExplainStmt); - n->query = (yyvsp[(5) - (5)].node); - n->options = (yyvsp[(3) - (5)].list); + n->query = (yyvsp[0].node); + n->options = (yyvsp[-2].list); (yyval.node) = (PGNode *) n; - ;} + } +#line 30073 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1342: + case 1348: /* opt_verbose: VERBOSE */ #line 44 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 30079 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1343: + case 1349: /* opt_verbose: %empty */ #line 45 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 30085 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1344: + case 1350: /* explain_option_arg: opt_boolean_or_string */ #line 50 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.node) = (PGNode *) makeString((yyvsp[(1) - (1)].str)); ;} + { (yyval.node) = (PGNode *) makeString((yyvsp[0].str)); } +#line 30091 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1345: + case 1351: /* explain_option_arg: NumericOnly */ #line 51 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.node) = (PGNode *) (yyvsp[(1) - (1)].value); ;} + { (yyval.node) = (PGNode *) (yyvsp[0].value); } +#line 30097 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1346: + case 1352: /* explain_option_arg: %empty */ #line 52 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.node) = NULL; ;} - break; - - case 1377: -#line 90 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.node) = NULL; } +#line 30103 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1378: + case 1384: /* NonReservedWord: IDENT */ #line 91 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 30109 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1379: + case 1385: /* NonReservedWord: unreserved_keyword */ #line 92 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = pstrdup((yyvsp[(1) - (1)].keyword)); ;} + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 30115 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1380: -#line 97 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1386: /* NonReservedWord: other_keyword */ +#line 93 "third_party/libpg_query/grammar/statements/explain.y" + { (yyval.str) = pstrdup((yyvsp[0].keyword)); } +#line 30121 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1381: + case 1387: /* NonReservedWord_or_Sconst: NonReservedWord */ #line 98 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 30127 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1382: -#line 104 "third_party/libpg_query/grammar/statements/explain.y" - { - (yyval.list) = list_make1((yyvsp[(1) - (1)].defelt)); - ;} + case 1388: /* NonReservedWord_or_Sconst: Sconst */ +#line 99 "third_party/libpg_query/grammar/statements/explain.y" + { (yyval.str) = (yyvsp[0].str); } +#line 30133 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1383: -#line 108 "third_party/libpg_query/grammar/statements/explain.y" - { - (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].defelt)); - ;} + case 1389: /* explain_option_list: explain_option_elem */ +#line 105 "third_party/libpg_query/grammar/statements/explain.y" + { + (yyval.list) = list_make1((yyvsp[0].defelt)); + } +#line 30141 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1384: -#line 115 "third_party/libpg_query/grammar/statements/explain.y" - {;} + case 1390: /* explain_option_list: explain_option_list ',' explain_option_elem */ +#line 109 "third_party/libpg_query/grammar/statements/explain.y" + { + (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); + } +#line 30149 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1385: + case 1391: /* analyze_keyword: ANALYZE */ #line 116 "third_party/libpg_query/grammar/statements/explain.y" - {;} + {} +#line 30155 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1386: -#line 121 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = (char*) "true"; ;} + case 1392: /* analyze_keyword: ANALYSE */ +#line 117 "third_party/libpg_query/grammar/statements/explain.y" + {} +#line 30161 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1387: + case 1393: /* opt_boolean_or_string: TRUE_P */ #line 122 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = (char*) "false"; ;} + { (yyval.str) = (char*) "true"; } +#line 30167 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1388: + case 1394: /* opt_boolean_or_string: FALSE_P */ #line 123 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = (char*) "on"; ;} + { (yyval.str) = (char*) "false"; } +#line 30173 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1389: -#line 129 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1395: /* opt_boolean_or_string: ON */ +#line 124 "third_party/libpg_query/grammar/statements/explain.y" + { (yyval.str) = (char*) "on"; } +#line 30179 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1390: -#line 135 "third_party/libpg_query/grammar/statements/explain.y" - { - (yyval.defelt) = makeDefElem((yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].node), (yylsp[(1) - (2)])); - ;} + case 1396: /* opt_boolean_or_string: NonReservedWord_or_Sconst */ +#line 130 "third_party/libpg_query/grammar/statements/explain.y" + { (yyval.str) = (yyvsp[0].str); } +#line 30185 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1391: -#line 142 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1397: /* explain_option_elem: explain_option_name explain_option_arg */ +#line 136 "third_party/libpg_query/grammar/statements/explain.y" + { + (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); + } +#line 30193 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1392: + case 1398: /* explain_option_name: NonReservedWord */ #line 143 "third_party/libpg_query/grammar/statements/explain.y" - { (yyval.str) = (char*) "analyze"; ;} + { (yyval.str) = (yyvsp[0].str); } +#line 30199 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1399: /* explain_option_name: analyze_keyword */ +#line 144 "third_party/libpg_query/grammar/statements/explain.y" + { (yyval.str) = (char*) "analyze"; } +#line 30205 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1393: + case 1400: /* VariableSetStmt: SET set_rest */ #line 11 "third_party/libpg_query/grammar/statements/variable_set.y" - { - PGVariableSetStmt *n = (yyvsp[(2) - (2)].vsetstmt); + { + PGVariableSetStmt *n = (yyvsp[0].vsetstmt); n->scope = VAR_SET_SCOPE_DEFAULT; (yyval.node) = (PGNode *) n; - ;} + } +#line 30215 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1394: + case 1401: /* VariableSetStmt: SET LOCAL set_rest */ #line 17 "third_party/libpg_query/grammar/statements/variable_set.y" - { - PGVariableSetStmt *n = (yyvsp[(3) - (3)].vsetstmt); + { + PGVariableSetStmt *n = (yyvsp[0].vsetstmt); n->scope = VAR_SET_SCOPE_LOCAL; (yyval.node) = (PGNode *) n; - ;} + } +#line 30225 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1395: + case 1402: /* VariableSetStmt: SET SESSION set_rest */ #line 23 "third_party/libpg_query/grammar/statements/variable_set.y" - { - PGVariableSetStmt *n = (yyvsp[(3) - (3)].vsetstmt); + { + PGVariableSetStmt *n = (yyvsp[0].vsetstmt); n->scope = VAR_SET_SCOPE_SESSION; (yyval.node) = (PGNode *) n; - ;} + } +#line 30235 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1396: + case 1403: /* VariableSetStmt: SET GLOBAL set_rest */ #line 29 "third_party/libpg_query/grammar/statements/variable_set.y" - { - PGVariableSetStmt *n = (yyvsp[(3) - (3)].vsetstmt); + { + PGVariableSetStmt *n = (yyvsp[0].vsetstmt); n->scope = VAR_SET_SCOPE_GLOBAL; (yyval.node) = (PGNode *) n; - ;} + } +#line 30245 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1397: + case 1404: /* set_rest: generic_set */ #line 38 "third_party/libpg_query/grammar/statements/variable_set.y" - {(yyval.vsetstmt) = (yyvsp[(1) - (1)].vsetstmt);;} + {(yyval.vsetstmt) = (yyvsp[0].vsetstmt);} +#line 30251 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1398: + case 1405: /* set_rest: var_name FROM CURRENT_P */ #line 40 "third_party/libpg_query/grammar/statements/variable_set.y" - { + { PGVariableSetStmt *n = makeNode(PGVariableSetStmt); n->kind = VAR_SET_CURRENT; - n->name = (yyvsp[(1) - (3)].str); + n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; - ;} + } +#line 30262 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1399: + case 1406: /* set_rest: TIME ZONE zone_value */ #line 48 "third_party/libpg_query/grammar/statements/variable_set.y" - { + { PGVariableSetStmt *n = makeNode(PGVariableSetStmt); n->kind = VAR_SET_VALUE; n->name = (char*) "timezone"; - if ((yyvsp[(3) - (3)].node) != NULL) - n->args = list_make1((yyvsp[(3) - (3)].node)); + if ((yyvsp[0].node) != NULL) + n->args = list_make1((yyvsp[0].node)); else n->kind = VAR_SET_DEFAULT; (yyval.vsetstmt) = n; - ;} + } +#line 30277 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1400: + case 1407: /* set_rest: SCHEMA Sconst */ #line 59 "third_party/libpg_query/grammar/statements/variable_set.y" - { + { PGVariableSetStmt *n = makeNode(PGVariableSetStmt); n->kind = VAR_SET_VALUE; n->name = (char*) "search_path"; - n->args = list_make1(makeStringConst((yyvsp[(2) - (2)].str), (yylsp[(2) - (2)]))); + n->args = list_make1(makeStringConst((yyvsp[0].str), (yylsp[0]))); (yyval.vsetstmt) = n; - ;} + } +#line 30289 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1401: + case 1408: /* generic_set: var_name TO var_list */ #line 71 "third_party/libpg_query/grammar/statements/variable_set.y" - { + { PGVariableSetStmt *n = makeNode(PGVariableSetStmt); n->kind = VAR_SET_VALUE; - n->name = (yyvsp[(1) - (3)].str); - n->args = (yyvsp[(3) - (3)].list); + n->name = (yyvsp[-2].str); + n->args = (yyvsp[0].list); (yyval.vsetstmt) = n; - ;} + } +#line 30301 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1402: + case 1409: /* generic_set: var_name '=' var_list */ #line 79 "third_party/libpg_query/grammar/statements/variable_set.y" - { + { PGVariableSetStmt *n = makeNode(PGVariableSetStmt); n->kind = VAR_SET_VALUE; - n->name = (yyvsp[(1) - (3)].str); - n->args = (yyvsp[(3) - (3)].list); + n->name = (yyvsp[-2].str); + n->args = (yyvsp[0].list); (yyval.vsetstmt) = n; - ;} + } +#line 30313 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1403: + case 1410: /* var_value: a_expr */ #line 90 "third_party/libpg_query/grammar/statements/variable_set.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 30319 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1404: + case 1411: /* zone_value: Sconst */ #line 96 "third_party/libpg_query/grammar/statements/variable_set.y" - { - (yyval.node) = makeStringConst((yyvsp[(1) - (1)].str), (yylsp[(1) - (1)])); - ;} + { + (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); + } +#line 30327 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1405: + case 1412: /* zone_value: IDENT */ #line 100 "third_party/libpg_query/grammar/statements/variable_set.y" - { - (yyval.node) = makeStringConst((yyvsp[(1) - (1)].str), (yylsp[(1) - (1)])); - ;} + { + (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); + } +#line 30335 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1406: + case 1413: /* zone_value: ConstInterval Sconst opt_interval */ #line 104 "third_party/libpg_query/grammar/statements/variable_set.y" - { - PGTypeName *t = (yyvsp[(1) - (3)].typnam); - if ((yyvsp[(3) - (3)].list) != NIL) + { + PGTypeName *t = (yyvsp[-2].typnam); + if ((yyvsp[0].list) != NIL) { - PGAConst *n = (PGAConst *) linitial((yyvsp[(3) - (3)].list)); + PGAConst *n = (PGAConst *) linitial((yyvsp[0].list)); if ((n->val.val.ival & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0) ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), errmsg("time zone interval must be HOUR or HOUR TO MINUTE"), - parser_errposition((yylsp[(3) - (3)])))); + parser_errposition((yylsp[0])))); } - t->typmods = (yyvsp[(3) - (3)].list); - (yyval.node) = makeStringConstCast((yyvsp[(2) - (3)].str), (yylsp[(2) - (3)]), t); - ;} + t->typmods = (yyvsp[0].list); + (yyval.node) = makeStringConstCast((yyvsp[-1].str), (yylsp[-1]), t); + } +#line 30354 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1407: + case 1414: /* zone_value: ConstInterval '(' Iconst ')' Sconst */ #line 119 "third_party/libpg_query/grammar/statements/variable_set.y" - { - PGTypeName *t = (yyvsp[(1) - (5)].typnam); + { + PGTypeName *t = (yyvsp[-4].typnam); t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), - makeIntConst((yyvsp[(3) - (5)].ival), (yylsp[(3) - (5)]))); - (yyval.node) = makeStringConstCast((yyvsp[(5) - (5)].str), (yylsp[(5) - (5)]), t); - ;} + makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); + (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); + } +#line 30365 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1408: + case 1415: /* zone_value: NumericOnly */ #line 125 "third_party/libpg_query/grammar/statements/variable_set.y" - { (yyval.node) = makeAConst((yyvsp[(1) - (1)].value), (yylsp[(1) - (1)])); ;} + { (yyval.node) = makeAConst((yyvsp[0].value), (yylsp[0])); } +#line 30371 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1409: + case 1416: /* zone_value: DEFAULT */ #line 126 "third_party/libpg_query/grammar/statements/variable_set.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 30377 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1410: + case 1417: /* zone_value: LOCAL */ #line 127 "third_party/libpg_query/grammar/statements/variable_set.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 30383 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1411: + case 1418: /* var_list: var_value */ #line 131 "third_party/libpg_query/grammar/statements/variable_set.y" - { (yyval.list) = list_make1((yyvsp[(1) - (1)].node)); ;} + { (yyval.list) = list_make1((yyvsp[0].node)); } +#line 30389 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1412: + case 1419: /* var_list: var_list ',' var_value */ #line 132 "third_party/libpg_query/grammar/statements/variable_set.y" - { (yyval.list) = lappend((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); ;} + { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } +#line 30395 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1413: + case 1420: /* LoadStmt: LOAD file_name */ #line 8 "third_party/libpg_query/grammar/statements/load.y" - { + { PGLoadStmt *n = makeNode(PGLoadStmt); - n->filename = (yyvsp[(2) - (2)].str); - n->repository = ""; + n->filename = (yyvsp[0].str); + n->repository = NULL; + n->repo_is_alias = false; + n->version = NULL; n->load_type = PG_LOAD_TYPE_LOAD; (yyval.node) = (PGNode *)n; - ;} + } +#line 30409 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1414: -#line 15 "third_party/libpg_query/grammar/statements/load.y" - { + case 1421: /* LoadStmt: opt_force INSTALL file_name opt_ext_version */ +#line 17 "third_party/libpg_query/grammar/statements/load.y" + { PGLoadStmt *n = makeNode(PGLoadStmt); - n->filename = (yyvsp[(2) - (2)].str); - n->repository = ""; - n->load_type = PG_LOAD_TYPE_INSTALL; + n->filename = (yyvsp[-1].str); + n->repository = NULL; + n->repo_is_alias = false; + n->version = (yyvsp[0].str); + n->load_type = (yyvsp[-3].loadinstalltype); (yyval.node) = (PGNode *)n; - ;} + } +#line 30423 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1415: -#line 22 "third_party/libpg_query/grammar/statements/load.y" - { - PGLoadStmt *n = makeNode(PGLoadStmt); - n->filename = (yyvsp[(3) - (3)].str); - n->repository = ""; - n->load_type = PG_LOAD_TYPE_FORCE_INSTALL; - (yyval.node) = (PGNode *)n; - ;} + case 1422: /* LoadStmt: opt_force INSTALL file_name FROM ColId opt_ext_version */ +#line 26 "third_party/libpg_query/grammar/statements/load.y" + { + PGLoadStmt *n = makeNode(PGLoadStmt); + n->repository = (yyvsp[-1].str); + n->repo_is_alias = true; + n->filename = (yyvsp[-3].str); + n->version = (yyvsp[0].str); + n->load_type = (yyvsp[-5].loadinstalltype); + (yyval.node) = (PGNode *)n; + } +#line 30437 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1416: -#line 29 "third_party/libpg_query/grammar/statements/load.y" - { - PGLoadStmt *n = makeNode(PGLoadStmt); - n->filename = (yyvsp[(2) - (4)].str); - n->repository = (yyvsp[(4) - (4)].str); - n->load_type = PG_LOAD_TYPE_INSTALL; - (yyval.node) = (PGNode *)n; - ;} + case 1423: /* LoadStmt: opt_force INSTALL file_name FROM Sconst opt_ext_version */ +#line 35 "third_party/libpg_query/grammar/statements/load.y" + { + PGLoadStmt *n = makeNode(PGLoadStmt); + n->filename = (yyvsp[-3].str); + n->repository = (yyvsp[-1].str); + n->repo_is_alias = false; + n->version = (yyvsp[0].str); + n->load_type = (yyvsp[-5].loadinstalltype); + (yyval.node) = (PGNode *)n; + } +#line 30451 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1417: -#line 36 "third_party/libpg_query/grammar/statements/load.y" - { - PGLoadStmt *n = makeNode(PGLoadStmt); - n->filename = (yyvsp[(3) - (5)].str); - n->repository = (yyvsp[(5) - (5)].str); - n->load_type = PG_LOAD_TYPE_FORCE_INSTALL; - (yyval.node) = (PGNode *)n; - ;} + case 1424: /* opt_force: %empty */ +#line 46 "third_party/libpg_query/grammar/statements/load.y" + { (yyval.loadinstalltype) = PG_LOAD_TYPE_INSTALL; } +#line 30457 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1418: -#line 45 "third_party/libpg_query/grammar/statements/load.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1425: /* opt_force: FORCE */ +#line 47 "third_party/libpg_query/grammar/statements/load.y" + { (yyval.loadinstalltype) = PG_LOAD_TYPE_FORCE_INSTALL; } +#line 30463 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1419: -#line 46 "third_party/libpg_query/grammar/statements/load.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1426: /* file_name: Sconst */ +#line 49 "third_party/libpg_query/grammar/statements/load.y" + { (yyval.str) = (yyvsp[0].str); } +#line 30469 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1420: -#line 48 "third_party/libpg_query/grammar/statements/load.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1427: /* file_name: ColId */ +#line 50 "third_party/libpg_query/grammar/statements/load.y" + { (yyval.str) = (yyvsp[0].str); } +#line 30475 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1421: -#line 49 "third_party/libpg_query/grammar/statements/load.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + case 1428: /* opt_ext_version: %empty */ +#line 53 "third_party/libpg_query/grammar/statements/load.y" + { (yyval.str) = NULL; } +#line 30481 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1429: /* opt_ext_version: VERSION_P Sconst */ +#line 54 "third_party/libpg_query/grammar/statements/load.y" + { (yyval.str) = (yyvsp[0].str); } +#line 30487 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1422: + case 1430: /* opt_ext_version: VERSION_P ColId */ +#line 55 "third_party/libpg_query/grammar/statements/load.y" + { (yyval.str) = (yyvsp[0].str); } +#line 30493 "third_party/libpg_query/grammar/grammar_out.cpp" + break; + + case 1431: /* VacuumStmt: VACUUM opt_full opt_freeze opt_verbose */ #line 9 "third_party/libpg_query/grammar/statements/vacuum.y" - { + { PGVacuumStmt *n = makeNode(PGVacuumStmt); n->options = PG_VACOPT_VACUUM; - if ((yyvsp[(2) - (4)].boolean)) + if ((yyvsp[-2].boolean)) n->options |= PG_VACOPT_FULL; - if ((yyvsp[(3) - (4)].boolean)) + if ((yyvsp[-1].boolean)) n->options |= PG_VACOPT_FREEZE; - if ((yyvsp[(4) - (4)].boolean)) + if ((yyvsp[0].boolean)) n->options |= PG_VACOPT_VERBOSE; n->relation = NULL; n->va_cols = NIL; (yyval.node) = (PGNode *)n; - ;} + } +#line 30511 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1423: + case 1432: /* VacuumStmt: VACUUM opt_full opt_freeze opt_verbose qualified_name opt_name_list */ #line 23 "third_party/libpg_query/grammar/statements/vacuum.y" - { + { PGVacuumStmt *n = makeNode(PGVacuumStmt); n->options = PG_VACOPT_VACUUM; - if ((yyvsp[(2) - (6)].boolean)) + if ((yyvsp[-4].boolean)) n->options |= PG_VACOPT_FULL; - if ((yyvsp[(3) - (6)].boolean)) + if ((yyvsp[-3].boolean)) n->options |= PG_VACOPT_FREEZE; - if ((yyvsp[(4) - (6)].boolean)) + if ((yyvsp[-2].boolean)) n->options |= PG_VACOPT_VERBOSE; - n->relation = (yyvsp[(5) - (6)].range); - n->va_cols = (yyvsp[(6) - (6)].list); + n->relation = (yyvsp[-1].range); + n->va_cols = (yyvsp[0].list); (yyval.node) = (PGNode *)n; - ;} + } +#line 30529 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1424: + case 1433: /* VacuumStmt: VACUUM opt_full opt_freeze opt_verbose AnalyzeStmt */ #line 37 "third_party/libpg_query/grammar/statements/vacuum.y" - { - PGVacuumStmt *n = (PGVacuumStmt *) (yyvsp[(5) - (5)].node); + { + PGVacuumStmt *n = (PGVacuumStmt *) (yyvsp[0].node); n->options |= PG_VACOPT_VACUUM; - if ((yyvsp[(2) - (5)].boolean)) + if ((yyvsp[-3].boolean)) n->options |= PG_VACOPT_FULL; - if ((yyvsp[(3) - (5)].boolean)) + if ((yyvsp[-2].boolean)) n->options |= PG_VACOPT_FREEZE; - if ((yyvsp[(4) - (5)].boolean)) + if ((yyvsp[-1].boolean)) n->options |= PG_VACOPT_VERBOSE; (yyval.node) = (PGNode *)n; - ;} + } +#line 30545 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1425: + case 1434: /* VacuumStmt: VACUUM '(' vacuum_option_list ')' */ #line 49 "third_party/libpg_query/grammar/statements/vacuum.y" - { + { PGVacuumStmt *n = makeNode(PGVacuumStmt); - n->options = PG_VACOPT_VACUUM | (yyvsp[(3) - (4)].ival); + n->options = PG_VACOPT_VACUUM | (yyvsp[-1].ival); n->relation = NULL; n->va_cols = NIL; (yyval.node) = (PGNode *) n; - ;} + } +#line 30557 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1426: + case 1435: /* VacuumStmt: VACUUM '(' vacuum_option_list ')' qualified_name opt_name_list */ #line 57 "third_party/libpg_query/grammar/statements/vacuum.y" - { + { PGVacuumStmt *n = makeNode(PGVacuumStmt); - n->options = PG_VACOPT_VACUUM | (yyvsp[(3) - (6)].ival); - n->relation = (yyvsp[(5) - (6)].range); - n->va_cols = (yyvsp[(6) - (6)].list); + n->options = PG_VACOPT_VACUUM | (yyvsp[-3].ival); + n->relation = (yyvsp[-1].range); + n->va_cols = (yyvsp[0].list); if (n->va_cols != NIL) /* implies analyze */ n->options |= PG_VACOPT_ANALYZE; (yyval.node) = (PGNode *) n; - ;} + } +#line 30571 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1427: + case 1436: /* vacuum_option_elem: analyze_keyword */ #line 70 "third_party/libpg_query/grammar/statements/vacuum.y" - { (yyval.ival) = PG_VACOPT_ANALYZE; ;} + { (yyval.ival) = PG_VACOPT_ANALYZE; } +#line 30577 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1428: + case 1437: /* vacuum_option_elem: VERBOSE */ #line 71 "third_party/libpg_query/grammar/statements/vacuum.y" - { (yyval.ival) = PG_VACOPT_VERBOSE; ;} + { (yyval.ival) = PG_VACOPT_VERBOSE; } +#line 30583 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1429: + case 1438: /* vacuum_option_elem: FREEZE */ #line 72 "third_party/libpg_query/grammar/statements/vacuum.y" - { (yyval.ival) = PG_VACOPT_FREEZE; ;} + { (yyval.ival) = PG_VACOPT_FREEZE; } +#line 30589 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1430: + case 1439: /* vacuum_option_elem: FULL */ #line 73 "third_party/libpg_query/grammar/statements/vacuum.y" - { (yyval.ival) = PG_VACOPT_FULL; ;} + { (yyval.ival) = PG_VACOPT_FULL; } +#line 30595 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1431: + case 1440: /* vacuum_option_elem: IDENT */ #line 75 "third_party/libpg_query/grammar/statements/vacuum.y" - { - if (strcmp((yyvsp[(1) - (1)].str), "disable_page_skipping") == 0) + { + if (strcmp((yyvsp[0].str), "disable_page_skipping") == 0) (yyval.ival) = PG_VACOPT_DISABLE_PAGE_SKIPPING; else ereport(ERROR, (errcode(PG_ERRCODE_SYNTAX_ERROR), - errmsg("unrecognized VACUUM option \"%s\"", (yyvsp[(1) - (1)].str)), - parser_errposition((yylsp[(1) - (1)])))); - ;} + errmsg("unrecognized VACUUM option \"%s\"", (yyvsp[0].str)), + parser_errposition((yylsp[0])))); + } +#line 30609 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1432: + case 1441: /* opt_full: FULL */ #line 87 "third_party/libpg_query/grammar/statements/vacuum.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 30615 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1433: + case 1442: /* opt_full: %empty */ #line 88 "third_party/libpg_query/grammar/statements/vacuum.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 30621 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1434: + case 1443: /* vacuum_option_list: vacuum_option_elem */ #line 93 "third_party/libpg_query/grammar/statements/vacuum.y" - { (yyval.ival) = (yyvsp[(1) - (1)].ival); ;} + { (yyval.ival) = (yyvsp[0].ival); } +#line 30627 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1435: + case 1444: /* vacuum_option_list: vacuum_option_list ',' vacuum_option_elem */ #line 94 "third_party/libpg_query/grammar/statements/vacuum.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) | (yyvsp[(3) - (3)].ival); ;} + { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } +#line 30633 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1436: + case 1445: /* opt_freeze: FREEZE */ #line 98 "third_party/libpg_query/grammar/statements/vacuum.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 30639 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1437: + case 1446: /* opt_freeze: %empty */ #line 99 "third_party/libpg_query/grammar/statements/vacuum.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 30645 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1438: + case 1447: /* DeleteStmt: opt_with_clause DELETE_P FROM relation_expr_opt_alias using_clause where_or_current_clause returning_clause */ #line 9 "third_party/libpg_query/grammar/statements/delete.y" - { + { PGDeleteStmt *n = makeNode(PGDeleteStmt); - n->relation = (yyvsp[(4) - (7)].range); - n->usingClause = (yyvsp[(5) - (7)].list); - n->whereClause = (yyvsp[(6) - (7)].node); - n->returningList = (yyvsp[(7) - (7)].list); - n->withClause = (yyvsp[(1) - (7)].with); + n->relation = (yyvsp[-3].range); + n->usingClause = (yyvsp[-2].list); + n->whereClause = (yyvsp[-1].node); + n->returningList = (yyvsp[0].list); + n->withClause = (yyvsp[-6].with); (yyval.node) = (PGNode *)n; - ;} + } +#line 30659 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1439: + case 1448: /* DeleteStmt: TRUNCATE opt_table relation_expr_opt_alias */ #line 19 "third_party/libpg_query/grammar/statements/delete.y" - { + { PGDeleteStmt *n = makeNode(PGDeleteStmt); - n->relation = (yyvsp[(3) - (3)].range); + n->relation = (yyvsp[0].range); n->usingClause = NULL; n->whereClause = NULL; n->returningList = NULL; n->withClause = NULL; (yyval.node) = (PGNode *)n; - ;} + } +#line 30673 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1440: + case 1449: /* relation_expr_opt_alias: relation_expr */ #line 32 "third_party/libpg_query/grammar/statements/delete.y" - { - (yyval.range) = (yyvsp[(1) - (1)].range); - ;} + { + (yyval.range) = (yyvsp[0].range); + } +#line 30681 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1441: + case 1450: /* relation_expr_opt_alias: relation_expr ColId */ #line 36 "third_party/libpg_query/grammar/statements/delete.y" - { + { PGAlias *alias = makeNode(PGAlias); - alias->aliasname = (yyvsp[(2) - (2)].str); - (yyvsp[(1) - (2)].range)->alias = alias; - (yyval.range) = (yyvsp[(1) - (2)].range); - ;} + alias->aliasname = (yyvsp[0].str); + (yyvsp[-1].range)->alias = alias; + (yyval.range) = (yyvsp[-1].range); + } +#line 30692 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1442: + case 1451: /* relation_expr_opt_alias: relation_expr AS ColId */ #line 43 "third_party/libpg_query/grammar/statements/delete.y" - { + { PGAlias *alias = makeNode(PGAlias); - alias->aliasname = (yyvsp[(3) - (3)].str); - (yyvsp[(1) - (3)].range)->alias = alias; - (yyval.range) = (yyvsp[(1) - (3)].range); - ;} + alias->aliasname = (yyvsp[0].str); + (yyvsp[-2].range)->alias = alias; + (yyval.range) = (yyvsp[-2].range); + } +#line 30703 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1443: + case 1452: /* where_or_current_clause: WHERE a_expr */ #line 53 "third_party/libpg_query/grammar/statements/delete.y" - { (yyval.node) = (yyvsp[(2) - (2)].node); ;} + { (yyval.node) = (yyvsp[0].node); } +#line 30709 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1444: + case 1453: /* where_or_current_clause: %empty */ #line 54 "third_party/libpg_query/grammar/statements/delete.y" - { (yyval.node) = NULL; ;} + { (yyval.node) = NULL; } +#line 30715 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1445: + case 1454: /* using_clause: USING from_list_opt_comma */ #line 60 "third_party/libpg_query/grammar/statements/delete.y" - { (yyval.list) = (yyvsp[(2) - (2)].list); ;} + { (yyval.list) = (yyvsp[0].list); } +#line 30721 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1446: + case 1455: /* using_clause: %empty */ #line 61 "third_party/libpg_query/grammar/statements/delete.y" - { (yyval.list) = NIL; ;} + { (yyval.list) = NIL; } +#line 30727 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1447: + case 1456: /* AnalyzeStmt: analyze_keyword opt_verbose */ #line 10 "third_party/libpg_query/grammar/statements/analyze.y" - { + { PGVacuumStmt *n = makeNode(PGVacuumStmt); n->options = PG_VACOPT_ANALYZE; - if ((yyvsp[(2) - (2)].boolean)) + if ((yyvsp[0].boolean)) n->options |= PG_VACOPT_VERBOSE; n->relation = NULL; n->va_cols = NIL; (yyval.node) = (PGNode *)n; - ;} + } +#line 30741 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1448: + case 1457: /* AnalyzeStmt: analyze_keyword opt_verbose qualified_name opt_name_list */ #line 20 "third_party/libpg_query/grammar/statements/analyze.y" - { + { PGVacuumStmt *n = makeNode(PGVacuumStmt); n->options = PG_VACOPT_ANALYZE; - if ((yyvsp[(2) - (4)].boolean)) + if ((yyvsp[-2].boolean)) n->options |= PG_VACOPT_VERBOSE; - n->relation = (yyvsp[(3) - (4)].range); - n->va_cols = (yyvsp[(4) - (4)].list); + n->relation = (yyvsp[-1].range); + n->va_cols = (yyvsp[0].list); (yyval.node) = (PGNode *)n; - ;} + } +#line 30755 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1449: + case 1458: /* AttachStmt: ATTACH opt_database Sconst opt_database_alias copy_options */ #line 8 "third_party/libpg_query/grammar/statements/attach.y" - { + { PGAttachStmt *n = makeNode(PGAttachStmt); - n->path = (yyvsp[(3) - (5)].str); - n->name = (yyvsp[(4) - (5)].str); - n->options = (yyvsp[(5) - (5)].list); + n->path = (yyvsp[-2].str); + n->name = (yyvsp[-1].str); + n->options = (yyvsp[0].list); n->onconflict = PG_ERROR_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 30768 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1450: + case 1459: /* AttachStmt: ATTACH IF_P NOT EXISTS opt_database Sconst opt_database_alias copy_options */ #line 17 "third_party/libpg_query/grammar/statements/attach.y" - { + { PGAttachStmt *n = makeNode(PGAttachStmt); - n->path = (yyvsp[(6) - (8)].str); - n->name = (yyvsp[(7) - (8)].str); - n->options = (yyvsp[(8) - (8)].list); + n->path = (yyvsp[-2].str); + n->name = (yyvsp[-1].str); + n->options = (yyvsp[0].list); n->onconflict = PG_IGNORE_ON_CONFLICT; (yyval.node) = (PGNode *)n; - ;} + } +#line 30781 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1451: + case 1460: /* DetachStmt: DETACH ColLabel */ #line 29 "third_party/libpg_query/grammar/statements/attach.y" - { + { PGDetachStmt *n = makeNode(PGDetachStmt); n->missing_ok = false; - n->db_name = (yyvsp[(2) - (2)].str); + n->db_name = (yyvsp[0].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 30792 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1452: + case 1461: /* DetachStmt: DETACH DATABASE ColLabel */ #line 36 "third_party/libpg_query/grammar/statements/attach.y" - { + { PGDetachStmt *n = makeNode(PGDetachStmt); n->missing_ok = false; - n->db_name = (yyvsp[(3) - (3)].str); + n->db_name = (yyvsp[0].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 30803 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1453: + case 1462: /* DetachStmt: DETACH DATABASE IF_P EXISTS ColLabel */ #line 43 "third_party/libpg_query/grammar/statements/attach.y" - { + { PGDetachStmt *n = makeNode(PGDetachStmt); n->missing_ok = true; - n->db_name = (yyvsp[(5) - (5)].str); + n->db_name = (yyvsp[0].str); (yyval.node) = (PGNode *)n; - ;} + } +#line 30814 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1454: + case 1463: /* opt_database: DATABASE */ #line 51 "third_party/libpg_query/grammar/statements/attach.y" - {;} + {} +#line 30820 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1455: + case 1464: /* opt_database: %empty */ #line 52 "third_party/libpg_query/grammar/statements/attach.y" - {;} + {} +#line 30826 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1456: + case 1465: /* opt_database_alias: AS ColId */ #line 56 "third_party/libpg_query/grammar/statements/attach.y" - { (yyval.str) = (yyvsp[(2) - (2)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 30832 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1457: + case 1466: /* opt_database_alias: %empty */ #line 57 "third_party/libpg_query/grammar/statements/attach.y" - { (yyval.str) = NULL; ;} + { (yyval.str) = NULL; } +#line 30838 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1458: + case 1467: /* VariableResetStmt: RESET reset_rest */ #line 3 "third_party/libpg_query/grammar/statements/variable_reset.y" - { - (yyvsp[(2) - (2)].vsetstmt)->scope = VAR_SET_SCOPE_DEFAULT; - (yyval.node) = (PGNode *) (yyvsp[(2) - (2)].vsetstmt); - ;} + { + (yyvsp[0].vsetstmt)->scope = VAR_SET_SCOPE_DEFAULT; + (yyval.node) = (PGNode *) (yyvsp[0].vsetstmt); + } +#line 30847 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1459: + case 1468: /* VariableResetStmt: RESET LOCAL reset_rest */ #line 8 "third_party/libpg_query/grammar/statements/variable_reset.y" - { - (yyvsp[(3) - (3)].vsetstmt)->scope = VAR_SET_SCOPE_LOCAL; - (yyval.node) = (PGNode *) (yyvsp[(3) - (3)].vsetstmt); - ;} + { + (yyvsp[0].vsetstmt)->scope = VAR_SET_SCOPE_LOCAL; + (yyval.node) = (PGNode *) (yyvsp[0].vsetstmt); + } +#line 30856 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1460: + case 1469: /* VariableResetStmt: RESET SESSION reset_rest */ #line 13 "third_party/libpg_query/grammar/statements/variable_reset.y" - { - (yyvsp[(3) - (3)].vsetstmt)->scope = VAR_SET_SCOPE_SESSION; - (yyval.node) = (PGNode *) (yyvsp[(3) - (3)].vsetstmt); - ;} + { + (yyvsp[0].vsetstmt)->scope = VAR_SET_SCOPE_SESSION; + (yyval.node) = (PGNode *) (yyvsp[0].vsetstmt); + } +#line 30865 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1461: + case 1470: /* VariableResetStmt: RESET GLOBAL reset_rest */ #line 18 "third_party/libpg_query/grammar/statements/variable_reset.y" - { - (yyvsp[(3) - (3)].vsetstmt)->scope = VAR_SET_SCOPE_GLOBAL; - (yyval.node) = (PGNode *) (yyvsp[(3) - (3)].vsetstmt); - ;} + { + (yyvsp[0].vsetstmt)->scope = VAR_SET_SCOPE_GLOBAL; + (yyval.node) = (PGNode *) (yyvsp[0].vsetstmt); + } +#line 30874 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1462: + case 1471: /* generic_reset: var_name */ #line 27 "third_party/libpg_query/grammar/statements/variable_reset.y" - { + { PGVariableSetStmt *n = makeNode(PGVariableSetStmt); n->kind = VAR_RESET; - n->name = (yyvsp[(1) - (1)].str); + n->name = (yyvsp[0].str); (yyval.vsetstmt) = n; - ;} + } +#line 30885 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1463: + case 1472: /* generic_reset: ALL */ #line 34 "third_party/libpg_query/grammar/statements/variable_reset.y" - { + { PGVariableSetStmt *n = makeNode(PGVariableSetStmt); n->kind = VAR_RESET_ALL; (yyval.vsetstmt) = n; - ;} + } +#line 30895 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1464: + case 1473: /* reset_rest: generic_reset */ #line 43 "third_party/libpg_query/grammar/statements/variable_reset.y" - { (yyval.vsetstmt) = (yyvsp[(1) - (1)].vsetstmt); ;} + { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } +#line 30901 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1465: + case 1474: /* reset_rest: TIME ZONE */ #line 45 "third_party/libpg_query/grammar/statements/variable_reset.y" - { + { PGVariableSetStmt *n = makeNode(PGVariableSetStmt); n->kind = VAR_RESET; n->name = (char*) "timezone"; (yyval.vsetstmt) = n; - ;} + } +#line 30912 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1466: + case 1475: /* reset_rest: TRANSACTION ISOLATION LEVEL */ #line 52 "third_party/libpg_query/grammar/statements/variable_reset.y" - { + { PGVariableSetStmt *n = makeNode(PGVariableSetStmt); n->kind = VAR_RESET; n->name = (char*) "transaction_isolation"; (yyval.vsetstmt) = n; - ;} + } +#line 30923 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1467: + case 1476: /* VariableShowStmt: show_or_describe SelectStmt */ #line 3 "third_party/libpg_query/grammar/statements/variable_show.y" - { + { PGVariableShowSelectStmt *n = makeNode(PGVariableShowSelectStmt); - n->stmt = (yyvsp[(2) - (2)].node); + n->stmt = (yyvsp[0].node); n->name = (char*) "select"; n->is_summary = 0; (yyval.node) = (PGNode *) n; - ;} + } +#line 30935 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1468: + case 1477: /* VariableShowStmt: SUMMARIZE SelectStmt */ #line 10 "third_party/libpg_query/grammar/statements/variable_show.y" - { + { PGVariableShowSelectStmt *n = makeNode(PGVariableShowSelectStmt); - n->stmt = (yyvsp[(2) - (2)].node); + n->stmt = (yyvsp[0].node); n->name = (char*) "select"; n->is_summary = 1; (yyval.node) = (PGNode *) n; - ;} + } +#line 30947 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1469: + case 1478: /* VariableShowStmt: SUMMARIZE table_id */ #line 18 "third_party/libpg_query/grammar/statements/variable_show.y" - { + { PGVariableShowStmt *n = makeNode(PGVariableShowStmt); - n->name = (yyvsp[(2) - (2)].str); + n->name = (yyvsp[0].str); n->is_summary = 1; (yyval.node) = (PGNode *) n; - ;} + } +#line 30958 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1470: + case 1479: /* VariableShowStmt: show_or_describe table_id */ #line 25 "third_party/libpg_query/grammar/statements/variable_show.y" - { + { PGVariableShowStmt *n = makeNode(PGVariableShowStmt); - n->name = (yyvsp[(2) - (2)].str); + n->name = (yyvsp[0].str); n->is_summary = 0; (yyval.node) = (PGNode *) n; - ;} + } +#line 30969 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1471: + case 1480: /* VariableShowStmt: show_or_describe TIME ZONE */ #line 32 "third_party/libpg_query/grammar/statements/variable_show.y" - { + { PGVariableShowStmt *n = makeNode(PGVariableShowStmt); n->name = (char*) "timezone"; n->is_summary = 0; (yyval.node) = (PGNode *) n; - ;} + } +#line 30980 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1472: + case 1481: /* VariableShowStmt: show_or_describe TRANSACTION ISOLATION LEVEL */ #line 39 "third_party/libpg_query/grammar/statements/variable_show.y" - { + { PGVariableShowStmt *n = makeNode(PGVariableShowStmt); n->name = (char*) "transaction_isolation"; n->is_summary = 0; (yyval.node) = (PGNode *) n; - ;} + } +#line 30991 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1473: + case 1482: /* VariableShowStmt: show_or_describe ALL opt_tables */ #line 46 "third_party/libpg_query/grammar/statements/variable_show.y" - { + { PGVariableShowStmt *n = makeNode(PGVariableShowStmt); n->name = (char*) "__show_tables_expanded"; n->is_summary = 0; (yyval.node) = (PGNode *) n; - ;} + } +#line 31002 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1474: + case 1483: /* VariableShowStmt: show_or_describe */ #line 53 "third_party/libpg_query/grammar/statements/variable_show.y" - { + { PGVariableShowStmt *n = makeNode(PGVariableShowStmt); n->name = (char*) "__show_tables_expanded"; n->is_summary = 0; (yyval.node) = (PGNode *) n; - ;} + } +#line 31013 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1481: + case 1490: /* var_name: ColId */ #line 67 "third_party/libpg_query/grammar/statements/variable_show.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + { (yyval.str) = (yyvsp[0].str); } +#line 31019 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1482: + case 1491: /* var_name: var_name '.' ColId */ #line 69 "third_party/libpg_query/grammar/statements/variable_show.y" - { (yyval.str) = psprintf("%s.%s", (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str)); ;} + { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } +#line 31025 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1483: + case 1492: /* table_id: ColId */ #line 72 "third_party/libpg_query/grammar/statements/variable_show.y" - { (yyval.str) = psprintf("\"%s\"", (yyvsp[(1) - (1)].str)); ;} + { (yyval.str) = psprintf("\"%s\"", (yyvsp[0].str)); } +#line 31031 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1484: + case 1493: /* table_id: table_id '.' ColId */ #line 74 "third_party/libpg_query/grammar/statements/variable_show.y" - { (yyval.str) = psprintf("%s.\"%s\"", (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str)); ;} + { (yyval.str) = psprintf("%s.\"%s\"", (yyvsp[-2].str), (yyvsp[0].str)); } +#line 31037 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1485: + case 1494: /* CallStmt: CALL_P func_application */ #line 7 "third_party/libpg_query/grammar/statements/call.y" - { + { PGCallStmt *n = makeNode(PGCallStmt); - n->func = (yyvsp[(2) - (2)].node); + n->func = (yyvsp[0].node); (yyval.node) = (PGNode *) n; - ;} + } +#line 31047 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1486: + case 1495: /* ViewStmt: CREATE_P OptTemp VIEW qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option */ #line 10 "third_party/libpg_query/grammar/statements/view.y" - { + { PGViewStmt *n = makeNode(PGViewStmt); - n->view = (yyvsp[(4) - (9)].range); - n->view->relpersistence = (yyvsp[(2) - (9)].ival); - n->aliases = (yyvsp[(5) - (9)].list); - n->query = (yyvsp[(8) - (9)].node); + n->view = (yyvsp[-5].range); + n->view->relpersistence = (yyvsp[-7].ival); + n->aliases = (yyvsp[-4].list); + n->query = (yyvsp[-1].node); n->onconflict = PG_ERROR_ON_CONFLICT; - n->options = (yyvsp[(6) - (9)].list); - n->withCheckOption = (yyvsp[(9) - (9)].viewcheckoption); + n->options = (yyvsp[-3].list); + n->withCheckOption = (yyvsp[0].viewcheckoption); (yyval.node) = (PGNode *) n; - ;} + } +#line 31063 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1487: + case 1496: /* ViewStmt: CREATE_P OptTemp VIEW IF_P NOT EXISTS qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option */ #line 23 "third_party/libpg_query/grammar/statements/view.y" - { + { PGViewStmt *n = makeNode(PGViewStmt); - n->view = (yyvsp[(7) - (12)].range); - n->view->relpersistence = (yyvsp[(2) - (12)].ival); - n->aliases = (yyvsp[(8) - (12)].list); - n->query = (yyvsp[(11) - (12)].node); + n->view = (yyvsp[-5].range); + n->view->relpersistence = (yyvsp[-10].ival); + n->aliases = (yyvsp[-4].list); + n->query = (yyvsp[-1].node); n->onconflict = PG_IGNORE_ON_CONFLICT; - n->options = (yyvsp[(9) - (12)].list); - n->withCheckOption = (yyvsp[(12) - (12)].viewcheckoption); + n->options = (yyvsp[-3].list); + n->withCheckOption = (yyvsp[0].viewcheckoption); (yyval.node) = (PGNode *) n; - ;} + } +#line 31079 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1488: + case 1497: /* ViewStmt: CREATE_P OR REPLACE OptTemp VIEW qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option */ #line 36 "third_party/libpg_query/grammar/statements/view.y" - { + { PGViewStmt *n = makeNode(PGViewStmt); - n->view = (yyvsp[(6) - (11)].range); - n->view->relpersistence = (yyvsp[(4) - (11)].ival); - n->aliases = (yyvsp[(7) - (11)].list); - n->query = (yyvsp[(10) - (11)].node); + n->view = (yyvsp[-5].range); + n->view->relpersistence = (yyvsp[-7].ival); + n->aliases = (yyvsp[-4].list); + n->query = (yyvsp[-1].node); n->onconflict = PG_REPLACE_ON_CONFLICT; - n->options = (yyvsp[(8) - (11)].list); - n->withCheckOption = (yyvsp[(11) - (11)].viewcheckoption); + n->options = (yyvsp[-3].list); + n->withCheckOption = (yyvsp[0].viewcheckoption); (yyval.node) = (PGNode *) n; - ;} + } +#line 31095 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1489: + case 1498: /* ViewStmt: CREATE_P OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions AS SelectStmt opt_check_option */ #line 49 "third_party/libpg_query/grammar/statements/view.y" - { + { PGViewStmt *n = makeNode(PGViewStmt); - n->view = (yyvsp[(5) - (12)].range); - n->view->relpersistence = (yyvsp[(2) - (12)].ival); - n->aliases = (yyvsp[(7) - (12)].list); - n->query = makeRecursiveViewSelect(n->view->relname, n->aliases, (yyvsp[(11) - (12)].node)); + n->view = (yyvsp[-7].range); + n->view->relpersistence = (yyvsp[-10].ival); + n->aliases = (yyvsp[-5].list); + n->query = makeRecursiveViewSelect(n->view->relname, n->aliases, (yyvsp[-1].node)); n->onconflict = PG_ERROR_ON_CONFLICT; - n->options = (yyvsp[(9) - (12)].list); - n->withCheckOption = (yyvsp[(12) - (12)].viewcheckoption); + n->options = (yyvsp[-3].list); + n->withCheckOption = (yyvsp[0].viewcheckoption); if (n->withCheckOption != PG_NO_CHECK_OPTION) ereport(ERROR, (errcode(PG_ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("WITH CHECK OPTION not supported on recursive views"), - parser_errposition((yylsp[(12) - (12)])))); + parser_errposition((yylsp[0])))); (yyval.node) = (PGNode *) n; - ;} + } +#line 31116 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1490: + case 1499: /* ViewStmt: CREATE_P OR REPLACE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions AS SelectStmt opt_check_option */ #line 67 "third_party/libpg_query/grammar/statements/view.y" - { + { PGViewStmt *n = makeNode(PGViewStmt); - n->view = (yyvsp[(7) - (14)].range); - n->view->relpersistence = (yyvsp[(4) - (14)].ival); - n->aliases = (yyvsp[(9) - (14)].list); - n->query = makeRecursiveViewSelect(n->view->relname, n->aliases, (yyvsp[(13) - (14)].node)); + n->view = (yyvsp[-7].range); + n->view->relpersistence = (yyvsp[-10].ival); + n->aliases = (yyvsp[-5].list); + n->query = makeRecursiveViewSelect(n->view->relname, n->aliases, (yyvsp[-1].node)); n->onconflict = PG_REPLACE_ON_CONFLICT; - n->options = (yyvsp[(11) - (14)].list); - n->withCheckOption = (yyvsp[(14) - (14)].viewcheckoption); + n->options = (yyvsp[-3].list); + n->withCheckOption = (yyvsp[0].viewcheckoption); if (n->withCheckOption != PG_NO_CHECK_OPTION) ereport(ERROR, (errcode(PG_ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("WITH CHECK OPTION not supported on recursive views"), - parser_errposition((yylsp[(14) - (14)])))); + parser_errposition((yylsp[0])))); (yyval.node) = (PGNode *) n; - ;} + } +#line 31137 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1491: + case 1500: /* opt_check_option: WITH CHECK_P OPTION */ #line 87 "third_party/libpg_query/grammar/statements/view.y" - { (yyval.viewcheckoption) = CASCADED_CHECK_OPTION; ;} + { (yyval.viewcheckoption) = CASCADED_CHECK_OPTION; } +#line 31143 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1492: + case 1501: /* opt_check_option: WITH CASCADED CHECK_P OPTION */ #line 88 "third_party/libpg_query/grammar/statements/view.y" - { (yyval.viewcheckoption) = CASCADED_CHECK_OPTION; ;} + { (yyval.viewcheckoption) = CASCADED_CHECK_OPTION; } +#line 31149 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1493: + case 1502: /* opt_check_option: WITH LOCAL CHECK_P OPTION */ #line 89 "third_party/libpg_query/grammar/statements/view.y" - { (yyval.viewcheckoption) = PG_LOCAL_CHECK_OPTION; ;} + { (yyval.viewcheckoption) = PG_LOCAL_CHECK_OPTION; } +#line 31155 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1494: + case 1503: /* opt_check_option: %empty */ #line 90 "third_party/libpg_query/grammar/statements/view.y" - { (yyval.viewcheckoption) = PG_NO_CHECK_OPTION; ;} + { (yyval.viewcheckoption) = PG_NO_CHECK_OPTION; } +#line 31161 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1495: + case 1504: /* CreateAsStmt: CREATE_P OptTemp TABLE create_as_target AS SelectStmt opt_with_data */ #line 12 "third_party/libpg_query/grammar/statements/create_as.y" - { + { PGCreateTableAsStmt *ctas = makeNode(PGCreateTableAsStmt); - ctas->query = (yyvsp[(6) - (7)].node); - ctas->into = (yyvsp[(4) - (7)].into); + ctas->query = (yyvsp[-1].node); + ctas->into = (yyvsp[-3].into); ctas->relkind = PG_OBJECT_TABLE; ctas->is_select_into = false; ctas->onconflict = PG_ERROR_ON_CONFLICT; /* cram additional flags into the PGIntoClause */ - (yyvsp[(4) - (7)].into)->rel->relpersistence = (yyvsp[(2) - (7)].ival); - (yyvsp[(4) - (7)].into)->skipData = !((yyvsp[(7) - (7)].boolean)); + (yyvsp[-3].into)->rel->relpersistence = (yyvsp[-5].ival); + (yyvsp[-3].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (PGNode *) ctas; - ;} + } +#line 31178 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1496: + case 1505: /* CreateAsStmt: CREATE_P OptTemp TABLE IF_P NOT EXISTS create_as_target AS SelectStmt opt_with_data */ #line 25 "third_party/libpg_query/grammar/statements/create_as.y" - { + { PGCreateTableAsStmt *ctas = makeNode(PGCreateTableAsStmt); - ctas->query = (yyvsp[(9) - (10)].node); - ctas->into = (yyvsp[(7) - (10)].into); + ctas->query = (yyvsp[-1].node); + ctas->into = (yyvsp[-3].into); ctas->relkind = PG_OBJECT_TABLE; ctas->is_select_into = false; ctas->onconflict = PG_IGNORE_ON_CONFLICT; /* cram additional flags into the PGIntoClause */ - (yyvsp[(7) - (10)].into)->rel->relpersistence = (yyvsp[(2) - (10)].ival); - (yyvsp[(7) - (10)].into)->skipData = !((yyvsp[(10) - (10)].boolean)); + (yyvsp[-3].into)->rel->relpersistence = (yyvsp[-8].ival); + (yyvsp[-3].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (PGNode *) ctas; - ;} + } +#line 31195 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1497: + case 1506: /* CreateAsStmt: CREATE_P OR REPLACE OptTemp TABLE create_as_target AS SelectStmt opt_with_data */ #line 38 "third_party/libpg_query/grammar/statements/create_as.y" - { + { PGCreateTableAsStmt *ctas = makeNode(PGCreateTableAsStmt); - ctas->query = (yyvsp[(8) - (9)].node); - ctas->into = (yyvsp[(6) - (9)].into); + ctas->query = (yyvsp[-1].node); + ctas->into = (yyvsp[-3].into); ctas->relkind = PG_OBJECT_TABLE; ctas->is_select_into = false; ctas->onconflict = PG_REPLACE_ON_CONFLICT; /* cram additional flags into the PGIntoClause */ - (yyvsp[(6) - (9)].into)->rel->relpersistence = (yyvsp[(4) - (9)].ival); - (yyvsp[(6) - (9)].into)->skipData = !((yyvsp[(9) - (9)].boolean)); + (yyvsp[-3].into)->rel->relpersistence = (yyvsp[-5].ival); + (yyvsp[-3].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (PGNode *) ctas; - ;} + } +#line 31212 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1498: + case 1507: /* opt_with_data: WITH DATA_P */ #line 54 "third_party/libpg_query/grammar/statements/create_as.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 31218 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1499: + case 1508: /* opt_with_data: WITH NO DATA_P */ #line 55 "third_party/libpg_query/grammar/statements/create_as.y" - { (yyval.boolean) = false; ;} + { (yyval.boolean) = false; } +#line 31224 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1500: + case 1509: /* opt_with_data: %empty */ #line 56 "third_party/libpg_query/grammar/statements/create_as.y" - { (yyval.boolean) = true; ;} + { (yyval.boolean) = true; } +#line 31230 "third_party/libpg_query/grammar/grammar_out.cpp" break; - case 1501: + case 1510: /* create_as_target: qualified_name opt_column_list OptWith OnCommitOption */ #line 62 "third_party/libpg_query/grammar/statements/create_as.y" - { + { (yyval.into) = makeNode(PGIntoClause); - (yyval.into)->rel = (yyvsp[(1) - (4)].range); - (yyval.into)->colNames = (yyvsp[(2) - (4)].list); - (yyval.into)->options = (yyvsp[(3) - (4)].list); - (yyval.into)->onCommit = (yyvsp[(4) - (4)].oncommit); + (yyval.into)->rel = (yyvsp[-3].range); + (yyval.into)->colNames = (yyvsp[-2].list); + (yyval.into)->options = (yyvsp[-1].list); + (yyval.into)->onCommit = (yyvsp[0].oncommit); (yyval.into)->viewQuery = NULL; (yyval.into)->skipData = false; /* might get changed later */ - ;} + } +#line 31244 "third_party/libpg_query/grammar/grammar_out.cpp" break; -/* Line 1267 of yacc.c. */ -#line 30744 "third_party/libpg_query/grammar/grammar_out.cpp" +#line 31248 "third_party/libpg_query/grammar/grammar_out.cpp" + default: break; } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; - YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; *++yylsp = yyloc; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE yyerror (&yylloc, yyscanner, YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (&yylloc, yyscanner, yymsg); - } - else - { - yyerror (&yylloc, yyscanner, YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif } - yyerror_range[0] = yylloc; - + yyerror_range[1] = yylloc; if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, yyscanner); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, yyscanner); + yychar = YYEMPTY; + } } - /* Else will try to reuse look-ahead token after shifting the error + /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; @@ -30842,15 +31324,13 @@ YYLTYPE yylloc; | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - yyerror_range[0] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -30863,47 +31343,45 @@ YYLTYPE yylloc; | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ + /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; - yyerror_range[0] = *yylsp; + yyerror_range[1] = *yylsp; yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp, yyscanner); + YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, yyscanner); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } - if (yyn == YYFINAL) - YYACCEPT; - + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END - yyerror_range[1] = yylloc; - /* Using YYLLOC is tempting, but would change the location of - the look-ahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); - *++yylsp = yyloc; + yyerror_range[2] = yylloc; + ++yylsp; + YYLLOC_DEFAULT (*yylsp, yyerror_range, 2); /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -30914,51 +31392,55 @@ YYLTYPE yylloc; `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; + /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (&yylloc, yyscanner, YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ -#endif + goto yyreturnlab; -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, yyscanner); - /* Do not reclaim the symbols of the rule which action triggered + +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, yyscanner); + } + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp, yyscanner); + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, yyscanner); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} + return yyresult; +} #line 83 "third_party/libpg_query/grammar/statements/create_as.y" @@ -31717,4 +32199,3 @@ parser_init(base_yy_extra_type *yyext) #undef yylloc } // namespace duckdb_libpgquery - diff --git a/src/duckdb/third_party/mbedtls/library/constant_time.cpp b/src/duckdb/third_party/mbedtls/library/constant_time.cpp index a797dce3..d2a2239e 100644 --- a/src/duckdb/third_party/mbedtls/library/constant_time.cpp +++ b/src/duckdb/third_party/mbedtls/library/constant_time.cpp @@ -61,7 +61,7 @@ int mbedtls_ct_memcmp( const void *a, * This avoids IAR compiler warning: * 'the order of volatile accesses is undefined ..' */ unsigned char x = A[i], y = B[i]; - diff |= x ^ y; + diff = (diff | (x ^ y)); } return( (int)diff ); diff --git a/src/duckdb/third_party/parquet/parquet_types.cpp b/src/duckdb/third_party/parquet/parquet_types.cpp index 22299be3..e6eeb774 100644 --- a/src/duckdb/third_party/parquet/parquet_types.cpp +++ b/src/duckdb/third_party/parquet/parquet_types.cpp @@ -113,6 +113,9 @@ std::ostream &operator<<(std::ostream &out, const ConvertedType::type &val) { case ConvertedType::INTERVAL: out << "INTERVAL"; return out; + case ConvertedType::NULL_TYPE: + out << "NULL"; + return out; // no default for compiler error on missing enum } out << static_cast(val); diff --git a/src/duckdb/third_party/parquet/parquet_types.h b/src/duckdb/third_party/parquet/parquet_types.h index 55bc8c0e..af109ee9 100644 --- a/src/duckdb/third_party/parquet/parquet_types.h +++ b/src/duckdb/third_party/parquet/parquet_types.h @@ -61,7 +61,8 @@ struct ConvertedType { INT_64 = 18, JSON = 19, BSON = 20, - INTERVAL = 21 + INTERVAL = 21, + NULL_TYPE = 24 }; }; diff --git a/src/duckdb/third_party/re2/re2/compile.cc b/src/duckdb/third_party/re2/re2/compile.cc index 7bc76bbd..cb03d8d4 100644 --- a/src/duckdb/third_party/re2/re2/compile.cc +++ b/src/duckdb/third_party/re2/re2/compile.cc @@ -487,8 +487,8 @@ int Compiler::CachedRuneByteSuffix(uint8_t lo, uint8_t hi, bool foldcase, } bool Compiler::IsCachedRuneByteSuffix(int id) { - uint8_t lo = inst_[id].lo_; - uint8_t hi = inst_[id].hi_; + uint8_t lo = inst_[id].byte_range.lo_; + uint8_t hi = inst_[id].byte_range.hi_; bool foldcase = inst_[id].foldcase() != 0; int next = inst_[id].out(); diff --git a/src/duckdb/third_party/re2/re2/dfa.cc b/src/duckdb/third_party/re2/re2/dfa.cc index 38b060d5..7793f8f5 100644 --- a/src/duckdb/third_party/re2/re2/dfa.cc +++ b/src/duckdb/third_party/re2/re2/dfa.cc @@ -116,13 +116,8 @@ class DFA { // into this state, along with kFlagMatch if this // is a matching state. -// Work around the bug affecting flexible array members in GCC 6.x (for x >= 1). -// (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70932) -#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 6 && __GNUC_MINOR__ >= 1 - std::atomic next_[0]; // Outgoing arrows from State, -#else - std::atomic next_[]; // Outgoing arrows from State, -#endif + // fixes from https://github.com/girishji/re2/commit/80b212f289c4ef75408b1510b9fc85e6cb9a447c + std::atomic *next_; // Outgoing arrows from State, // one per input byte class }; @@ -751,7 +746,7 @@ DFA::State* DFA::CachedState(int* inst, int ninst, uint32_t flag) { // Allocate new state along with room for next_ and inst_. char* space = std::allocator().allocate(mem); State* s = new (space) State; - (void) new (s->next_) std::atomic[nnext]; + s->next_ = new (space + sizeof(State)) std::atomic[nnext]; // Work around a unfortunate bug in older versions of libstdc++. // (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64658) for (int i = 0; i < nnext; i++) diff --git a/src/duckdb/third_party/re2/re2/onepass.cc b/src/duckdb/third_party/re2/re2/onepass.cc index 2290e8c8..f2a620e2 100644 --- a/src/duckdb/third_party/re2/re2/onepass.cc +++ b/src/duckdb/third_party/re2/re2/onepass.cc @@ -143,7 +143,7 @@ namespace duckdb_re2 { // the memory footprint.) struct OneState { uint32_t matchcond; // conditions to match right now. - uint32_t action[]; + uint32_t action[256]; }; // The uint32_t conditions in the action are a combination of @@ -243,7 +243,8 @@ bool Prog::SearchOnePass(const StringPiece& text, kind = kFullMatch; uint8_t* nodes = onepass_nodes_.data(); - int statesize = sizeof(OneState) + bytemap_range()*sizeof(uint32_t); + int statesize = sizeof(uint32_t) + bytemap_range()*sizeof(uint32_t); + // start() is always mapped to the zeroth OneState. OneState* state = IndexToNode(nodes, statesize, 0); uint8_t* bytemap = bytemap_; @@ -392,7 +393,7 @@ bool Prog::IsOnePass() { // Limit max node count to 65000 as a conservative estimate to // avoid overflowing 16-bit node index in encoding. int maxnodes = 2 + inst_count(kInstByteRange); - int statesize = sizeof(OneState) + bytemap_range()*sizeof(uint32_t); + int statesize = sizeof(uint32_t) + bytemap_range()*sizeof(uint32_t); if (maxnodes >= 65000 || dfa_mem_ / 4 / statesize < maxnodes) return false; diff --git a/src/duckdb/third_party/re2/re2/prog.cc b/src/duckdb/third_party/re2/re2/prog.cc index b0ed4dbb..92c54f8a 100644 --- a/src/duckdb/third_party/re2/re2/prog.cc +++ b/src/duckdb/third_party/re2/re2/prog.cc @@ -38,9 +38,9 @@ void Prog::Inst::InitAlt(uint32_t out, uint32_t out1) { void Prog::Inst::InitByteRange(int lo, int hi, int foldcase, uint32_t out) { DCHECK_EQ(out_opcode_, 0); set_out_opcode(out, kInstByteRange); - lo_ = lo & 0xFF; - hi_ = hi & 0xFF; - hint_foldcase_ = foldcase&1; + byte_range.lo_ = lo & 0xFF; + byte_range.hi_ = hi & 0xFF; + byte_range.hint_foldcase_ = foldcase&1; } void Prog::Inst::InitCapture(int cap, uint32_t out) { @@ -85,7 +85,7 @@ std::string Prog::Inst::Dump() { case kInstByteRange: return StringPrintf("byte%s [%02x-%02x] %d -> %d", foldcase() ? "/i" : "", - lo_, hi_, hint(), out()); + byte_range.lo_, byte_range.hi_, hint(), out()); case kInstCapture: return StringPrintf("capture %d -> %d", cap_, out()); @@ -921,7 +921,7 @@ void Prog::ComputeHints(std::vector* flat, int begin, int end) { if (first != end) { uint16_t hint = static_cast(std::min(first - id, 32767)); - ip->hint_foldcase_ |= hint<<1; + ip->byte_range.hint_foldcase_ |= hint<<1; } } } @@ -1022,11 +1022,11 @@ void Prog::ConfigurePrefixAccel(const std::string& prefix, prefix_dfa_ = BuildShiftDFA(prefix.substr(0, prefix_size_)); } else if (prefix_size_ != 1) { // Use PrefixAccel_FrontAndBack(). - prefix_front_ = prefix.front(); - prefix_back_ = prefix.back(); + prefix_front_back.prefix_front_ = prefix.front(); + prefix_front_back.prefix_back_ = prefix.back(); } else { // Use memchr(3). - prefix_front_ = prefix.front(); + prefix_front_back.prefix_front_ = prefix.front(); } } @@ -1166,8 +1166,8 @@ const void* Prog::PrefixAccel_FrontAndBack(const void* data, size_t size) { const char* p0 = reinterpret_cast(data); for (const char* p = p0;; p++) { DCHECK_GE(size, static_cast(p-p0)); - p = reinterpret_cast(memchr(p, prefix_front_, size - (p-p0))); - if (p == NULL || p[prefix_size_-1] == prefix_back_) + p = reinterpret_cast(memchr(p, prefix_front_back.prefix_front_, size - (p-p0))); + if (p == NULL || p[prefix_size_-1] == prefix_front_back.prefix_back_) return p; } } diff --git a/src/duckdb/third_party/re2/re2/prog.h b/src/duckdb/third_party/re2/re2/prog.h index 29be811a..e385b59e 100644 --- a/src/duckdb/third_party/re2/re2/prog.h +++ b/src/duckdb/third_party/re2/re2/prog.h @@ -84,10 +84,10 @@ class Prog { int out() { return out_opcode_>>4; } int out1() { DCHECK(opcode() == kInstAlt || opcode() == kInstAltMatch); return out1_; } int cap() { DCHECK_EQ(opcode(), kInstCapture); return cap_; } - int lo() { DCHECK_EQ(opcode(), kInstByteRange); return lo_; } - int hi() { DCHECK_EQ(opcode(), kInstByteRange); return hi_; } - int foldcase() { DCHECK_EQ(opcode(), kInstByteRange); return hint_foldcase_&1; } - int hint() { DCHECK_EQ(opcode(), kInstByteRange); return hint_foldcase_>>1; } + int lo() { DCHECK_EQ(opcode(), kInstByteRange); return byte_range.lo_; } + int hi() { DCHECK_EQ(opcode(), kInstByteRange); return byte_range.hi_; } + int foldcase() { DCHECK_EQ(opcode(), kInstByteRange); return byte_range.hint_foldcase_&1; } + int hint() { DCHECK_EQ(opcode(), kInstByteRange); return byte_range.hint_foldcase_>>1; } int match_id() { DCHECK_EQ(opcode(), kInstMatch); return match_id_; } EmptyOp empty() { DCHECK_EQ(opcode(), kInstEmptyWidth); return empty_; } @@ -103,7 +103,7 @@ class Prog { DCHECK_EQ(opcode(), kInstByteRange); if (foldcase() && 'A' <= c && c <= 'Z') c += 'a' - 'A'; - return lo_ <= c && c <= hi_; + return byte_range.lo_ <= c && c <= byte_range.hi_; } // Returns string representation for debugging. @@ -155,7 +155,7 @@ class Prog { // means there are no remaining possibilities, // which is most likely for character classes. // foldcase: A-Z -> a-z before checking range. - }; + } byte_range; EmptyOp empty_; // opcode == kInstEmptyWidth // empty_ is bitwise OR of kEmpty* flags above. @@ -227,7 +227,7 @@ class Prog { } else if (prefix_size_ != 1) { return PrefixAccel_FrontAndBack(data, size); } else { - return memchr(data, prefix_front_, size); + return memchr(data, prefix_front_back.prefix_front_, size); } } @@ -426,7 +426,7 @@ class Prog { struct { int prefix_front_; // first byte of prefix int prefix_back_; // last byte of prefix - }; + } prefix_front_back; }; int list_count_; // count of lists (see above) diff --git a/src/duckdb/third_party/tdigest/t_digest.hpp b/src/duckdb/third_party/tdigest/t_digest.hpp index 5c78567d..a25668c0 100644 --- a/src/duckdb/third_party/tdigest/t_digest.hpp +++ b/src/duckdb/third_party/tdigest/t_digest.hpp @@ -219,7 +219,7 @@ class TDigest { pq.push((*iter)); } std::vector batch; - batch.reserve(size); + batch.reserve(size_t(size)); size_t totalSize = 0; while (!pq.empty()) { @@ -324,7 +324,7 @@ class TDigest { CentroidComparator cc; auto iter = std::upper_bound(processed_.cbegin(), processed_.cend(), Centroid(x, 0), cc); - auto i = std::distance(processed_.cbegin(), iter); + auto i = size_t(std::distance(processed_.cbegin(), iter)); auto z1 = x - (iter - 1)->mean(); auto z2 = (iter)->mean() - x; return weightedAverage(cumulative_[i - 1], z2, cumulative_[i], z1) / processedWeight_; @@ -369,7 +369,7 @@ class TDigest { auto iter = std::lower_bound(cumulative_.cbegin(), cumulative_.cend(), index); if (iter + 1 != cumulative_.cend()) { - auto i = std::distance(cumulative_.cbegin(), iter); + auto i = size_t(std::distance(cumulative_.cbegin(), iter)); auto z1 = index - *(iter - 1); auto z2 = *(iter)-index; // LOG(INFO) << "z2 " << z2 << " index " << index << " z1 " << z1; @@ -406,9 +406,9 @@ class TDigest { inline void add(std::vector::const_iterator iter, std::vector::const_iterator end) { while (iter != end) { - const size_t diff = std::distance(iter, end); + const size_t diff = size_t(std::distance(iter, end)); const size_t room = maxUnprocessed_ - unprocessed_.size(); - auto mid = iter + std::min(diff, room); + auto mid = iter + int64_t(std::min(diff, room)); while (iter != mid) { unprocessed_.push_back(*(iter++)); } @@ -538,7 +538,7 @@ class TDigest { std::sort(unprocessed_.begin(), unprocessed_.end(), cc); auto count = unprocessed_.size(); unprocessed_.insert(unprocessed_.end(), processed_.cbegin(), processed_.cend()); - std::inplace_merge(unprocessed_.begin(), unprocessed_.begin() + count, unprocessed_.end(), cc); + std::inplace_merge(unprocessed_.begin(), unprocessed_.begin() + int64_t(count), unprocessed_.end(), cc); processedWeight_ += unprocessedWeight_; unprocessedWeight_ = 0; diff --git a/src/duckdb/third_party/utf8proc/include/utf8proc.hpp b/src/duckdb/third_party/utf8proc/include/utf8proc.hpp index a7cc6eef..37fa1f26 100644 --- a/src/duckdb/third_party/utf8proc/include/utf8proc.hpp +++ b/src/duckdb/third_party/utf8proc/include/utf8proc.hpp @@ -637,7 +637,7 @@ void utf8proc_grapheme_callback(const char *s, size_t len, T &&fun) { size_t start = 0; size_t cpos = 0; while(true) { - cpos += sz; + cpos += static_cast(sz); if (cpos >= len) { fun(start, cpos); return; diff --git a/src/duckdb/third_party/yyjson/include/yyjson.hpp b/src/duckdb/third_party/yyjson/include/yyjson.hpp new file mode 100644 index 00000000..69898d15 --- /dev/null +++ b/src/duckdb/third_party/yyjson/include/yyjson.hpp @@ -0,0 +1,7930 @@ +/*============================================================================== + Copyright (c) 2020 YaoYuan + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + *============================================================================*/ + +/** + @file yyjson.h + @date 2019-03-09 + @author YaoYuan + */ + +#ifndef DUCKDB_YYJSON_H +#define DUCKDB_YYJSON_H + + + +/*============================================================================== + * Header Files + *============================================================================*/ + +#include +#include +#include +#include +#include +#include + +#include "duckdb/common/fast_mem.hpp" + +namespace duckdb_yyjson { + +/*============================================================================== + * Compile-time Options + *============================================================================*/ + +/* + Define as 1 to disable JSON reader if JSON parsing is not required. + + This will disable these functions at compile-time: + - yyjson_read() + - yyjson_read_opts() + - yyjson_read_file() + - yyjson_read_number() + - yyjson_mut_read_number() + + This will reduce the binary size by about 60%. + */ +#ifndef YYJSON_DISABLE_READER +#endif + +/* + Define as 1 to disable JSON writer if JSON serialization is not required. + + This will disable these functions at compile-time: + - yyjson_write() + - yyjson_write_file() + - yyjson_write_opts() + - yyjson_val_write() + - yyjson_val_write_file() + - yyjson_val_write_opts() + - yyjson_mut_write() + - yyjson_mut_write_file() + - yyjson_mut_write_opts() + - yyjson_mut_val_write() + - yyjson_mut_val_write_file() + - yyjson_mut_val_write_opts() + + This will reduce the binary size by about 30%. + */ +#ifndef YYJSON_DISABLE_WRITER +#endif + +/* + Define as 1 to disable JSON Pointer, JSON Patch and JSON Merge Patch supports. + + This will disable these functions at compile-time: + - yyjson_ptr_xxx() + - yyjson_mut_ptr_xxx() + - yyjson_doc_ptr_xxx() + - yyjson_mut_doc_ptr_xxx() + - yyjson_patch() + - yyjson_mut_patch() + - yyjson_merge_patch() + - yyjson_mut_merge_patch() + */ +#ifndef YYJSON_DISABLE_UTILS +#endif + +/* + Define as 1 to disable the fast floating-point number conversion in yyjson, + and use libc's `strtod/snprintf` instead. + + This will reduce the binary size by about 30%, but significantly slow down the + floating-point read/write speed. + */ +#ifndef YYJSON_DISABLE_FAST_FP_CONV +#endif + +/* + Define as 1 to disable non-standard JSON support at compile-time: + - Reading and writing inf/nan literal, such as `NaN`, `-Infinity`. + - Single line and multiple line comments. + - Single trailing comma at the end of an object or array. + - Invalid unicode in string value. + + This will also invalidate these run-time options: + - YYJSON_READ_ALLOW_INF_AND_NAN + - YYJSON_READ_ALLOW_COMMENTS + - YYJSON_READ_ALLOW_TRAILING_COMMAS + - YYJSON_READ_ALLOW_INVALID_UNICODE + - YYJSON_WRITE_ALLOW_INF_AND_NAN + - YYJSON_WRITE_ALLOW_INVALID_UNICODE + + This will reduce the binary size by about 10%, and speed up the reading and + writing speed by about 2% to 6%. + */ +#ifndef YYJSON_DISABLE_NON_STANDARD +#endif + +/* + Define as 1 to disable UTF-8 validation at compile time. + + If all input strings are guaranteed to be valid UTF-8 encoding (for example, + some language's String object has already validated the encoding), using this + flag can avoid redundant UTF-8 validation in yyjson. + + This flag can speed up the reading and writing speed of non-ASCII encoded + strings by about 3% to 7%. + + Note: If this flag is used while passing in illegal UTF-8 strings, the + following errors may occur: + - Escaped characters may be ignored when parsing JSON strings. + - Ending quotes may be ignored when parsing JSON strings, causing the string + to be concatenated to the next value. + - When accessing `yyjson_mut_val` for serialization, the string ending may be + accessed out of bounds, causing a segmentation fault. + */ +#ifndef YYJSON_DISABLE_UTF8_VALIDATION +#endif + +/* + Define as 1 to indicate that the target architecture does not support unaligned + memory access. Please refer to the comments in the C file for details. + */ +#ifndef YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS +#endif + +/* Define as 1 to export symbols when building this library as Windows DLL. */ +#ifndef YYJSON_EXPORTS +#endif + +/* Define as 1 to import symbols when using this library as Windows DLL. */ +#ifndef YYJSON_IMPORTS +#endif + +/* Define as 1 to include for compiler which doesn't support C99. */ +#ifndef YYJSON_HAS_STDINT_H +#endif + +/* Define as 1 to include for compiler which doesn't support C99. */ +#ifndef YYJSON_HAS_STDBOOL_H +#endif + + + +/*============================================================================== + * Compiler Macros + *============================================================================*/ + +/** compiler version (MSVC) */ +#ifdef _MSC_VER +# define YYJSON_MSC_VER _MSC_VER +#else +# define YYJSON_MSC_VER 0 +#endif + +/** compiler version (GCC) */ +#ifdef __GNUC__ +# define YYJSON_GCC_VER __GNUC__ +# if defined(__GNUC_PATCHLEVEL__) +# define yyjson_gcc_available(major, minor, patch) \ + ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \ + >= (major * 10000 + minor * 100 + patch)) +# else +# define yyjson_gcc_available(major, minor, patch) \ + ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100) \ + >= (major * 10000 + minor * 100 + patch)) +# endif +#else +# define YYJSON_GCC_VER 0 +# define yyjson_gcc_available(major, minor, patch) 0 +#endif + +/** real gcc check */ +#if !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__ICC) && \ + defined(__GNUC__) +# define YYJSON_IS_REAL_GCC 1 +#else +# define YYJSON_IS_REAL_GCC 0 +#endif + +/** C version (STDC) */ +#if defined(__STDC__) && (__STDC__ >= 1) && defined(__STDC_VERSION__) +# define YYJSON_STDC_VER __STDC_VERSION__ +#else +# define YYJSON_STDC_VER 0 +#endif + +/** C++ version */ +#if defined(__cplusplus) +# define YYJSON_CPP_VER __cplusplus +#else +# define YYJSON_CPP_VER 0 +#endif + +/** compiler builtin check (since gcc 10.0, clang 2.6, icc 2021) */ +#ifndef yyjson_has_builtin +# ifdef __has_builtin +# define yyjson_has_builtin(x) __has_builtin(x) +# else +# define yyjson_has_builtin(x) 0 +# endif +#endif + +/** compiler attribute check (since gcc 5.0, clang 2.9, icc 17) */ +#ifndef yyjson_has_attribute +# ifdef __has_attribute +# define yyjson_has_attribute(x) __has_attribute(x) +# else +# define yyjson_has_attribute(x) 0 +# endif +#endif + +/** compiler feature check (since clang 2.6, icc 17) */ +#ifndef yyjson_has_feature +# ifdef __has_feature +# define yyjson_has_feature(x) __has_feature(x) +# else +# define yyjson_has_feature(x) 0 +# endif +#endif + +/** include check (since gcc 5.0, clang 2.7, icc 16, msvc 2017 15.3) */ +#ifndef yyjson_has_include +# ifdef __has_include +# define yyjson_has_include(x) __has_include(x) +# else +# define yyjson_has_include(x) 0 +# endif +#endif + +/** inline for compiler */ +#ifndef yyjson_inline +# if YYJSON_MSC_VER >= 1200 +# define yyjson_inline __forceinline +# elif defined(_MSC_VER) +# define yyjson_inline __inline +# elif yyjson_has_attribute(always_inline) || YYJSON_GCC_VER >= 4 +# define yyjson_inline __inline__ __attribute__((always_inline)) +# elif defined(__clang__) || defined(__GNUC__) +# define yyjson_inline __inline__ +# elif defined(__cplusplus) || YYJSON_STDC_VER >= 199901L +# define yyjson_inline inline +# else +# define yyjson_inline +# endif +#endif + +/** noinline for compiler */ +#ifndef yyjson_noinline +# if YYJSON_MSC_VER >= 1400 +# define yyjson_noinline __declspec(noinline) +# elif yyjson_has_attribute(noinline) || YYJSON_GCC_VER >= 4 +# define yyjson_noinline __attribute__((noinline)) +# else +# define yyjson_noinline +# endif +#endif + +/** align for compiler */ +#ifndef yyjson_align +# if YYJSON_MSC_VER >= 1300 +# define yyjson_align(x) __declspec(align(x)) +# elif yyjson_has_attribute(aligned) || defined(__GNUC__) +# define yyjson_align(x) __attribute__((aligned(x))) +# elif YYJSON_CPP_VER >= 201103L +# define yyjson_align(x) alignas(x) +# else +# define yyjson_align(x) +# endif +#endif + +/** likely for compiler */ +#ifndef yyjson_likely +# if yyjson_has_builtin(__builtin_expect) || \ + (YYJSON_GCC_VER >= 4 && YYJSON_GCC_VER != 5) +# define yyjson_likely(expr) __builtin_expect(!!(expr), 1) +# else +# define yyjson_likely(expr) (expr) +# endif +#endif + +/** unlikely for compiler */ +#ifndef yyjson_unlikely +# if yyjson_has_builtin(__builtin_expect) || \ + (YYJSON_GCC_VER >= 4 && YYJSON_GCC_VER != 5) +# define yyjson_unlikely(expr) __builtin_expect(!!(expr), 0) +# else +# define yyjson_unlikely(expr) (expr) +# endif +#endif + +/** compile-time constant check for compiler */ +#ifndef yyjson_constant_p +# if yyjson_has_builtin(__builtin_constant_p) || (YYJSON_GCC_VER >= 3) +# define YYJSON_HAS_CONSTANT_P 1 +# define yyjson_constant_p(value) __builtin_constant_p(value) +# else +# define YYJSON_HAS_CONSTANT_P 0 +# define yyjson_constant_p(value) 0 +# endif +#endif + +/** deprecate warning */ +#ifndef yyjson_deprecated +# if YYJSON_MSC_VER >= 1400 +# define yyjson_deprecated(msg) __declspec(deprecated(msg)) +# elif yyjson_has_feature(attribute_deprecated_with_message) || \ + (YYJSON_GCC_VER > 4 || (YYJSON_GCC_VER == 4 && __GNUC_MINOR__ >= 5)) +# define yyjson_deprecated(msg) __attribute__((deprecated(msg))) +# elif YYJSON_GCC_VER >= 3 +# define yyjson_deprecated(msg) __attribute__((deprecated)) +# else +# define yyjson_deprecated(msg) +# endif +#endif + +/** function export */ +#ifndef yyjson_api +# if defined(_WIN32) +# if defined(YYJSON_EXPORTS) && YYJSON_EXPORTS +# define yyjson_api __declspec(dllexport) +# elif defined(YYJSON_IMPORTS) && YYJSON_IMPORTS +# define yyjson_api __declspec(dllimport) +# else +# define yyjson_api +# endif +# elif yyjson_has_attribute(visibility) || YYJSON_GCC_VER >= 4 +# define yyjson_api __attribute__((visibility("default"))) +# else +# define yyjson_api +# endif +#endif + +/** inline function export */ +#ifndef yyjson_api_inline +# define yyjson_api_inline static yyjson_inline +#endif + +/** stdint (C89 compatible) */ +#if (defined(YYJSON_HAS_STDINT_H) && YYJSON_HAS_STDINT_H) || \ + YYJSON_MSC_VER >= 1600 || YYJSON_STDC_VER >= 199901L || \ + defined(_STDINT_H) || defined(_STDINT_H_) || \ + defined(__CLANG_STDINT_H) || defined(_STDINT_H_INCLUDED) || \ + yyjson_has_include() +# include +#elif defined(_MSC_VER) +# if _MSC_VER < 1300 + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + typedef signed __int64 int64_t; + typedef unsigned __int64 uint64_t; +# else + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef signed __int64 int64_t; + typedef unsigned __int64 uint64_t; +# endif +#else +# if UCHAR_MAX == 0xFFU + typedef signed char int8_t; + typedef unsigned char uint8_t; +# else +# error cannot find 8-bit integer type +# endif +# if USHRT_MAX == 0xFFFFU + typedef unsigned short uint16_t; + typedef signed short int16_t; +# elif UINT_MAX == 0xFFFFU + typedef unsigned int uint16_t; + typedef signed int int16_t; +# else +# error cannot find 16-bit integer type +# endif +# if UINT_MAX == 0xFFFFFFFFUL + typedef unsigned int uint32_t; + typedef signed int int32_t; +# elif ULONG_MAX == 0xFFFFFFFFUL + typedef unsigned long uint32_t; + typedef signed long int32_t; +# elif USHRT_MAX == 0xFFFFFFFFUL + typedef unsigned short uint32_t; + typedef signed short int32_t; +# else +# error cannot find 32-bit integer type +# endif +# if defined(__INT64_TYPE__) && defined(__UINT64_TYPE__) + typedef __INT64_TYPE__ int64_t; + typedef __UINT64_TYPE__ uint64_t; +# elif defined(__GNUC__) || defined(__clang__) +# if !defined(_SYS_TYPES_H) && !defined(__int8_t_defined) + __extension__ typedef long long int64_t; +# endif + __extension__ typedef unsigned long long uint64_t; +# elif defined(_LONG_LONG) || defined(__MWERKS__) || defined(_CRAYC) || \ + defined(__SUNPRO_C) || defined(__SUNPRO_CC) + typedef long long int64_t; + typedef unsigned long long uint64_t; +# elif (defined(__BORLANDC__) && __BORLANDC__ > 0x460) || \ + defined(__WATCOM_INT64__) || defined (__alpha) || defined (__DECC) + typedef __int64 int64_t; + typedef unsigned __int64 uint64_t; +# else +# error cannot find 64-bit integer type +# endif +#endif + +/** stdbool (C89 compatible) */ +#if (defined(YYJSON_HAS_STDBOOL_H) && YYJSON_HAS_STDBOOL_H) || \ + (yyjson_has_include() && !defined(__STRICT_ANSI__)) || \ + YYJSON_MSC_VER >= 1800 || YYJSON_STDC_VER >= 199901L +# include +#elif !defined(__bool_true_false_are_defined) +# define __bool_true_false_are_defined 1 +# if defined(__cplusplus) +# if defined(__GNUC__) && !defined(__STRICT_ANSI__) +# define _Bool bool +# if __cplusplus < 201103L +# define bool bool +# define false false +# define true true +# endif +# endif +# else +# define bool unsigned char +# define true 1 +# define false 0 +# endif +#endif + +/** char bit check */ +#if defined(CHAR_BIT) +# if CHAR_BIT != 8 +# error non 8-bit char is not supported +# endif +#endif + +/** + Microsoft Visual C++ 6.0 doesn't support converting number from u64 to f64: + error C2520: conversion from unsigned __int64 to double not implemented. + */ +#ifndef YYJSON_U64_TO_F64_NO_IMPL +# if (0 < YYJSON_MSC_VER) && (YYJSON_MSC_VER <= 1200) +# define YYJSON_U64_TO_F64_NO_IMPL 1 +# else +# define YYJSON_U64_TO_F64_NO_IMPL 0 +# endif +#endif + + + +/*============================================================================== + * Compile Hint Begin + *============================================================================*/ + +/* extern "C" begin */ +#ifdef __cplusplus +// extern "C" { +#endif + +/* warning suppress begin */ +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunused-const-variable" +# pragma clang diagnostic ignored "-Wunused-function" +# pragma clang diagnostic ignored "-Wunused-parameter" +#elif defined(__GNUC__) +# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# pragma GCC diagnostic push +# endif +# pragma GCC diagnostic ignored "-Wunused-const-variable" +# pragma GCC diagnostic ignored "-Wunused-function" +# pragma GCC diagnostic ignored "-Wunused-parameter" +#elif defined(_MSC_VER) +# pragma warning(push) +# pragma warning(disable:4800) /* 'int': forcing value to 'true' or 'false' */ +#endif + + + +/*============================================================================== + * Version + *============================================================================*/ + +/** The major version of yyjson. */ +#define YYJSON_VERSION_MAJOR 0 + +/** The minor version of yyjson. */ +#define YYJSON_VERSION_MINOR 9 + +/** The patch version of yyjson. */ +#define YYJSON_VERSION_PATCH 0 + +/** The version of yyjson in hex: `(major << 16) | (minor << 8) | (patch)`. */ +#define YYJSON_VERSION_HEX 0x000900 + +/** The version string of yyjson. */ +#define YYJSON_VERSION_STRING "0.9.0" + +/** The version of yyjson in hex, same as `YYJSON_VERSION_HEX`. */ +yyjson_api uint32_t yyjson_version(void); + + + +/*============================================================================== + * JSON Types + *============================================================================*/ + +/** Type of a JSON value (3 bit). */ +typedef uint8_t yyjson_type; +/** No type, invalid. */ +#define YYJSON_TYPE_NONE ((uint8_t)0) /* _____000 */ +/** Raw string type, no subtype. */ +#define YYJSON_TYPE_RAW ((uint8_t)1) /* _____001 */ +/** Null type: `null` literal, no subtype. */ +#define YYJSON_TYPE_NULL ((uint8_t)2) /* _____010 */ +/** Boolean type, subtype: TRUE, FALSE. */ +#define YYJSON_TYPE_BOOL ((uint8_t)3) /* _____011 */ +/** Number type, subtype: UINT, SINT, REAL. */ +#define YYJSON_TYPE_NUM ((uint8_t)4) /* _____100 */ +/** String type, subtype: NONE, NOESC. */ +#define YYJSON_TYPE_STR ((uint8_t)5) /* _____101 */ +/** Array type, no subtype. */ +#define YYJSON_TYPE_ARR ((uint8_t)6) /* _____110 */ +/** Object type, no subtype. */ +#define YYJSON_TYPE_OBJ ((uint8_t)7) /* _____111 */ + +/** Subtype of a JSON value (2 bit). */ +typedef uint8_t yyjson_subtype; +/** No subtype. */ +#define YYJSON_SUBTYPE_NONE ((uint8_t)(0 << 3)) /* ___00___ */ +/** False subtype: `false` literal. */ +#define YYJSON_SUBTYPE_FALSE ((uint8_t)(0 << 3)) /* ___00___ */ +/** True subtype: `true` literal. */ +#define YYJSON_SUBTYPE_TRUE ((uint8_t)(1 << 3)) /* ___01___ */ +/** Unsigned integer subtype: `uint64_t`. */ +#define YYJSON_SUBTYPE_UINT ((uint8_t)(0 << 3)) /* ___00___ */ +/** Signed integer subtype: `int64_t`. */ +#define YYJSON_SUBTYPE_SINT ((uint8_t)(1 << 3)) /* ___01___ */ +/** Real number subtype: `double`. */ +#define YYJSON_SUBTYPE_REAL ((uint8_t)(2 << 3)) /* ___10___ */ +/** String that do not need to be escaped for writing (internal use). */ +#define YYJSON_SUBTYPE_NOESC ((uint8_t)(1 << 3)) /* ___01___ */ + +/** The mask used to extract the type of a JSON value. */ +#define YYJSON_TYPE_MASK ((uint8_t)0x07) /* _____111 */ +/** The number of bits used by the type. */ +#define YYJSON_TYPE_BIT ((uint8_t)3) +/** The mask used to extract the subtype of a JSON value. */ +#define YYJSON_SUBTYPE_MASK ((uint8_t)0x18) /* ___11___ */ +/** The number of bits used by the subtype. */ +#define YYJSON_SUBTYPE_BIT ((uint8_t)2) +/** The mask used to extract the reserved bits of a JSON value. */ +#define YYJSON_RESERVED_MASK ((uint8_t)0xE0) /* 111_____ */ +/** The number of reserved bits. */ +#define YYJSON_RESERVED_BIT ((uint8_t)3) +/** The mask used to extract the tag of a JSON value. */ +#define YYJSON_TAG_MASK ((uint8_t)0xFF) /* 11111111 */ +/** The number of bits used by the tag. */ +#define YYJSON_TAG_BIT ((uint8_t)8) + +/** Padding size for JSON reader. */ +#define YYJSON_PADDING_SIZE 4 + + + +/*============================================================================== + * Allocator + *============================================================================*/ + +/** + A memory allocator. + + Typically you don't need to use it, unless you want to customize your own + memory allocator. + */ +typedef struct yyjson_alc { + /** Same as libc's malloc(size), should not be NULL. */ + void *(*malloc)(void *ctx, size_t size); + /** Same as libc's realloc(ptr, size), should not be NULL. */ + void *(*realloc)(void *ctx, void *ptr, size_t old_size, size_t size); + /** Same as libc's free(ptr), should not be NULL. */ + void (*free)(void *ctx, void *ptr); + /** A context for malloc/realloc/free, can be NULL. */ + void *ctx; +} yyjson_alc; + +/** + A pool allocator uses fixed length pre-allocated memory. + + This allocator may be used to avoid malloc/realloc calls. The pre-allocated + memory should be held by the caller. The maximum amount of memory required to + read a JSON can be calculated using the `yyjson_read_max_memory_usage()` + function, but the amount of memory required to write a JSON cannot be directly + calculated. + + This is not a general-purpose allocator. It is designed to handle a single JSON + data at a time. If it is used for overly complex memory tasks, such as parsing + multiple JSON documents using the same allocator but releasing only a few of + them, it may cause memory fragmentation, resulting in performance degradation + and memory waste. + + @param alc The allocator to be initialized. + If this parameter is NULL, the function will fail and return false. + If `buf` or `size` is invalid, this will be set to an empty allocator. + @param buf The buffer memory for this allocator. + If this parameter is NULL, the function will fail and return false. + @param size The size of `buf`, in bytes. + If this parameter is less than 8 words (32/64 bytes on 32/64-bit OS), the + function will fail and return false. + @return true if the `alc` has been successfully initialized. + + @par Example + @code + // parse JSON with stack memory + char buf[1024]; + yyjson_alc alc; + yyjson_alc_pool_init(&alc, buf, 1024); + + const char *json = "{\"name\":\"Helvetica\",\"size\":16}" + yyjson_doc *doc = yyjson_read_opts(json, strlen(json), 0, &alc, NULL); + // the memory of `doc` is on the stack + @endcode + + @warning This Allocator is not thread-safe. + */ +yyjson_api bool yyjson_alc_pool_init(yyjson_alc *alc, void *buf, size_t size); + +/** + A dynamic allocator. + + This allocator has a similar usage to the pool allocator above. However, when + there is not enough memory, this allocator will dynamically request more memory + using libc's `malloc` function, and frees it all at once when it is destroyed. + + @return A new dynamic allocator, or NULL if memory allocation failed. + @note The returned value should be freed with `yyjson_alc_dyn_free()`. + + @warning This Allocator is not thread-safe. + */ +yyjson_api yyjson_alc *yyjson_alc_dyn_new(void); + +/** + Free a dynamic allocator which is created by `yyjson_alc_dyn_new()`. + @param alc The dynamic allocator to be destroyed. + */ +yyjson_api void yyjson_alc_dyn_free(yyjson_alc *alc); + + + +/*============================================================================== + * JSON Structure + *============================================================================*/ + +/** + An immutable document for reading JSON. + This document holds memory for all its JSON values and strings. When it is no + longer used, the user should call `yyjson_doc_free()` to free its memory. + */ +typedef struct yyjson_doc yyjson_doc; + +/** + An immutable value for reading JSON. + A JSON Value has the same lifetime as its document. The memory is held by its + document and and cannot be freed alone. + */ +typedef struct yyjson_val yyjson_val; + +/** + A mutable document for building JSON. + This document holds memory for all its JSON values and strings. When it is no + longer used, the user should call `yyjson_mut_doc_free()` to free its memory. + */ +typedef struct yyjson_mut_doc yyjson_mut_doc; + +/** + A mutable value for building JSON. + A JSON Value has the same lifetime as its document. The memory is held by its + document and and cannot be freed alone. + */ +typedef struct yyjson_mut_val yyjson_mut_val; + + + +/*============================================================================== + * JSON Reader API + *============================================================================*/ + +/** Run-time options for JSON reader. */ +typedef uint32_t yyjson_read_flag; + +/** Default option (RFC 8259 compliant): + - Read positive integer as uint64_t. + - Read negative integer as int64_t. + - Read floating-point number as double with round-to-nearest mode. + - Read integer which cannot fit in uint64_t or int64_t as double. + - Report error if double number is infinity. + - Report error if string contains invalid UTF-8 character or BOM. + - Report error on trailing commas, comments, inf and nan literals. */ +static const yyjson_read_flag YYJSON_READ_NOFLAG = 0; + +/** Read the input data in-situ. + This option allows the reader to modify and use input data to store string + values, which can increase reading speed slightly. + The caller should hold the input data before free the document. + The input data must be padded by at least `YYJSON_PADDING_SIZE` bytes. + For example: `[1,2]` should be `[1,2]\0\0\0\0`, input length should be 5. */ +static const yyjson_read_flag YYJSON_READ_INSITU = 1 << 0; + +/** Stop when done instead of issuing an error if there's additional content + after a JSON document. This option may be used to parse small pieces of JSON + in larger data, such as `NDJSON`. */ +static const yyjson_read_flag YYJSON_READ_STOP_WHEN_DONE = 1 << 1; + +/** Allow single trailing comma at the end of an object or array, + such as `[1,2,3,]`, `{"a":1,"b":2,}` (non-standard). */ +static const yyjson_read_flag YYJSON_READ_ALLOW_TRAILING_COMMAS = 1 << 2; + +/** Allow C-style single line and multiple line comments (non-standard). */ +static const yyjson_read_flag YYJSON_READ_ALLOW_COMMENTS = 1 << 3; + +/** Allow inf/nan number and literal, case-insensitive, + such as 1e999, NaN, inf, -Infinity (non-standard). */ +static const yyjson_read_flag YYJSON_READ_ALLOW_INF_AND_NAN = 1 << 4; + +/** Read all numbers as raw strings (value with `YYJSON_TYPE_RAW` type), + inf/nan literal is also read as raw with `ALLOW_INF_AND_NAN` flag. */ +static const yyjson_read_flag YYJSON_READ_NUMBER_AS_RAW = 1 << 5; + +/** Allow reading invalid unicode when parsing string values (non-standard). + Invalid characters will be allowed to appear in the string values, but + invalid escape sequences will still be reported as errors. + This flag does not affect the performance of correctly encoded strings. + + @warning Strings in JSON values may contain incorrect encoding when this + option is used, you need to handle these strings carefully to avoid security + risks. */ +static const yyjson_read_flag YYJSON_READ_ALLOW_INVALID_UNICODE = 1 << 6; + +/** Read big numbers as raw strings. These big numbers include integers that + cannot be represented by `int64_t` and `uint64_t`, and floating-point + numbers that cannot be represented by finite `double`. + The flag will be overridden by `YYJSON_READ_NUMBER_AS_RAW` flag. */ +static const yyjson_read_flag YYJSON_READ_BIGNUM_AS_RAW = 1 << 7; + + + +/** Result code for JSON reader. */ +typedef uint32_t yyjson_read_code; + +/** Success, no error. */ +static const yyjson_read_code YYJSON_READ_SUCCESS = 0; + +/** Invalid parameter, such as NULL input string or 0 input length. */ +static const yyjson_read_code YYJSON_READ_ERROR_INVALID_PARAMETER = 1; + +/** Memory allocation failure occurs. */ +static const yyjson_read_code YYJSON_READ_ERROR_MEMORY_ALLOCATION = 2; + +/** Input JSON string is empty. */ +static const yyjson_read_code YYJSON_READ_ERROR_EMPTY_CONTENT = 3; + +/** Unexpected content after document, such as `[123]abc`. */ +static const yyjson_read_code YYJSON_READ_ERROR_UNEXPECTED_CONTENT = 4; + +/** Unexpected ending, such as `[123`. */ +static const yyjson_read_code YYJSON_READ_ERROR_UNEXPECTED_END = 5; + +/** Unexpected character inside the document, such as `[abc]`. */ +static const yyjson_read_code YYJSON_READ_ERROR_UNEXPECTED_CHARACTER = 6; + +/** Invalid JSON structure, such as `[1,]`. */ +static const yyjson_read_code YYJSON_READ_ERROR_JSON_STRUCTURE = 7; + +/** Invalid comment, such as unclosed multi-line comment. */ +static const yyjson_read_code YYJSON_READ_ERROR_INVALID_COMMENT = 8; + +/** Invalid number, such as `123.e12`, `000`. */ +static const yyjson_read_code YYJSON_READ_ERROR_INVALID_NUMBER = 9; + +/** Invalid string, such as invalid escaped character inside a string. */ +static const yyjson_read_code YYJSON_READ_ERROR_INVALID_STRING = 10; + +/** Invalid JSON literal, such as `truu`. */ +static const yyjson_read_code YYJSON_READ_ERROR_LITERAL = 11; + +/** Failed to open a file. */ +static const yyjson_read_code YYJSON_READ_ERROR_FILE_OPEN = 12; + +/** Failed to read a file. */ +static const yyjson_read_code YYJSON_READ_ERROR_FILE_READ = 13; + +/** Error information for JSON reader. */ +typedef struct yyjson_read_err { + /** Error code, see `yyjson_read_code` for all possible values. */ + yyjson_read_code code; + /** Error message, constant, no need to free (NULL if success). */ + const char *msg; + /** Error byte position for input data (0 if success). */ + size_t pos; +} yyjson_read_err; + + + +/** + Read JSON with options. + + This function is thread-safe when: + 1. The `dat` is not modified by other threads. + 2. The `alc` is thread-safe or NULL. + + @param dat The JSON data (UTF-8 without BOM), null-terminator is not required. + If this parameter is NULL, the function will fail and return NULL. + The `dat` will not be modified without the flag `YYJSON_READ_INSITU`, so you + can pass a `const char *` string and case it to `char *` if you don't use + the `YYJSON_READ_INSITU` flag. + @param len The length of JSON data in bytes. + If this parameter is 0, the function will fail and return NULL. + @param flg The JSON read options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON reader. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return A new JSON document, or NULL if an error occurs. + When it's no longer needed, it should be freed with `yyjson_doc_free()`. + */ +yyjson_api yyjson_doc *yyjson_read_opts(char *dat, + size_t len, + yyjson_read_flag flg, + const yyjson_alc *alc, + yyjson_read_err *err); + +/** + Read a JSON file. + + This function is thread-safe when: + 1. The file is not modified by other threads. + 2. The `alc` is thread-safe or NULL. + + @param path The JSON file's path. + If this path is NULL or invalid, the function will fail and return NULL. + @param flg The JSON read options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON reader. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return A new JSON document, or NULL if an error occurs. + When it's no longer needed, it should be freed with `yyjson_doc_free()`. + + @warning On 32-bit operating system, files larger than 2GB may fail to read. + */ +yyjson_api yyjson_doc *yyjson_read_file(const char *path, + yyjson_read_flag flg, + const yyjson_alc *alc, + yyjson_read_err *err); + +/** + Read JSON from a file pointer. + + @param fp The file pointer. + The data will be read from the current position of the FILE to the end. + If this fp is NULL or invalid, the function will fail and return NULL. + @param flg The JSON read options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON reader. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return A new JSON document, or NULL if an error occurs. + When it's no longer needed, it should be freed with `yyjson_doc_free()`. + + @warning On 32-bit operating system, files larger than 2GB may fail to read. + */ +yyjson_api yyjson_doc *yyjson_read_fp(FILE *fp, + yyjson_read_flag flg, + const yyjson_alc *alc, + yyjson_read_err *err); + +/** + Read a JSON string. + + This function is thread-safe. + + @param dat The JSON data (UTF-8 without BOM), null-terminator is not required. + If this parameter is NULL, the function will fail and return NULL. + @param len The length of JSON data in bytes. + If this parameter is 0, the function will fail and return NULL. + @param flg The JSON read options. + Multiple options can be combined with `|` operator. 0 means no options. + @return A new JSON document, or NULL if an error occurs. + When it's no longer needed, it should be freed with `yyjson_doc_free()`. + */ +yyjson_api_inline yyjson_doc *yyjson_read(const char *dat, + size_t len, + yyjson_read_flag flg) { + flg &= ~YYJSON_READ_INSITU; /* const string cannot be modified */ + return yyjson_read_opts((char *)(void *)(size_t)(const void *)dat, + len, flg, NULL, NULL); +} + +/** + Returns the size of maximum memory usage to read a JSON data. + + You may use this value to avoid malloc() or calloc() call inside the reader + to get better performance, or read multiple JSON with one piece of memory. + + @param len The length of JSON data in bytes. + @param flg The JSON read options. + @return The maximum memory size to read this JSON, or 0 if overflow. + + @par Example + @code + // read multiple JSON with same pre-allocated memory + + char *dat1, *dat2, *dat3; // JSON data + size_t len1, len2, len3; // JSON length + size_t max_len = MAX(len1, MAX(len2, len3)); + yyjson_doc *doc; + + // use one allocator for multiple JSON + size_t size = yyjson_read_max_memory_usage(max_len, 0); + void *buf = malloc(size); + yyjson_alc alc; + yyjson_alc_pool_init(&alc, buf, size); + + // no more alloc() or realloc() call during reading + doc = yyjson_read_opts(dat1, len1, 0, &alc, NULL); + yyjson_doc_free(doc); + doc = yyjson_read_opts(dat2, len2, 0, &alc, NULL); + yyjson_doc_free(doc); + doc = yyjson_read_opts(dat3, len3, 0, &alc, NULL); + yyjson_doc_free(doc); + + free(buf); + @endcode + @see yyjson_alc_pool_init() + */ +yyjson_api_inline size_t yyjson_read_max_memory_usage(size_t len, + yyjson_read_flag flg) { + /* + 1. The max value count is (json_size / 2 + 1), + for example: "[1,2,3,4]" size is 9, value count is 5. + 2. Some broken JSON may cost more memory during reading, but fail at end, + for example: "[[[[[[[[". + 3. yyjson use 16 bytes per value, see struct yyjson_val. + 4. yyjson use dynamic memory with a growth factor of 1.5. + + The max memory size is (json_size / 2 * 16 * 1.5 + padding). + */ + size_t mul = (size_t)12 + !(flg & YYJSON_READ_INSITU); + size_t pad = 256; + size_t max = (size_t)(~(size_t)0); + if (flg & YYJSON_READ_STOP_WHEN_DONE) len = len < 256 ? 256 : len; + if (len >= (max - pad - mul) / mul) return 0; + return len * mul + pad; +} + +/** + Read a JSON number. + + This function is thread-safe when data is not modified by other threads. + + @param dat The JSON data (UTF-8 without BOM), null-terminator is required. + If this parameter is NULL, the function will fail and return NULL. + @param val The output value where result is stored. + If this parameter is NULL, the function will fail and return NULL. + The value will hold either UINT or SINT or REAL number; + @param flg The JSON read options. + Multiple options can be combined with `|` operator. 0 means no options. + Supports `YYJSON_READ_NUMBER_AS_RAW` and `YYJSON_READ_ALLOW_INF_AND_NAN`. + @param alc The memory allocator used for long number. + It is only used when the built-in floating point reader is disabled. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return If successful, a pointer to the character after the last character + used in the conversion, NULL if an error occurs. + */ +yyjson_api const char *yyjson_read_number(const char *dat, + yyjson_val *val, + yyjson_read_flag flg, + const yyjson_alc *alc, + yyjson_read_err *err); + +/** + Read a JSON number. + + This function is thread-safe when data is not modified by other threads. + + @param dat The JSON data (UTF-8 without BOM), null-terminator is required. + If this parameter is NULL, the function will fail and return NULL. + @param val The output value where result is stored. + If this parameter is NULL, the function will fail and return NULL. + The value will hold either UINT or SINT or REAL number; + @param flg The JSON read options. + Multiple options can be combined with `|` operator. 0 means no options. + Supports `YYJSON_READ_NUMBER_AS_RAW` and `YYJSON_READ_ALLOW_INF_AND_NAN`. + @param alc The memory allocator used for long number. + It is only used when the built-in floating point reader is disabled. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return If successful, a pointer to the character after the last character + used in the conversion, NULL if an error occurs. + */ +yyjson_api_inline const char *yyjson_mut_read_number(const char *dat, + yyjson_mut_val *val, + yyjson_read_flag flg, + const yyjson_alc *alc, + yyjson_read_err *err) { + return yyjson_read_number(dat, (yyjson_val *)val, flg, alc, err); +} + + +/*============================================================================== + * JSON Writer API + *============================================================================*/ + +/** Run-time options for JSON writer. */ +typedef uint32_t yyjson_write_flag; + +/** Default option: + - Write JSON minify. + - Report error on inf or nan number. + - Report error on invalid UTF-8 string. + - Do not escape unicode or slash. */ +static const yyjson_write_flag YYJSON_WRITE_NOFLAG = 0; + +/** Write JSON pretty with 4 space indent. */ +static const yyjson_write_flag YYJSON_WRITE_PRETTY = 1 << 0; + +/** Escape unicode as `uXXXX`, make the output ASCII only. */ +static const yyjson_write_flag YYJSON_WRITE_ESCAPE_UNICODE = 1 << 1; + +/** Escape '/' as '\/'. */ +static const yyjson_write_flag YYJSON_WRITE_ESCAPE_SLASHES = 1 << 2; + +/** Write inf and nan number as 'Infinity' and 'NaN' literal (non-standard). */ +static const yyjson_write_flag YYJSON_WRITE_ALLOW_INF_AND_NAN = 1 << 3; + +/** Write inf and nan number as null literal. + This flag will override `YYJSON_WRITE_ALLOW_INF_AND_NAN` flag. */ +static const yyjson_write_flag YYJSON_WRITE_INF_AND_NAN_AS_NULL = 1 << 4; + +/** Allow invalid unicode when encoding string values (non-standard). + Invalid characters in string value will be copied byte by byte. + If `YYJSON_WRITE_ESCAPE_UNICODE` flag is also set, invalid character will be + escaped as `U+FFFD` (replacement character). + This flag does not affect the performance of correctly encoded strings. */ +static const yyjson_write_flag YYJSON_WRITE_ALLOW_INVALID_UNICODE = 1 << 5; + +/** Write JSON pretty with 2 space indent. + This flag will override `YYJSON_WRITE_PRETTY` flag. */ +static const yyjson_write_flag YYJSON_WRITE_PRETTY_TWO_SPACES = 1 << 6; + +/** Adds a newline character `\n` at the end of the JSON. + This can be helpful for text editors or NDJSON. */ +static const yyjson_write_flag YYJSON_WRITE_NEWLINE_AT_END = 1 << 7; + + + +/** Result code for JSON writer */ +typedef uint32_t yyjson_write_code; + +/** Success, no error. */ +static const yyjson_write_code YYJSON_WRITE_SUCCESS = 0; + +/** Invalid parameter, such as NULL document. */ +static const yyjson_write_code YYJSON_WRITE_ERROR_INVALID_PARAMETER = 1; + +/** Memory allocation failure occurs. */ +static const yyjson_write_code YYJSON_WRITE_ERROR_MEMORY_ALLOCATION = 2; + +/** Invalid value type in JSON document. */ +static const yyjson_write_code YYJSON_WRITE_ERROR_INVALID_VALUE_TYPE = 3; + +/** NaN or Infinity number occurs. */ +static const yyjson_write_code YYJSON_WRITE_ERROR_NAN_OR_INF = 4; + +/** Failed to open a file. */ +static const yyjson_write_code YYJSON_WRITE_ERROR_FILE_OPEN = 5; + +/** Failed to write a file. */ +static const yyjson_write_code YYJSON_WRITE_ERROR_FILE_WRITE = 6; + +/** Invalid unicode in string. */ +static const yyjson_write_code YYJSON_WRITE_ERROR_INVALID_STRING = 7; + +/** Error information for JSON writer. */ +typedef struct yyjson_write_err { + /** Error code, see `yyjson_write_code` for all possible values. */ + yyjson_write_code code; + /** Error message, constant, no need to free (NULL if success). */ + const char *msg; +} yyjson_write_err; + + + +/*============================================================================== + * JSON Document Writer API + *============================================================================*/ + +/** + Write a document to JSON string with options. + + This function is thread-safe when: + The `alc` is thread-safe or NULL. + + @param doc The JSON document. + If this doc is NULL or has no root, the function will fail and return false. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param len A pointer to receive output length in bytes (not including the + null-terminator). Pass NULL if you don't need length information. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return A new JSON string, or NULL if an error occurs. + This string is encoded as UTF-8 with a null-terminator. + When it's no longer needed, it should be freed with free() or alc->free(). + */ +yyjson_api char *yyjson_write_opts(const yyjson_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc, + size_t *len, + yyjson_write_err *err); + +/** + Write a document to JSON file with options. + + This function is thread-safe when: + 1. The file is not accessed by other threads. + 2. The `alc` is thread-safe or NULL. + + @param path The JSON file's path. + If this path is NULL or invalid, the function will fail and return false. + If this file is not empty, the content will be discarded. + @param doc The JSON document. + If this doc is NULL or has no root, the function will fail and return false. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return true if successful, false if an error occurs. + + @warning On 32-bit operating system, files larger than 2GB may fail to write. + */ +yyjson_api bool yyjson_write_file(const char *path, + const yyjson_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc, + yyjson_write_err *err); + +/** + Write a document to file pointer with options. + + @param fp The file pointer. + The data will be written to the current position of the file. + If this fp is NULL or invalid, the function will fail and return false. + @param doc The JSON document. + If this doc is NULL or has no root, the function will fail and return false. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return true if successful, false if an error occurs. + + @warning On 32-bit operating system, files larger than 2GB may fail to write. + */ +yyjson_api bool yyjson_write_fp(FILE *fp, + const yyjson_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc, + yyjson_write_err *err); + +/** + Write a document to JSON string. + + This function is thread-safe. + + @param doc The JSON document. + If this doc is NULL or has no root, the function will fail and return false. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param len A pointer to receive output length in bytes (not including the + null-terminator). Pass NULL if you don't need length information. + @return A new JSON string, or NULL if an error occurs. + This string is encoded as UTF-8 with a null-terminator. + When it's no longer needed, it should be freed with free(). + */ +yyjson_api_inline char *yyjson_write(const yyjson_doc *doc, + yyjson_write_flag flg, + size_t *len) { + return yyjson_write_opts(doc, flg, NULL, len, NULL); +} + + + +/** + Write a document to JSON string with options. + + This function is thread-safe when: + 1. The `doc` is not modified by other threads. + 2. The `alc` is thread-safe or NULL. + + @param doc The mutable JSON document. + If this doc is NULL or has no root, the function will fail and return false. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param len A pointer to receive output length in bytes (not including the + null-terminator). Pass NULL if you don't need length information. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return A new JSON string, or NULL if an error occurs. + This string is encoded as UTF-8 with a null-terminator. + When it's no longer needed, it should be freed with free() or alc->free(). + */ +yyjson_api char *yyjson_mut_write_opts(const yyjson_mut_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc, + size_t *len, + yyjson_write_err *err); + +/** + Write a document to JSON file with options. + + This function is thread-safe when: + 1. The file is not accessed by other threads. + 2. The `doc` is not modified by other threads. + 3. The `alc` is thread-safe or NULL. + + @param path The JSON file's path. + If this path is NULL or invalid, the function will fail and return false. + If this file is not empty, the content will be discarded. + @param doc The mutable JSON document. + If this doc is NULL or has no root, the function will fail and return false. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return true if successful, false if an error occurs. + + @warning On 32-bit operating system, files larger than 2GB may fail to write. + */ +yyjson_api bool yyjson_mut_write_file(const char *path, + const yyjson_mut_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc, + yyjson_write_err *err); + +/** + Write a document to file pointer with options. + + @param fp The file pointer. + The data will be written to the current position of the file. + If this fp is NULL or invalid, the function will fail and return false. + @param doc The mutable JSON document. + If this doc is NULL or has no root, the function will fail and return false. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return true if successful, false if an error occurs. + + @warning On 32-bit operating system, files larger than 2GB may fail to write. + */ +yyjson_api bool yyjson_mut_write_fp(FILE *fp, + const yyjson_mut_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc, + yyjson_write_err *err); + +/** + Write a document to JSON string. + + This function is thread-safe when: + The `doc` is not modified by other threads. + + @param doc The JSON document. + If this doc is NULL or has no root, the function will fail and return false. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param len A pointer to receive output length in bytes (not including the + null-terminator). Pass NULL if you don't need length information. + @return A new JSON string, or NULL if an error occurs. + This string is encoded as UTF-8 with a null-terminator. + When it's no longer needed, it should be freed with free(). + */ +yyjson_api_inline char *yyjson_mut_write(const yyjson_mut_doc *doc, + yyjson_write_flag flg, + size_t *len) { + return yyjson_mut_write_opts(doc, flg, NULL, len, NULL); +} + + + +/*============================================================================== + * JSON Value Writer API + *============================================================================*/ + +/** + Write a value to JSON string with options. + + This function is thread-safe when: + The `alc` is thread-safe or NULL. + + @param val The JSON root value. + If this parameter is NULL, the function will fail and return NULL. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param len A pointer to receive output length in bytes (not including the + null-terminator). Pass NULL if you don't need length information. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return A new JSON string, or NULL if an error occurs. + This string is encoded as UTF-8 with a null-terminator. + When it's no longer needed, it should be freed with free() or alc->free(). + */ +yyjson_api char *yyjson_val_write_opts(const yyjson_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc, + size_t *len, + yyjson_write_err *err); + +/** + Write a value to JSON file with options. + + This function is thread-safe when: + 1. The file is not accessed by other threads. + 2. The `alc` is thread-safe or NULL. + + @param path The JSON file's path. + If this path is NULL or invalid, the function will fail and return false. + If this file is not empty, the content will be discarded. + @param val The JSON root value. + If this parameter is NULL, the function will fail and return NULL. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return true if successful, false if an error occurs. + + @warning On 32-bit operating system, files larger than 2GB may fail to write. + */ +yyjson_api bool yyjson_val_write_file(const char *path, + const yyjson_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc, + yyjson_write_err *err); + +/** + Write a value to file pointer with options. + + @param fp The file pointer. + The data will be written to the current position of the file. + If this path is NULL or invalid, the function will fail and return false. + @param val The JSON root value. + If this parameter is NULL, the function will fail and return NULL. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return true if successful, false if an error occurs. + + @warning On 32-bit operating system, files larger than 2GB may fail to write. + */ +yyjson_api bool yyjson_val_write_fp(FILE *fp, + const yyjson_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc, + yyjson_write_err *err); + +/** + Write a value to JSON string. + + This function is thread-safe. + + @param val The JSON root value. + If this parameter is NULL, the function will fail and return NULL. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param len A pointer to receive output length in bytes (not including the + null-terminator). Pass NULL if you don't need length information. + @return A new JSON string, or NULL if an error occurs. + This string is encoded as UTF-8 with a null-terminator. + When it's no longer needed, it should be freed with free(). + */ +yyjson_api_inline char *yyjson_val_write(const yyjson_val *val, + yyjson_write_flag flg, + size_t *len) { + return yyjson_val_write_opts(val, flg, NULL, len, NULL); +} + +/** + Write a value to JSON string with options. + + This function is thread-safe when: + 1. The `val` is not modified by other threads. + 2. The `alc` is thread-safe or NULL. + + @param val The mutable JSON root value. + If this parameter is NULL, the function will fail and return NULL. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param len A pointer to receive output length in bytes (not including the + null-terminator). Pass NULL if you don't need length information. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return A new JSON string, or NULL if an error occurs. + This string is encoded as UTF-8 with a null-terminator. + When it's no longer needed, it should be freed with free() or alc->free(). + */ +yyjson_api char *yyjson_mut_val_write_opts(const yyjson_mut_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc, + size_t *len, + yyjson_write_err *err); + +/** + Write a value to JSON file with options. + + This function is thread-safe when: + 1. The file is not accessed by other threads. + 2. The `val` is not modified by other threads. + 3. The `alc` is thread-safe or NULL. + + @param path The JSON file's path. + If this path is NULL or invalid, the function will fail and return false. + If this file is not empty, the content will be discarded. + @param val The mutable JSON root value. + If this parameter is NULL, the function will fail and return NULL. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return true if successful, false if an error occurs. + + @warning On 32-bit operating system, files larger than 2GB may fail to write. + */ +yyjson_api bool yyjson_mut_val_write_file(const char *path, + const yyjson_mut_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc, + yyjson_write_err *err); + +/** + Write a value to JSON file with options. + + @param fp The file pointer. + The data will be written to the current position of the file. + If this path is NULL or invalid, the function will fail and return false. + @param val The mutable JSON root value. + If this parameter is NULL, the function will fail and return NULL. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param alc The memory allocator used by JSON writer. + Pass NULL to use the libc's default allocator. + @param err A pointer to receive error information. + Pass NULL if you don't need error information. + @return true if successful, false if an error occurs. + + @warning On 32-bit operating system, files larger than 2GB may fail to write. + */ +yyjson_api bool yyjson_mut_val_write_fp(FILE *fp, + const yyjson_mut_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc, + yyjson_write_err *err); + +/** + Write a value to JSON string. + + This function is thread-safe when: + The `val` is not modified by other threads. + + @param val The JSON root value. + If this parameter is NULL, the function will fail and return NULL. + @param flg The JSON write options. + Multiple options can be combined with `|` operator. 0 means no options. + @param len A pointer to receive output length in bytes (not including the + null-terminator). Pass NULL if you don't need length information. + @return A new JSON string, or NULL if an error occurs. + This string is encoded as UTF-8 with a null-terminator. + When it's no longer needed, it should be freed with free(). + */ +yyjson_api_inline char *yyjson_mut_val_write(const yyjson_mut_val *val, + yyjson_write_flag flg, + size_t *len) { + return yyjson_mut_val_write_opts(val, flg, NULL, len, NULL); +} + + + +/*============================================================================== + * JSON Document API + *============================================================================*/ + +/** Returns the root value of this JSON document. + Returns NULL if `doc` is NULL. */ +yyjson_api_inline yyjson_val *yyjson_doc_get_root(yyjson_doc *doc); + +/** Returns read size of input JSON data. + Returns 0 if `doc` is NULL. + For example: the read size of `[1,2,3]` is 7 bytes. */ +yyjson_api_inline size_t yyjson_doc_get_read_size(yyjson_doc *doc); + +/** Returns total value count in this JSON document. + Returns 0 if `doc` is NULL. + For example: the value count of `[1,2,3]` is 4. */ +yyjson_api_inline size_t yyjson_doc_get_val_count(yyjson_doc *doc); + +/** Release the JSON document and free the memory. + After calling this function, the `doc` and all values from the `doc` are no + longer available. This function will do nothing if the `doc` is NULL. */ +yyjson_api_inline void yyjson_doc_free(yyjson_doc *doc); + + + +/*============================================================================== + * JSON Value Type API + *============================================================================*/ + +/** Returns whether the JSON value is raw. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_raw(yyjson_val *val); + +/** Returns whether the JSON value is `null`. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_null(yyjson_val *val); + +/** Returns whether the JSON value is `true`. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_true(yyjson_val *val); + +/** Returns whether the JSON value is `false`. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_false(yyjson_val *val); + +/** Returns whether the JSON value is bool (true/false). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_bool(yyjson_val *val); + +/** Returns whether the JSON value is unsigned integer (uint64_t). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_uint(yyjson_val *val); + +/** Returns whether the JSON value is signed integer (int64_t). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_sint(yyjson_val *val); + +/** Returns whether the JSON value is integer (uint64_t/int64_t). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_int(yyjson_val *val); + +/** Returns whether the JSON value is real number (double). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_real(yyjson_val *val); + +/** Returns whether the JSON value is number (uint64_t/int64_t/double). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_num(yyjson_val *val); + +/** Returns whether the JSON value is string. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_str(yyjson_val *val); + +/** Returns whether the JSON value is array. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_arr(yyjson_val *val); + +/** Returns whether the JSON value is object. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_obj(yyjson_val *val); + +/** Returns whether the JSON value is container (array/object). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_is_ctn(yyjson_val *val); + + + +/*============================================================================== + * JSON Value Content API + *============================================================================*/ + +/** Returns the JSON value's type. + Returns YYJSON_TYPE_NONE if `val` is NULL. */ +yyjson_api_inline yyjson_type yyjson_get_type(yyjson_val *val); + +/** Returns the JSON value's subtype. + Returns YYJSON_SUBTYPE_NONE if `val` is NULL. */ +yyjson_api_inline yyjson_subtype yyjson_get_subtype(yyjson_val *val); + +/** Returns the JSON value's tag. + Returns 0 if `val` is NULL. */ +yyjson_api_inline uint8_t yyjson_get_tag(yyjson_val *val); + +/** Returns the JSON value's type description. + The return value should be one of these strings: "raw", "null", "string", + "array", "object", "true", "false", "uint", "sint", "real", "unknown". */ +yyjson_api_inline const char *yyjson_get_type_desc(yyjson_val *val); + +/** Returns the content if the value is raw. + Returns NULL if `val` is NULL or type is not raw. */ +yyjson_api_inline const char *yyjson_get_raw(yyjson_val *val); + +/** Returns the content if the value is bool. + Returns NULL if `val` is NULL or type is not bool. */ +yyjson_api_inline bool yyjson_get_bool(yyjson_val *val); + +/** Returns the content and cast to uint64_t. + Returns 0 if `val` is NULL or type is not integer(sint/uint). */ +yyjson_api_inline uint64_t yyjson_get_uint(yyjson_val *val); + +/** Returns the content and cast to int64_t. + Returns 0 if `val` is NULL or type is not integer(sint/uint). */ +yyjson_api_inline int64_t yyjson_get_sint(yyjson_val *val); + +/** Returns the content and cast to int. + Returns 0 if `val` is NULL or type is not integer(sint/uint). */ +yyjson_api_inline int yyjson_get_int(yyjson_val *val); + +/** Returns the content if the value is real number, or 0.0 on error. + Returns 0.0 if `val` is NULL or type is not real(double). */ +yyjson_api_inline double yyjson_get_real(yyjson_val *val); + +/** Returns the content and typecast to `double` if the value is number. + Returns 0.0 if `val` is NULL or type is not number(uint/sint/real). */ +yyjson_api_inline double yyjson_get_num(yyjson_val *val); + +/** Returns the content if the value is string. + Returns NULL if `val` is NULL or type is not string. */ +yyjson_api_inline const char *yyjson_get_str(yyjson_val *val); + +/** Returns the content length (string length, array size, object size. + Returns 0 if `val` is NULL or type is not string/array/object. */ +yyjson_api_inline size_t yyjson_get_len(yyjson_val *val); + +/** Returns whether the JSON value is equals to a string. + Returns false if input is NULL or type is not string. */ +yyjson_api_inline bool yyjson_equals_str(yyjson_val *val, const char *str); + +/** Returns whether the JSON value is equals to a string. + The `str` should be a UTF-8 string, null-terminator is not required. + Returns false if input is NULL or type is not string. */ +yyjson_api_inline bool yyjson_equals_strn(yyjson_val *val, const char *str, + size_t len); + +/** Returns whether two JSON values are equal (deep compare). + Returns false if input is NULL. + @note the result may be inaccurate if object has duplicate keys. + @warning This function is recursive and may cause a stack overflow + if the object level is too deep. */ +yyjson_api_inline bool yyjson_equals(yyjson_val *lhs, yyjson_val *rhs); + +/** Set the value to raw. + Returns false if input is NULL or `val` is object or array. + @warning This will modify the `immutable` value, use with caution. */ +yyjson_api_inline bool yyjson_set_raw(yyjson_val *val, + const char *raw, size_t len); + +/** Set the value to null. + Returns false if input is NULL or `val` is object or array. + @warning This will modify the `immutable` value, use with caution. */ +yyjson_api_inline bool yyjson_set_null(yyjson_val *val); + +/** Set the value to bool. + Returns false if input is NULL or `val` is object or array. + @warning This will modify the `immutable` value, use with caution. */ +yyjson_api_inline bool yyjson_set_bool(yyjson_val *val, bool num); + +/** Set the value to uint. + Returns false if input is NULL or `val` is object or array. + @warning This will modify the `immutable` value, use with caution. */ +yyjson_api_inline bool yyjson_set_uint(yyjson_val *val, uint64_t num); + +/** Set the value to sint. + Returns false if input is NULL or `val` is object or array. + @warning This will modify the `immutable` value, use with caution. */ +yyjson_api_inline bool yyjson_set_sint(yyjson_val *val, int64_t num); + +/** Set the value to int. + Returns false if input is NULL or `val` is object or array. + @warning This will modify the `immutable` value, use with caution. */ +yyjson_api_inline bool yyjson_set_int(yyjson_val *val, int num); + +/** Set the value to real. + Returns false if input is NULL or `val` is object or array. + @warning This will modify the `immutable` value, use with caution. */ +yyjson_api_inline bool yyjson_set_real(yyjson_val *val, double num); + +/** Set the value to string (null-terminated). + Returns false if input is NULL or `val` is object or array. + @warning This will modify the `immutable` value, use with caution. */ +yyjson_api_inline bool yyjson_set_str(yyjson_val *val, const char *str); + +/** Set the value to string (with length). + Returns false if input is NULL or `val` is object or array. + @warning This will modify the `immutable` value, use with caution. */ +yyjson_api_inline bool yyjson_set_strn(yyjson_val *val, + const char *str, size_t len); + + + +/*============================================================================== + * JSON Array API + *============================================================================*/ + +/** Returns the number of elements in this array. + Returns 0 if `arr` is NULL or type is not array. */ +yyjson_api_inline size_t yyjson_arr_size(yyjson_val *arr); + +/** Returns the element at the specified position in this array. + Returns NULL if array is NULL/empty or the index is out of bounds. + @warning This function takes a linear search time if array is not flat. + For example: `[1,{},3]` is flat, `[1,[2],3]` is not flat. */ +yyjson_api_inline yyjson_val *yyjson_arr_get(yyjson_val *arr, size_t idx); + +/** Returns the first element of this array. + Returns NULL if `arr` is NULL/empty or type is not array. */ +yyjson_api_inline yyjson_val *yyjson_arr_get_first(yyjson_val *arr); + +/** Returns the last element of this array. + Returns NULL if `arr` is NULL/empty or type is not array. + @warning This function takes a linear search time if array is not flat. + For example: `[1,{},3]` is flat, `[1,[2],3]` is not flat.*/ +yyjson_api_inline yyjson_val *yyjson_arr_get_last(yyjson_val *arr); + + + +/*============================================================================== + * JSON Array Iterator API + *============================================================================*/ + +/** + A JSON array iterator. + + @par Example + @code + yyjson_val *val; + yyjson_arr_iter iter = yyjson_arr_iter_with(arr); + while ((val = yyjson_arr_iter_next(&iter))) { + your_func(val); + } + @endcode + */ +typedef struct yyjson_arr_iter { + size_t idx; /**< next value's index */ + size_t max; /**< maximum index (arr.size) */ + yyjson_val *cur; /**< next value */ +} yyjson_arr_iter; + +/** + Initialize an iterator for this array. + + @param arr The array to be iterated over. + If this parameter is NULL or not an array, `iter` will be set to empty. + @param iter The iterator to be initialized. + If this parameter is NULL, the function will fail and return false. + @return true if the `iter` has been successfully initialized. + + @note The iterator does not need to be destroyed. + */ +yyjson_api_inline bool yyjson_arr_iter_init(yyjson_val *arr, + yyjson_arr_iter *iter); + +/** + Create an iterator with an array , same as `yyjson_arr_iter_init()`. + + @param arr The array to be iterated over. + If this parameter is NULL or not an array, an empty iterator will returned. + @return A new iterator for the array. + + @note The iterator does not need to be destroyed. + */ +yyjson_api_inline yyjson_arr_iter yyjson_arr_iter_with(yyjson_val *arr); + +/** + Returns whether the iteration has more elements. + If `iter` is NULL, this function will return false. + */ +yyjson_api_inline bool yyjson_arr_iter_has_next(yyjson_arr_iter *iter); + +/** + Returns the next element in the iteration, or NULL on end. + If `iter` is NULL, this function will return NULL. + */ +yyjson_api_inline yyjson_val *yyjson_arr_iter_next(yyjson_arr_iter *iter); + +/** + Macro for iterating over an array. + It works like iterator, but with a more intuitive API. + + @par Example + @code + size_t idx, max; + yyjson_val *val; + yyjson_arr_foreach(arr, idx, max, val) { + your_func(idx, val); + } + @endcode + */ +#define yyjson_arr_foreach(arr, idx, max, val) \ + for ((idx) = 0, \ + (max) = yyjson_arr_size(arr), \ + (val) = yyjson_arr_get_first(arr); \ + (idx) < (max); \ + (idx)++, \ + (val) = unsafe_yyjson_get_next(val)) + + + +/*============================================================================== + * JSON Object API + *============================================================================*/ + +/** Returns the number of key-value pairs in this object. + Returns 0 if `obj` is NULL or type is not object. */ +yyjson_api_inline size_t yyjson_obj_size(yyjson_val *obj); + +/** Returns the value to which the specified key is mapped. + Returns NULL if this object contains no mapping for the key. + Returns NULL if `obj/key` is NULL, or type is not object. + + The `key` should be a null-terminated UTF-8 string. + + @warning This function takes a linear search time. */ +yyjson_api_inline yyjson_val *yyjson_obj_get(yyjson_val *obj, const char *key); + +/** Returns the value to which the specified key is mapped. + Returns NULL if this object contains no mapping for the key. + Returns NULL if `obj/key` is NULL, or type is not object. + + The `key` should be a UTF-8 string, null-terminator is not required. + The `key_len` should be the length of the key, in bytes. + + @warning This function takes a linear search time. */ +yyjson_api_inline yyjson_val *yyjson_obj_getn(yyjson_val *obj, const char *key, + size_t key_len); + + + +/*============================================================================== + * JSON Object Iterator API + *============================================================================*/ + +/** + A JSON object iterator. + + @par Example + @code + yyjson_val *key, *val; + yyjson_obj_iter iter = yyjson_obj_iter_with(obj); + while ((key = yyjson_obj_iter_next(&iter))) { + val = yyjson_obj_iter_get_val(key); + your_func(key, val); + } + @endcode + + If the ordering of the keys is known at compile-time, you can use this method + to speed up value lookups: + @code + // {"k1":1, "k2": 3, "k3": 3} + yyjson_val *key, *val; + yyjson_obj_iter iter = yyjson_obj_iter_with(obj); + yyjson_val *v1 = yyjson_obj_iter_get(&iter, "k1"); + yyjson_val *v3 = yyjson_obj_iter_get(&iter, "k3"); + @endcode + @see yyjson_obj_iter_get() and yyjson_obj_iter_getn() + */ +typedef struct yyjson_obj_iter { + size_t idx; /**< next key's index */ + size_t max; /**< maximum key index (obj.size) */ + yyjson_val *cur; /**< next key */ + yyjson_val *obj; /**< the object being iterated */ +} yyjson_obj_iter; + +/** + Initialize an iterator for this object. + + @param obj The object to be iterated over. + If this parameter is NULL or not an object, `iter` will be set to empty. + @param iter The iterator to be initialized. + If this parameter is NULL, the function will fail and return false. + @return true if the `iter` has been successfully initialized. + + @note The iterator does not need to be destroyed. + */ +yyjson_api_inline bool yyjson_obj_iter_init(yyjson_val *obj, + yyjson_obj_iter *iter); + +/** + Create an iterator with an object, same as `yyjson_obj_iter_init()`. + + @param obj The object to be iterated over. + If this parameter is NULL or not an object, an empty iterator will returned. + @return A new iterator for the object. + + @note The iterator does not need to be destroyed. + */ +yyjson_api_inline yyjson_obj_iter yyjson_obj_iter_with(yyjson_val *obj); + +/** + Returns whether the iteration has more elements. + If `iter` is NULL, this function will return false. + */ +yyjson_api_inline bool yyjson_obj_iter_has_next(yyjson_obj_iter *iter); + +/** + Returns the next key in the iteration, or NULL on end. + If `iter` is NULL, this function will return NULL. + */ +yyjson_api_inline yyjson_val *yyjson_obj_iter_next(yyjson_obj_iter *iter); + +/** + Returns the value for key inside the iteration. + If `iter` is NULL, this function will return NULL. + */ +yyjson_api_inline yyjson_val *yyjson_obj_iter_get_val(yyjson_val *key); + +/** + Iterates to a specified key and returns the value. + + This function does the same thing as `yyjson_obj_get()`, but is much faster + if the ordering of the keys is known at compile-time and you are using the same + order to look up the values. If the key exists in this object, then the + iterator will stop at the next key, otherwise the iterator will not change and + NULL is returned. + + @param iter The object iterator, should not be NULL. + @param key The key, should be a UTF-8 string with null-terminator. + @return The value to which the specified key is mapped. + NULL if this object contains no mapping for the key or input is invalid. + + @warning This function takes a linear search time if the key is not nearby. + */ +yyjson_api_inline yyjson_val *yyjson_obj_iter_get(yyjson_obj_iter *iter, + const char *key); + +/** + Iterates to a specified key and returns the value. + + This function does the same thing as `yyjson_obj_getn()`, but is much faster + if the ordering of the keys is known at compile-time and you are using the same + order to look up the values. If the key exists in this object, then the + iterator will stop at the next key, otherwise the iterator will not change and + NULL is returned. + + @param iter The object iterator, should not be NULL. + @param key The key, should be a UTF-8 string, null-terminator is not required. + @param key_len The the length of `key`, in bytes. + @return The value to which the specified key is mapped. + NULL if this object contains no mapping for the key or input is invalid. + + @warning This function takes a linear search time if the key is not nearby. + */ +yyjson_api_inline yyjson_val *yyjson_obj_iter_getn(yyjson_obj_iter *iter, + const char *key, + size_t key_len); + +/** + Macro for iterating over an object. + It works like iterator, but with a more intuitive API. + + @par Example + @code + size_t idx, max; + yyjson_val *key, *val; + yyjson_obj_foreach(obj, idx, max, key, val) { + your_func(key, val); + } + @endcode + */ +#define yyjson_obj_foreach(obj, idx, max, key, val) \ + for ((idx) = 0, \ + (max) = yyjson_obj_size(obj), \ + (key) = (obj) ? unsafe_yyjson_get_first(obj) : NULL, \ + (val) = (key) + 1; \ + (idx) < (max); \ + (idx)++, \ + (key) = unsafe_yyjson_get_next(val), \ + (val) = (key) + 1) + + + +/*============================================================================== + * Mutable JSON Document API + *============================================================================*/ + +/** Returns the root value of this JSON document. + Returns NULL if `doc` is NULL. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_get_root(yyjson_mut_doc *doc); + +/** Sets the root value of this JSON document. + Pass NULL to clear root value of the document. */ +yyjson_api_inline void yyjson_mut_doc_set_root(yyjson_mut_doc *doc, + yyjson_mut_val *root); + +/** + Set the string pool size for a mutable document. + This function does not allocate memory immediately, but uses the size when + the next memory allocation is needed. + + If the caller knows the approximate bytes of strings that the document needs to + store (e.g. copy string with `yyjson_mut_strcpy` function), setting a larger + size can avoid multiple memory allocations and improve performance. + + @param doc The mutable document. + @param len The desired string pool size in bytes (total string length). + @return true if successful, false if size is 0 or overflow. + */ +yyjson_api bool yyjson_mut_doc_set_str_pool_size(yyjson_mut_doc *doc, + size_t len); + +/** + Set the value pool size for a mutable document. + This function does not allocate memory immediately, but uses the size when + the next memory allocation is needed. + + If the caller knows the approximate number of values that the document needs to + store (e.g. create new value with `yyjson_mut_xxx` functions), setting a larger + size can avoid multiple memory allocations and improve performance. + + @param doc The mutable document. + @param count The desired value pool size (number of `yyjson_mut_val`). + @return true if successful, false if size is 0 or overflow. + */ +yyjson_api bool yyjson_mut_doc_set_val_pool_size(yyjson_mut_doc *doc, + size_t count); + +/** Release the JSON document and free the memory. + After calling this function, the `doc` and all values from the `doc` are no + longer available. This function will do nothing if the `doc` is NULL. */ +yyjson_api void yyjson_mut_doc_free(yyjson_mut_doc *doc); + +/** Creates and returns a new mutable JSON document, returns NULL on error. + If allocator is NULL, the default allocator will be used. */ +yyjson_api yyjson_mut_doc *yyjson_mut_doc_new(const yyjson_alc *alc); + +/** Copies and returns a new mutable document from input, returns NULL on error. + This makes a `deep-copy` on the immutable document. + If allocator is NULL, the default allocator will be used. + @note `imut_doc` -> `mut_doc`. */ +yyjson_api yyjson_mut_doc *yyjson_doc_mut_copy(yyjson_doc *doc, + const yyjson_alc *alc); + +/** Copies and returns a new mutable document from input, returns NULL on error. + This makes a `deep-copy` on the mutable document. + If allocator is NULL, the default allocator will be used. + @note `mut_doc` -> `mut_doc`. */ +yyjson_api yyjson_mut_doc *yyjson_mut_doc_mut_copy(yyjson_mut_doc *doc, + const yyjson_alc *alc); + +/** Copies and returns a new mutable value from input, returns NULL on error. + This makes a `deep-copy` on the immutable value. + The memory was managed by mutable document. + @note `imut_val` -> `mut_val`. */ +yyjson_api yyjson_mut_val *yyjson_val_mut_copy(yyjson_mut_doc *doc, + yyjson_val *val); + +/** Copies and returns a new mutable value from input, returns NULL on error. + This makes a `deep-copy` on the mutable value. + The memory was managed by mutable document. + @note `mut_val` -> `mut_val`. + @warning This function is recursive and may cause a stack overflow + if the object level is too deep. */ +yyjson_api yyjson_mut_val *yyjson_mut_val_mut_copy(yyjson_mut_doc *doc, + yyjson_mut_val *val); + +/** Copies and returns a new immutable document from input, + returns NULL on error. This makes a `deep-copy` on the mutable document. + The returned document should be freed with `yyjson_doc_free()`. + @note `mut_doc` -> `imut_doc`. + @warning This function is recursive and may cause a stack overflow + if the object level is too deep. */ +yyjson_api yyjson_doc *yyjson_mut_doc_imut_copy(yyjson_mut_doc *doc, + const yyjson_alc *alc); + +/** Copies and returns a new immutable document from input, + returns NULL on error. This makes a `deep-copy` on the mutable value. + The returned document should be freed with `yyjson_doc_free()`. + @note `mut_val` -> `imut_doc`. + @warning This function is recursive and may cause a stack overflow + if the object level is too deep. */ +yyjson_api yyjson_doc *yyjson_mut_val_imut_copy(yyjson_mut_val *val, + const yyjson_alc *alc); + + + +/*============================================================================== + * Mutable JSON Value Type API + *============================================================================*/ + +/** Returns whether the JSON value is raw. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_raw(yyjson_mut_val *val); + +/** Returns whether the JSON value is `null`. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_null(yyjson_mut_val *val); + +/** Returns whether the JSON value is `true`. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_true(yyjson_mut_val *val); + +/** Returns whether the JSON value is `false`. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_false(yyjson_mut_val *val); + +/** Returns whether the JSON value is bool (true/false). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_bool(yyjson_mut_val *val); + +/** Returns whether the JSON value is unsigned integer (uint64_t). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_uint(yyjson_mut_val *val); + +/** Returns whether the JSON value is signed integer (int64_t). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_sint(yyjson_mut_val *val); + +/** Returns whether the JSON value is integer (uint64_t/int64_t). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_int(yyjson_mut_val *val); + +/** Returns whether the JSON value is real number (double). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_real(yyjson_mut_val *val); + +/** Returns whether the JSON value is number (uint/sint/real). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_num(yyjson_mut_val *val); + +/** Returns whether the JSON value is string. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_str(yyjson_mut_val *val); + +/** Returns whether the JSON value is array. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_arr(yyjson_mut_val *val); + +/** Returns whether the JSON value is object. + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_obj(yyjson_mut_val *val); + +/** Returns whether the JSON value is container (array/object). + Returns false if `val` is NULL. */ +yyjson_api_inline bool yyjson_mut_is_ctn(yyjson_mut_val *val); + + + +/*============================================================================== + * Mutable JSON Value Content API + *============================================================================*/ + +/** Returns the JSON value's type. + Returns `YYJSON_TYPE_NONE` if `val` is NULL. */ +yyjson_api_inline yyjson_type yyjson_mut_get_type(yyjson_mut_val *val); + +/** Returns the JSON value's subtype. + Returns `YYJSON_SUBTYPE_NONE` if `val` is NULL. */ +yyjson_api_inline yyjson_subtype yyjson_mut_get_subtype(yyjson_mut_val *val); + +/** Returns the JSON value's tag. + Returns 0 if `val` is NULL. */ +yyjson_api_inline uint8_t yyjson_mut_get_tag(yyjson_mut_val *val); + +/** Returns the JSON value's type description. + The return value should be one of these strings: "raw", "null", "string", + "array", "object", "true", "false", "uint", "sint", "real", "unknown". */ +yyjson_api_inline const char *yyjson_mut_get_type_desc(yyjson_mut_val *val); + +/** Returns the content if the value is raw. + Returns NULL if `val` is NULL or type is not raw. */ +yyjson_api_inline const char *yyjson_mut_get_raw(yyjson_mut_val *val); + +/** Returns the content if the value is bool. + Returns NULL if `val` is NULL or type is not bool. */ +yyjson_api_inline bool yyjson_mut_get_bool(yyjson_mut_val *val); + +/** Returns the content and cast to uint64_t. + Returns 0 if `val` is NULL or type is not integer(sint/uint). */ +yyjson_api_inline uint64_t yyjson_mut_get_uint(yyjson_mut_val *val); + +/** Returns the content and cast to int64_t. + Returns 0 if `val` is NULL or type is not integer(sint/uint). */ +yyjson_api_inline int64_t yyjson_mut_get_sint(yyjson_mut_val *val); + +/** Returns the content and cast to int. + Returns 0 if `val` is NULL or type is not integer(sint/uint). */ +yyjson_api_inline int yyjson_mut_get_int(yyjson_mut_val *val); + +/** Returns the content if the value is real number. + Returns 0.0 if `val` is NULL or type is not real(double). */ +yyjson_api_inline double yyjson_mut_get_real(yyjson_mut_val *val); + +/** Returns the content and typecast to `double` if the value is number. + Returns 0.0 if `val` is NULL or type is not number(uint/sint/real). */ +yyjson_api_inline double yyjson_mut_get_num(yyjson_mut_val *val); + +/** Returns the content if the value is string. + Returns NULL if `val` is NULL or type is not string. */ +yyjson_api_inline const char *yyjson_mut_get_str(yyjson_mut_val *val); + +/** Returns the content length (string length, array size, object size. + Returns 0 if `val` is NULL or type is not string/array/object. */ +yyjson_api_inline size_t yyjson_mut_get_len(yyjson_mut_val *val); + +/** Returns whether the JSON value is equals to a string. + The `str` should be a null-terminated UTF-8 string. + Returns false if input is NULL or type is not string. */ +yyjson_api_inline bool yyjson_mut_equals_str(yyjson_mut_val *val, + const char *str); + +/** Returns whether the JSON value is equals to a string. + The `str` should be a UTF-8 string, null-terminator is not required. + Returns false if input is NULL or type is not string. */ +yyjson_api_inline bool yyjson_mut_equals_strn(yyjson_mut_val *val, + const char *str, size_t len); + +/** Returns whether two JSON values are equal (deep compare). + Returns false if input is NULL. + @note the result may be inaccurate if object has duplicate keys. + @warning This function is recursive and may cause a stack overflow + if the object level is too deep. */ +yyjson_api_inline bool yyjson_mut_equals(yyjson_mut_val *lhs, + yyjson_mut_val *rhs); + +/** Set the value to raw. + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_raw(yyjson_mut_val *val, + const char *raw, size_t len); + +/** Set the value to null. + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_null(yyjson_mut_val *val); + +/** Set the value to bool. + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_bool(yyjson_mut_val *val, bool num); + +/** Set the value to uint. + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_uint(yyjson_mut_val *val, uint64_t num); + +/** Set the value to sint. + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_sint(yyjson_mut_val *val, int64_t num); + +/** Set the value to int. + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_int(yyjson_mut_val *val, int num); + +/** Set the value to real. + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_real(yyjson_mut_val *val, double num); + +/** Set the value to string (null-terminated). + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_str(yyjson_mut_val *val, const char *str); + +/** Set the value to string (with length). + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_strn(yyjson_mut_val *val, + const char *str, size_t len); + +/** Set the value to array. + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_arr(yyjson_mut_val *val); + +/** Set the value to array. + Returns false if input is NULL. + @warning This function should not be used on an existing object or array. */ +yyjson_api_inline bool yyjson_mut_set_obj(yyjson_mut_val *val); + + + +/*============================================================================== + * Mutable JSON Value Creation API + *============================================================================*/ + +/** Creates and returns a raw value, returns NULL on error. + The `str` should be a null-terminated UTF-8 string. + + @warning The input string is not copied, you should keep this string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_raw(yyjson_mut_doc *doc, + const char *str); + +/** Creates and returns a raw value, returns NULL on error. + The `str` should be a UTF-8 string, null-terminator is not required. + + @warning The input string is not copied, you should keep this string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_rawn(yyjson_mut_doc *doc, + const char *str, + size_t len); + +/** Creates and returns a raw value, returns NULL on error. + The `str` should be a null-terminated UTF-8 string. + The input string is copied and held by the document. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_rawcpy(yyjson_mut_doc *doc, + const char *str); + +/** Creates and returns a raw value, returns NULL on error. + The `str` should be a UTF-8 string, null-terminator is not required. + The input string is copied and held by the document. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_rawncpy(yyjson_mut_doc *doc, + const char *str, + size_t len); + +/** Creates and returns a null value, returns NULL on error. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_null(yyjson_mut_doc *doc); + +/** Creates and returns a true value, returns NULL on error. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_true(yyjson_mut_doc *doc); + +/** Creates and returns a false value, returns NULL on error. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_false(yyjson_mut_doc *doc); + +/** Creates and returns a bool value, returns NULL on error. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_bool(yyjson_mut_doc *doc, + bool val); + +/** Creates and returns an unsigned integer value, returns NULL on error. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_uint(yyjson_mut_doc *doc, + uint64_t num); + +/** Creates and returns a signed integer value, returns NULL on error. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_sint(yyjson_mut_doc *doc, + int64_t num); + +/** Creates and returns a signed integer value, returns NULL on error. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_int(yyjson_mut_doc *doc, + int64_t num); + +/** Creates and returns an real number value, returns NULL on error. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_real(yyjson_mut_doc *doc, + double num); + +/** Creates and returns a string value, returns NULL on error. + The `str` should be a null-terminated UTF-8 string. + @warning The input string is not copied, you should keep this string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_str(yyjson_mut_doc *doc, + const char *str); + +/** Creates and returns a string value, returns NULL on error. + The `str` should be a UTF-8 string, null-terminator is not required. + @warning The input string is not copied, you should keep this string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_strn(yyjson_mut_doc *doc, + const char *str, + size_t len); + +/** Creates and returns a string value, returns NULL on error. + The `str` should be a null-terminated UTF-8 string. + The input string is copied and held by the document. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_strcpy(yyjson_mut_doc *doc, + const char *str); + +/** Creates and returns a string value, returns NULL on error. + The `str` should be a UTF-8 string, null-terminator is not required. + The input string is copied and held by the document. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_strncpy(yyjson_mut_doc *doc, + const char *str, + size_t len); + + + +/*============================================================================== + * Mutable JSON Array API + *============================================================================*/ + +/** Returns the number of elements in this array. + Returns 0 if `arr` is NULL or type is not array. */ +yyjson_api_inline size_t yyjson_mut_arr_size(yyjson_mut_val *arr); + +/** Returns the element at the specified position in this array. + Returns NULL if array is NULL/empty or the index is out of bounds. + @warning This function takes a linear search time. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_get(yyjson_mut_val *arr, + size_t idx); + +/** Returns the first element of this array. + Returns NULL if `arr` is NULL/empty or type is not array. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_get_first(yyjson_mut_val *arr); + +/** Returns the last element of this array. + Returns NULL if `arr` is NULL/empty or type is not array. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_get_last(yyjson_mut_val *arr); + + + +/*============================================================================== + * Mutable JSON Array Iterator API + *============================================================================*/ + +/** + A mutable JSON array iterator. + + @warning You should not modify the array while iterating over it, but you can + use `yyjson_mut_arr_iter_remove()` to remove current value. + + @par Example + @code + yyjson_mut_val *val; + yyjson_mut_arr_iter iter = yyjson_mut_arr_iter_with(arr); + while ((val = yyjson_mut_arr_iter_next(&iter))) { + your_func(val); + if (your_val_is_unused(val)) { + yyjson_mut_arr_iter_remove(&iter); + } + } + @endcode + */ +typedef struct yyjson_mut_arr_iter { + size_t idx; /**< next value's index */ + size_t max; /**< maximum index (arr.size) */ + yyjson_mut_val *cur; /**< current value */ + yyjson_mut_val *pre; /**< previous value */ + yyjson_mut_val *arr; /**< the array being iterated */ +} yyjson_mut_arr_iter; + +/** + Initialize an iterator for this array. + + @param arr The array to be iterated over. + If this parameter is NULL or not an array, `iter` will be set to empty. + @param iter The iterator to be initialized. + If this parameter is NULL, the function will fail and return false. + @return true if the `iter` has been successfully initialized. + + @note The iterator does not need to be destroyed. + */ +yyjson_api_inline bool yyjson_mut_arr_iter_init(yyjson_mut_val *arr, + yyjson_mut_arr_iter *iter); + +/** + Create an iterator with an array , same as `yyjson_mut_arr_iter_init()`. + + @param arr The array to be iterated over. + If this parameter is NULL or not an array, an empty iterator will returned. + @return A new iterator for the array. + + @note The iterator does not need to be destroyed. + */ +yyjson_api_inline yyjson_mut_arr_iter yyjson_mut_arr_iter_with( + yyjson_mut_val *arr); + +/** + Returns whether the iteration has more elements. + If `iter` is NULL, this function will return false. + */ +yyjson_api_inline bool yyjson_mut_arr_iter_has_next( + yyjson_mut_arr_iter *iter); + +/** + Returns the next element in the iteration, or NULL on end. + If `iter` is NULL, this function will return NULL. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_iter_next( + yyjson_mut_arr_iter *iter); + +/** + Removes and returns current element in the iteration. + If `iter` is NULL, this function will return NULL. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_iter_remove( + yyjson_mut_arr_iter *iter); + +/** + Macro for iterating over an array. + It works like iterator, but with a more intuitive API. + + @warning You should not modify the array while iterating over it. + + @par Example + @code + size_t idx, max; + yyjson_mut_val *val; + yyjson_mut_arr_foreach(arr, idx, max, val) { + your_func(idx, val); + } + @endcode + */ +#define yyjson_mut_arr_foreach(arr, idx, max, val) \ + for ((idx) = 0, \ + (max) = yyjson_mut_arr_size(arr), \ + (val) = yyjson_mut_arr_get_first(arr); \ + (idx) < (max); \ + (idx)++, \ + (val) = (val)->next) + + + +/*============================================================================== + * Mutable JSON Array Creation API + *============================================================================*/ + +/** + Creates and returns an empty mutable array. + @param doc A mutable document, used for memory allocation only. + @return The new array. NULL if input is NULL or memory allocation failed. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr(yyjson_mut_doc *doc); + +/** + Creates and returns a new mutable array with the given boolean values. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of boolean values. + @param count The value count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const bool vals[3] = { true, false, true }; + yyjson_mut_val *arr = yyjson_mut_arr_with_bool(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_bool( + yyjson_mut_doc *doc, const bool *vals, size_t count); + +/** + Creates and returns a new mutable array with the given sint numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of sint numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const int64_t vals[3] = { -1, 0, 1 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_sint64(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_sint( + yyjson_mut_doc *doc, const int64_t *vals, size_t count); + +/** + Creates and returns a new mutable array with the given uint numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of uint numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const uint64_t vals[3] = { 0, 1, 0 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_uint(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_uint( + yyjson_mut_doc *doc, const uint64_t *vals, size_t count); + +/** + Creates and returns a new mutable array with the given real numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of real numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const double vals[3] = { 0.1, 0.2, 0.3 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_real(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_real( + yyjson_mut_doc *doc, const double *vals, size_t count); + +/** + Creates and returns a new mutable array with the given int8 numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of int8 numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const int8_t vals[3] = { -1, 0, 1 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_sint8(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_sint8( + yyjson_mut_doc *doc, const int8_t *vals, size_t count); + +/** + Creates and returns a new mutable array with the given int16 numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of int16 numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const int16_t vals[3] = { -1, 0, 1 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_sint16(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_sint16( + yyjson_mut_doc *doc, const int16_t *vals, size_t count); + +/** + Creates and returns a new mutable array with the given int32 numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of int32 numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const int32_t vals[3] = { -1, 0, 1 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_sint32(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_sint32( + yyjson_mut_doc *doc, const int32_t *vals, size_t count); + +/** + Creates and returns a new mutable array with the given int64 numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of int64 numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const int64_t vals[3] = { -1, 0, 1 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_sint64(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_sint64( + yyjson_mut_doc *doc, const int64_t *vals, size_t count); + +/** + Creates and returns a new mutable array with the given uint8 numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of uint8 numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const uint8_t vals[3] = { 0, 1, 0 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_uint8(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_uint8( + yyjson_mut_doc *doc, const uint8_t *vals, size_t count); + +/** + Creates and returns a new mutable array with the given uint16 numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of uint16 numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const uint16_t vals[3] = { 0, 1, 0 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_uint16(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_uint16( + yyjson_mut_doc *doc, const uint16_t *vals, size_t count); + +/** + Creates and returns a new mutable array with the given uint32 numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of uint32 numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const uint32_t vals[3] = { 0, 1, 0 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_uint32(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_uint32( + yyjson_mut_doc *doc, const uint32_t *vals, size_t count); + +/** + Creates and returns a new mutable array with the given uint64 numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of uint64 numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const uint64_t vals[3] = { 0, 1, 0 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_uint64(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_uint64( + yyjson_mut_doc *doc, const uint64_t *vals, size_t count); + +/** + Creates and returns a new mutable array with the given float numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of float numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const float vals[3] = { -1.0f, 0.0f, 1.0f }; + yyjson_mut_val *arr = yyjson_mut_arr_with_float(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_float( + yyjson_mut_doc *doc, const float *vals, size_t count); + +/** + Creates and returns a new mutable array with the given double numbers. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of double numbers. + @param count The number count. If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const double vals[3] = { -1.0, 0.0, 1.0 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_double(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_double( + yyjson_mut_doc *doc, const double *vals, size_t count); + +/** + Creates and returns a new mutable array with the given strings, these strings + will not be copied. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of UTF-8 null-terminator strings. + If this array contains NULL, the function will fail and return NULL. + @param count The number of values in `vals`. + If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @warning The input strings are not copied, you should keep these strings + unmodified for the lifetime of this JSON document. If these strings will be + modified, you should use `yyjson_mut_arr_with_strcpy()` instead. + + @par Example + @code + const char *vals[3] = { "a", "b", "c" }; + yyjson_mut_val *arr = yyjson_mut_arr_with_str(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_str( + yyjson_mut_doc *doc, const char **vals, size_t count); + +/** + Creates and returns a new mutable array with the given strings and string + lengths, these strings will not be copied. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of UTF-8 strings, null-terminator is not required. + If this array contains NULL, the function will fail and return NULL. + @param lens A C array of string lengths, in bytes. + @param count The number of strings in `vals`. + If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @warning The input strings are not copied, you should keep these strings + unmodified for the lifetime of this JSON document. If these strings will be + modified, you should use `yyjson_mut_arr_with_strncpy()` instead. + + @par Example + @code + const char *vals[3] = { "a", "bb", "c" }; + const size_t lens[3] = { 1, 2, 1 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_strn(doc, vals, lens, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_strn( + yyjson_mut_doc *doc, const char **vals, const size_t *lens, size_t count); + +/** + Creates and returns a new mutable array with the given strings, these strings + will be copied. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of UTF-8 null-terminator strings. + If this array contains NULL, the function will fail and return NULL. + @param count The number of values in `vals`. + If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const char *vals[3] = { "a", "b", "c" }; + yyjson_mut_val *arr = yyjson_mut_arr_with_strcpy(doc, vals, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_strcpy( + yyjson_mut_doc *doc, const char **vals, size_t count); + +/** + Creates and returns a new mutable array with the given strings and string + lengths, these strings will be copied. + + @param doc A mutable document, used for memory allocation only. + If this parameter is NULL, the function will fail and return NULL. + @param vals A C array of UTF-8 strings, null-terminator is not required. + If this array contains NULL, the function will fail and return NULL. + @param lens A C array of string lengths, in bytes. + @param count The number of strings in `vals`. + If this value is 0, an empty array will return. + @return The new array. NULL if input is invalid or memory allocation failed. + + @par Example + @code + const char *vals[3] = { "a", "bb", "c" }; + const size_t lens[3] = { 1, 2, 1 }; + yyjson_mut_val *arr = yyjson_mut_arr_with_strn(doc, vals, lens, 3); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_strncpy( + yyjson_mut_doc *doc, const char **vals, const size_t *lens, size_t count); + + + +/*============================================================================== + * Mutable JSON Array Modification API + *============================================================================*/ + +/** + Inserts a value into an array at a given index. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param val The value to be inserted. Returns false if it is NULL. + @param idx The index to which to insert the new value. + Returns false if the index is out of range. + @return Whether successful. + @warning This function takes a linear search time. + */ +yyjson_api_inline bool yyjson_mut_arr_insert(yyjson_mut_val *arr, + yyjson_mut_val *val, size_t idx); + +/** + Inserts a value at the end of the array. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param val The value to be inserted. Returns false if it is NULL. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_append(yyjson_mut_val *arr, + yyjson_mut_val *val); + +/** + Inserts a value at the head of the array. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param val The value to be inserted. Returns false if it is NULL. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_prepend(yyjson_mut_val *arr, + yyjson_mut_val *val); + +/** + Replaces a value at index and returns old value. + @param arr The array to which the value is to be replaced. + Returns false if it is NULL or not an array. + @param idx The index to which to replace the value. + Returns false if the index is out of range. + @param val The new value to replace. Returns false if it is NULL. + @return Old value, or NULL on error. + @warning This function takes a linear search time. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_replace(yyjson_mut_val *arr, + size_t idx, + yyjson_mut_val *val); + +/** + Removes and returns a value at index. + @param arr The array from which the value is to be removed. + Returns false if it is NULL or not an array. + @param idx The index from which to remove the value. + Returns false if the index is out of range. + @return Old value, or NULL on error. + @warning This function takes a linear search time. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_remove(yyjson_mut_val *arr, + size_t idx); + +/** + Removes and returns the first value in this array. + @param arr The array from which the value is to be removed. + Returns false if it is NULL or not an array. + @return The first value, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_remove_first( + yyjson_mut_val *arr); + +/** + Removes and returns the last value in this array. + @param arr The array from which the value is to be removed. + Returns false if it is NULL or not an array. + @return The last value, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_remove_last( + yyjson_mut_val *arr); + +/** + Removes all values within a specified range in the array. + @param arr The array from which the value is to be removed. + Returns false if it is NULL or not an array. + @param idx The start index of the range (0 is the first). + @param len The number of items in the range (can be 0). + @return Whether successful. + @warning This function takes a linear search time. + */ +yyjson_api_inline bool yyjson_mut_arr_remove_range(yyjson_mut_val *arr, + size_t idx, size_t len); + +/** + Removes all values in this array. + @param arr The array from which all of the values are to be removed. + Returns false if it is NULL or not an array. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_clear(yyjson_mut_val *arr); + +/** + Rotates values in this array for the given number of times. + For example: `[1,2,3,4,5]` rotate 2 is `[3,4,5,1,2]`. + @param arr The array to be rotated. + @param idx Index (or times) to rotate. + @warning This function takes a linear search time. + */ +yyjson_api_inline bool yyjson_mut_arr_rotate(yyjson_mut_val *arr, + size_t idx); + + + +/*============================================================================== + * Mutable JSON Array Modification Convenience API + *============================================================================*/ + +/** + Adds a value at the end of the array. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param val The value to be inserted. Returns false if it is NULL. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_val(yyjson_mut_val *arr, + yyjson_mut_val *val); + +/** + Adds a `null` value at the end of the array. + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_null(yyjson_mut_doc *doc, + yyjson_mut_val *arr); + +/** + Adds a `true` value at the end of the array. + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_true(yyjson_mut_doc *doc, + yyjson_mut_val *arr); + +/** + Adds a `false` value at the end of the array. + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_false(yyjson_mut_doc *doc, + yyjson_mut_val *arr); + +/** + Adds a bool value at the end of the array. + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param val The bool value to be added. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_bool(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + bool val); + +/** + Adds an unsigned integer value at the end of the array. + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param num The number to be added. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_uint(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + uint64_t num); + +/** + Adds a signed integer value at the end of the array. + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param num The number to be added. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_sint(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + int64_t num); + +/** + Adds a integer value at the end of the array. + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param num The number to be added. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_int(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + int64_t num); + +/** + Adds a double value at the end of the array. + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param num The number to be added. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_real(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + double num); + +/** + Adds a string value at the end of the array (no copy). + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param str A null-terminated UTF-8 string. + @return Whether successful. + @warning The input string is not copied, you should keep this string unmodified + for the lifetime of this JSON document. + */ +yyjson_api_inline bool yyjson_mut_arr_add_str(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + const char *str); + +/** + Adds a string value at the end of the array (no copy). + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param str A UTF-8 string, null-terminator is not required. + @param len The length of the string, in bytes. + @return Whether successful. + @warning The input string is not copied, you should keep this string unmodified + for the lifetime of this JSON document. + */ +yyjson_api_inline bool yyjson_mut_arr_add_strn(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + const char *str, + size_t len); + +/** + Adds a string value at the end of the array (copied). + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param str A null-terminated UTF-8 string. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_strcpy(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + const char *str); + +/** + Adds a string value at the end of the array (copied). + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @param str A UTF-8 string, null-terminator is not required. + @param len The length of the string, in bytes. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_arr_add_strncpy(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + const char *str, + size_t len); + +/** + Creates and adds a new array at the end of the array. + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @return The new array, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_add_arr(yyjson_mut_doc *doc, + yyjson_mut_val *arr); + +/** + Creates and adds a new object at the end of the array. + @param doc The `doc` is only used for memory allocation. + @param arr The array to which the value is to be inserted. + Returns false if it is NULL or not an array. + @return The new object, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_add_obj(yyjson_mut_doc *doc, + yyjson_mut_val *arr); + + + +/*============================================================================== + * Mutable JSON Object API + *============================================================================*/ + +/** Returns the number of key-value pairs in this object. + Returns 0 if `obj` is NULL or type is not object. */ +yyjson_api_inline size_t yyjson_mut_obj_size(yyjson_mut_val *obj); + +/** Returns the value to which the specified key is mapped. + Returns NULL if this object contains no mapping for the key. + Returns NULL if `obj/key` is NULL, or type is not object. + + The `key` should be a null-terminated UTF-8 string. + + @warning This function takes a linear search time. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_get(yyjson_mut_val *obj, + const char *key); + +/** Returns the value to which the specified key is mapped. + Returns NULL if this object contains no mapping for the key. + Returns NULL if `obj/key` is NULL, or type is not object. + + The `key` should be a UTF-8 string, null-terminator is not required. + The `key_len` should be the length of the key, in bytes. + + @warning This function takes a linear search time. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_getn(yyjson_mut_val *obj, + const char *key, + size_t key_len); + + + +/*============================================================================== + * Mutable JSON Object Iterator API + *============================================================================*/ + +/** + A mutable JSON object iterator. + + @warning You should not modify the object while iterating over it, but you can + use `yyjson_mut_obj_iter_remove()` to remove current value. + + @par Example + @code + yyjson_mut_val *key, *val; + yyjson_mut_obj_iter iter = yyjson_mut_obj_iter_with(obj); + while ((key = yyjson_mut_obj_iter_next(&iter))) { + val = yyjson_mut_obj_iter_get_val(key); + your_func(key, val); + if (your_val_is_unused(key, val)) { + yyjson_mut_obj_iter_remove(&iter); + } + } + @endcode + + If the ordering of the keys is known at compile-time, you can use this method + to speed up value lookups: + @code + // {"k1":1, "k2": 3, "k3": 3} + yyjson_mut_val *key, *val; + yyjson_mut_obj_iter iter = yyjson_mut_obj_iter_with(obj); + yyjson_mut_val *v1 = yyjson_mut_obj_iter_get(&iter, "k1"); + yyjson_mut_val *v3 = yyjson_mut_obj_iter_get(&iter, "k3"); + @endcode + @see `yyjson_mut_obj_iter_get()` and `yyjson_mut_obj_iter_getn()` + */ +typedef struct yyjson_mut_obj_iter { + size_t idx; /**< next key's index */ + size_t max; /**< maximum key index (obj.size) */ + yyjson_mut_val *cur; /**< current key */ + yyjson_mut_val *pre; /**< previous key */ + yyjson_mut_val *obj; /**< the object being iterated */ +} yyjson_mut_obj_iter; + +/** + Initialize an iterator for this object. + + @param obj The object to be iterated over. + If this parameter is NULL or not an array, `iter` will be set to empty. + @param iter The iterator to be initialized. + If this parameter is NULL, the function will fail and return false. + @return true if the `iter` has been successfully initialized. + + @note The iterator does not need to be destroyed. + */ +yyjson_api_inline bool yyjson_mut_obj_iter_init(yyjson_mut_val *obj, + yyjson_mut_obj_iter *iter); + +/** + Create an iterator with an object, same as `yyjson_obj_iter_init()`. + + @param obj The object to be iterated over. + If this parameter is NULL or not an object, an empty iterator will returned. + @return A new iterator for the object. + + @note The iterator does not need to be destroyed. + */ +yyjson_api_inline yyjson_mut_obj_iter yyjson_mut_obj_iter_with( + yyjson_mut_val *obj); + +/** + Returns whether the iteration has more elements. + If `iter` is NULL, this function will return false. + */ +yyjson_api_inline bool yyjson_mut_obj_iter_has_next( + yyjson_mut_obj_iter *iter); + +/** + Returns the next key in the iteration, or NULL on end. + If `iter` is NULL, this function will return NULL. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_iter_next( + yyjson_mut_obj_iter *iter); + +/** + Returns the value for key inside the iteration. + If `iter` is NULL, this function will return NULL. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_iter_get_val( + yyjson_mut_val *key); + +/** + Removes current key-value pair in the iteration, returns the removed value. + If `iter` is NULL, this function will return NULL. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_iter_remove( + yyjson_mut_obj_iter *iter); + +/** + Iterates to a specified key and returns the value. + + This function does the same thing as `yyjson_mut_obj_get()`, but is much faster + if the ordering of the keys is known at compile-time and you are using the same + order to look up the values. If the key exists in this object, then the + iterator will stop at the next key, otherwise the iterator will not change and + NULL is returned. + + @param iter The object iterator, should not be NULL. + @param key The key, should be a UTF-8 string with null-terminator. + @return The value to which the specified key is mapped. + NULL if this object contains no mapping for the key or input is invalid. + + @warning This function takes a linear search time if the key is not nearby. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_iter_get( + yyjson_mut_obj_iter *iter, const char *key); + +/** + Iterates to a specified key and returns the value. + + This function does the same thing as `yyjson_mut_obj_getn()` but is much faster + if the ordering of the keys is known at compile-time and you are using the same + order to look up the values. If the key exists in this object, then the + iterator will stop at the next key, otherwise the iterator will not change and + NULL is returned. + + @param iter The object iterator, should not be NULL. + @param key The key, should be a UTF-8 string, null-terminator is not required. + @param key_len The the length of `key`, in bytes. + @return The value to which the specified key is mapped. + NULL if this object contains no mapping for the key or input is invalid. + + @warning This function takes a linear search time if the key is not nearby. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_iter_getn( + yyjson_mut_obj_iter *iter, const char *key, size_t key_len); + +/** + Macro for iterating over an object. + It works like iterator, but with a more intuitive API. + + @warning You should not modify the object while iterating over it. + + @par Example + @code + size_t idx, max; + yyjson_val *key, *val; + yyjson_obj_foreach(obj, idx, max, key, val) { + your_func(key, val); + } + @endcode + */ +#define yyjson_mut_obj_foreach(obj, idx, max, key, val) \ + for ((idx) = 0, \ + (max) = yyjson_mut_obj_size(obj), \ + (key) = (max) ? ((yyjson_mut_val *)(obj)->uni.ptr)->next->next : NULL, \ + (val) = (key) ? (key)->next : NULL; \ + (idx) < (max); \ + (idx)++, \ + (key) = (val)->next, \ + (val) = (key)->next) + + + +/*============================================================================== + * Mutable JSON Object Creation API + *============================================================================*/ + +/** Creates and returns a mutable object, returns NULL on error. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj(yyjson_mut_doc *doc); + +/** + Creates and returns a mutable object with keys and values, returns NULL on + error. The keys and values are not copied. The strings should be a + null-terminated UTF-8 string. + + @warning The input string is not copied, you should keep this string + unmodified for the lifetime of this JSON document. + + @par Example + @code + const char *keys[2] = { "id", "name" }; + const char *vals[2] = { "01", "Harry" }; + yyjson_mut_val *obj = yyjson_mut_obj_with_str(doc, keys, vals, 2); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_with_str(yyjson_mut_doc *doc, + const char **keys, + const char **vals, + size_t count); + +/** + Creates and returns a mutable object with key-value pairs and pair count, + returns NULL on error. The keys and values are not copied. The strings should + be a null-terminated UTF-8 string. + + @warning The input string is not copied, you should keep this string + unmodified for the lifetime of this JSON document. + + @par Example + @code + const char *kv_pairs[4] = { "id", "01", "name", "Harry" }; + yyjson_mut_val *obj = yyjson_mut_obj_with_kv(doc, kv_pairs, 2); + @endcode + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_with_kv(yyjson_mut_doc *doc, + const char **kv_pairs, + size_t pair_count); + + + +/*============================================================================== + * Mutable JSON Object Modification API + *============================================================================*/ + +/** + Adds a key-value pair at the end of the object. + This function allows duplicated key in one object. + @param obj The object to which the new key-value pair is to be added. + @param key The key, should be a string which is created by `yyjson_mut_str()`, + `yyjson_mut_strn()`, `yyjson_mut_strcpy()` or `yyjson_mut_strncpy()`. + @param val The value to add to the object. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_obj_add(yyjson_mut_val *obj, + yyjson_mut_val *key, + yyjson_mut_val *val); +/** + Sets a key-value pair at the end of the object. + This function may remove all key-value pairs for the given key before add. + @param obj The object to which the new key-value pair is to be added. + @param key The key, should be a string which is created by `yyjson_mut_str()`, + `yyjson_mut_strn()`, `yyjson_mut_strcpy()` or `yyjson_mut_strncpy()`. + @param val The value to add to the object. If this value is null, the behavior + is same as `yyjson_mut_obj_remove()`. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_obj_put(yyjson_mut_val *obj, + yyjson_mut_val *key, + yyjson_mut_val *val); + +/** + Inserts a key-value pair to the object at the given position. + This function allows duplicated key in one object. + @param obj The object to which the new key-value pair is to be added. + @param key The key, should be a string which is created by `yyjson_mut_str()`, + `yyjson_mut_strn()`, `yyjson_mut_strcpy()` or `yyjson_mut_strncpy()`. + @param val The value to add to the object. + @param idx The index to which to insert the new pair. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_obj_insert(yyjson_mut_val *obj, + yyjson_mut_val *key, + yyjson_mut_val *val, + size_t idx); + +/** + Removes all key-value pair from the object with given key. + @param obj The object from which the key-value pair is to be removed. + @param key The key, should be a string value. + @return The first matched value, or NULL if no matched value. + @warning This function takes a linear search time. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_remove(yyjson_mut_val *obj, + yyjson_mut_val *key); + +/** + Removes all key-value pair from the object with given key. + @param obj The object from which the key-value pair is to be removed. + @param key The key, should be a UTF-8 string with null-terminator. + @return The first matched value, or NULL if no matched value. + @warning This function takes a linear search time. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_remove_key( + yyjson_mut_val *obj, const char *key); + +/** + Removes all key-value pair from the object with given key. + @param obj The object from which the key-value pair is to be removed. + @param key The key, should be a UTF-8 string, null-terminator is not required. + @param key_len The length of the key. + @return The first matched value, or NULL if no matched value. + @warning This function takes a linear search time. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_remove_keyn( + yyjson_mut_val *obj, const char *key, size_t key_len); + +/** + Removes all key-value pairs in this object. + @param obj The object from which all of the values are to be removed. + @return Whether successful. + */ +yyjson_api_inline bool yyjson_mut_obj_clear(yyjson_mut_val *obj); + +/** + Replaces value from the object with given key. + If the key is not exist, or the value is NULL, it will fail. + @param obj The object to which the value is to be replaced. + @param key The key, should be a string value. + @param val The value to replace into the object. + @return Whether successful. + @warning This function takes a linear search time. + */ +yyjson_api_inline bool yyjson_mut_obj_replace(yyjson_mut_val *obj, + yyjson_mut_val *key, + yyjson_mut_val *val); + +/** + Rotates key-value pairs in the object for the given number of times. + For example: `{"a":1,"b":2,"c":3,"d":4}` rotate 1 is + `{"b":2,"c":3,"d":4,"a":1}`. + @param obj The object to be rotated. + @param idx Index (or times) to rotate. + @return Whether successful. + @warning This function takes a linear search time. + */ +yyjson_api_inline bool yyjson_mut_obj_rotate(yyjson_mut_val *obj, + size_t idx); + + + +/*============================================================================== + * Mutable JSON Object Modification Convenience API + *============================================================================*/ + +/** Adds a `null` value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep the string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_null(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key); + +/** Adds a `true` value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep the string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_true(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key); + +/** Adds a `false` value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep the string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_false(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key); + +/** Adds a bool value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep the string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_bool(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, bool val); + +/** Adds an unsigned integer value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep the string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_uint(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, uint64_t val); + +/** Adds a signed integer value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep the string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_sint(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, int64_t val); + +/** Adds an int value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep the string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_int(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, int64_t val); + +/** Adds a double value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep the string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_real(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, double val); + +/** Adds a string value at the end of the object. + The `key` and `val` should be null-terminated UTF-8 strings. + This function allows duplicated key in one object. + + @warning The key/value strings are not copied, you should keep these strings + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_str(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, const char *val); + +/** Adds a string value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + The `val` should be a UTF-8 string, null-terminator is not required. + The `len` should be the length of the `val`, in bytes. + This function allows duplicated key in one object. + + @warning The key/value strings are not copied, you should keep these strings + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_strn(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, + const char *val, size_t len); + +/** Adds a string value at the end of the object. + The `key` and `val` should be null-terminated UTF-8 strings. + The value string is copied. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep the string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_strcpy(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, + const char *val); + +/** Adds a string value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + The `val` should be a UTF-8 string, null-terminator is not required. + The `len` should be the length of the `val`, in bytes. + This function allows duplicated key in one object. + + @warning The key strings are not copied, you should keep these strings + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_strncpy(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, + const char *val, size_t len); + +/** + Creates and adds a new array to the target object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep these strings + unmodified for the lifetime of this JSON document. + @return The new array, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_add_arr(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key); + +/** + Creates and adds a new object to the target object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep these strings + unmodified for the lifetime of this JSON document. + @return The new object, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_add_obj(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key); + +/** Adds a JSON value at the end of the object. + The `key` should be a null-terminated UTF-8 string. + This function allows duplicated key in one object. + + @warning The key string is not copied, you should keep the string + unmodified for the lifetime of this JSON document. */ +yyjson_api_inline bool yyjson_mut_obj_add_val(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, + yyjson_mut_val *val); + +/** Removes all key-value pairs for the given key. + Returns the first value to which the specified key is mapped or NULL if this + object contains no mapping for the key. + The `key` should be a null-terminated UTF-8 string. + + @warning This function takes a linear search time. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_remove_str( + yyjson_mut_val *obj, const char *key); + +/** Removes all key-value pairs for the given key. + Returns the first value to which the specified key is mapped or NULL if this + object contains no mapping for the key. + The `key` should be a UTF-8 string, null-terminator is not required. + The `len` should be the length of the key, in bytes. + + @warning This function takes a linear search time. */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_remove_strn( + yyjson_mut_val *obj, const char *key, size_t len); + +/** Replaces all matching keys with the new key. + Returns true if at least one key was renamed. + The `key` and `new_key` should be a null-terminated UTF-8 string. + The `new_key` is copied and held by doc. + + @warning This function takes a linear search time. + If `new_key` already exists, it will cause duplicate keys. + */ +yyjson_api_inline bool yyjson_mut_obj_rename_key(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, + const char *new_key); + +/** Replaces all matching keys with the new key. + Returns true if at least one key was renamed. + The `key` and `new_key` should be a UTF-8 string, + null-terminator is not required. The `new_key` is copied and held by doc. + + @warning This function takes a linear search time. + If `new_key` already exists, it will cause duplicate keys. + */ +yyjson_api_inline bool yyjson_mut_obj_rename_keyn(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, + size_t len, + const char *new_key, + size_t new_len); + + + +/*============================================================================== + * JSON Pointer API (RFC 6901) + * https://tools.ietf.org/html/rfc6901 + *============================================================================*/ + +/** JSON Pointer error code. */ +typedef uint32_t yyjson_ptr_code; + +/** No JSON pointer error. */ +static const yyjson_ptr_code YYJSON_PTR_ERR_NONE = 0; + +/** Invalid input parameter, such as NULL input. */ +static const yyjson_ptr_code YYJSON_PTR_ERR_PARAMETER = 1; + +/** JSON pointer syntax error, such as invalid escape, token no prefix. */ +static const yyjson_ptr_code YYJSON_PTR_ERR_SYNTAX = 2; + +/** JSON pointer resolve failed, such as index out of range, key not found. */ +static const yyjson_ptr_code YYJSON_PTR_ERR_RESOLVE = 3; + +/** Document's root is NULL, but it is required for the function call. */ +static const yyjson_ptr_code YYJSON_PTR_ERR_NULL_ROOT = 4; + +/** Cannot set root as the target is not a document. */ +static const yyjson_ptr_code YYJSON_PTR_ERR_SET_ROOT = 5; + +/** The memory allocation failed and a new value could not be created. */ +static const yyjson_ptr_code YYJSON_PTR_ERR_MEMORY_ALLOCATION = 6; + +/** Error information for JSON pointer. */ +typedef struct yyjson_ptr_err { + /** Error code, see `yyjson_ptr_code` for all possible values. */ + yyjson_ptr_code code; + /** Error message, constant, no need to free (NULL if no error). */ + const char *msg; + /** Error byte position for input JSON pointer (0 if no error). */ + size_t pos; +} yyjson_ptr_err; + +/** + A context for JSON pointer operation. + + This struct stores the context of JSON Pointer operation result. The struct + can be used with three helper functions: `ctx_append()`, `ctx_replace()`, and + `ctx_remove()`, which perform the corresponding operations on the container + without re-parsing the JSON Pointer. + + For example: + @code + // doc before: {"a":[0,1,null]} + // ptr: "/a/2" + val = yyjson_mut_doc_ptr_getx(doc, ptr, strlen(ptr), &ctx, &err); + if (yyjson_is_null(val)) { + yyjson_ptr_ctx_remove(&ctx); + } + // doc after: {"a":[0,1]} + @endcode + */ +typedef struct yyjson_ptr_ctx { + /** + The container (parent) of the target value. It can be either an array or + an object. If the target location has no value, but all its parent + containers exist, and the target location can be used to insert a new + value, then `ctn` is the parent container of the target location. + Otherwise, `ctn` is NULL. + */ + yyjson_mut_val *ctn; + /** + The previous sibling of the target value. It can be either a value in an + array or a key in an object. As the container is a `circular linked list` + of elements, `pre` is the previous node of the target value. If the + operation is `add` or `set`, then `pre` is the previous node of the new + value, not the original target value. If the target value does not exist, + `pre` is NULL. + */ + yyjson_mut_val *pre; + /** + The removed value if the operation is `set`, `replace` or `remove`. It can + be used to restore the original state of the document if needed. + */ + yyjson_mut_val *old; +} yyjson_ptr_ctx; + +/** + Get value by a JSON Pointer. + @param doc The JSON document to be queried. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @return The value referenced by the JSON pointer. + NULL if `doc` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_val *yyjson_doc_ptr_get(yyjson_doc *doc, + const char *ptr); + +/** + Get value by a JSON Pointer. + @param doc The JSON document to be queried. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @return The value referenced by the JSON pointer. + NULL if `doc` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_val *yyjson_doc_ptr_getn(yyjson_doc *doc, + const char *ptr, size_t len); + +/** + Get value by a JSON Pointer. + @param doc The JSON document to be queried. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param err A pointer to store the error information, or NULL if not needed. + @return The value referenced by the JSON pointer. + NULL if `doc` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_val *yyjson_doc_ptr_getx(yyjson_doc *doc, + const char *ptr, size_t len, + yyjson_ptr_err *err); + +/** + Get value by a JSON Pointer. + @param val The JSON value to be queried. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @return The value referenced by the JSON pointer. + NULL if `val` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_val *yyjson_ptr_get(yyjson_val *val, + const char *ptr); + +/** + Get value by a JSON Pointer. + @param val The JSON value to be queried. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @return The value referenced by the JSON pointer. + NULL if `val` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_val *yyjson_ptr_getn(yyjson_val *val, + const char *ptr, size_t len); + +/** + Get value by a JSON Pointer. + @param val The JSON value to be queried. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param err A pointer to store the error information, or NULL if not needed. + @return The value referenced by the JSON pointer. + NULL if `val` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_val *yyjson_ptr_getx(yyjson_val *val, + const char *ptr, size_t len, + yyjson_ptr_err *err); + +/** + Get value by a JSON Pointer. + @param doc The JSON document to be queried. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @return The value referenced by the JSON pointer. + NULL if `doc` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_get(yyjson_mut_doc *doc, + const char *ptr); + +/** + Get value by a JSON Pointer. + @param doc The JSON document to be queried. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @return The value referenced by the JSON pointer. + NULL if `doc` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_getn(yyjson_mut_doc *doc, + const char *ptr, + size_t len); + +/** + Get value by a JSON Pointer. + @param doc The JSON document to be queried. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param ctx A pointer to store the result context, or NULL if not needed. + @param err A pointer to store the error information, or NULL if not needed. + @return The value referenced by the JSON pointer. + NULL if `doc` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_getx(yyjson_mut_doc *doc, + const char *ptr, + size_t len, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err); + +/** + Get value by a JSON Pointer. + @param val The JSON value to be queried. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @return The value referenced by the JSON pointer. + NULL if `val` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_get(yyjson_mut_val *val, + const char *ptr); + +/** + Get value by a JSON Pointer. + @param val The JSON value to be queried. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @return The value referenced by the JSON pointer. + NULL if `val` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_getn(yyjson_mut_val *val, + const char *ptr, + size_t len); + +/** + Get value by a JSON Pointer. + @param val The JSON value to be queried. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param ctx A pointer to store the result context, or NULL if not needed. + @param err A pointer to store the error information, or NULL if not needed. + @return The value referenced by the JSON pointer. + NULL if `val` or `ptr` is NULL, or the JSON pointer cannot be resolved. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_getx(yyjson_mut_val *val, + const char *ptr, + size_t len, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err); + +/** + Add (insert) value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @param new_val The value to be added. + @return true if JSON pointer is valid and new value is added, false otherwise. + @note The parent nodes will be created if they do not exist. + */ +yyjson_api_inline bool yyjson_mut_doc_ptr_add(yyjson_mut_doc *doc, + const char *ptr, + yyjson_mut_val *new_val); + +/** + Add (insert) value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param new_val The value to be added. + @return true if JSON pointer is valid and new value is added, false otherwise. + @note The parent nodes will be created if they do not exist. + */ +yyjson_api_inline bool yyjson_mut_doc_ptr_addn(yyjson_mut_doc *doc, + const char *ptr, size_t len, + yyjson_mut_val *new_val); + +/** + Add (insert) value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param new_val The value to be added. + @param create_parent Whether to create parent nodes if not exist. + @param ctx A pointer to store the result context, or NULL if not needed. + @param err A pointer to store the error information, or NULL if not needed. + @return true if JSON pointer is valid and new value is added, false otherwise. + */ +yyjson_api_inline bool yyjson_mut_doc_ptr_addx(yyjson_mut_doc *doc, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + bool create_parent, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err); + +/** + Add (insert) value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @param doc Only used to create new values when needed. + @param new_val The value to be added. + @return true if JSON pointer is valid and new value is added, false otherwise. + @note The parent nodes will be created if they do not exist. + */ +yyjson_api_inline bool yyjson_mut_ptr_add(yyjson_mut_val *val, + const char *ptr, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc); + +/** + Add (insert) value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param doc Only used to create new values when needed. + @param new_val The value to be added. + @return true if JSON pointer is valid and new value is added, false otherwise. + @note The parent nodes will be created if they do not exist. + */ +yyjson_api_inline bool yyjson_mut_ptr_addn(yyjson_mut_val *val, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc); + +/** + Add (insert) value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param doc Only used to create new values when needed. + @param new_val The value to be added. + @param create_parent Whether to create parent nodes if not exist. + @param ctx A pointer to store the result context, or NULL if not needed. + @param err A pointer to store the error information, or NULL if not needed. + @return true if JSON pointer is valid and new value is added, false otherwise. + */ +yyjson_api_inline bool yyjson_mut_ptr_addx(yyjson_mut_val *val, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc, + bool create_parent, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err); + +/** + Set value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @param new_val The value to be set, pass NULL to remove. + @return true if JSON pointer is valid and new value is set, false otherwise. + @note The parent nodes will be created if they do not exist. + If the target value already exists, it will be replaced by the new value. + */ +yyjson_api_inline bool yyjson_mut_doc_ptr_set(yyjson_mut_doc *doc, + const char *ptr, + yyjson_mut_val *new_val); + +/** + Set value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param new_val The value to be set, pass NULL to remove. + @return true if JSON pointer is valid and new value is set, false otherwise. + @note The parent nodes will be created if they do not exist. + If the target value already exists, it will be replaced by the new value. + */ +yyjson_api_inline bool yyjson_mut_doc_ptr_setn(yyjson_mut_doc *doc, + const char *ptr, size_t len, + yyjson_mut_val *new_val); + +/** + Set value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param new_val The value to be set, pass NULL to remove. + @param create_parent Whether to create parent nodes if not exist. + @param ctx A pointer to store the result context, or NULL if not needed. + @param err A pointer to store the error information, or NULL if not needed. + @return true if JSON pointer is valid and new value is set, false otherwise. + @note If the target value already exists, it will be replaced by the new value. + */ +yyjson_api_inline bool yyjson_mut_doc_ptr_setx(yyjson_mut_doc *doc, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + bool create_parent, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err); + +/** + Set value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @param new_val The value to be set, pass NULL to remove. + @param doc Only used to create new values when needed. + @return true if JSON pointer is valid and new value is set, false otherwise. + @note The parent nodes will be created if they do not exist. + If the target value already exists, it will be replaced by the new value. + */ +yyjson_api_inline bool yyjson_mut_ptr_set(yyjson_mut_val *val, + const char *ptr, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc); + +/** + Set value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param new_val The value to be set, pass NULL to remove. + @param doc Only used to create new values when needed. + @return true if JSON pointer is valid and new value is set, false otherwise. + @note The parent nodes will be created if they do not exist. + If the target value already exists, it will be replaced by the new value. + */ +yyjson_api_inline bool yyjson_mut_ptr_setn(yyjson_mut_val *val, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc); + +/** + Set value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param new_val The value to be set, pass NULL to remove. + @param doc Only used to create new values when needed. + @param create_parent Whether to create parent nodes if not exist. + @param ctx A pointer to store the result context, or NULL if not needed. + @param err A pointer to store the error information, or NULL if not needed. + @return true if JSON pointer is valid and new value is set, false otherwise. + @note If the target value already exists, it will be replaced by the new value. + */ +yyjson_api_inline bool yyjson_mut_ptr_setx(yyjson_mut_val *val, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc, + bool create_parent, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err); + +/** + Replace value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @param new_val The new value to replace the old one. + @return The old value that was replaced, or NULL if not found. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_replace( + yyjson_mut_doc *doc, const char *ptr, yyjson_mut_val *new_val); + +/** + Replace value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param new_val The new value to replace the old one. + @return The old value that was replaced, or NULL if not found. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_replacen( + yyjson_mut_doc *doc, const char *ptr, size_t len, yyjson_mut_val *new_val); + +/** + Replace value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param new_val The new value to replace the old one. + @param ctx A pointer to store the result context, or NULL if not needed. + @param err A pointer to store the error information, or NULL if not needed. + @return The old value that was replaced, or NULL if not found. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_replacex( + yyjson_mut_doc *doc, const char *ptr, size_t len, yyjson_mut_val *new_val, + yyjson_ptr_ctx *ctx, yyjson_ptr_err *err); + +/** + Replace value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @param new_val The new value to replace the old one. + @return The old value that was replaced, or NULL if not found. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_replace( + yyjson_mut_val *val, const char *ptr, yyjson_mut_val *new_val); + +/** + Replace value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param new_val The new value to replace the old one. + @return The old value that was replaced, or NULL if not found. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_replacen( + yyjson_mut_val *val, const char *ptr, size_t len, yyjson_mut_val *new_val); + +/** + Replace value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param new_val The new value to replace the old one. + @param ctx A pointer to store the result context, or NULL if not needed. + @param err A pointer to store the error information, or NULL if not needed. + @return The old value that was replaced, or NULL if not found. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_replacex( + yyjson_mut_val *val, const char *ptr, size_t len, yyjson_mut_val *new_val, + yyjson_ptr_ctx *ctx, yyjson_ptr_err *err); + +/** + Remove value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @return The removed value, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_remove( + yyjson_mut_doc *doc, const char *ptr); + +/** + Remove value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @return The removed value, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_removen( + yyjson_mut_doc *doc, const char *ptr, size_t len); + +/** + Remove value by a JSON pointer. + @param doc The target JSON document. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param ctx A pointer to store the result context, or NULL if not needed. + @param err A pointer to store the error information, or NULL if not needed. + @return The removed value, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_removex( + yyjson_mut_doc *doc, const char *ptr, size_t len, + yyjson_ptr_ctx *ctx, yyjson_ptr_err *err); + +/** + Remove value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8 with null-terminator). + @return The removed value, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_remove(yyjson_mut_val *val, + const char *ptr); + +/** + Remove value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @return The removed value, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_removen(yyjson_mut_val *val, + const char *ptr, + size_t len); + +/** + Remove value by a JSON pointer. + @param val The target JSON value. + @param ptr The JSON pointer string (UTF-8, null-terminator is not required). + @param len The length of `ptr` in bytes. + @param ctx A pointer to store the result context, or NULL if not needed. + @param err A pointer to store the error information, or NULL if not needed. + @return The removed value, or NULL on error. + */ +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_removex(yyjson_mut_val *val, + const char *ptr, + size_t len, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err); + +/** + Append value by JSON pointer context. + @param ctx The context from the `yyjson_mut_ptr_xxx()` calls. + @param key New key if `ctx->ctn` is object, or NULL if `ctx->ctn` is array. + @param val New value to be added. + @return true on success or false on fail. + */ +yyjson_api_inline bool yyjson_ptr_ctx_append(yyjson_ptr_ctx *ctx, + yyjson_mut_val *key, + yyjson_mut_val *val); + +/** + Replace value by JSON pointer context. + @param ctx The context from the `yyjson_mut_ptr_xxx()` calls. + @param val New value to be replaced. + @return true on success or false on fail. + @note If success, the old value will be returned via `ctx->old`. + */ +yyjson_api_inline bool yyjson_ptr_ctx_replace(yyjson_ptr_ctx *ctx, + yyjson_mut_val *val); + +/** + Remove value by JSON pointer context. + @param ctx The context from the `yyjson_mut_ptr_xxx()` calls. + @return true on success or false on fail. + @note If success, the old value will be returned via `ctx->old`. + */ +yyjson_api_inline bool yyjson_ptr_ctx_remove(yyjson_ptr_ctx *ctx); + + + +/*============================================================================== + * JSON Patch API (RFC 6902) + * https://tools.ietf.org/html/rfc6902 + *============================================================================*/ + +/** Result code for JSON patch. */ +typedef uint32_t yyjson_patch_code; + +/** Success, no error. */ +static const yyjson_patch_code YYJSON_PATCH_SUCCESS = 0; + +/** Invalid parameter, such as NULL input or non-array patch. */ +static const yyjson_patch_code YYJSON_PATCH_ERROR_INVALID_PARAMETER = 1; + +/** Memory allocation failure occurs. */ +static const yyjson_patch_code YYJSON_PATCH_ERROR_MEMORY_ALLOCATION = 2; + +/** JSON patch operation is not object type. */ +static const yyjson_patch_code YYJSON_PATCH_ERROR_INVALID_OPERATION = 3; + +/** JSON patch operation is missing a required key. */ +static const yyjson_patch_code YYJSON_PATCH_ERROR_MISSING_KEY = 4; + +/** JSON patch operation member is invalid. */ +static const yyjson_patch_code YYJSON_PATCH_ERROR_INVALID_MEMBER = 5; + +/** JSON patch operation `test` not equal. */ +static const yyjson_patch_code YYJSON_PATCH_ERROR_EQUAL = 6; + +/** JSON patch operation failed on JSON pointer. */ +static const yyjson_patch_code YYJSON_PATCH_ERROR_POINTER = 7; + +/** Error information for JSON patch. */ +typedef struct yyjson_patch_err { + /** Error code, see `yyjson_patch_code` for all possible values. */ + yyjson_patch_code code; + /** Index of the error operation (0 if no error). */ + size_t idx; + /** Error message, constant, no need to free (NULL if no error). */ + const char *msg; + /** JSON pointer error if `code == YYJSON_PATCH_ERROR_POINTER`. */ + yyjson_ptr_err ptr; +} yyjson_patch_err; + +/** + Creates and returns a patched JSON value (RFC 6902). + The memory of the returned value is allocated by the `doc`. + The `err` is used to receive error information, pass NULL if not needed. + Returns NULL if the patch could not be applied. + */ +yyjson_api yyjson_mut_val *yyjson_patch(yyjson_mut_doc *doc, + yyjson_val *orig, + yyjson_val *patch, + yyjson_patch_err *err); + +/** + Creates and returns a patched JSON value (RFC 6902). + The memory of the returned value is allocated by the `doc`. + The `err` is used to receive error information, pass NULL if not needed. + Returns NULL if the patch could not be applied. + */ +yyjson_api yyjson_mut_val *yyjson_mut_patch(yyjson_mut_doc *doc, + yyjson_mut_val *orig, + yyjson_mut_val *patch, + yyjson_patch_err *err); + + + +/*============================================================================== + * JSON Merge-Patch API (RFC 7386) + * https://tools.ietf.org/html/rfc7386 + *============================================================================*/ + +/** + Creates and returns a merge-patched JSON value (RFC 7386). + The memory of the returned value is allocated by the `doc`. + Returns NULL if the patch could not be applied. + + @warning This function is recursive and may cause a stack overflow if the + object level is too deep. + */ +yyjson_api yyjson_mut_val *yyjson_merge_patch(yyjson_mut_doc *doc, + yyjson_val *orig, + yyjson_val *patch); + +/** + Creates and returns a merge-patched JSON value (RFC 7386). + The memory of the returned value is allocated by the `doc`. + Returns NULL if the patch could not be applied. + + @warning This function is recursive and may cause a stack overflow if the + object level is too deep. + */ +yyjson_api yyjson_mut_val *yyjson_mut_merge_patch(yyjson_mut_doc *doc, + yyjson_mut_val *orig, + yyjson_mut_val *patch); + + + +/*============================================================================== + * JSON Structure (Implementation) + *============================================================================*/ + +/** Payload of a JSON value (8 bytes). */ +typedef union yyjson_val_uni { + uint64_t u64; + int64_t i64; + double f64; + const char *str; + void *ptr; + size_t ofs; +} yyjson_val_uni; + +/** + Immutable JSON value, 16 bytes. + */ +struct yyjson_val { + uint64_t tag; /**< type, subtype and length */ + yyjson_val_uni uni; /**< payload */ +}; + +struct yyjson_doc { + /** Root value of the document (nonnull). */ + yyjson_val *root; + /** Allocator used by document (nonnull). */ + yyjson_alc alc; + /** The total number of bytes read when parsing JSON (nonzero). */ + size_t dat_read; + /** The total number of value read when parsing JSON (nonzero). */ + size_t val_read; + /** The string pool used by JSON values (nullable). */ + char *str_pool; +}; + + + +/*============================================================================== + * Unsafe JSON Value API (Implementation) + *============================================================================*/ + +/* + Whether the string does not need to be escaped for serialization. + This function is used to optimize the writing speed of small constant strings. + This function works only if the compiler can evaluate it at compile time. + + Clang supports it since v8.0, + earlier versions do not support constant_p(strlen) and return false. + GCC supports it since at least v4.4, + earlier versions may compile it as run-time instructions. + ICC supports it since at least v16, + earlier versions are uncertain. + + @param str The C string. + @param len The returnd value from strlen(str). + */ +yyjson_api_inline bool unsafe_yyjson_is_str_noesc(const char *str, size_t len) { +#if YYJSON_HAS_CONSTANT_P && \ + (!YYJSON_IS_REAL_GCC || yyjson_gcc_available(4, 4, 0)) + if (yyjson_constant_p(len) && len <= 32) { + /* + Same as the following loop: + + for (size_t i = 0; i < len; i++) { + char c = str[i]; + if (c < ' ' || c > '~' || c == '"' || c == '\\') return false; + } + + GCC evaluates it at compile time only if the string length is within 17 + and -O3 (which turns on the -fpeel-loops flag) is used. + So the loop is unrolled for GCC. + */ +# define yyjson_repeat32_incr(x) \ + x(0) x(1) x(2) x(3) x(4) x(5) x(6) x(7) \ + x(8) x(9) x(10) x(11) x(12) x(13) x(14) x(15) \ + x(16) x(17) x(18) x(19) x(20) x(21) x(22) x(23) \ + x(24) x(25) x(26) x(27) x(28) x(29) x(30) x(31) +# define yyjson_check_char_noesc(i) \ + if (i < len) { \ + char c = str[i]; \ + if (c < ' ' || c > '~' || c == '"' || c == '\\') return false; } + yyjson_repeat32_incr(yyjson_check_char_noesc) +# undef yyjson_repeat32_incr +# undef yyjson_check_char_noesc + return true; + } +#else + (void)str; + (void)len; +#endif + return false; +} + +yyjson_api_inline yyjson_type unsafe_yyjson_get_type(void *val) { + uint8_t tag = (uint8_t)((yyjson_val *)val)->tag; + return (yyjson_type)(tag & YYJSON_TYPE_MASK); +} + +yyjson_api_inline yyjson_subtype unsafe_yyjson_get_subtype(void *val) { + uint8_t tag = (uint8_t)((yyjson_val *)val)->tag; + return (yyjson_subtype)(tag & YYJSON_SUBTYPE_MASK); +} + +yyjson_api_inline uint8_t unsafe_yyjson_get_tag(void *val) { + uint8_t tag = (uint8_t)((yyjson_val *)val)->tag; + return (uint8_t)(tag & YYJSON_TAG_MASK); +} + +yyjson_api_inline bool unsafe_yyjson_is_raw(void *val) { + return unsafe_yyjson_get_type(val) == YYJSON_TYPE_RAW; +} + +yyjson_api_inline bool unsafe_yyjson_is_null(void *val) { + return unsafe_yyjson_get_type(val) == YYJSON_TYPE_NULL; +} + +yyjson_api_inline bool unsafe_yyjson_is_bool(void *val) { + return unsafe_yyjson_get_type(val) == YYJSON_TYPE_BOOL; +} + +yyjson_api_inline bool unsafe_yyjson_is_num(void *val) { + return unsafe_yyjson_get_type(val) == YYJSON_TYPE_NUM; +} + +yyjson_api_inline bool unsafe_yyjson_is_str(void *val) { + return unsafe_yyjson_get_type(val) == YYJSON_TYPE_STR; +} + +yyjson_api_inline bool unsafe_yyjson_is_arr(void *val) { + return unsafe_yyjson_get_type(val) == YYJSON_TYPE_ARR; +} + +yyjson_api_inline bool unsafe_yyjson_is_obj(void *val) { + return unsafe_yyjson_get_type(val) == YYJSON_TYPE_OBJ; +} + +yyjson_api_inline bool unsafe_yyjson_is_ctn(void *val) { + uint8_t mask = YYJSON_TYPE_ARR & YYJSON_TYPE_OBJ; + return (unsafe_yyjson_get_tag(val) & mask) == mask; +} + +yyjson_api_inline bool unsafe_yyjson_is_uint(void *val) { + const uint8_t patt = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_UINT; + return unsafe_yyjson_get_tag(val) == patt; +} + +yyjson_api_inline bool unsafe_yyjson_is_sint(void *val) { + const uint8_t patt = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_SINT; + return unsafe_yyjson_get_tag(val) == patt; +} + +yyjson_api_inline bool unsafe_yyjson_is_int(void *val) { + const uint8_t mask = YYJSON_TAG_MASK & (~YYJSON_SUBTYPE_SINT); + const uint8_t patt = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_UINT; + return (unsafe_yyjson_get_tag(val) & mask) == patt; +} + +yyjson_api_inline bool unsafe_yyjson_is_real(void *val) { + const uint8_t patt = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; + return unsafe_yyjson_get_tag(val) == patt; +} + +yyjson_api_inline bool unsafe_yyjson_is_true(void *val) { + const uint8_t patt = YYJSON_TYPE_BOOL | YYJSON_SUBTYPE_TRUE; + return unsafe_yyjson_get_tag(val) == patt; +} + +yyjson_api_inline bool unsafe_yyjson_is_false(void *val) { + const uint8_t patt = YYJSON_TYPE_BOOL | YYJSON_SUBTYPE_FALSE; + return unsafe_yyjson_get_tag(val) == patt; +} + +yyjson_api_inline bool unsafe_yyjson_arr_is_flat(yyjson_val *val) { + size_t ofs = val->uni.ofs; + size_t len = (size_t)(val->tag >> YYJSON_TAG_BIT); + return len * sizeof(yyjson_val) + sizeof(yyjson_val) == ofs; +} + +yyjson_api_inline const char *unsafe_yyjson_get_raw(void *val) { + return ((yyjson_val *)val)->uni.str; +} + +yyjson_api_inline bool unsafe_yyjson_get_bool(void *val) { + uint8_t tag = unsafe_yyjson_get_tag(val); + return (bool)((tag & YYJSON_SUBTYPE_MASK) >> YYJSON_TYPE_BIT); +} + +yyjson_api_inline uint64_t unsafe_yyjson_get_uint(void *val) { + return ((yyjson_val *)val)->uni.u64; +} + +yyjson_api_inline int64_t unsafe_yyjson_get_sint(void *val) { + return ((yyjson_val *)val)->uni.i64; +} + +yyjson_api_inline int unsafe_yyjson_get_int(void *val) { + return (int)((yyjson_val *)val)->uni.i64; +} + +yyjson_api_inline double unsafe_yyjson_get_real(void *val) { + return ((yyjson_val *)val)->uni.f64; +} + +yyjson_api_inline double unsafe_yyjson_get_num(void *val) { + uint8_t tag = unsafe_yyjson_get_tag(val); + if (tag == (YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL)) { + return ((yyjson_val *)val)->uni.f64; + } else if (tag == (YYJSON_TYPE_NUM | YYJSON_SUBTYPE_SINT)) { + return (double)((yyjson_val *)val)->uni.i64; + } else if (tag == (YYJSON_TYPE_NUM | YYJSON_SUBTYPE_UINT)) { +#if YYJSON_U64_TO_F64_NO_IMPL + uint64_t msb = ((uint64_t)1) << 63; + uint64_t num = ((yyjson_val *)val)->uni.u64; + if ((num & msb) == 0) { + return (double)(int64_t)num; + } else { + return ((double)(int64_t)((num >> 1) | (num & 1))) * (double)2.0; + } +#else + return (double)((yyjson_val *)val)->uni.u64; +#endif + } + return 0.0; +} + +yyjson_api_inline const char *unsafe_yyjson_get_str(void *val) { + return ((yyjson_val *)val)->uni.str; +} + +yyjson_api_inline size_t unsafe_yyjson_get_len(void *val) { + return (size_t)(((yyjson_val *)val)->tag >> YYJSON_TAG_BIT); +} + +yyjson_api_inline yyjson_val *unsafe_yyjson_get_first(yyjson_val *ctn) { + return ctn + 1; +} + +yyjson_api_inline yyjson_val *unsafe_yyjson_get_next(yyjson_val *val) { + bool is_ctn = unsafe_yyjson_is_ctn(val); + size_t ctn_ofs = val->uni.ofs; + size_t ofs = (is_ctn ? ctn_ofs : sizeof(yyjson_val)); + return (yyjson_val *)(void *)((uint8_t *)val + ofs); +} + +yyjson_api_inline bool unsafe_yyjson_equals_strn(void *val, const char *str, + size_t len) { + return unsafe_yyjson_get_len(val) == len && + memcmp(((yyjson_val *)val)->uni.str, str, len) == 0; +} + +yyjson_api_inline bool unsafe_yyjson_equals_str(void *val, const char *str) { + return unsafe_yyjson_equals_strn(val, str, strlen(str)); +} + +yyjson_api_inline void unsafe_yyjson_set_type(void *val, yyjson_type type, + yyjson_subtype subtype) { + uint8_t tag = (type | subtype); + uint64_t new_tag = ((yyjson_val *)val)->tag; + new_tag = (new_tag & (~(uint64_t)YYJSON_TAG_MASK)) | (uint64_t)tag; + ((yyjson_val *)val)->tag = new_tag; +} + +yyjson_api_inline void unsafe_yyjson_set_len(void *val, size_t len) { + uint64_t tag = ((yyjson_val *)val)->tag & YYJSON_TAG_MASK; + tag |= (uint64_t)len << YYJSON_TAG_BIT; + ((yyjson_val *)val)->tag = tag; +} + +yyjson_api_inline void unsafe_yyjson_inc_len(void *val) { + uint64_t tag = ((yyjson_val *)val)->tag; + tag += (uint64_t)(1 << YYJSON_TAG_BIT); + ((yyjson_val *)val)->tag = tag; +} + +yyjson_api_inline void unsafe_yyjson_set_raw(void *val, const char *raw, + size_t len) { + unsafe_yyjson_set_type(val, YYJSON_TYPE_RAW, YYJSON_SUBTYPE_NONE); + unsafe_yyjson_set_len(val, len); + ((yyjson_val *)val)->uni.str = raw; +} + +yyjson_api_inline void unsafe_yyjson_set_null(void *val) { + unsafe_yyjson_set_type(val, YYJSON_TYPE_NULL, YYJSON_SUBTYPE_NONE); + unsafe_yyjson_set_len(val, 0); +} + +yyjson_api_inline void unsafe_yyjson_set_bool(void *val, bool num) { + yyjson_subtype subtype = num ? YYJSON_SUBTYPE_TRUE : YYJSON_SUBTYPE_FALSE; + unsafe_yyjson_set_type(val, YYJSON_TYPE_BOOL, subtype); + unsafe_yyjson_set_len(val, 0); +} + +yyjson_api_inline void unsafe_yyjson_set_uint(void *val, uint64_t num) { + unsafe_yyjson_set_type(val, YYJSON_TYPE_NUM, YYJSON_SUBTYPE_UINT); + unsafe_yyjson_set_len(val, 0); + ((yyjson_val *)val)->uni.u64 = num; +} + +yyjson_api_inline void unsafe_yyjson_set_sint(void *val, int64_t num) { + unsafe_yyjson_set_type(val, YYJSON_TYPE_NUM, YYJSON_SUBTYPE_SINT); + unsafe_yyjson_set_len(val, 0); + ((yyjson_val *)val)->uni.i64 = num; +} + +yyjson_api_inline void unsafe_yyjson_set_real(void *val, double num) { + unsafe_yyjson_set_type(val, YYJSON_TYPE_NUM, YYJSON_SUBTYPE_REAL); + unsafe_yyjson_set_len(val, 0); + ((yyjson_val *)val)->uni.f64 = num; +} + +yyjson_api_inline void unsafe_yyjson_set_str(void *val, const char *str) { + size_t len = strlen(str); + bool noesc = unsafe_yyjson_is_str_noesc(str, len); + yyjson_subtype sub = noesc ? YYJSON_SUBTYPE_NOESC : YYJSON_SUBTYPE_NONE; + unsafe_yyjson_set_type(val, YYJSON_TYPE_STR, sub); + unsafe_yyjson_set_len(val, len); + ((yyjson_val *)val)->uni.str = str; +} + +yyjson_api_inline void unsafe_yyjson_set_strn(void *val, const char *str, + size_t len) { + unsafe_yyjson_set_type(val, YYJSON_TYPE_STR, YYJSON_SUBTYPE_NONE); + unsafe_yyjson_set_len(val, len); + ((yyjson_val *)val)->uni.str = str; +} + +yyjson_api_inline void unsafe_yyjson_set_arr(void *val, size_t size) { + unsafe_yyjson_set_type(val, YYJSON_TYPE_ARR, YYJSON_SUBTYPE_NONE); + unsafe_yyjson_set_len(val, size); +} + +yyjson_api_inline void unsafe_yyjson_set_obj(void *val, size_t size) { + unsafe_yyjson_set_type(val, YYJSON_TYPE_OBJ, YYJSON_SUBTYPE_NONE); + unsafe_yyjson_set_len(val, size); +} + + + +/*============================================================================== + * JSON Document API (Implementation) + *============================================================================*/ + +yyjson_api_inline yyjson_val *yyjson_doc_get_root(yyjson_doc *doc) { + return doc ? doc->root : NULL; +} + +yyjson_api_inline size_t yyjson_doc_get_read_size(yyjson_doc *doc) { + return doc ? doc->dat_read : 0; +} + +yyjson_api_inline size_t yyjson_doc_get_val_count(yyjson_doc *doc) { + return doc ? doc->val_read : 0; +} + +yyjson_api_inline void yyjson_doc_free(yyjson_doc *doc) { + if (doc) { + yyjson_alc alc = doc->alc; + memset(&doc->alc, 0, sizeof(alc)); + if (doc->str_pool) alc.free(alc.ctx, doc->str_pool); + alc.free(alc.ctx, doc); + } +} + + + +/*============================================================================== + * JSON Value Type API (Implementation) + *============================================================================*/ + +yyjson_api_inline bool yyjson_is_raw(yyjson_val *val) { + return val ? unsafe_yyjson_is_raw(val) : false; +} + +yyjson_api_inline bool yyjson_is_null(yyjson_val *val) { + return val ? unsafe_yyjson_is_null(val) : false; +} + +yyjson_api_inline bool yyjson_is_true(yyjson_val *val) { + return val ? unsafe_yyjson_is_true(val) : false; +} + +yyjson_api_inline bool yyjson_is_false(yyjson_val *val) { + return val ? unsafe_yyjson_is_false(val) : false; +} + +yyjson_api_inline bool yyjson_is_bool(yyjson_val *val) { + return val ? unsafe_yyjson_is_bool(val) : false; +} + +yyjson_api_inline bool yyjson_is_uint(yyjson_val *val) { + return val ? unsafe_yyjson_is_uint(val) : false; +} + +yyjson_api_inline bool yyjson_is_sint(yyjson_val *val) { + return val ? unsafe_yyjson_is_sint(val) : false; +} + +yyjson_api_inline bool yyjson_is_int(yyjson_val *val) { + return val ? unsafe_yyjson_is_int(val) : false; +} + +yyjson_api_inline bool yyjson_is_real(yyjson_val *val) { + return val ? unsafe_yyjson_is_real(val) : false; +} + +yyjson_api_inline bool yyjson_is_num(yyjson_val *val) { + return val ? unsafe_yyjson_is_num(val) : false; +} + +yyjson_api_inline bool yyjson_is_str(yyjson_val *val) { + return val ? unsafe_yyjson_is_str(val) : false; +} + +yyjson_api_inline bool yyjson_is_arr(yyjson_val *val) { + return val ? unsafe_yyjson_is_arr(val) : false; +} + +yyjson_api_inline bool yyjson_is_obj(yyjson_val *val) { + return val ? unsafe_yyjson_is_obj(val) : false; +} + +yyjson_api_inline bool yyjson_is_ctn(yyjson_val *val) { + return val ? unsafe_yyjson_is_ctn(val) : false; +} + + + +/*============================================================================== + * JSON Value Content API (Implementation) + *============================================================================*/ + +yyjson_api_inline yyjson_type yyjson_get_type(yyjson_val *val) { + return val ? unsafe_yyjson_get_type(val) : YYJSON_TYPE_NONE; +} + +yyjson_api_inline yyjson_subtype yyjson_get_subtype(yyjson_val *val) { + return val ? unsafe_yyjson_get_subtype(val) : YYJSON_SUBTYPE_NONE; +} + +yyjson_api_inline uint8_t yyjson_get_tag(yyjson_val *val) { + return val ? unsafe_yyjson_get_tag(val) : 0; +} + +yyjson_api_inline const char *yyjson_get_type_desc(yyjson_val *val) { + switch (yyjson_get_tag(val)) { + case YYJSON_TYPE_RAW | YYJSON_SUBTYPE_NONE: return "raw"; + case YYJSON_TYPE_NULL | YYJSON_SUBTYPE_NONE: return "null"; + case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NONE: return "string"; + case YYJSON_TYPE_STR | YYJSON_SUBTYPE_NOESC: return "string"; + case YYJSON_TYPE_ARR | YYJSON_SUBTYPE_NONE: return "array"; + case YYJSON_TYPE_OBJ | YYJSON_SUBTYPE_NONE: return "object"; + case YYJSON_TYPE_BOOL | YYJSON_SUBTYPE_TRUE: return "true"; + case YYJSON_TYPE_BOOL | YYJSON_SUBTYPE_FALSE: return "false"; + case YYJSON_TYPE_NUM | YYJSON_SUBTYPE_UINT: return "uint"; + case YYJSON_TYPE_NUM | YYJSON_SUBTYPE_SINT: return "sint"; + case YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL: return "real"; + default: return "unknown"; + } +} + +yyjson_api_inline const char *yyjson_get_raw(yyjson_val *val) { + return yyjson_is_raw(val) ? unsafe_yyjson_get_raw(val) : NULL; +} + +yyjson_api_inline bool yyjson_get_bool(yyjson_val *val) { + return yyjson_is_bool(val) ? unsafe_yyjson_get_bool(val) : false; +} + +yyjson_api_inline uint64_t yyjson_get_uint(yyjson_val *val) { + return yyjson_is_int(val) ? unsafe_yyjson_get_uint(val) : 0; +} + +yyjson_api_inline int64_t yyjson_get_sint(yyjson_val *val) { + return yyjson_is_int(val) ? unsafe_yyjson_get_sint(val) : 0; +} + +yyjson_api_inline int yyjson_get_int(yyjson_val *val) { + return yyjson_is_int(val) ? unsafe_yyjson_get_int(val) : 0; +} + +yyjson_api_inline double yyjson_get_real(yyjson_val *val) { + return yyjson_is_real(val) ? unsafe_yyjson_get_real(val) : 0.0; +} + +yyjson_api_inline double yyjson_get_num(yyjson_val *val) { + return val ? unsafe_yyjson_get_num(val) : 0.0; +} + +yyjson_api_inline const char *yyjson_get_str(yyjson_val *val) { + return yyjson_is_str(val) ? unsafe_yyjson_get_str(val) : NULL; +} + +yyjson_api_inline size_t yyjson_get_len(yyjson_val *val) { + return val ? unsafe_yyjson_get_len(val) : 0; +} + +yyjson_api_inline bool yyjson_equals_str(yyjson_val *val, const char *str) { + if (yyjson_likely(val && str)) { + return unsafe_yyjson_is_str(val) && + unsafe_yyjson_equals_str(val, str); + } + return false; +} + +yyjson_api_inline bool yyjson_equals_strn(yyjson_val *val, const char *str, + size_t len) { + if (yyjson_likely(val && str)) { + return unsafe_yyjson_is_str(val) && + unsafe_yyjson_equals_strn(val, str, len); + } + return false; +} + +yyjson_api bool unsafe_yyjson_equals(yyjson_val *lhs, yyjson_val *rhs); + +yyjson_api_inline bool yyjson_equals(yyjson_val *lhs, yyjson_val *rhs) { + if (yyjson_unlikely(!lhs || !rhs)) return false; + return unsafe_yyjson_equals(lhs, rhs); +} + +yyjson_api_inline bool yyjson_set_raw(yyjson_val *val, + const char *raw, size_t len) { + if (yyjson_unlikely(!val || unsafe_yyjson_is_ctn(val))) return false; + unsafe_yyjson_set_raw(val, raw, len); + return true; +} + +yyjson_api_inline bool yyjson_set_null(yyjson_val *val) { + if (yyjson_unlikely(!val || unsafe_yyjson_is_ctn(val))) return false; + unsafe_yyjson_set_null(val); + return true; +} + +yyjson_api_inline bool yyjson_set_bool(yyjson_val *val, bool num) { + if (yyjson_unlikely(!val || unsafe_yyjson_is_ctn(val))) return false; + unsafe_yyjson_set_bool(val, num); + return true; +} + +yyjson_api_inline bool yyjson_set_uint(yyjson_val *val, uint64_t num) { + if (yyjson_unlikely(!val || unsafe_yyjson_is_ctn(val))) return false; + unsafe_yyjson_set_uint(val, num); + return true; +} + +yyjson_api_inline bool yyjson_set_sint(yyjson_val *val, int64_t num) { + if (yyjson_unlikely(!val || unsafe_yyjson_is_ctn(val))) return false; + unsafe_yyjson_set_sint(val, num); + return true; +} + +yyjson_api_inline bool yyjson_set_int(yyjson_val *val, int num) { + if (yyjson_unlikely(!val || unsafe_yyjson_is_ctn(val))) return false; + unsafe_yyjson_set_sint(val, (int64_t)num); + return true; +} + +yyjson_api_inline bool yyjson_set_real(yyjson_val *val, double num) { + if (yyjson_unlikely(!val || unsafe_yyjson_is_ctn(val))) return false; + unsafe_yyjson_set_real(val, num); + return true; +} + +yyjson_api_inline bool yyjson_set_str(yyjson_val *val, const char *str) { + if (yyjson_unlikely(!val || unsafe_yyjson_is_ctn(val))) return false; + if (yyjson_unlikely(!str)) return false; + unsafe_yyjson_set_str(val, str); + return true; +} + +yyjson_api_inline bool yyjson_set_strn(yyjson_val *val, + const char *str, size_t len) { + if (yyjson_unlikely(!val || unsafe_yyjson_is_ctn(val))) return false; + if (yyjson_unlikely(!str)) return false; + unsafe_yyjson_set_strn(val, str, len); + return true; +} + + + +/*============================================================================== + * JSON Array API (Implementation) + *============================================================================*/ + +yyjson_api_inline size_t yyjson_arr_size(yyjson_val *arr) { + return yyjson_is_arr(arr) ? unsafe_yyjson_get_len(arr) : 0; +} + +yyjson_api_inline yyjson_val *yyjson_arr_get(yyjson_val *arr, size_t idx) { + if (yyjson_likely(yyjson_is_arr(arr))) { + if (yyjson_likely(unsafe_yyjson_get_len(arr) > idx)) { + yyjson_val *val = unsafe_yyjson_get_first(arr); + if (unsafe_yyjson_arr_is_flat(arr)) { + return val + idx; + } else { + while (idx-- > 0) val = unsafe_yyjson_get_next(val); + return val; + } + } + } + return NULL; +} + +yyjson_api_inline yyjson_val *yyjson_arr_get_first(yyjson_val *arr) { + if (yyjson_likely(yyjson_is_arr(arr))) { + if (yyjson_likely(unsafe_yyjson_get_len(arr) > 0)) { + return unsafe_yyjson_get_first(arr); + } + } + return NULL; +} + +yyjson_api_inline yyjson_val *yyjson_arr_get_last(yyjson_val *arr) { + if (yyjson_likely(yyjson_is_arr(arr))) { + size_t len = unsafe_yyjson_get_len(arr); + if (yyjson_likely(len > 0)) { + yyjson_val *val = unsafe_yyjson_get_first(arr); + if (unsafe_yyjson_arr_is_flat(arr)) { + return val + (len - 1); + } else { + while (len-- > 1) val = unsafe_yyjson_get_next(val); + return val; + } + } + } + return NULL; +} + + + +/*============================================================================== + * JSON Array Iterator API (Implementation) + *============================================================================*/ + +yyjson_api_inline bool yyjson_arr_iter_init(yyjson_val *arr, + yyjson_arr_iter *iter) { + if (yyjson_likely(yyjson_is_arr(arr) && iter)) { + iter->idx = 0; + iter->max = unsafe_yyjson_get_len(arr); + iter->cur = unsafe_yyjson_get_first(arr); + return true; + } + if (iter) memset(iter, 0, sizeof(yyjson_arr_iter)); + return false; +} + +yyjson_api_inline yyjson_arr_iter yyjson_arr_iter_with(yyjson_val *arr) { + yyjson_arr_iter iter; + yyjson_arr_iter_init(arr, &iter); + return iter; +} + +yyjson_api_inline bool yyjson_arr_iter_has_next(yyjson_arr_iter *iter) { + return iter ? iter->idx < iter->max : false; +} + +yyjson_api_inline yyjson_val *yyjson_arr_iter_next(yyjson_arr_iter *iter) { + yyjson_val *val; + if (iter && iter->idx < iter->max) { + val = iter->cur; + iter->cur = unsafe_yyjson_get_next(val); + iter->idx++; + return val; + } + return NULL; +} + + + +/*============================================================================== + * JSON Object API (Implementation) + *============================================================================*/ + +yyjson_api_inline size_t yyjson_obj_size(yyjson_val *obj) { + return yyjson_is_obj(obj) ? unsafe_yyjson_get_len(obj) : 0; +} + +yyjson_api_inline yyjson_val *yyjson_obj_get(yyjson_val *obj, + const char *key) { + return yyjson_obj_getn(obj, key, key ? strlen(key) : 0); +} + +yyjson_api_inline yyjson_val *yyjson_obj_getn(yyjson_val *obj, + const char *_key, + size_t key_len) { + if (yyjson_likely(yyjson_is_obj(obj) && _key)) { + size_t len = unsafe_yyjson_get_len(obj); + yyjson_val *key = unsafe_yyjson_get_first(obj); + while (len-- > 0) { + if (unsafe_yyjson_equals_strn(key, _key, key_len)) return key + 1; + key = unsafe_yyjson_get_next(key + 1); + } + } + return NULL; +} + + + +/*============================================================================== + * JSON Object Iterator API (Implementation) + *============================================================================*/ + +yyjson_api_inline bool yyjson_obj_iter_init(yyjson_val *obj, + yyjson_obj_iter *iter) { + if (yyjson_likely(yyjson_is_obj(obj) && iter)) { + iter->idx = 0; + iter->max = unsafe_yyjson_get_len(obj); + iter->cur = unsafe_yyjson_get_first(obj); + iter->obj = obj; + return true; + } + if (iter) memset(iter, 0, sizeof(yyjson_obj_iter)); + return false; +} + +yyjson_api_inline yyjson_obj_iter yyjson_obj_iter_with(yyjson_val *obj) { + yyjson_obj_iter iter; + yyjson_obj_iter_init(obj, &iter); + return iter; +} + +yyjson_api_inline bool yyjson_obj_iter_has_next(yyjson_obj_iter *iter) { + return iter ? iter->idx < iter->max : false; +} + +yyjson_api_inline yyjson_val *yyjson_obj_iter_next(yyjson_obj_iter *iter) { + if (iter && iter->idx < iter->max) { + yyjson_val *key = iter->cur; + iter->idx++; + iter->cur = unsafe_yyjson_get_next(key + 1); + return key; + } + return NULL; +} + +yyjson_api_inline yyjson_val *yyjson_obj_iter_get_val(yyjson_val *key) { + return key ? key + 1 : NULL; +} + +yyjson_api_inline yyjson_val *yyjson_obj_iter_get(yyjson_obj_iter *iter, + const char *key) { + return yyjson_obj_iter_getn(iter, key, key ? strlen(key) : 0); +} + +yyjson_api_inline yyjson_val *yyjson_obj_iter_getn(yyjson_obj_iter *iter, + const char *key, + size_t key_len) { + if (iter && key) { + size_t idx = iter->idx; + size_t max = iter->max; + yyjson_val *cur = iter->cur; + if (yyjson_unlikely(idx == max)) { + idx = 0; + cur = unsafe_yyjson_get_first(iter->obj); + } + while (idx++ < max) { + yyjson_val *next = unsafe_yyjson_get_next(cur + 1); + if (unsafe_yyjson_equals_strn(cur, key, key_len)) { + iter->idx = idx; + iter->cur = next; + return cur + 1; + } + cur = next; + if (idx == iter->max && iter->idx < iter->max) { + idx = 0; + max = iter->idx; + cur = unsafe_yyjson_get_first(iter->obj); + } + } + } + return NULL; +} + + + +/*============================================================================== + * Mutable JSON Structure (Implementation) + *============================================================================*/ + +/** + Mutable JSON value, 24 bytes. + The 'tag' and 'uni' field is same as immutable value. + The 'next' field links all elements inside the container to be a cycle. + */ +struct yyjson_mut_val { + uint64_t tag; /**< type, subtype and length */ + yyjson_val_uni uni; /**< payload */ + yyjson_mut_val *next; /**< the next value in circular linked list */ +}; + +/** + A memory chunk in string memory pool. + */ +typedef struct yyjson_str_chunk { + struct yyjson_str_chunk *next; /* next chunk linked list */ + size_t chunk_size; /* chunk size in bytes */ + /* char str[]; flexible array member */ +} yyjson_str_chunk; + +/** + A memory pool to hold all strings in a mutable document. + */ +typedef struct yyjson_str_pool { + char *cur; /* cursor inside current chunk */ + char *end; /* the end of current chunk */ + size_t chunk_size; /* chunk size in bytes while creating new chunk */ + size_t chunk_size_max; /* maximum chunk size in bytes */ + yyjson_str_chunk *chunks; /* a linked list of chunks, nullable */ +} yyjson_str_pool; + +/** + A memory chunk in value memory pool. + `sizeof(yyjson_val_chunk)` should not larger than `sizeof(yyjson_mut_val)`. + */ +typedef struct yyjson_val_chunk { + struct yyjson_val_chunk *next; /* next chunk linked list */ + size_t chunk_size; /* chunk size in bytes */ + /* char pad[sizeof(yyjson_mut_val) - sizeof(yyjson_val_chunk)]; padding */ + /* yyjson_mut_val vals[]; flexible array member */ +} yyjson_val_chunk; + +/** + A memory pool to hold all values in a mutable document. + */ +typedef struct yyjson_val_pool { + yyjson_mut_val *cur; /* cursor inside current chunk */ + yyjson_mut_val *end; /* the end of current chunk */ + size_t chunk_size; /* chunk size in bytes while creating new chunk */ + size_t chunk_size_max; /* maximum chunk size in bytes */ + yyjson_val_chunk *chunks; /* a linked list of chunks, nullable */ +} yyjson_val_pool; + +struct yyjson_mut_doc { + yyjson_mut_val *root; /**< root value of the JSON document, nullable */ + yyjson_alc alc; /**< a valid allocator, nonnull */ + yyjson_str_pool str_pool; /**< string memory pool */ + yyjson_val_pool val_pool; /**< value memory pool */ +}; + +/* Ensures the capacity to at least equal to the specified byte length. */ +yyjson_api bool unsafe_yyjson_str_pool_grow(yyjson_str_pool *pool, + const yyjson_alc *alc, + size_t len); + +/* Ensures the capacity to at least equal to the specified value count. */ +yyjson_api bool unsafe_yyjson_val_pool_grow(yyjson_val_pool *pool, + const yyjson_alc *alc, + size_t count); + +/* Allocate memory for string. */ +yyjson_api_inline char *unsafe_yyjson_mut_str_alc(yyjson_mut_doc *doc, + size_t len) { + char *mem; + const yyjson_alc *alc = &doc->alc; + yyjson_str_pool *pool = &doc->str_pool; + if (yyjson_unlikely((size_t)(pool->end - pool->cur) <= len)) { + if (yyjson_unlikely(!unsafe_yyjson_str_pool_grow(pool, alc, len + 1))) { + return NULL; + } + } + mem = pool->cur; + pool->cur = mem + len + 1; + return mem; +} + +yyjson_api_inline char *unsafe_yyjson_mut_strncpy(yyjson_mut_doc *doc, + const char *str, size_t len) { + char *mem = unsafe_yyjson_mut_str_alc(doc, len); + if (yyjson_unlikely(!mem)) return NULL; + memcpy((void *)mem, (const void *)str, len); + mem[len] = '\0'; + return mem; +} + +yyjson_api_inline yyjson_mut_val *unsafe_yyjson_mut_val(yyjson_mut_doc *doc, + size_t count) { + yyjson_mut_val *val; + yyjson_alc *alc = &doc->alc; + yyjson_val_pool *pool = &doc->val_pool; + if (yyjson_unlikely((size_t)(pool->end - pool->cur) < count)) { + if (yyjson_unlikely(!unsafe_yyjson_val_pool_grow(pool, alc, count))) { + return NULL; + } + } + val = pool->cur; + pool->cur += count; + return val; +} + + + +/*============================================================================== + * Mutable JSON Document API (Implementation) + *============================================================================*/ + +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_get_root(yyjson_mut_doc *doc) { + return doc ? doc->root : NULL; +} + +yyjson_api_inline void yyjson_mut_doc_set_root(yyjson_mut_doc *doc, + yyjson_mut_val *root) { + if (doc) doc->root = root; +} + + + +/*============================================================================== + * Mutable JSON Value Type API (Implementation) + *============================================================================*/ + +yyjson_api_inline bool yyjson_mut_is_raw(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_raw(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_null(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_null(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_true(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_true(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_false(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_false(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_bool(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_bool(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_uint(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_uint(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_sint(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_sint(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_int(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_int(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_real(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_real(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_num(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_num(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_str(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_str(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_arr(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_arr(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_obj(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_obj(val) : false; +} + +yyjson_api_inline bool yyjson_mut_is_ctn(yyjson_mut_val *val) { + return val ? unsafe_yyjson_is_ctn(val) : false; +} + + + +/*============================================================================== + * Mutable JSON Value Content API (Implementation) + *============================================================================*/ + +yyjson_api_inline yyjson_type yyjson_mut_get_type(yyjson_mut_val *val) { + return yyjson_get_type((yyjson_val *)val); +} + +yyjson_api_inline yyjson_subtype yyjson_mut_get_subtype(yyjson_mut_val *val) { + return yyjson_get_subtype((yyjson_val *)val); +} + +yyjson_api_inline uint8_t yyjson_mut_get_tag(yyjson_mut_val *val) { + return yyjson_get_tag((yyjson_val *)val); +} + +yyjson_api_inline const char *yyjson_mut_get_type_desc(yyjson_mut_val *val) { + return yyjson_get_type_desc((yyjson_val *)val); +} + +yyjson_api_inline const char *yyjson_mut_get_raw(yyjson_mut_val *val) { + return yyjson_get_raw((yyjson_val *)val); +} + +yyjson_api_inline bool yyjson_mut_get_bool(yyjson_mut_val *val) { + return yyjson_get_bool((yyjson_val *)val); +} + +yyjson_api_inline uint64_t yyjson_mut_get_uint(yyjson_mut_val *val) { + return yyjson_get_uint((yyjson_val *)val); +} + +yyjson_api_inline int64_t yyjson_mut_get_sint(yyjson_mut_val *val) { + return yyjson_get_sint((yyjson_val *)val); +} + +yyjson_api_inline int yyjson_mut_get_int(yyjson_mut_val *val) { + return yyjson_get_int((yyjson_val *)val); +} + +yyjson_api_inline double yyjson_mut_get_real(yyjson_mut_val *val) { + return yyjson_get_real((yyjson_val *)val); +} + +yyjson_api_inline double yyjson_mut_get_num(yyjson_mut_val *val) { + return yyjson_get_num((yyjson_val *)val); +} + +yyjson_api_inline const char *yyjson_mut_get_str(yyjson_mut_val *val) { + return yyjson_get_str((yyjson_val *)val); +} + +yyjson_api_inline size_t yyjson_mut_get_len(yyjson_mut_val *val) { + return yyjson_get_len((yyjson_val *)val); +} + +yyjson_api_inline bool yyjson_mut_equals_str(yyjson_mut_val *val, + const char *str) { + return yyjson_equals_str((yyjson_val *)val, str); +} + +yyjson_api_inline bool yyjson_mut_equals_strn(yyjson_mut_val *val, + const char *str, size_t len) { + return yyjson_equals_strn((yyjson_val *)val, str, len); +} + +yyjson_api bool unsafe_yyjson_mut_equals(yyjson_mut_val *lhs, + yyjson_mut_val *rhs); + +yyjson_api_inline bool yyjson_mut_equals(yyjson_mut_val *lhs, + yyjson_mut_val *rhs) { + if (yyjson_unlikely(!lhs || !rhs)) return false; + return unsafe_yyjson_mut_equals(lhs, rhs); +} + +yyjson_api_inline bool yyjson_mut_set_raw(yyjson_mut_val *val, + const char *raw, size_t len) { + if (yyjson_unlikely(!val || !raw)) return false; + unsafe_yyjson_set_raw(val, raw, len); + return true; +} + +yyjson_api_inline bool yyjson_mut_set_null(yyjson_mut_val *val) { + if (yyjson_unlikely(!val)) return false; + unsafe_yyjson_set_null(val); + return true; +} + +yyjson_api_inline bool yyjson_mut_set_bool(yyjson_mut_val *val, bool num) { + if (yyjson_unlikely(!val)) return false; + unsafe_yyjson_set_bool(val, num); + return true; +} + +yyjson_api_inline bool yyjson_mut_set_uint(yyjson_mut_val *val, uint64_t num) { + if (yyjson_unlikely(!val)) return false; + unsafe_yyjson_set_uint(val, num); + return true; +} + +yyjson_api_inline bool yyjson_mut_set_sint(yyjson_mut_val *val, int64_t num) { + if (yyjson_unlikely(!val)) return false; + unsafe_yyjson_set_sint(val, num); + return true; +} + +yyjson_api_inline bool yyjson_mut_set_int(yyjson_mut_val *val, int num) { + if (yyjson_unlikely(!val)) return false; + unsafe_yyjson_set_sint(val, (int64_t)num); + return true; +} + +yyjson_api_inline bool yyjson_mut_set_real(yyjson_mut_val *val, double num) { + if (yyjson_unlikely(!val)) return false; + unsafe_yyjson_set_real(val, num); + return true; +} + +yyjson_api_inline bool yyjson_mut_set_str(yyjson_mut_val *val, + const char *str) { + if (yyjson_unlikely(!val || !str)) return false; + unsafe_yyjson_set_str(val, str); + return true; +} + +yyjson_api_inline bool yyjson_mut_set_strn(yyjson_mut_val *val, + const char *str, size_t len) { + if (yyjson_unlikely(!val || !str)) return false; + unsafe_yyjson_set_strn(val, str, len); + return true; +} + +yyjson_api_inline bool yyjson_mut_set_arr(yyjson_mut_val *val) { + if (yyjson_unlikely(!val)) return false; + unsafe_yyjson_set_arr(val, 0); + return true; +} + +yyjson_api_inline bool yyjson_mut_set_obj(yyjson_mut_val *val) { + if (yyjson_unlikely(!val)) return false; + unsafe_yyjson_set_obj(val, 0); + return true; +} + + + +/*============================================================================== + * Mutable JSON Value Creation API (Implementation) + *============================================================================*/ + +yyjson_api_inline yyjson_mut_val *yyjson_mut_raw(yyjson_mut_doc *doc, + const char *str) { + if (yyjson_likely(str)) return yyjson_mut_rawn(doc, str, strlen(str)); + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_rawn(yyjson_mut_doc *doc, + const char *str, + size_t len) { + if (yyjson_likely(doc && str)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = ((uint64_t)len << YYJSON_TAG_BIT) | YYJSON_TYPE_RAW; + val->uni.str = str; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_rawcpy(yyjson_mut_doc *doc, + const char *str) { + if (yyjson_likely(str)) return yyjson_mut_rawncpy(doc, str, strlen(str)); + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_rawncpy(yyjson_mut_doc *doc, + const char *str, + size_t len) { + if (yyjson_likely(doc && str)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + char *new_str = unsafe_yyjson_mut_strncpy(doc, str, len); + if (yyjson_likely(val && new_str)) { + val->tag = ((uint64_t)len << YYJSON_TAG_BIT) | YYJSON_TYPE_RAW; + val->uni.str = new_str; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_null(yyjson_mut_doc *doc) { + if (yyjson_likely(doc)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = YYJSON_TYPE_NULL | YYJSON_SUBTYPE_NONE; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_true(yyjson_mut_doc *doc) { + if (yyjson_likely(doc)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = YYJSON_TYPE_BOOL | YYJSON_SUBTYPE_TRUE; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_false(yyjson_mut_doc *doc) { + if (yyjson_likely(doc)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = YYJSON_TYPE_BOOL | YYJSON_SUBTYPE_FALSE; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_bool(yyjson_mut_doc *doc, + bool _val) { + if (yyjson_likely(doc)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + _val = !!_val; + val->tag = YYJSON_TYPE_BOOL | (uint8_t)((uint8_t)_val << 3); + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_uint(yyjson_mut_doc *doc, + uint64_t num) { + if (yyjson_likely(doc)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_UINT; + val->uni.u64 = num; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_sint(yyjson_mut_doc *doc, + int64_t num) { + if (yyjson_likely(doc)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_SINT; + val->uni.i64 = num; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_int(yyjson_mut_doc *doc, + int64_t num) { + return yyjson_mut_sint(doc, num); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_real(yyjson_mut_doc *doc, + double num) { + if (yyjson_likely(doc)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; + val->uni.f64 = num; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_str(yyjson_mut_doc *doc, + const char *str) { + if (yyjson_likely(doc && str)) { + size_t len = strlen(str); + bool noesc = unsafe_yyjson_is_str_noesc(str, len); + yyjson_subtype sub = noesc ? YYJSON_SUBTYPE_NOESC : YYJSON_SUBTYPE_NONE; + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = ((uint64_t)len << YYJSON_TAG_BIT) | + (uint64_t)(YYJSON_TYPE_STR | sub); + val->uni.str = str; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_strn(yyjson_mut_doc *doc, + const char *str, + size_t len) { + if (yyjson_likely(doc && str)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = ((uint64_t)len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->uni.str = str; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_strcpy(yyjson_mut_doc *doc, + const char *str) { + if (yyjson_likely(doc && str)) { + size_t len = strlen(str); + bool noesc = unsafe_yyjson_is_str_noesc(str, len); + yyjson_subtype sub = noesc ? YYJSON_SUBTYPE_NOESC : YYJSON_SUBTYPE_NONE; + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + char *new_str = unsafe_yyjson_mut_strncpy(doc, str, len); + if (yyjson_likely(val && new_str)) { + val->tag = ((uint64_t)len << YYJSON_TAG_BIT) | + (uint64_t)(YYJSON_TYPE_STR | sub); + val->uni.str = new_str; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_strncpy(yyjson_mut_doc *doc, + const char *str, + size_t len) { + if (yyjson_likely(doc && str)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + char *new_str = unsafe_yyjson_mut_strncpy(doc, str, len); + if (yyjson_likely(val && new_str)) { + val->tag = ((uint64_t)len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->uni.str = new_str; + return val; + } + } + return NULL; +} + + + +/*============================================================================== + * Mutable JSON Array API (Implementation) + *============================================================================*/ + +yyjson_api_inline size_t yyjson_mut_arr_size(yyjson_mut_val *arr) { + return yyjson_mut_is_arr(arr) ? unsafe_yyjson_get_len(arr) : 0; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_get(yyjson_mut_val *arr, + size_t idx) { + if (yyjson_likely(idx < yyjson_mut_arr_size(arr))) { + yyjson_mut_val *val = (yyjson_mut_val *)arr->uni.ptr; + while (idx-- > 0) val = val->next; + return val->next; + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_get_first( + yyjson_mut_val *arr) { + if (yyjson_likely(yyjson_mut_arr_size(arr) > 0)) { + return ((yyjson_mut_val *)arr->uni.ptr)->next; + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_get_last( + yyjson_mut_val *arr) { + if (yyjson_likely(yyjson_mut_arr_size(arr) > 0)) { + return ((yyjson_mut_val *)arr->uni.ptr); + } + return NULL; +} + + + +/*============================================================================== + * Mutable JSON Array Iterator API (Implementation) + *============================================================================*/ + +yyjson_api_inline bool yyjson_mut_arr_iter_init(yyjson_mut_val *arr, + yyjson_mut_arr_iter *iter) { + if (yyjson_likely(yyjson_mut_is_arr(arr) && iter)) { + iter->idx = 0; + iter->max = unsafe_yyjson_get_len(arr); + iter->cur = iter->max ? (yyjson_mut_val *)arr->uni.ptr : NULL; + iter->pre = NULL; + iter->arr = arr; + return true; + } + if (iter) memset(iter, 0, sizeof(yyjson_mut_arr_iter)); + return false; +} + +yyjson_api_inline yyjson_mut_arr_iter yyjson_mut_arr_iter_with( + yyjson_mut_val *arr) { + yyjson_mut_arr_iter iter; + yyjson_mut_arr_iter_init(arr, &iter); + return iter; +} + +yyjson_api_inline bool yyjson_mut_arr_iter_has_next(yyjson_mut_arr_iter *iter) { + return iter ? iter->idx < iter->max : false; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_iter_next( + yyjson_mut_arr_iter *iter) { + if (iter && iter->idx < iter->max) { + yyjson_mut_val *val = iter->cur; + iter->pre = val; + iter->cur = val->next; + iter->idx++; + return iter->cur; + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_iter_remove( + yyjson_mut_arr_iter *iter) { + if (yyjson_likely(iter && 0 < iter->idx && iter->idx <= iter->max)) { + yyjson_mut_val *prev = iter->pre; + yyjson_mut_val *cur = iter->cur; + yyjson_mut_val *next = cur->next; + if (yyjson_unlikely(iter->idx == iter->max)) iter->arr->uni.ptr = prev; + iter->idx--; + iter->max--; + unsafe_yyjson_set_len(iter->arr, iter->max); + prev->next = next; + iter->cur = next; + return cur; + } + return NULL; +} + + + +/*============================================================================== + * Mutable JSON Array Creation API (Implementation) + *============================================================================*/ + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr(yyjson_mut_doc *doc) { + if (yyjson_likely(doc)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = YYJSON_TYPE_ARR | YYJSON_SUBTYPE_NONE; + return val; + } + } + return NULL; +} + +#define yyjson_mut_arr_with_func(func) \ + if (yyjson_likely(doc && ((0 < count && count < \ + (~(size_t)0) / sizeof(yyjson_mut_val) && vals) || count == 0))) { \ + yyjson_mut_val *arr = unsafe_yyjson_mut_val(doc, 1 + count); \ + if (yyjson_likely(arr)) { \ + arr->tag = ((uint64_t)count << YYJSON_TAG_BIT) | YYJSON_TYPE_ARR; \ + if (count > 0) { \ + size_t i; \ + for (i = 0; i < count; i++) { \ + yyjson_mut_val *val = arr + i + 1; \ + func \ + val->next = val + 1; \ + } \ + arr[count].next = arr + 1; \ + arr->uni.ptr = arr + count; \ + } \ + return arr; \ + } \ + } \ + return NULL + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_bool( + yyjson_mut_doc *doc, const bool *vals, size_t count) { + yyjson_mut_arr_with_func({ + bool _val = !!vals[i]; + val->tag = YYJSON_TYPE_BOOL | (uint8_t)((uint8_t)_val << 3); + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_sint( + yyjson_mut_doc *doc, const int64_t *vals, size_t count) { + return yyjson_mut_arr_with_sint64(doc, vals, count); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_uint( + yyjson_mut_doc *doc, const uint64_t *vals, size_t count) { + return yyjson_mut_arr_with_uint64(doc, vals, count); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_real( + yyjson_mut_doc *doc, const double *vals, size_t count) { + return yyjson_mut_arr_with_double(doc, vals, count); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_sint8( + yyjson_mut_doc *doc, const int8_t *vals, size_t count) { + yyjson_mut_arr_with_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_SINT; + val->uni.i64 = (int64_t)vals[i]; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_sint16( + yyjson_mut_doc *doc, const int16_t *vals, size_t count) { + yyjson_mut_arr_with_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_SINT; + val->uni.i64 = vals[i]; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_sint32( + yyjson_mut_doc *doc, const int32_t *vals, size_t count) { + yyjson_mut_arr_with_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_SINT; + val->uni.i64 = vals[i]; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_sint64( + yyjson_mut_doc *doc, const int64_t *vals, size_t count) { + yyjson_mut_arr_with_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_SINT; + val->uni.i64 = vals[i]; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_uint8( + yyjson_mut_doc *doc, const uint8_t *vals, size_t count) { + yyjson_mut_arr_with_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_UINT; + val->uni.u64 = vals[i]; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_uint16( + yyjson_mut_doc *doc, const uint16_t *vals, size_t count) { + yyjson_mut_arr_with_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_UINT; + val->uni.u64 = vals[i]; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_uint32( + yyjson_mut_doc *doc, const uint32_t *vals, size_t count) { + yyjson_mut_arr_with_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_UINT; + val->uni.u64 = vals[i]; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_uint64( + yyjson_mut_doc *doc, const uint64_t *vals, size_t count) { + yyjson_mut_arr_with_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_UINT; + val->uni.u64 = vals[i]; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_float( + yyjson_mut_doc *doc, const float *vals, size_t count) { + yyjson_mut_arr_with_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; + val->uni.f64 = (double)vals[i]; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_double( + yyjson_mut_doc *doc, const double *vals, size_t count) { + yyjson_mut_arr_with_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; + val->uni.f64 = vals[i]; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_str( + yyjson_mut_doc *doc, const char **vals, size_t count) { + yyjson_mut_arr_with_func({ + uint64_t len = (uint64_t)strlen(vals[i]); + val->tag = (len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->uni.str = vals[i]; + if (yyjson_unlikely(!val->uni.str)) return NULL; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_strn( + yyjson_mut_doc *doc, const char **vals, const size_t *lens, size_t count) { + if (yyjson_unlikely(count > 0 && !lens)) return NULL; + yyjson_mut_arr_with_func({ + val->tag = ((uint64_t)lens[i] << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->uni.str = vals[i]; + if (yyjson_unlikely(!val->uni.str)) return NULL; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_strcpy( + yyjson_mut_doc *doc, const char **vals, size_t count) { + size_t len; + const char *str; + yyjson_mut_arr_with_func({ + str = vals[i]; + if (!str) return NULL; + len = strlen(str); + val->tag = ((uint64_t)len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->uni.str = unsafe_yyjson_mut_strncpy(doc, str, len); + if (yyjson_unlikely(!val->uni.str)) return NULL; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_with_strncpy( + yyjson_mut_doc *doc, const char **vals, const size_t *lens, size_t count) { + size_t len; + const char *str; + if (yyjson_unlikely(count > 0 && !lens)) return NULL; + yyjson_mut_arr_with_func({ + str = vals[i]; + len = lens[i]; + val->tag = ((uint64_t)len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->uni.str = unsafe_yyjson_mut_strncpy(doc, str, len); + if (yyjson_unlikely(!val->uni.str)) return NULL; + }); +} + +#undef yyjson_mut_arr_with_func + + + +/*============================================================================== + * Mutable JSON Array Modification API (Implementation) + *============================================================================*/ + +yyjson_api_inline bool yyjson_mut_arr_insert(yyjson_mut_val *arr, + yyjson_mut_val *val, size_t idx) { + if (yyjson_likely(yyjson_mut_is_arr(arr) && val)) { + size_t len = unsafe_yyjson_get_len(arr); + if (yyjson_likely(idx <= len)) { + unsafe_yyjson_set_len(arr, len + 1); + if (len == 0) { + val->next = val; + arr->uni.ptr = val; + } else { + yyjson_mut_val *prev = ((yyjson_mut_val *)arr->uni.ptr); + yyjson_mut_val *next = prev->next; + if (idx == len) { + prev->next = val; + val->next = next; + arr->uni.ptr = val; + } else { + while (idx-- > 0) { + prev = next; + next = next->next; + } + prev->next = val; + val->next = next; + } + } + return true; + } + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_append(yyjson_mut_val *arr, + yyjson_mut_val *val) { + if (yyjson_likely(yyjson_mut_is_arr(arr) && val)) { + size_t len = unsafe_yyjson_get_len(arr); + unsafe_yyjson_set_len(arr, len + 1); + if (len == 0) { + val->next = val; + } else { + yyjson_mut_val *prev = ((yyjson_mut_val *)arr->uni.ptr); + yyjson_mut_val *next = prev->next; + prev->next = val; + val->next = next; + } + arr->uni.ptr = val; + return true; + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_prepend(yyjson_mut_val *arr, + yyjson_mut_val *val) { + if (yyjson_likely(yyjson_mut_is_arr(arr) && val)) { + size_t len = unsafe_yyjson_get_len(arr); + unsafe_yyjson_set_len(arr, len + 1); + if (len == 0) { + val->next = val; + arr->uni.ptr = val; + } else { + yyjson_mut_val *prev = ((yyjson_mut_val *)arr->uni.ptr); + yyjson_mut_val *next = prev->next; + prev->next = val; + val->next = next; + } + return true; + } + return false; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_replace(yyjson_mut_val *arr, + size_t idx, + yyjson_mut_val *val) { + if (yyjson_likely(yyjson_mut_is_arr(arr) && val)) { + size_t len = unsafe_yyjson_get_len(arr); + if (yyjson_likely(idx < len)) { + if (yyjson_likely(len > 1)) { + yyjson_mut_val *prev = ((yyjson_mut_val *)arr->uni.ptr); + yyjson_mut_val *next = prev->next; + while (idx-- > 0) { + prev = next; + next = next->next; + } + prev->next = val; + val->next = next->next; + if ((void *)next == arr->uni.ptr) arr->uni.ptr = val; + return next; + } else { + yyjson_mut_val *prev = ((yyjson_mut_val *)arr->uni.ptr); + val->next = val; + arr->uni.ptr = val; + return prev; + } + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_remove(yyjson_mut_val *arr, + size_t idx) { + if (yyjson_likely(yyjson_mut_is_arr(arr))) { + size_t len = unsafe_yyjson_get_len(arr); + if (yyjson_likely(idx < len)) { + unsafe_yyjson_set_len(arr, len - 1); + if (yyjson_likely(len > 1)) { + yyjson_mut_val *prev = ((yyjson_mut_val *)arr->uni.ptr); + yyjson_mut_val *next = prev->next; + while (idx-- > 0) { + prev = next; + next = next->next; + } + prev->next = next->next; + if ((void *)next == arr->uni.ptr) arr->uni.ptr = prev; + return next; + } else { + return ((yyjson_mut_val *)arr->uni.ptr); + } + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_remove_first( + yyjson_mut_val *arr) { + if (yyjson_likely(yyjson_mut_is_arr(arr))) { + size_t len = unsafe_yyjson_get_len(arr); + if (len > 1) { + yyjson_mut_val *prev = ((yyjson_mut_val *)arr->uni.ptr); + yyjson_mut_val *next = prev->next; + prev->next = next->next; + unsafe_yyjson_set_len(arr, len - 1); + return next; + } else if (len == 1) { + yyjson_mut_val *prev = ((yyjson_mut_val *)arr->uni.ptr); + unsafe_yyjson_set_len(arr, 0); + return prev; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_remove_last( + yyjson_mut_val *arr) { + if (yyjson_likely(yyjson_mut_is_arr(arr))) { + size_t len = unsafe_yyjson_get_len(arr); + if (yyjson_likely(len > 1)) { + yyjson_mut_val *prev = ((yyjson_mut_val *)arr->uni.ptr); + yyjson_mut_val *next = prev->next; + unsafe_yyjson_set_len(arr, len - 1); + while (--len > 0) prev = prev->next; + prev->next = next; + next = (yyjson_mut_val *)arr->uni.ptr; + arr->uni.ptr = prev; + return next; + } else if (len == 1) { + yyjson_mut_val *prev = ((yyjson_mut_val *)arr->uni.ptr); + unsafe_yyjson_set_len(arr, 0); + return prev; + } + } + return NULL; +} + +yyjson_api_inline bool yyjson_mut_arr_remove_range(yyjson_mut_val *arr, + size_t _idx, size_t _len) { + if (yyjson_likely(yyjson_mut_is_arr(arr))) { + yyjson_mut_val *prev, *next; + bool tail_removed; + size_t len = unsafe_yyjson_get_len(arr); + if (yyjson_unlikely(_idx + _len > len)) return false; + if (yyjson_unlikely(_len == 0)) return true; + unsafe_yyjson_set_len(arr, len - _len); + if (yyjson_unlikely(len == _len)) return true; + tail_removed = (_idx + _len == len); + prev = ((yyjson_mut_val *)arr->uni.ptr); + while (_idx-- > 0) prev = prev->next; + next = prev->next; + while (_len-- > 0) next = next->next; + prev->next = next; + if (yyjson_unlikely(tail_removed)) arr->uni.ptr = prev; + return true; + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_clear(yyjson_mut_val *arr) { + if (yyjson_likely(yyjson_mut_is_arr(arr))) { + unsafe_yyjson_set_len(arr, 0); + return true; + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_rotate(yyjson_mut_val *arr, + size_t idx) { + if (yyjson_likely(yyjson_mut_is_arr(arr) && + unsafe_yyjson_get_len(arr) > idx)) { + yyjson_mut_val *val = (yyjson_mut_val *)arr->uni.ptr; + while (idx-- > 0) val = val->next; + arr->uni.ptr = (void *)val; + return true; + } + return false; +} + + + +/*============================================================================== + * Mutable JSON Array Modification Convenience API (Implementation) + *============================================================================*/ + +yyjson_api_inline bool yyjson_mut_arr_add_val(yyjson_mut_val *arr, + yyjson_mut_val *val) { + return yyjson_mut_arr_append(arr, val); +} + +yyjson_api_inline bool yyjson_mut_arr_add_null(yyjson_mut_doc *doc, + yyjson_mut_val *arr) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_null(doc); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_true(yyjson_mut_doc *doc, + yyjson_mut_val *arr) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_true(doc); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_false(yyjson_mut_doc *doc, + yyjson_mut_val *arr) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_false(doc); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_bool(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + bool _val) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_bool(doc, _val); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_uint(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + uint64_t num) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_uint(doc, num); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_sint(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + int64_t num) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_sint(doc, num); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_int(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + int64_t num) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_sint(doc, num); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_real(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + double num) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_real(doc, num); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_str(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + const char *str) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_str(doc, str); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_strn(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + const char *str, size_t len) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_strn(doc, str, len); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_strcpy(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + const char *str) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_strcpy(doc, str); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_arr_add_strncpy(yyjson_mut_doc *doc, + yyjson_mut_val *arr, + const char *str, size_t len) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_strncpy(doc, str, len); + return yyjson_mut_arr_append(arr, val); + } + return false; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_add_arr(yyjson_mut_doc *doc, + yyjson_mut_val *arr) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_arr(doc); + return yyjson_mut_arr_append(arr, val) ? val : NULL; + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_arr_add_obj(yyjson_mut_doc *doc, + yyjson_mut_val *arr) { + if (yyjson_likely(doc && yyjson_mut_is_arr(arr))) { + yyjson_mut_val *val = yyjson_mut_obj(doc); + return yyjson_mut_arr_append(arr, val) ? val : NULL; + } + return NULL; +} + + + +/*============================================================================== + * Mutable JSON Object API (Implementation) + *============================================================================*/ + +yyjson_api_inline size_t yyjson_mut_obj_size(yyjson_mut_val *obj) { + return yyjson_mut_is_obj(obj) ? unsafe_yyjson_get_len(obj) : 0; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_get(yyjson_mut_val *obj, + const char *key) { + return yyjson_mut_obj_getn(obj, key, key ? strlen(key) : 0); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_getn(yyjson_mut_val *obj, + const char *_key, + size_t key_len) { + size_t len = yyjson_mut_obj_size(obj); + if (yyjson_likely(len && _key)) { + yyjson_mut_val *key = ((yyjson_mut_val *)obj->uni.ptr)->next->next; + while (len-- > 0) { + if (unsafe_yyjson_equals_strn(key, _key, key_len)) return key->next; + key = key->next->next; + } + } + return NULL; +} + + + +/*============================================================================== + * Mutable JSON Object Iterator API (Implementation) + *============================================================================*/ + +yyjson_api_inline bool yyjson_mut_obj_iter_init(yyjson_mut_val *obj, + yyjson_mut_obj_iter *iter) { + if (yyjson_likely(yyjson_mut_is_obj(obj) && iter)) { + iter->idx = 0; + iter->max = unsafe_yyjson_get_len(obj); + iter->cur = iter->max ? (yyjson_mut_val *)obj->uni.ptr : NULL; + iter->pre = NULL; + iter->obj = obj; + return true; + } + if (iter) memset(iter, 0, sizeof(yyjson_mut_obj_iter)); + return false; +} + +yyjson_api_inline yyjson_mut_obj_iter yyjson_mut_obj_iter_with( + yyjson_mut_val *obj) { + yyjson_mut_obj_iter iter; + yyjson_mut_obj_iter_init(obj, &iter); + return iter; +} + +yyjson_api_inline bool yyjson_mut_obj_iter_has_next(yyjson_mut_obj_iter *iter) { + return iter ? iter->idx < iter->max : false; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_iter_next( + yyjson_mut_obj_iter *iter) { + if (iter && iter->idx < iter->max) { + yyjson_mut_val *key = iter->cur; + iter->pre = key; + iter->cur = key->next->next; + iter->idx++; + return iter->cur; + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_iter_get_val( + yyjson_mut_val *key) { + return key ? key->next : NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_iter_remove( + yyjson_mut_obj_iter *iter) { + if (yyjson_likely(iter && 0 < iter->idx && iter->idx <= iter->max)) { + yyjson_mut_val *prev = iter->pre; + yyjson_mut_val *cur = iter->cur; + yyjson_mut_val *next = cur->next->next; + if (yyjson_unlikely(iter->idx == iter->max)) iter->obj->uni.ptr = prev; + iter->idx--; + iter->max--; + unsafe_yyjson_set_len(iter->obj, iter->max); + prev->next->next = next; + iter->cur = prev; + return cur->next; + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_iter_get( + yyjson_mut_obj_iter *iter, const char *key) { + return yyjson_mut_obj_iter_getn(iter, key, key ? strlen(key) : 0); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_iter_getn( + yyjson_mut_obj_iter *iter, const char *key, size_t key_len) { + if (iter && key) { + size_t idx = 0; + size_t max = iter->max; + yyjson_mut_val *pre, *cur = iter->cur; + while (idx++ < max) { + pre = cur; + cur = cur->next->next; + if (unsafe_yyjson_equals_strn(cur, key, key_len)) { + iter->idx += idx; + if (iter->idx > max) iter->idx -= max + 1; + iter->pre = pre; + iter->cur = cur; + return cur->next; + } + } + } + return NULL; +} + + + +/*============================================================================== + * Mutable JSON Object Creation API (Implementation) + *============================================================================*/ + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj(yyjson_mut_doc *doc) { + if (yyjson_likely(doc)) { + yyjson_mut_val *val = unsafe_yyjson_mut_val(doc, 1); + if (yyjson_likely(val)) { + val->tag = YYJSON_TYPE_OBJ | YYJSON_SUBTYPE_NONE; + return val; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_with_str(yyjson_mut_doc *doc, + const char **keys, + const char **vals, + size_t count) { + if (yyjson_likely(doc && ((count > 0 && keys && vals) || (count == 0)))) { + yyjson_mut_val *obj = unsafe_yyjson_mut_val(doc, 1 + count * 2); + if (yyjson_likely(obj)) { + obj->tag = ((uint64_t)count << YYJSON_TAG_BIT) | YYJSON_TYPE_OBJ; + if (count > 0) { + size_t i; + for (i = 0; i < count; i++) { + yyjson_mut_val *key = obj + (i * 2 + 1); + yyjson_mut_val *val = obj + (i * 2 + 2); + uint64_t key_len = (uint64_t)strlen(keys[i]); + uint64_t val_len = (uint64_t)strlen(vals[i]); + key->tag = (key_len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->tag = (val_len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + key->uni.str = keys[i]; + val->uni.str = vals[i]; + key->next = val; + val->next = val + 1; + } + obj[count * 2].next = obj + 1; + obj->uni.ptr = obj + (count * 2 - 1); + } + return obj; + } + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_with_kv(yyjson_mut_doc *doc, + const char **pairs, + size_t count) { + if (yyjson_likely(doc && ((count > 0 && pairs) || (count == 0)))) { + yyjson_mut_val *obj = unsafe_yyjson_mut_val(doc, 1 + count * 2); + if (yyjson_likely(obj)) { + obj->tag = ((uint64_t)count << YYJSON_TAG_BIT) | YYJSON_TYPE_OBJ; + if (count > 0) { + size_t i; + for (i = 0; i < count; i++) { + yyjson_mut_val *key = obj + (i * 2 + 1); + yyjson_mut_val *val = obj + (i * 2 + 2); + const char *key_str = pairs[i * 2 + 0]; + const char *val_str = pairs[i * 2 + 1]; + uint64_t key_len = (uint64_t)strlen(key_str); + uint64_t val_len = (uint64_t)strlen(val_str); + key->tag = (key_len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->tag = (val_len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + key->uni.str = key_str; + val->uni.str = val_str; + key->next = val; + val->next = val + 1; + } + obj[count * 2].next = obj + 1; + obj->uni.ptr = obj + (count * 2 - 1); + } + return obj; + } + } + return NULL; +} + + + +/*============================================================================== + * Mutable JSON Object Modification API (Implementation) + *============================================================================*/ + +yyjson_api_inline void unsafe_yyjson_mut_obj_add(yyjson_mut_val *obj, + yyjson_mut_val *key, + yyjson_mut_val *val, + size_t len) { + if (yyjson_likely(len)) { + yyjson_mut_val *prev_val = ((yyjson_mut_val *)obj->uni.ptr)->next; + yyjson_mut_val *next_key = prev_val->next; + prev_val->next = key; + val->next = next_key; + } else { + val->next = key; + } + key->next = val; + obj->uni.ptr = (void *)key; + unsafe_yyjson_set_len(obj, len + 1); +} + +yyjson_api_inline yyjson_mut_val *unsafe_yyjson_mut_obj_remove( + yyjson_mut_val *obj, const char *key, size_t key_len) { + size_t obj_len = unsafe_yyjson_get_len(obj); + if (obj_len) { + yyjson_mut_val *pre_key = (yyjson_mut_val *)obj->uni.ptr; + yyjson_mut_val *cur_key = pre_key->next->next; + yyjson_mut_val *removed_item = NULL; + size_t i; + for (i = 0; i < obj_len; i++) { + if (unsafe_yyjson_equals_strn(cur_key, key, key_len)) { + if (!removed_item) removed_item = cur_key->next; + cur_key = cur_key->next->next; + pre_key->next->next = cur_key; + if (i + 1 == obj_len) obj->uni.ptr = pre_key; + i--; + obj_len--; + } else { + pre_key = cur_key; + cur_key = cur_key->next->next; + } + } + unsafe_yyjson_set_len(obj, obj_len); + return removed_item; + } else { + return NULL; + } +} + +yyjson_api_inline bool unsafe_yyjson_mut_obj_replace(yyjson_mut_val *obj, + yyjson_mut_val *key, + yyjson_mut_val *val) { + size_t key_len = unsafe_yyjson_get_len(key); + size_t obj_len = unsafe_yyjson_get_len(obj); + if (obj_len) { + yyjson_mut_val *pre_key = (yyjson_mut_val *)obj->uni.ptr; + yyjson_mut_val *cur_key = pre_key->next->next; + size_t i; + for (i = 0; i < obj_len; i++) { + if (unsafe_yyjson_equals_strn(cur_key, key->uni.str, key_len)) { + cur_key->next->tag = val->tag; + cur_key->next->uni.u64 = val->uni.u64; + return true; + } else { + cur_key = cur_key->next->next; + } + } + } + return false; +} + +yyjson_api_inline void unsafe_yyjson_mut_obj_rotate(yyjson_mut_val *obj, + size_t idx) { + yyjson_mut_val *key = (yyjson_mut_val *)obj->uni.ptr; + while (idx-- > 0) key = key->next->next; + obj->uni.ptr = (void *)key; +} + +yyjson_api_inline bool yyjson_mut_obj_add(yyjson_mut_val *obj, + yyjson_mut_val *key, + yyjson_mut_val *val) { + if (yyjson_likely(yyjson_mut_is_obj(obj) && + yyjson_mut_is_str(key) && val)) { + unsafe_yyjson_mut_obj_add(obj, key, val, unsafe_yyjson_get_len(obj)); + return true; + } + return false; +} + +yyjson_api_inline bool yyjson_mut_obj_put(yyjson_mut_val *obj, + yyjson_mut_val *key, + yyjson_mut_val *val) { + bool replaced = false; + size_t key_len; + yyjson_mut_obj_iter iter; + yyjson_mut_val *cur_key; + if (yyjson_unlikely(!yyjson_mut_is_obj(obj) || + !yyjson_mut_is_str(key))) return false; + key_len = unsafe_yyjson_get_len(key); + yyjson_mut_obj_iter_init(obj, &iter); + while ((cur_key = yyjson_mut_obj_iter_next(&iter)) != 0) { + if (unsafe_yyjson_equals_strn(cur_key, key->uni.str, key_len)) { + if (!replaced && val) { + replaced = true; + val->next = cur_key->next->next; + cur_key->next = val; + } else { + yyjson_mut_obj_iter_remove(&iter); + } + } + } + if (!replaced && val) unsafe_yyjson_mut_obj_add(obj, key, val, iter.max); + return true; +} + +yyjson_api_inline bool yyjson_mut_obj_insert(yyjson_mut_val *obj, + yyjson_mut_val *key, + yyjson_mut_val *val, + size_t idx) { + if (yyjson_likely(yyjson_mut_is_obj(obj) && + yyjson_mut_is_str(key) && val)) { + size_t len = unsafe_yyjson_get_len(obj); + if (yyjson_likely(len >= idx)) { + if (len > idx) { + void *ptr = obj->uni.ptr; + unsafe_yyjson_mut_obj_rotate(obj, idx); + unsafe_yyjson_mut_obj_add(obj, key, val, len); + obj->uni.ptr = ptr; + } else { + unsafe_yyjson_mut_obj_add(obj, key, val, len); + } + return true; + } + } + return false; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_remove(yyjson_mut_val *obj, + yyjson_mut_val *key) { + if (yyjson_likely(yyjson_mut_is_obj(obj) && yyjson_mut_is_str(key))) { + return unsafe_yyjson_mut_obj_remove(obj, key->uni.str, + unsafe_yyjson_get_len(key)); + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_remove_key( + yyjson_mut_val *obj, const char *key) { + if (yyjson_likely(yyjson_mut_is_obj(obj) && key)) { + size_t key_len = strlen(key); + return unsafe_yyjson_mut_obj_remove(obj, key, key_len); + } + return NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_remove_keyn( + yyjson_mut_val *obj, const char *key, size_t key_len) { + if (yyjson_likely(yyjson_mut_is_obj(obj) && key)) { + return unsafe_yyjson_mut_obj_remove(obj, key, key_len); + } + return NULL; +} + +yyjson_api_inline bool yyjson_mut_obj_clear(yyjson_mut_val *obj) { + if (yyjson_likely(yyjson_mut_is_obj(obj))) { + unsafe_yyjson_set_len(obj, 0); + return true; + } + return false; +} + +yyjson_api_inline bool yyjson_mut_obj_replace(yyjson_mut_val *obj, + yyjson_mut_val *key, + yyjson_mut_val *val) { + if (yyjson_likely(yyjson_mut_is_obj(obj) && + yyjson_mut_is_str(key) && val)) { + return unsafe_yyjson_mut_obj_replace(obj, key, val); + } + return false; +} + +yyjson_api_inline bool yyjson_mut_obj_rotate(yyjson_mut_val *obj, + size_t idx) { + if (yyjson_likely(yyjson_mut_is_obj(obj) && + unsafe_yyjson_get_len(obj) > idx)) { + unsafe_yyjson_mut_obj_rotate(obj, idx); + return true; + } + return false; +} + + + +/*============================================================================== + * Mutable JSON Object Modification Convenience API (Implementation) + *============================================================================*/ + +#define yyjson_mut_obj_add_func(func) \ + if (yyjson_likely(doc && yyjson_mut_is_obj(obj) && _key)) { \ + yyjson_mut_val *key = unsafe_yyjson_mut_val(doc, 2); \ + if (yyjson_likely(key)) { \ + size_t len = unsafe_yyjson_get_len(obj); \ + yyjson_mut_val *val = key + 1; \ + size_t key_len = strlen(_key); \ + bool noesc = unsafe_yyjson_is_str_noesc(_key, key_len); \ + key->tag = YYJSON_TYPE_STR; \ + key->tag |= noesc ? YYJSON_SUBTYPE_NOESC : YYJSON_SUBTYPE_NONE; \ + key->tag |= (uint64_t)strlen(_key) << YYJSON_TAG_BIT; \ + key->uni.str = _key; \ + func \ + unsafe_yyjson_mut_obj_add(obj, key, val, len); \ + return true; \ + } \ + } \ + return false + +yyjson_api_inline bool yyjson_mut_obj_add_null(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key) { + yyjson_mut_obj_add_func({ + val->tag = YYJSON_TYPE_NULL | YYJSON_SUBTYPE_NONE; + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_true(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key) { + yyjson_mut_obj_add_func({ + val->tag = YYJSON_TYPE_BOOL | YYJSON_SUBTYPE_TRUE; + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_false(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key) { + yyjson_mut_obj_add_func({ + val->tag = YYJSON_TYPE_BOOL | YYJSON_SUBTYPE_FALSE; + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_bool(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key, + bool _val) { + yyjson_mut_obj_add_func({ + _val = !!_val; + val->tag = YYJSON_TYPE_BOOL | (uint8_t)((uint8_t)(_val) << 3); + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_uint(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key, + uint64_t _val) { + yyjson_mut_obj_add_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_UINT; + val->uni.u64 = _val; + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_sint(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key, + int64_t _val) { + yyjson_mut_obj_add_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_SINT; + val->uni.i64 = _val; + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_int(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key, + int64_t _val) { + yyjson_mut_obj_add_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_SINT; + val->uni.i64 = _val; + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_real(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key, + double _val) { + yyjson_mut_obj_add_func({ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; + val->uni.f64 = _val; + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_str(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key, + const char *_val) { + if (yyjson_unlikely(!_val)) return false; + yyjson_mut_obj_add_func({ + size_t val_len = strlen(_val); + bool val_noesc = unsafe_yyjson_is_str_noesc(_val, val_len); + val->tag = ((uint64_t)strlen(_val) << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->tag |= val_noesc ? YYJSON_SUBTYPE_NOESC : YYJSON_SUBTYPE_NONE; + val->uni.str = _val; + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_strn(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key, + const char *_val, + size_t _len) { + if (yyjson_unlikely(!_val)) return false; + yyjson_mut_obj_add_func({ + val->tag = ((uint64_t)_len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->uni.str = _val; + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_strcpy(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key, + const char *_val) { + if (yyjson_unlikely(!_val)) return false; + yyjson_mut_obj_add_func({ + size_t _len = strlen(_val); + val->uni.str = unsafe_yyjson_mut_strncpy(doc, _val, _len); + if (yyjson_unlikely(!val->uni.str)) return false; + val->tag = ((uint64_t)_len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + }); +} + +yyjson_api_inline bool yyjson_mut_obj_add_strncpy(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key, + const char *_val, + size_t _len) { + if (yyjson_unlikely(!_val)) return false; + yyjson_mut_obj_add_func({ + val->uni.str = unsafe_yyjson_mut_strncpy(doc, _val, _len); + if (yyjson_unlikely(!val->uni.str)) return false; + val->tag = ((uint64_t)_len << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_add_arr(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key) { + yyjson_mut_val *key = yyjson_mut_str(doc, _key); + yyjson_mut_val *val = yyjson_mut_arr(doc); + return yyjson_mut_obj_add(obj, key, val) ? val : NULL; +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_add_obj(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key) { + yyjson_mut_val *key = yyjson_mut_str(doc, _key); + yyjson_mut_val *val = yyjson_mut_obj(doc); + return yyjson_mut_obj_add(obj, key, val) ? val : NULL; +} + +yyjson_api_inline bool yyjson_mut_obj_add_val(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *_key, + yyjson_mut_val *_val) { + if (yyjson_unlikely(!_val)) return false; + yyjson_mut_obj_add_func({ + val = _val; + }); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_remove_str(yyjson_mut_val *obj, + const char *key) { + return yyjson_mut_obj_remove_strn(obj, key, key ? strlen(key) : 0); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_obj_remove_strn( + yyjson_mut_val *obj, const char *_key, size_t _len) { + if (yyjson_likely(yyjson_mut_is_obj(obj) && _key)) { + yyjson_mut_val *key; + yyjson_mut_obj_iter iter; + yyjson_mut_val *val_removed = NULL; + yyjson_mut_obj_iter_init(obj, &iter); + while ((key = yyjson_mut_obj_iter_next(&iter)) != NULL) { + if (unsafe_yyjson_equals_strn(key, _key, _len)) { + if (!val_removed) val_removed = key->next; + yyjson_mut_obj_iter_remove(&iter); + } + } + return val_removed; + } + return NULL; +} + +yyjson_api_inline bool yyjson_mut_obj_rename_key(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, + const char *new_key) { + if (!key || !new_key) return false; + return yyjson_mut_obj_rename_keyn(doc, obj, key, strlen(key), + new_key, strlen(new_key)); +} + +yyjson_api_inline bool yyjson_mut_obj_rename_keyn(yyjson_mut_doc *doc, + yyjson_mut_val *obj, + const char *key, + size_t len, + const char *new_key, + size_t new_len) { + char *cpy_key = NULL; + yyjson_mut_val *old_key; + yyjson_mut_obj_iter iter; + if (!doc || !obj || !key || !new_key) return false; + yyjson_mut_obj_iter_init(obj, &iter); + while ((old_key = yyjson_mut_obj_iter_next(&iter))) { + if (unsafe_yyjson_equals_strn((void *)old_key, key, len)) { + if (!cpy_key) { + cpy_key = unsafe_yyjson_mut_strncpy(doc, new_key, new_len); + if (!cpy_key) return false; + } + yyjson_mut_set_strn(old_key, cpy_key, new_len); + } + } + return cpy_key != NULL; +} + + + +/*============================================================================== + * JSON Pointer API (Implementation) + *============================================================================*/ + +#define yyjson_ptr_set_err(_code, _msg) do { \ + if (err) { \ + err->code = YYJSON_PTR_ERR_##_code; \ + err->msg = _msg; \ + err->pos = 0; \ + } \ +} while(false) + +/* require: val != NULL, *ptr == '/', len > 0 */ +yyjson_api yyjson_val *unsafe_yyjson_ptr_getx(yyjson_val *val, + const char *ptr, size_t len, + yyjson_ptr_err *err); + +/* require: val != NULL, *ptr == '/', len > 0 */ +yyjson_api yyjson_mut_val *unsafe_yyjson_mut_ptr_getx(yyjson_mut_val *val, + const char *ptr, + size_t len, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err); + +/* require: val/new_val/doc != NULL, *ptr == '/', len > 0 */ +yyjson_api bool unsafe_yyjson_mut_ptr_putx(yyjson_mut_val *val, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc, + bool create_parent, bool insert_new, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err); + +/* require: val/err != NULL, *ptr == '/', len > 0 */ +yyjson_api yyjson_mut_val *unsafe_yyjson_mut_ptr_replacex( + yyjson_mut_val *val, const char *ptr, size_t len, yyjson_mut_val *new_val, + yyjson_ptr_ctx *ctx, yyjson_ptr_err *err); + +/* require: val/err != NULL, *ptr == '/', len > 0 */ +yyjson_api yyjson_mut_val *unsafe_yyjson_mut_ptr_removex(yyjson_mut_val *val, + const char *ptr, + size_t len, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err); + +yyjson_api_inline yyjson_val *yyjson_doc_ptr_get(yyjson_doc *doc, + const char *ptr) { + if (yyjson_unlikely(!ptr)) return NULL; + return yyjson_doc_ptr_getn(doc, ptr, strlen(ptr)); +} + +yyjson_api_inline yyjson_val *yyjson_doc_ptr_getn(yyjson_doc *doc, + const char *ptr, size_t len) { + return yyjson_doc_ptr_getx(doc, ptr, len, NULL); +} + +yyjson_api_inline yyjson_val *yyjson_doc_ptr_getx(yyjson_doc *doc, + const char *ptr, size_t len, + yyjson_ptr_err *err) { + yyjson_ptr_set_err(NONE, NULL); + if (yyjson_unlikely(!doc || !ptr)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return NULL; + } + if (yyjson_unlikely(!doc->root)) { + yyjson_ptr_set_err(NULL_ROOT, "document's root is NULL"); + return NULL; + } + if (yyjson_unlikely(len == 0)) { + return doc->root; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return NULL; + } + return unsafe_yyjson_ptr_getx(doc->root, ptr, len, err); +} + +yyjson_api_inline yyjson_val *yyjson_ptr_get(yyjson_val *val, + const char *ptr) { + if (yyjson_unlikely(!ptr)) return NULL; + return yyjson_ptr_getn(val, ptr, strlen(ptr)); +} + +yyjson_api_inline yyjson_val *yyjson_ptr_getn(yyjson_val *val, + const char *ptr, size_t len) { + return yyjson_ptr_getx(val, ptr, len, NULL); +} + +yyjson_api_inline yyjson_val *yyjson_ptr_getx(yyjson_val *val, + const char *ptr, size_t len, + yyjson_ptr_err *err) { + yyjson_ptr_set_err(NONE, NULL); + if (yyjson_unlikely(!val || !ptr)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return NULL; + } + if (yyjson_unlikely(len == 0)) { + return val; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return NULL; + } + return unsafe_yyjson_ptr_getx(val, ptr, len, err); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_get(yyjson_mut_doc *doc, + const char *ptr) { + if (!ptr) return NULL; + return yyjson_mut_doc_ptr_getn(doc, ptr, strlen(ptr)); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_getn(yyjson_mut_doc *doc, + const char *ptr, + size_t len) { + return yyjson_mut_doc_ptr_getx(doc, ptr, len, NULL, NULL); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_getx(yyjson_mut_doc *doc, + const char *ptr, + size_t len, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err) { + yyjson_ptr_set_err(NONE, NULL); + if (ctx) memset(ctx, 0, sizeof(*ctx)); + + if (yyjson_unlikely(!doc || !ptr)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return NULL; + } + if (yyjson_unlikely(!doc->root)) { + yyjson_ptr_set_err(NULL_ROOT, "document's root is NULL"); + return NULL; + } + if (yyjson_unlikely(len == 0)) { + return doc->root; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return NULL; + } + return unsafe_yyjson_mut_ptr_getx(doc->root, ptr, len, ctx, err); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_get(yyjson_mut_val *val, + const char *ptr) { + if (!ptr) return NULL; + return yyjson_mut_ptr_getn(val, ptr, strlen(ptr)); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_getn(yyjson_mut_val *val, + const char *ptr, + size_t len) { + return yyjson_mut_ptr_getx(val, ptr, len, NULL, NULL); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_getx(yyjson_mut_val *val, + const char *ptr, + size_t len, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err) { + yyjson_ptr_set_err(NONE, NULL); + if (ctx) memset(ctx, 0, sizeof(*ctx)); + + if (yyjson_unlikely(!val || !ptr)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return NULL; + } + if (yyjson_unlikely(len == 0)) { + return val; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return NULL; + } + return unsafe_yyjson_mut_ptr_getx(val, ptr, len, ctx, err); +} + +yyjson_api_inline bool yyjson_mut_doc_ptr_add(yyjson_mut_doc *doc, + const char *ptr, + yyjson_mut_val *new_val) { + if (yyjson_unlikely(!ptr)) return false; + return yyjson_mut_doc_ptr_addn(doc, ptr, strlen(ptr), new_val); +} + +yyjson_api_inline bool yyjson_mut_doc_ptr_addn(yyjson_mut_doc *doc, + const char *ptr, + size_t len, + yyjson_mut_val *new_val) { + return yyjson_mut_doc_ptr_addx(doc, ptr, len, new_val, true, NULL, NULL); +} + +yyjson_api_inline bool yyjson_mut_doc_ptr_addx(yyjson_mut_doc *doc, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + bool create_parent, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err) { + yyjson_ptr_set_err(NONE, NULL); + if (ctx) memset(ctx, 0, sizeof(*ctx)); + + if (yyjson_unlikely(!doc || !ptr || !new_val)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return false; + } + if (yyjson_unlikely(len == 0)) { + if (doc->root) { + yyjson_ptr_set_err(SET_ROOT, "cannot set document's root"); + return false; + } else { + doc->root = new_val; + return true; + } + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return false; + } + if (yyjson_unlikely(!doc->root && !create_parent)) { + yyjson_ptr_set_err(NULL_ROOT, "document's root is NULL"); + return false; + } + if (yyjson_unlikely(!doc->root)) { + yyjson_mut_val *root = yyjson_mut_obj(doc); + if (yyjson_unlikely(!root)) { + yyjson_ptr_set_err(MEMORY_ALLOCATION, "failed to create value"); + return false; + } + if (unsafe_yyjson_mut_ptr_putx(root, ptr, len, new_val, doc, + create_parent, true, ctx, err)) { + doc->root = root; + return true; + } + return false; + } + return unsafe_yyjson_mut_ptr_putx(doc->root, ptr, len, new_val, doc, + create_parent, true, ctx, err); +} + +yyjson_api_inline bool yyjson_mut_ptr_add(yyjson_mut_val *val, + const char *ptr, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc) { + if (yyjson_unlikely(!ptr)) return false; + return yyjson_mut_ptr_addn(val, ptr, strlen(ptr), new_val, doc); +} + +yyjson_api_inline bool yyjson_mut_ptr_addn(yyjson_mut_val *val, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc) { + return yyjson_mut_ptr_addx(val, ptr, len, new_val, doc, true, NULL, NULL); +} + +yyjson_api_inline bool yyjson_mut_ptr_addx(yyjson_mut_val *val, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc, + bool create_parent, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err) { + yyjson_ptr_set_err(NONE, NULL); + if (ctx) memset(ctx, 0, sizeof(*ctx)); + + if (yyjson_unlikely(!val || !ptr || !new_val || !doc)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return false; + } + if (yyjson_unlikely(len == 0)) { + yyjson_ptr_set_err(SET_ROOT, "cannot set root"); + return false; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return false; + } + return unsafe_yyjson_mut_ptr_putx(val, ptr, len, new_val, + doc, create_parent, true, ctx, err); +} + +yyjson_api_inline bool yyjson_mut_doc_ptr_set(yyjson_mut_doc *doc, + const char *ptr, + yyjson_mut_val *new_val) { + if (yyjson_unlikely(!ptr)) return false; + return yyjson_mut_doc_ptr_setn(doc, ptr, strlen(ptr), new_val); +} + +yyjson_api_inline bool yyjson_mut_doc_ptr_setn(yyjson_mut_doc *doc, + const char *ptr, size_t len, + yyjson_mut_val *new_val) { + return yyjson_mut_doc_ptr_setx(doc, ptr, len, new_val, true, NULL, NULL); +} + +yyjson_api_inline bool yyjson_mut_doc_ptr_setx(yyjson_mut_doc *doc, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + bool create_parent, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err) { + yyjson_ptr_set_err(NONE, NULL); + if (ctx) memset(ctx, 0, sizeof(*ctx)); + + if (yyjson_unlikely(!doc || !ptr)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return false; + } + if (yyjson_unlikely(len == 0)) { + if (ctx) ctx->old = doc->root; + doc->root = new_val; + return true; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return false; + } + if (!new_val) { + if (!doc->root) { + yyjson_ptr_set_err(RESOLVE, "JSON pointer cannot be resolved"); + return false; + } + return !!unsafe_yyjson_mut_ptr_removex(doc->root, ptr, len, ctx, err); + } + if (yyjson_unlikely(!doc->root && !create_parent)) { + yyjson_ptr_set_err(NULL_ROOT, "document's root is NULL"); + return false; + } + if (yyjson_unlikely(!doc->root)) { + yyjson_mut_val *root = yyjson_mut_obj(doc); + if (yyjson_unlikely(!root)) { + yyjson_ptr_set_err(MEMORY_ALLOCATION, "failed to create value"); + return false; + } + if (unsafe_yyjson_mut_ptr_putx(root, ptr, len, new_val, doc, + create_parent, false, ctx, err)) { + doc->root = root; + return true; + } + return false; + } + return unsafe_yyjson_mut_ptr_putx(doc->root, ptr, len, new_val, doc, + create_parent, false, ctx, err); +} + +yyjson_api_inline bool yyjson_mut_ptr_set(yyjson_mut_val *val, + const char *ptr, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc) { + if (yyjson_unlikely(!ptr)) return false; + return yyjson_mut_ptr_setn(val, ptr, strlen(ptr), new_val, doc); +} + +yyjson_api_inline bool yyjson_mut_ptr_setn(yyjson_mut_val *val, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc) { + return yyjson_mut_ptr_setx(val, ptr, len, new_val, doc, true, NULL, NULL); +} + +yyjson_api_inline bool yyjson_mut_ptr_setx(yyjson_mut_val *val, + const char *ptr, size_t len, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc, + bool create_parent, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err) { + yyjson_ptr_set_err(NONE, NULL); + if (ctx) memset(ctx, 0, sizeof(*ctx)); + + if (yyjson_unlikely(!val || !ptr || !doc)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return false; + } + if (yyjson_unlikely(len == 0)) { + yyjson_ptr_set_err(SET_ROOT, "cannot set root"); + return false; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return false; + } + if (!new_val) { + return !!unsafe_yyjson_mut_ptr_removex(val, ptr, len, ctx, err); + } + return unsafe_yyjson_mut_ptr_putx(val, ptr, len, new_val, doc, + create_parent, false, ctx, err); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_replace( + yyjson_mut_doc *doc, const char *ptr, yyjson_mut_val *new_val) { + if (!ptr) return NULL; + return yyjson_mut_doc_ptr_replacen(doc, ptr, strlen(ptr), new_val); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_replacen( + yyjson_mut_doc *doc, const char *ptr, size_t len, yyjson_mut_val *new_val) { + return yyjson_mut_doc_ptr_replacex(doc, ptr, len, new_val, NULL, NULL); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_replacex( + yyjson_mut_doc *doc, const char *ptr, size_t len, yyjson_mut_val *new_val, + yyjson_ptr_ctx *ctx, yyjson_ptr_err *err) { + + yyjson_ptr_set_err(NONE, NULL); + if (ctx) memset(ctx, 0, sizeof(*ctx)); + + if (yyjson_unlikely(!doc || !ptr || !new_val)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return NULL; + } + if (yyjson_unlikely(len == 0)) { + yyjson_mut_val *root = doc->root; + if (yyjson_unlikely(!root)) { + yyjson_ptr_set_err(RESOLVE, "JSON pointer cannot be resolved"); + return NULL; + } + if (ctx) ctx->old = root; + doc->root = new_val; + return root; + } + if (yyjson_unlikely(!doc->root)) { + yyjson_ptr_set_err(NULL_ROOT, "document's root is NULL"); + return NULL; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return NULL; + } + return unsafe_yyjson_mut_ptr_replacex(doc->root, ptr, len, new_val, + ctx, err); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_replace( + yyjson_mut_val *val, const char *ptr, yyjson_mut_val *new_val) { + if (!ptr) return NULL; + return yyjson_mut_ptr_replacen(val, ptr, strlen(ptr), new_val); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_replacen( + yyjson_mut_val *val, const char *ptr, size_t len, yyjson_mut_val *new_val) { + return yyjson_mut_ptr_replacex(val, ptr, len, new_val, NULL, NULL); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_replacex( + yyjson_mut_val *val, const char *ptr, size_t len, yyjson_mut_val *new_val, + yyjson_ptr_ctx *ctx, yyjson_ptr_err *err) { + + yyjson_ptr_set_err(NONE, NULL); + if (ctx) memset(ctx, 0, sizeof(*ctx)); + + if (yyjson_unlikely(!val || !ptr || !new_val)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return NULL; + } + if (yyjson_unlikely(len == 0)) { + yyjson_ptr_set_err(SET_ROOT, "cannot set root"); + return NULL; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return NULL; + } + return unsafe_yyjson_mut_ptr_replacex(val, ptr, len, new_val, ctx, err); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_remove( + yyjson_mut_doc *doc, const char *ptr) { + if (!ptr) return NULL; + return yyjson_mut_doc_ptr_removen(doc, ptr, strlen(ptr)); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_removen( + yyjson_mut_doc *doc, const char *ptr, size_t len) { + return yyjson_mut_doc_ptr_removex(doc, ptr, len, NULL, NULL); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_ptr_removex( + yyjson_mut_doc *doc, const char *ptr, size_t len, + yyjson_ptr_ctx *ctx, yyjson_ptr_err *err) { + + yyjson_ptr_set_err(NONE, NULL); + if (ctx) memset(ctx, 0, sizeof(*ctx)); + + if (yyjson_unlikely(!doc || !ptr)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return NULL; + } + if (yyjson_unlikely(!doc->root)) { + yyjson_ptr_set_err(NULL_ROOT, "document's root is NULL"); + return NULL; + } + if (yyjson_unlikely(len == 0)) { + yyjson_mut_val *root = doc->root; + if (ctx) ctx->old = root; + doc->root = NULL; + return root; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return NULL; + } + return unsafe_yyjson_mut_ptr_removex(doc->root, ptr, len, ctx, err); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_remove(yyjson_mut_val *val, + const char *ptr) { + if (!ptr) return NULL; + return yyjson_mut_ptr_removen(val, ptr, strlen(ptr)); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_removen(yyjson_mut_val *val, + const char *ptr, + size_t len) { + return yyjson_mut_ptr_removex(val, ptr, len, NULL, NULL); +} + +yyjson_api_inline yyjson_mut_val *yyjson_mut_ptr_removex(yyjson_mut_val *val, + const char *ptr, + size_t len, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err) { + yyjson_ptr_set_err(NONE, NULL); + if (ctx) memset(ctx, 0, sizeof(*ctx)); + + if (yyjson_unlikely(!val || !ptr)) { + yyjson_ptr_set_err(PARAMETER, "input parameter is NULL"); + return NULL; + } + if (yyjson_unlikely(len == 0)) { + yyjson_ptr_set_err(SET_ROOT, "cannot set root"); + return NULL; + } + if (yyjson_unlikely(*ptr != '/')) { + yyjson_ptr_set_err(SYNTAX, "no prefix '/'"); + return NULL; + } + return unsafe_yyjson_mut_ptr_removex(val, ptr, len, ctx, err); +} + +yyjson_api_inline bool yyjson_ptr_ctx_append(yyjson_ptr_ctx *ctx, + yyjson_mut_val *key, + yyjson_mut_val *val) { + yyjson_mut_val *ctn, *pre_key, *pre_val, *cur_key, *cur_val; + if (!ctx || !ctx->ctn || !val) return false; + ctn = ctx->ctn; + + if (yyjson_mut_is_obj(ctn)) { + if (!key) return false; + key->next = val; + pre_key = ctx->pre; + if (unsafe_yyjson_get_len(ctn) == 0) { + val->next = key; + ctn->uni.ptr = key; + ctx->pre = key; + } else if (!pre_key) { + pre_key = (yyjson_mut_val *)ctn->uni.ptr; + pre_val = pre_key->next; + val->next = pre_val->next; + pre_val->next = key; + ctn->uni.ptr = key; + ctx->pre = pre_key; + } else { + cur_key = pre_key->next->next; + cur_val = cur_key->next; + val->next = cur_val->next; + cur_val->next = key; + if (ctn->uni.ptr == cur_key) ctn->uni.ptr = key; + ctx->pre = cur_key; + } + } else { + pre_val = ctx->pre; + if (unsafe_yyjson_get_len(ctn) == 0) { + val->next = val; + ctn->uni.ptr = val; + ctx->pre = val; + } else if (!pre_val) { + pre_val = (yyjson_mut_val *)ctn->uni.ptr; + val->next = pre_val->next; + pre_val->next = val; + ctn->uni.ptr = val; + ctx->pre = pre_val; + } else { + cur_val = pre_val->next; + val->next = cur_val->next; + cur_val->next = val; + if (ctn->uni.ptr == cur_val) ctn->uni.ptr = val; + ctx->pre = cur_val; + } + } + unsafe_yyjson_inc_len(ctn); + return true; +} + +yyjson_api_inline bool yyjson_ptr_ctx_replace(yyjson_ptr_ctx *ctx, + yyjson_mut_val *val) { + yyjson_mut_val *ctn, *pre_key, *cur_key, *pre_val, *cur_val; + if (!ctx || !ctx->ctn || !ctx->pre || !val) return false; + ctn = ctx->ctn; + if (yyjson_mut_is_obj(ctn)) { + pre_key = ctx->pre; + pre_val = pre_key->next; + cur_key = pre_val->next; + cur_val = cur_key->next; + /* replace current value */ + cur_key->next = val; + val->next = cur_val->next; + ctx->old = cur_val; + } else { + pre_val = ctx->pre; + cur_val = pre_val->next; + /* replace current value */ + if (pre_val != cur_val) { + val->next = cur_val->next; + pre_val->next = val; + if (ctn->uni.ptr == cur_val) ctn->uni.ptr = val; + } else { + val->next = val; + ctn->uni.ptr = val; + ctx->pre = val; + } + ctx->old = cur_val; + } + return true; +} + +yyjson_api_inline bool yyjson_ptr_ctx_remove(yyjson_ptr_ctx *ctx) { + yyjson_mut_val *ctn, *pre_key, *pre_val, *cur_key, *cur_val; + size_t len; + if (!ctx || !ctx->ctn || !ctx->pre) return false; + ctn = ctx->ctn; + if (yyjson_mut_is_obj(ctn)) { + pre_key = ctx->pre; + pre_val = pre_key->next; + cur_key = pre_val->next; + cur_val = cur_key->next; + /* remove current key-value */ + pre_val->next = cur_val->next; + if (ctn->uni.ptr == cur_key) ctn->uni.ptr = pre_key; + ctx->pre = NULL; + ctx->old = cur_val; + } else { + pre_val = ctx->pre; + cur_val = pre_val->next; + /* remove current key-value */ + pre_val->next = cur_val->next; + if (ctn->uni.ptr == cur_val) ctn->uni.ptr = pre_val; + ctx->pre = NULL; + ctx->old = cur_val; + } + len = unsafe_yyjson_get_len(ctn) - 1; + if (len == 0) ctn->uni.ptr = NULL; + unsafe_yyjson_set_len(ctn, len); + return true; +} + +#undef yyjson_ptr_set_err + + + +/*============================================================================== + * JSON Value at Pointer API (Implementation) + *============================================================================*/ + +/** + Set provided `value` if the JSON Pointer (RFC 6901) exists and is type bool. + Returns true if value at `ptr` exists and is the correct type, otherwise false. + */ +yyjson_api_inline bool yyjson_ptr_get_bool( + yyjson_val *root, const char *ptr, bool *value) { + yyjson_val *val = yyjson_ptr_get(root, ptr); + if (value && yyjson_is_bool(val)) { + *value = unsafe_yyjson_get_bool(val); + return true; + } else { + return false; + } +} + +/** + Set provided `value` if the JSON Pointer (RFC 6901) exists and is an integer + that fits in `uint64_t`. Returns true if successful, otherwise false. + */ +yyjson_api_inline bool yyjson_ptr_get_uint( + yyjson_val *root, const char *ptr, uint64_t *value) { + yyjson_val *val = yyjson_ptr_get(root, ptr); + if (value && val) { + uint64_t ret = val->uni.u64; + if (unsafe_yyjson_is_uint(val) || + (unsafe_yyjson_is_sint(val) && !(ret >> 63))) { + *value = ret; + return true; + } + } + return false; +} + +/** + Set provided `value` if the JSON Pointer (RFC 6901) exists and is an integer + that fits in `int64_t`. Returns true if successful, otherwise false. + */ +yyjson_api_inline bool yyjson_ptr_get_sint( + yyjson_val *root, const char *ptr, int64_t *value) { + yyjson_val *val = yyjson_ptr_get(root, ptr); + if (value && val) { + int64_t ret = val->uni.i64; + if (unsafe_yyjson_is_sint(val) || + (unsafe_yyjson_is_uint(val) && ret >= 0)) { + *value = ret; + return true; + } + } + return false; +} + +/** + Set provided `value` if the JSON Pointer (RFC 6901) exists and is type real. + Returns true if value at `ptr` exists and is the correct type, otherwise false. + */ +yyjson_api_inline bool yyjson_ptr_get_real( + yyjson_val *root, const char *ptr, double *value) { + yyjson_val *val = yyjson_ptr_get(root, ptr); + if (value && yyjson_is_real(val)) { + *value = unsafe_yyjson_get_real(val); + return true; + } else { + return false; + } +} + +/** + Set provided `value` if the JSON Pointer (RFC 6901) exists and is type sint, + uint or real. + Returns true if value at `ptr` exists and is the correct type, otherwise false. + */ +yyjson_api_inline bool yyjson_ptr_get_num( + yyjson_val *root, const char *ptr, double *value) { + yyjson_val *val = yyjson_ptr_get(root, ptr); + if (value && yyjson_is_num(val)) { + *value = unsafe_yyjson_get_num(val); + return true; + } else { + return false; + } +} + +/** + Set provided `value` if the JSON Pointer (RFC 6901) exists and is type string. + Returns true if value at `ptr` exists and is the correct type, otherwise false. + */ +yyjson_api_inline bool yyjson_ptr_get_str( + yyjson_val *root, const char *ptr, const char **value) { + yyjson_val *val = yyjson_ptr_get(root, ptr); + if (value && yyjson_is_str(val)) { + *value = unsafe_yyjson_get_str(val); + return true; + } else { + return false; + } +} + + + +/*============================================================================== + * Deprecated + *============================================================================*/ + +/** @deprecated renamed to `yyjson_doc_ptr_get` */ +yyjson_deprecated("renamed to yyjson_doc_ptr_get") +yyjson_api_inline yyjson_val *yyjson_doc_get_pointer(yyjson_doc *doc, + const char *ptr) { + return yyjson_doc_ptr_get(doc, ptr); +} + +/** @deprecated renamed to `yyjson_doc_ptr_getn` */ +yyjson_deprecated("renamed to yyjson_doc_ptr_getn") +yyjson_api_inline yyjson_val *yyjson_doc_get_pointern(yyjson_doc *doc, + const char *ptr, + size_t len) { + return yyjson_doc_ptr_getn(doc, ptr, len); +} + +/** @deprecated renamed to `yyjson_mut_doc_ptr_get` */ +yyjson_deprecated("renamed to yyjson_mut_doc_ptr_get") +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_get_pointer( + yyjson_mut_doc *doc, const char *ptr) { + return yyjson_mut_doc_ptr_get(doc, ptr); +} + +/** @deprecated renamed to `yyjson_mut_doc_ptr_getn` */ +yyjson_deprecated("renamed to yyjson_mut_doc_ptr_getn") +yyjson_api_inline yyjson_mut_val *yyjson_mut_doc_get_pointern( + yyjson_mut_doc *doc, const char *ptr, size_t len) { + return yyjson_mut_doc_ptr_getn(doc, ptr, len); +} + +/** @deprecated renamed to `yyjson_ptr_get` */ +yyjson_deprecated("renamed to yyjson_ptr_get") +yyjson_api_inline yyjson_val *yyjson_get_pointer(yyjson_val *val, + const char *ptr) { + return yyjson_ptr_get(val, ptr); +} + +/** @deprecated renamed to `yyjson_ptr_getn` */ +yyjson_deprecated("renamed to yyjson_ptr_getn") +yyjson_api_inline yyjson_val *yyjson_get_pointern(yyjson_val *val, + const char *ptr, + size_t len) { + return yyjson_ptr_getn(val, ptr, len); +} + +/** @deprecated renamed to `yyjson_mut_ptr_get` */ +yyjson_deprecated("renamed to yyjson_mut_ptr_get") +yyjson_api_inline yyjson_mut_val *yyjson_mut_get_pointer(yyjson_mut_val *val, + const char *ptr) { + return yyjson_mut_ptr_get(val, ptr); +} + +/** @deprecated renamed to `yyjson_mut_ptr_getn` */ +yyjson_deprecated("renamed to yyjson_mut_ptr_getn") +yyjson_api_inline yyjson_mut_val *yyjson_mut_get_pointern(yyjson_mut_val *val, + const char *ptr, + size_t len) { + return yyjson_mut_ptr_getn(val, ptr, len); +} + +/** @deprecated renamed to `yyjson_mut_ptr_getn` */ +yyjson_deprecated("renamed to unsafe_yyjson_ptr_getn") +yyjson_api_inline yyjson_val *unsafe_yyjson_get_pointer(yyjson_val *val, + const char *ptr, + size_t len) { + yyjson_ptr_err err; + return unsafe_yyjson_ptr_getx(val, ptr, len, &err); +} + +/** @deprecated renamed to `unsafe_yyjson_mut_ptr_getx` */ +yyjson_deprecated("renamed to unsafe_yyjson_mut_ptr_getx") +yyjson_api_inline yyjson_mut_val *unsafe_yyjson_mut_get_pointer( + yyjson_mut_val *val, const char *ptr, size_t len) { + yyjson_ptr_err err; + return unsafe_yyjson_mut_ptr_getx(val, ptr, len, NULL, &err); +} + + + +/*============================================================================== + * Compiler Hint End + *============================================================================*/ + +#if defined(__clang__) +# pragma clang diagnostic pop +#elif defined(__GNUC__) +# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# pragma GCC diagnostic pop +# endif +#elif defined(_MSC_VER) +# pragma warning(pop) +#endif /* warning suppress end */ + +#ifdef __cplusplus +// } +#endif /* extern "C" end */ + +} // namespace duckdb_yyjson + +#endif /* DUCKDB_YYJSON_H */ diff --git a/src/duckdb/third_party/yyjson/yyjson.cpp b/src/duckdb/third_party/yyjson/yyjson.cpp new file mode 100644 index 00000000..d8df196f --- /dev/null +++ b/src/duckdb/third_party/yyjson/yyjson.cpp @@ -0,0 +1,9490 @@ +/*============================================================================== + Copyright (c) 2020 YaoYuan + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + *============================================================================*/ + +#include "yyjson.hpp" +#include + +namespace duckdb_yyjson { + +/*============================================================================== + * Warning Suppress + *============================================================================*/ + +/* warning suppress begin */ +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunused-function" +# pragma clang diagnostic ignored "-Wunused-parameter" +# pragma clang diagnostic ignored "-Wunused-label" +# pragma clang diagnostic ignored "-Wunused-macros" +# pragma clang diagnostic ignored "-Wunused-variable" +#elif defined(__GNUC__) +# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# pragma GCC diagnostic push +# endif +# pragma GCC diagnostic ignored "-Wunused-function" +# pragma GCC diagnostic ignored "-Wunused-parameter" +# pragma GCC diagnostic ignored "-Wunused-label" +# pragma GCC diagnostic ignored "-Wunused-macros" +#elif defined(_MSC_VER) +# pragma warning(push) +# pragma warning(disable:4100) /* unreferenced formal parameter */ +# pragma warning(disable:4101) /* unreferenced variable */ +# pragma warning(disable:4102) /* unreferenced label */ +# pragma warning(disable:4127) /* conditional expression is constant */ +# pragma warning(disable:4706) /* assignment within conditional expression */ +#endif + + + +/*============================================================================== + * Version + *============================================================================*/ + +uint32_t yyjson_version(void) { + return YYJSON_VERSION_HEX; +} + + + +/*============================================================================== + * Flags + *============================================================================*/ + +/* msvc intrinsic */ +#if YYJSON_MSC_VER >= 1400 +# include +# if defined(_M_AMD64) || defined(_M_ARM64) +# define MSC_HAS_BIT_SCAN_64 1 +# pragma intrinsic(_BitScanForward64) +# pragma intrinsic(_BitScanReverse64) +# else +# define MSC_HAS_BIT_SCAN_64 0 +# endif +# if defined(_M_AMD64) || defined(_M_ARM64) || \ + defined(_M_IX86) || defined(_M_ARM) +# define MSC_HAS_BIT_SCAN 1 +# pragma intrinsic(_BitScanForward) +# pragma intrinsic(_BitScanReverse) +# else +# define MSC_HAS_BIT_SCAN 0 +# endif +# if defined(_M_AMD64) +# define MSC_HAS_UMUL128 1 +# pragma intrinsic(_umul128) +# else +# define MSC_HAS_UMUL128 0 +# endif +#else +# define MSC_HAS_BIT_SCAN_64 0 +# define MSC_HAS_BIT_SCAN 0 +# define MSC_HAS_UMUL128 0 +#endif + +/* gcc builtin */ +#if yyjson_has_builtin(__builtin_clzll) || yyjson_gcc_available(3, 4, 0) +# define GCC_HAS_CLZLL 1 +#else +# define GCC_HAS_CLZLL 0 +#endif + +#if yyjson_has_builtin(__builtin_ctzll) || yyjson_gcc_available(3, 4, 0) +# define GCC_HAS_CTZLL 1 +#else +# define GCC_HAS_CTZLL 0 +#endif + +/* int128 type */ +#if defined(__SIZEOF_INT128__) && (__SIZEOF_INT128__ == 16) && \ + (defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)) +# define YYJSON_HAS_INT128 1 +#else +# define YYJSON_HAS_INT128 0 +#endif + +/* IEEE 754 floating-point binary representation */ +#if defined(__STDC_IEC_559__) || defined(__STDC_IEC_60559_BFP__) +# define YYJSON_HAS_IEEE_754 1 +#elif (FLT_RADIX == 2) && (DBL_MANT_DIG == 53) && (DBL_DIG == 15) && \ + (DBL_MIN_EXP == -1021) && (DBL_MAX_EXP == 1024) && \ + (DBL_MIN_10_EXP == -307) && (DBL_MAX_10_EXP == 308) +# define YYJSON_HAS_IEEE_754 1 +#else +# define YYJSON_HAS_IEEE_754 0 +#endif + +/* + Correct rounding in double number computations. + + On the x86 architecture, some compilers may use x87 FPU instructions for + floating-point arithmetic. The x87 FPU loads all floating point number as + 80-bit double-extended precision internally, then rounds the result to original + precision, which may produce inaccurate results. For a more detailed + explanation, see the paper: https://arxiv.org/abs/cs/0701192 + + Here are some examples of double precision calculation error: + + 2877.0 / 1e6 == 0.002877, but x87 returns 0.0028770000000000002 + 43683.0 * 1e21 == 4.3683e25, but x87 returns 4.3683000000000004e25 + + Here are some examples of compiler flags to generate x87 instructions on x86: + + clang -m32 -mno-sse + gcc/icc -m32 -mfpmath=387 + msvc /arch:SSE or /arch:IA32 + + If we are sure that there's no similar error described above, we can define the + YYJSON_DOUBLE_MATH_CORRECT as 1 to enable the fast path calculation. This is + not an accurate detection, it's just try to avoid the error at compile-time. + An accurate detection can be done at run-time: + + bool is_double_math_correct(void) { + volatile double r = 43683.0; + r *= 1e21; + return r == 4.3683e25; + } + + See also: utils.h in https://github.com/google/double-conversion/ + */ +#if !defined(FLT_EVAL_METHOD) && defined(__FLT_EVAL_METHOD__) +# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ +#endif + +#if defined(FLT_EVAL_METHOD) && FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1 +# define YYJSON_DOUBLE_MATH_CORRECT 0 +#elif defined(i386) || defined(__i386) || defined(__i386__) || \ + defined(_X86_) || defined(__X86__) || defined(_M_IX86) || \ + defined(__I86__) || defined(__IA32__) || defined(__THW_INTEL) +# if (defined(_MSC_VER) && defined(_M_IX86_FP) && _M_IX86_FP == 2) || \ + (defined(__SSE2_MATH__) && __SSE2_MATH__) +# define YYJSON_DOUBLE_MATH_CORRECT 1 +# else +# define YYJSON_DOUBLE_MATH_CORRECT 0 +# endif +#elif defined(__mc68000__) || defined(__pnacl__) || defined(__native_client__) +# define YYJSON_DOUBLE_MATH_CORRECT 0 +#else +# define YYJSON_DOUBLE_MATH_CORRECT 1 +#endif + +/* endian */ +#if yyjson_has_include() +# include /* POSIX */ +#endif +#if yyjson_has_include() +# include /* Linux */ +#elif yyjson_has_include() +# include /* BSD, Android */ +#elif yyjson_has_include() +# include /* BSD, Darwin */ +#endif + +#define YYJSON_BIG_ENDIAN 4321 +#define YYJSON_LITTLE_ENDIAN 1234 + +#if defined(BYTE_ORDER) && BYTE_ORDER +# if defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN) +# define YYJSON_ENDIAN YYJSON_BIG_ENDIAN +# elif defined(LITTLE_ENDIAN) && (BYTE_ORDER == LITTLE_ENDIAN) +# define YYJSON_ENDIAN YYJSON_LITTLE_ENDIAN +# endif + +#elif defined(__BYTE_ORDER) && __BYTE_ORDER +# if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN) +# define YYJSON_ENDIAN YYJSON_BIG_ENDIAN +# elif defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN) +# define YYJSON_ENDIAN YYJSON_LITTLE_ENDIAN +# endif + +#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ +# if defined(__ORDER_BIG_ENDIAN__) && \ + (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +# define YYJSON_ENDIAN YYJSON_BIG_ENDIAN +# elif defined(__ORDER_LITTLE_ENDIAN__) && \ + (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) +# define YYJSON_ENDIAN YYJSON_LITTLE_ENDIAN +# endif + +#elif (defined(__LITTLE_ENDIAN__) && __LITTLE_ENDIAN__ == 1) || \ + defined(__i386) || defined(__i386__) || \ + defined(_X86_) || defined(__X86__) || \ + defined(_M_IX86) || defined(__THW_INTEL__) || \ + defined(__x86_64) || defined(__x86_64__) || \ + defined(__amd64) || defined(__amd64__) || \ + defined(_M_AMD64) || defined(_M_X64) || \ + defined(_M_ARM) || defined(_M_ARM64) || \ + defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \ + defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) || \ + defined(__EMSCRIPTEN__) || defined(__wasm__) || \ + defined(__loongarch__) +# define YYJSON_ENDIAN YYJSON_LITTLE_ENDIAN + +#elif (defined(__BIG_ENDIAN__) && __BIG_ENDIAN__ == 1) || \ + defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \ + defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) || \ + defined(__or1k__) || defined(__OR1K__) +# define YYJSON_ENDIAN YYJSON_BIG_ENDIAN + +#else +# define YYJSON_ENDIAN 0 /* unknown endian, detect at run-time */ +#endif + +/* + This macro controls how yyjson handles unaligned memory accesses. + + By default, yyjson uses `memcpy()` for memory copying. This takes advantage of + the compiler's automatic optimizations to generate unaligned memory access + instructions when the target architecture supports it. + + However, for some older compilers or architectures where `memcpy()` isn't + optimized well and may generate unnecessary function calls, consider defining + this macro as 1. In such cases, yyjson switches to manual byte-by-byte access, + potentially improving performance. An example of the generated assembly code on + the ARM platform can be found here: https://godbolt.org/z/334jjhxPT + + As this flag has already been enabled for some common architectures in the + following code, users typically don't need to manually specify it. If users are + unsure about it, please review the generated assembly code or perform actual + benchmark to make an informed decision. + */ +#ifndef YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS +# if defined(__ia64) || defined(_IA64) || defined(__IA64__) || \ + defined(__ia64__) || defined(_M_IA64) || defined(__itanium__) +# define YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS 1 /* Itanium */ +# elif (defined(__arm__) || defined(__arm64__) || defined(__aarch64__)) && \ + (defined(__GNUC__) || defined(__clang__)) && \ + (!defined(__ARM_FEATURE_UNALIGNED) || !__ARM_FEATURE_UNALIGNED) +# define YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS 1 /* ARM */ +# elif defined(__sparc) || defined(__sparc__) +# define YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS 1 /* SPARC */ +# elif defined(__mips) || defined(__mips__) || defined(__MIPS__) +# define YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS 1 /* MIPS */ +# elif defined(__m68k__) || defined(M68000) +# define YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS 1 /* M68K */ +# else +# define YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS 0 +# endif +#endif + +/* + Estimated initial ratio of the JSON data (data_size / value_count). + For example: + + data: {"id":12345678,"name":"Harry"} + data_size: 30 + value_count: 5 + ratio: 6 + + yyjson uses dynamic memory with a growth factor of 1.5 when reading and writing + JSON, the ratios below are used to determine the initial memory size. + + A too large ratio will waste memory, and a too small ratio will cause multiple + memory growths and degrade performance. Currently, these ratios are generated + with some commonly used JSON datasets. + */ +#define YYJSON_READER_ESTIMATED_PRETTY_RATIO 16 +#define YYJSON_READER_ESTIMATED_MINIFY_RATIO 6 +#define YYJSON_WRITER_ESTIMATED_PRETTY_RATIO 32 +#define YYJSON_WRITER_ESTIMATED_MINIFY_RATIO 18 + +/* The initial and maximum size of the memory pool's chunk in yyjson_mut_doc. */ +#define YYJSON_MUT_DOC_STR_POOL_INIT_SIZE 0x100 +#define YYJSON_MUT_DOC_STR_POOL_MAX_SIZE 0x10000000 +#define YYJSON_MUT_DOC_VAL_POOL_INIT_SIZE (0x10 * sizeof(yyjson_mut_val)) +#define YYJSON_MUT_DOC_VAL_POOL_MAX_SIZE (0x1000000 * sizeof(yyjson_mut_val)) + +/* The minimum size of the dynamic allocator's chunk. */ +#define YYJSON_ALC_DYN_MIN_SIZE 0x1000 + +/* Default value for compile-time options. */ +#ifndef YYJSON_DISABLE_READER +#define YYJSON_DISABLE_READER 0 +#endif +#ifndef YYJSON_DISABLE_WRITER +#define YYJSON_DISABLE_WRITER 0 +#endif +#ifndef YYJSON_DISABLE_UTILS +#define YYJSON_DISABLE_UTILS 0 +#endif +#ifndef YYJSON_DISABLE_FAST_FP_CONV +#define YYJSON_DISABLE_FAST_FP_CONV 0 +#endif +#ifndef YYJSON_DISABLE_NON_STANDARD +#define YYJSON_DISABLE_NON_STANDARD 0 +#endif +#ifndef YYJSON_DISABLE_UTF8_VALIDATION +#define YYJSON_DISABLE_UTF8_VALIDATION 0 +#endif + + + +/*============================================================================== + * Macros + *============================================================================*/ + +/* Macros used for loop unrolling and other purpose. */ +#define repeat2(x) { x x } +#define repeat3(x) { x x x } +#define repeat4(x) { x x x x } +#define repeat8(x) { x x x x x x x x } +#define repeat16(x) { x x x x x x x x x x x x x x x x } + +#define repeat2_incr(x) { x(0) x(1) } +#define repeat4_incr(x) { x(0) x(1) x(2) x(3) } +#define repeat8_incr(x) { x(0) x(1) x(2) x(3) x(4) x(5) x(6) x(7) } +#define repeat16_incr(x) { x(0) x(1) x(2) x(3) x(4) x(5) x(6) x(7) \ + x(8) x(9) x(10) x(11) x(12) x(13) x(14) x(15) } + +#define repeat_in_1_18(x) { x(1) x(2) x(3) x(4) x(5) x(6) x(7) x(8) \ + x(9) x(10) x(11) x(12) x(13) x(14) x(15) x(16) \ + x(17) x(18) } + +/* Macros used to provide branch prediction information for compiler. */ +#undef likely +#define likely(x) yyjson_likely(x) +#undef unlikely +#define unlikely(x) yyjson_unlikely(x) + +/* Macros used to provide inline information for compiler. */ +#undef static_inline +#define static_inline static yyjson_inline +#undef static_noinline +#define static_noinline static yyjson_noinline + +/* Macros for min and max. */ +#undef yyjson_min +#define yyjson_min(x, y) ((x) < (y) ? (x) : (y)) +#undef yyjson_max +#define yyjson_max(x, y) ((x) > (y) ? (x) : (y)) + +/* Used to write u64 literal for C89 which doesn't support "ULL" suffix. */ +#undef U64 +#define U64(hi, lo) ((((u64)hi##UL) << 32U) + lo##UL) + +/* Used to cast away (remove) const qualifier. */ +#define constcast(type) (type)(void *)(size_t)(const void *) + +/* flag test */ +#define has_read_flag(_flag) unlikely(read_flag_eq(flg, YYJSON_READ_##_flag)) +#define has_write_flag(_flag) unlikely(write_flag_eq(flg, YYJSON_WRITE_##_flag)) + +static_inline bool read_flag_eq(yyjson_read_flag flg, yyjson_read_flag chk) { +#if YYJSON_DISABLE_NON_STANDARD + if (chk == YYJSON_READ_ALLOW_INF_AND_NAN || + chk == YYJSON_READ_ALLOW_COMMENTS || + chk == YYJSON_READ_ALLOW_TRAILING_COMMAS || + chk == YYJSON_READ_ALLOW_INVALID_UNICODE) + return false; /* this should be evaluated at compile-time */ +#endif + return (flg & chk) != 0; +} + +static_inline bool write_flag_eq(yyjson_write_flag flg, yyjson_write_flag chk) { +#if YYJSON_DISABLE_NON_STANDARD + if (chk == YYJSON_WRITE_ALLOW_INF_AND_NAN || + chk == YYJSON_WRITE_ALLOW_INVALID_UNICODE) + return false; /* this should be evaluated at compile-time */ +#endif + return (flg & chk) != 0; +} + + + +/*============================================================================== + * Integer Constants + *============================================================================*/ + +/* U64 constant values */ +#undef U64_MAX +#define U64_MAX U64(0xFFFFFFFF, 0xFFFFFFFF) +#undef I64_MAX +#define I64_MAX U64(0x7FFFFFFF, 0xFFFFFFFF) +#undef USIZE_MAX +#define USIZE_MAX ((usize)(~(usize)0)) + +/* Maximum number of digits for reading u32/u64/usize safety (not overflow). */ +#undef U32_SAFE_DIG +#define U32_SAFE_DIG 9 /* u32 max is 4294967295, 10 digits */ +#undef U64_SAFE_DIG +#define U64_SAFE_DIG 19 /* u64 max is 18446744073709551615, 20 digits */ +#undef USIZE_SAFE_DIG +#define USIZE_SAFE_DIG (sizeof(usize) == 8 ? U64_SAFE_DIG : U32_SAFE_DIG) + + + +/*============================================================================== + * IEEE-754 Double Number Constants + *============================================================================*/ + +/* Inf raw value (positive) */ +#define F64_RAW_INF U64(0x7FF00000, 0x00000000) + +/* NaN raw value (quiet NaN, no payload, no sign) */ +#if defined(__hppa__) || (defined(__mips__) && !defined(__mips_nan2008)) +#define F64_RAW_NAN U64(0x7FF7FFFF, 0xFFFFFFFF) +#else +#define F64_RAW_NAN U64(0x7FF80000, 0x00000000) +#endif + +/* double number bits */ +#define F64_BITS 64 + +/* double number exponent part bits */ +#define F64_EXP_BITS 11 + +/* double number significand part bits */ +#define F64_SIG_BITS 52 + +/* double number significand part bits (with 1 hidden bit) */ +#define F64_SIG_FULL_BITS 53 + +/* double number significand bit mask */ +#define F64_SIG_MASK U64(0x000FFFFF, 0xFFFFFFFF) + +/* double number exponent bit mask */ +#define F64_EXP_MASK U64(0x7FF00000, 0x00000000) + +/* double number exponent bias */ +#define F64_EXP_BIAS 1023 + +/* double number significant digits count in decimal */ +#define F64_DEC_DIG 17 + +/* max significant digits count in decimal when reading double number */ +#define F64_MAX_DEC_DIG 768 + +/* maximum decimal power of double number (1.7976931348623157e308) */ +#define F64_MAX_DEC_EXP 308 + +/* minimum decimal power of double number (4.9406564584124654e-324) */ +#define F64_MIN_DEC_EXP (-324) + +/* maximum binary power of double number */ +#define F64_MAX_BIN_EXP 1024 + +/* minimum binary power of double number */ +#define F64_MIN_BIN_EXP (-1021) + + + +/*============================================================================== + * Types + *============================================================================*/ + +/** Type define for primitive types. */ +typedef float f32; +typedef double f64; +typedef int8_t i8; +typedef uint8_t u8; +typedef int16_t i16; +typedef uint16_t u16; +typedef int32_t i32; +typedef uint32_t u32; +typedef int64_t i64; +typedef uint64_t u64; +typedef size_t usize; + +/** 128-bit integer, used by floating-point number reader and writer. */ +#if YYJSON_HAS_INT128 +__extension__ typedef __int128 i128; +__extension__ typedef unsigned __int128 u128; +#endif + +/** 16/32/64-bit vector */ +typedef struct v16 { char c[2]; } v16; +typedef struct v32 { char c[4]; } v32; +typedef struct v64 { char c[8]; } v64; + +/** 16/32/64-bit vector union */ +typedef union v16_uni { v16 v; u16 u; } v16_uni; +typedef union v32_uni { v32 v; u32 u; } v32_uni; +typedef union v64_uni { v64 v; u64 u; } v64_uni; + + + +/*============================================================================== + * Load/Store Utils + *============================================================================*/ + +#if YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS + +#define byte_move_idx(x) ((char *)dst)[x] = ((const char *)src)[x]; + +static_inline void byte_copy_2(void *dst, const void *src) { + repeat2_incr(byte_move_idx) +} + +static_inline void byte_copy_4(void *dst, const void *src) { + repeat4_incr(byte_move_idx) +} + +static_inline void byte_copy_8(void *dst, const void *src) { + repeat8_incr(byte_move_idx) +} + +static_inline void byte_copy_16(void *dst, const void *src) { + repeat16_incr(byte_move_idx) +} + +static_inline void byte_move_2(void *dst, const void *src) { + repeat2_incr(byte_move_idx) +} + +static_inline void byte_move_4(void *dst, const void *src) { + repeat4_incr(byte_move_idx) +} + +static_inline void byte_move_8(void *dst, const void *src) { + repeat8_incr(byte_move_idx) +} + +static_inline void byte_move_16(void *dst, const void *src) { + repeat16_incr(byte_move_idx) +} + +static_inline bool byte_match_2(void *buf, const char *pat) { + return + ((char *)buf)[0] == ((const char *)pat)[0] && + ((char *)buf)[1] == ((const char *)pat)[1]; +} + +static_inline bool byte_match_4(void *buf, const char *pat) { + return + ((char *)buf)[0] == ((const char *)pat)[0] && + ((char *)buf)[1] == ((const char *)pat)[1] && + ((char *)buf)[2] == ((const char *)pat)[2] && + ((char *)buf)[3] == ((const char *)pat)[3]; +} + +static_inline u16 byte_load_2(const void *src) { + v16_uni uni; + uni.v.c[0] = ((const char *)src)[0]; + uni.v.c[1] = ((const char *)src)[1]; + return uni.u; +} + +static_inline u32 byte_load_3(const void *src) { + v32_uni uni; + uni.v.c[0] = ((const char *)src)[0]; + uni.v.c[1] = ((const char *)src)[1]; + uni.v.c[2] = ((const char *)src)[2]; + uni.v.c[3] = 0; + return uni.u; +} + +static_inline u32 byte_load_4(const void *src) { + v32_uni uni; + uni.v.c[0] = ((const char *)src)[0]; + uni.v.c[1] = ((const char *)src)[1]; + uni.v.c[2] = ((const char *)src)[2]; + uni.v.c[3] = ((const char *)src)[3]; + return uni.u; +} + +#undef byte_move_expr + +#else + +static_inline void byte_copy_2(void *dst, const void *src) { + memcpy(dst, src, 2); +} + +static_inline void byte_copy_4(void *dst, const void *src) { + memcpy(dst, src, 4); +} + +static_inline void byte_copy_8(void *dst, const void *src) { + memcpy(dst, src, 8); +} + +static_inline void byte_copy_16(void *dst, const void *src) { + memcpy(dst, src, 16); +} + +static_inline void byte_move_2(void *dst, const void *src) { + u16 tmp; + memcpy(&tmp, src, 2); + memcpy(dst, &tmp, 2); +} + +static_inline void byte_move_4(void *dst, const void *src) { + u32 tmp; + memcpy(&tmp, src, 4); + memcpy(dst, &tmp, 4); +} + +static_inline void byte_move_8(void *dst, const void *src) { + u64 tmp; + memcpy(&tmp, src, 8); + memcpy(dst, &tmp, 8); +} + +static_inline void byte_move_16(void *dst, const void *src) { + char *pdst = (char *)dst; + const char *psrc = (const char *)src; + u64 tmp1, tmp2; + memcpy(&tmp1, psrc, 8); + memcpy(&tmp2, psrc + 8, 8); + memcpy(pdst, &tmp1, 8); + memcpy(pdst + 8, &tmp2, 8); +} + +static_inline bool byte_match_2(void *buf, const char *pat) { + v16_uni u1, u2; + memcpy(&u1, buf, 2); + memcpy(&u2, pat, 2); + return u1.u == u2.u; +} + +static_inline bool byte_match_4(void *buf, const char *pat) { + v32_uni u1, u2; + memcpy(&u1, buf, 4); + memcpy(&u2, pat, 4); + return u1.u == u2.u; +} + +static_inline u16 byte_load_2(const void *src) { + v16_uni uni; + memcpy(&uni, src, 2); + return uni.u; +} + +static_inline u32 byte_load_3(const void *src) { + v32_uni uni; + memcpy(&uni, src, 2); + uni.v.c[2] = ((const char *)src)[2]; + uni.v.c[3] = 0; + return uni.u; +} + +static_inline u32 byte_load_4(const void *src) { + v32_uni uni; + memcpy(&uni, src, 4); + return uni.u; +} + +#endif + + + +/*============================================================================== + * Number Utils + * These functions are used to detect and convert NaN and Inf numbers. + *============================================================================*/ + +/** Convert raw binary to double. */ +static_inline f64 f64_from_raw(u64 u) { + /* use memcpy to avoid violating the strict aliasing rule */ + f64 f; + memcpy(&f, &u, 8); + return f; +} + +/** Convert double to raw binary. */ +static_inline u64 f64_to_raw(f64 f) { + /* use memcpy to avoid violating the strict aliasing rule */ + u64 u; + memcpy(&u, &f, 8); + return u; +} + +/** Get raw 'infinity' with sign. */ +static_inline u64 f64_raw_get_inf(bool sign) { +#if YYJSON_HAS_IEEE_754 + return F64_RAW_INF | ((u64)sign << 63); +#elif defined(INFINITY) + return f64_to_raw(sign ? -INFINITY : INFINITY); +#else + return f64_to_raw(sign ? -HUGE_VAL : HUGE_VAL); +#endif +} + +/** Get raw 'nan' with sign. */ +static_inline u64 f64_raw_get_nan(bool sign) { +#if YYJSON_HAS_IEEE_754 + return F64_RAW_NAN | ((u64)sign << 63); +#elif defined(NAN) + return f64_to_raw(sign ? (f64)-NAN : (f64)NAN); +#else + return f64_to_raw((sign ? -0.0 : 0.0) / 0.0); +#endif +} + +/** + Convert normalized u64 (highest bit is 1) to f64. + + Some compiler (such as Microsoft Visual C++ 6.0) do not support converting + number from u64 to f64. This function will first convert u64 to i64 and then + to f64, with `to nearest` rounding mode. + */ +static_inline f64 normalized_u64_to_f64(u64 val) { +#if YYJSON_U64_TO_F64_NO_IMPL + i64 sig = (i64)((val >> 1) | (val & 1)); + return ((f64)sig) * (f64)2.0; +#else + return (f64)val; +#endif +} + + + +/*============================================================================== + * Size Utils + * These functions are used for memory allocation. + *============================================================================*/ + +/** Returns whether the size is overflow after increment. */ +static_inline bool size_add_is_overflow(usize size, usize add) { + return size > (size + add); +} + +/** Returns whether the size is power of 2 (size should not be 0). */ +static_inline bool size_is_pow2(usize size) { + return (size & (size - 1)) == 0; +} + +/** Align size upwards (may overflow). */ +static_inline usize size_align_up(usize size, usize align) { + if (size_is_pow2(align)) { + return (size + (align - 1)) & ~(align - 1); + } else { + return size + align - (size + align - 1) % align - 1; + } +} + +/** Align size downwards. */ +static_inline usize size_align_down(usize size, usize align) { + if (size_is_pow2(align)) { + return size & ~(align - 1); + } else { + return size - (size % align); + } +} + +/** Align address upwards (may overflow). */ +static_inline void *mem_align_up(void *mem, usize align) { + usize size; + memcpy(&size, &mem, sizeof(usize)); + size = size_align_up(size, align); + memcpy(&mem, &size, sizeof(usize)); + return mem; +} + + + +/*============================================================================== + * Bits Utils + * These functions are used by the floating-point number reader and writer. + *============================================================================*/ + +/** Returns the number of leading 0-bits in value (input should not be 0). */ +static_inline u32 u64_lz_bits(u64 v) { +#if GCC_HAS_CLZLL + return (u32)__builtin_clzll(v); +#elif MSC_HAS_BIT_SCAN_64 + unsigned long r; + _BitScanReverse64(&r, v); + return (u32)63 - (u32)r; +#elif MSC_HAS_BIT_SCAN + unsigned long hi, lo; + bool hi_set = _BitScanReverse(&hi, (u32)(v >> 32)) != 0; + _BitScanReverse(&lo, (u32)v); + hi |= 32; + return (u32)63 - (u32)(hi_set ? hi : lo); +#else + /* + branchless, use de Bruijn sequences + see: https://www.chessprogramming.org/BitScan + */ + const u8 table[64] = { + 63, 16, 62, 7, 15, 36, 61, 3, 6, 14, 22, 26, 35, 47, 60, 2, + 9, 5, 28, 11, 13, 21, 42, 19, 25, 31, 34, 40, 46, 52, 59, 1, + 17, 8, 37, 4, 23, 27, 48, 10, 29, 12, 43, 20, 32, 41, 53, 18, + 38, 24, 49, 30, 44, 33, 54, 39, 50, 45, 55, 51, 56, 57, 58, 0 + }; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v |= v >> 32; + return table[(v * U64(0x03F79D71, 0xB4CB0A89)) >> 58]; +#endif +} + +/** Returns the number of trailing 0-bits in value (input should not be 0). */ +static_inline u32 u64_tz_bits(u64 v) { +#if GCC_HAS_CTZLL + return (u32)__builtin_ctzll(v); +#elif MSC_HAS_BIT_SCAN_64 + unsigned long r; + _BitScanForward64(&r, v); + return (u32)r; +#elif MSC_HAS_BIT_SCAN + unsigned long lo, hi; + bool lo_set = _BitScanForward(&lo, (u32)(v)) != 0; + _BitScanForward(&hi, (u32)(v >> 32)); + hi += 32; + return lo_set ? lo : hi; +#else + /* + branchless, use de Bruijn sequences + see: https://www.chessprogramming.org/BitScan + */ + const u8 table[64] = { + 0, 1, 2, 53, 3, 7, 54, 27, 4, 38, 41, 8, 34, 55, 48, 28, + 62, 5, 39, 46, 44, 42, 22, 9, 24, 35, 59, 56, 49, 18, 29, 11, + 63, 52, 6, 26, 37, 40, 33, 47, 61, 45, 43, 21, 23, 58, 17, 10, + 51, 25, 36, 32, 60, 20, 57, 16, 50, 31, 19, 15, 30, 14, 13, 12 + }; + return table[((v & (~v + 1)) * U64(0x022FDD63, 0xCC95386D)) >> 58]; +#endif +} + + + +/*============================================================================== + * 128-bit Integer Utils + * These functions are used by the floating-point number reader and writer. + *============================================================================*/ + +/** Multiplies two 64-bit unsigned integers (a * b), + returns the 128-bit result as 'hi' and 'lo'. */ +static_inline void u128_mul(u64 a, u64 b, u64 *hi, u64 *lo) { +#if YYJSON_HAS_INT128 + u128 m = (u128)a * b; + *hi = (u64)(m >> 64); + *lo = (u64)(m); +#elif MSC_HAS_UMUL128 + *lo = _umul128(a, b, hi); +#else + u32 a0 = (u32)(a), a1 = (u32)(a >> 32); + u32 b0 = (u32)(b), b1 = (u32)(b >> 32); + u64 p00 = (u64)a0 * b0, p01 = (u64)a0 * b1; + u64 p10 = (u64)a1 * b0, p11 = (u64)a1 * b1; + u64 m0 = p01 + (p00 >> 32); + u32 m00 = (u32)(m0), m01 = (u32)(m0 >> 32); + u64 m1 = p10 + m00; + u32 m10 = (u32)(m1), m11 = (u32)(m1 >> 32); + *hi = p11 + m01 + m11; + *lo = ((u64)m10 << 32) | (u32)p00; +#endif +} + +/** Multiplies two 64-bit unsigned integers and add a value (a * b + c), + returns the 128-bit result as 'hi' and 'lo'. */ +static_inline void u128_mul_add(u64 a, u64 b, u64 c, u64 *hi, u64 *lo) { +#if YYJSON_HAS_INT128 + u128 m = (u128)a * b + c; + *hi = (u64)(m >> 64); + *lo = (u64)(m); +#else + u64 h, l, t; + u128_mul(a, b, &h, &l); + t = l + c; + h += (u64)(((t < l) | (t < c))); + *hi = h; + *lo = t; +#endif +} + + + +/*============================================================================== + * File Utils + * These functions are used to read and write JSON files. + *============================================================================*/ + +#define YYJSON_FOPEN_EXT +#if !defined(_MSC_VER) && defined(__GLIBC__) && defined(__GLIBC_PREREQ) +# if __GLIBC_PREREQ(2, 7) +# undef YYJSON_FOPEN_EXT +# define YYJSON_FOPEN_EXT "e" /* glibc extension to enable O_CLOEXEC */ +# endif +#endif + +static_inline FILE *fopen_safe(const char *path, const char *mode) { +#if YYJSON_MSC_VER >= 1400 + FILE *file = NULL; + if (fopen_s(&file, path, mode) != 0) return NULL; + return file; +#else + return fopen(path, mode); +#endif +} + +static_inline FILE *fopen_readonly(const char *path) { + return fopen_safe(path, "rb" YYJSON_FOPEN_EXT); +} + +static_inline FILE *fopen_writeonly(const char *path) { + return fopen_safe(path, "wb" YYJSON_FOPEN_EXT); +} + +static_inline usize fread_safe(void *buf, usize size, FILE *file) { +#if YYJSON_MSC_VER >= 1400 + return fread_s(buf, size, 1, size, file); +#else + return fread(buf, 1, size, file); +#endif +} + + + +/*============================================================================== + * Default Memory Allocator + * This is a simple libc memory allocator wrapper. + *============================================================================*/ + +static void *default_malloc(void *ctx, usize size) { + return malloc(size); +} + +static void *default_realloc(void *ctx, void *ptr, usize old_size, usize size) { + return realloc(ptr, size); +} + +static void default_free(void *ctx, void *ptr) { + free(ptr); +} + +static const yyjson_alc YYJSON_DEFAULT_ALC = { + default_malloc, + default_realloc, + default_free, + NULL +}; + + + +/*============================================================================== + * Null Memory Allocator + * + * This allocator is just a placeholder to ensure that the internal + * malloc/realloc/free function pointers are not null. + *============================================================================*/ + +static void *null_malloc(void *ctx, usize size) { + return NULL; +} + +static void *null_realloc(void *ctx, void *ptr, usize old_size, usize size) { + return NULL; +} + +static void null_free(void *ctx, void *ptr) { + return; +} + +static const yyjson_alc YYJSON_NULL_ALC = { + null_malloc, + null_realloc, + null_free, + NULL +}; + + + +/*============================================================================== + * Pool Memory Allocator + * + * This allocator is initialized with a fixed-size buffer. + * The buffer is split into multiple memory chunks for memory allocation. + *============================================================================*/ + +/** memory chunk header */ +typedef struct pool_chunk { + usize size; /* chunk memory size, include chunk header */ + struct pool_chunk *next; /* linked list, nullable */ + /* char mem[]; flexible array member */ +} pool_chunk; + +/** allocator ctx header */ +typedef struct pool_ctx { + usize size; /* total memory size, include ctx header */ + pool_chunk *free_list; /* linked list, nullable */ + /* pool_chunk chunks[]; flexible array member */ +} pool_ctx; + +/** align up the input size to chunk size */ +static_inline void pool_size_align(usize *size) { + *size = size_align_up(*size, sizeof(pool_chunk)) + sizeof(pool_chunk); +} + +static void *pool_malloc(void *ctx_ptr, usize size) { + /* assert(size != 0) */ + pool_ctx *ctx = (pool_ctx *)ctx_ptr; + pool_chunk *next, *prev = NULL, *cur = ctx->free_list; + + if (unlikely(size >= ctx->size)) return NULL; + pool_size_align(&size); + + while (cur) { + if (cur->size < size) { + /* not enough space, try next chunk */ + prev = cur; + cur = cur->next; + continue; + } + if (cur->size >= size + sizeof(pool_chunk) * 2) { + /* too much space, split this chunk */ + next = (pool_chunk *)(void *)((u8 *)cur + size); + next->size = cur->size - size; + next->next = cur->next; + cur->size = size; + } else { + /* just enough space, use whole chunk */ + next = cur->next; + } + if (prev) prev->next = next; + else ctx->free_list = next; + return (void *)(cur + 1); + } + return NULL; +} + +static void pool_free(void *ctx_ptr, void *ptr) { + /* assert(ptr != NULL) */ + pool_ctx *ctx = (pool_ctx *)ctx_ptr; + pool_chunk *cur = ((pool_chunk *)ptr) - 1; + pool_chunk *prev = NULL, *next = ctx->free_list; + + while (next && next < cur) { + prev = next; + next = next->next; + } + if (prev) prev->next = cur; + else ctx->free_list = cur; + cur->next = next; + + if (next && ((u8 *)cur + cur->size) == (u8 *)next) { + /* merge cur to higher chunk */ + cur->size += next->size; + cur->next = next->next; + } + if (prev && ((u8 *)prev + prev->size) == (u8 *)cur) { + /* merge cur to lower chunk */ + prev->size += cur->size; + prev->next = cur->next; + } +} + +static void *pool_realloc(void *ctx_ptr, void *ptr, + usize old_size, usize size) { + /* assert(ptr != NULL && size != 0 && old_size < size) */ + pool_ctx *ctx = (pool_ctx *)ctx_ptr; + pool_chunk *cur = ((pool_chunk *)ptr) - 1, *prev, *next, *tmp; + + /* check size */ + if (unlikely(size >= ctx->size)) return NULL; + pool_size_align(&old_size); + pool_size_align(&size); + if (unlikely(old_size == size)) return ptr; + + /* find next and prev chunk */ + prev = NULL; + next = ctx->free_list; + while (next && next < cur) { + prev = next; + next = next->next; + } + + if ((u8 *)cur + cur->size == (u8 *)next && cur->size + next->size >= size) { + /* merge to higher chunk if they are contiguous */ + usize free_size = cur->size + next->size - size; + if (free_size > sizeof(pool_chunk) * 2) { + tmp = (pool_chunk *)(void *)((u8 *)cur + size); + if (prev) prev->next = tmp; + else ctx->free_list = tmp; + tmp->next = next->next; + tmp->size = free_size; + cur->size = size; + } else { + if (prev) prev->next = next->next; + else ctx->free_list = next->next; + cur->size += next->size; + } + return ptr; + } else { + /* fallback to malloc and memcpy */ + void *new_ptr = pool_malloc(ctx_ptr, size - sizeof(pool_chunk)); + if (new_ptr) { + memcpy(new_ptr, ptr, cur->size - sizeof(pool_chunk)); + pool_free(ctx_ptr, ptr); + } + return new_ptr; + } +} + +bool yyjson_alc_pool_init(yyjson_alc *alc, void *buf, usize size) { + pool_chunk *chunk; + pool_ctx *ctx; + + if (unlikely(!alc)) return false; + *alc = YYJSON_NULL_ALC; + if (size < sizeof(pool_ctx) * 4) return false; + ctx = (pool_ctx *)mem_align_up(buf, sizeof(pool_ctx)); + if (unlikely(!ctx)) return false; + size -= (usize)((u8 *)ctx - (u8 *)buf); + size = size_align_down(size, sizeof(pool_ctx)); + + chunk = (pool_chunk *)(ctx + 1); + chunk->size = size - sizeof(pool_ctx); + chunk->next = NULL; + ctx->size = size; + ctx->free_list = chunk; + + alc->malloc = pool_malloc; + alc->realloc = pool_realloc; + alc->free = pool_free; + alc->ctx = (void *)ctx; + return true; +} + + + +/*============================================================================== + * Dynamic Memory Allocator + * + * This allocator allocates memory on demand and does not immediately release + * unused memory. Instead, it places the unused memory into a freelist for + * potential reuse in the future. It is only when the entire allocator is + * destroyed that all previously allocated memory is released at once. + *============================================================================*/ + +/** memory chunk header */ +typedef struct dyn_chunk { + usize size; /* chunk size, include header */ + struct dyn_chunk *next; + /* char mem[]; flexible array member */ +} dyn_chunk; + +/** allocator ctx header */ +typedef struct { + dyn_chunk free_list; /* dummy header, sorted from small to large */ + dyn_chunk used_list; /* dummy header */ +} dyn_ctx; + +/** align up the input size to chunk size */ +static_inline bool dyn_size_align(usize *size) { + usize alc_size = *size + sizeof(dyn_chunk); + alc_size = size_align_up(alc_size, YYJSON_ALC_DYN_MIN_SIZE); + if (unlikely(alc_size < *size)) return false; /* overflow */ + *size = alc_size; + return true; +} + +/** remove a chunk from list (the chunk must already be in the list) */ +static_inline void dyn_chunk_list_remove(dyn_chunk *list, dyn_chunk *chunk) { + dyn_chunk *prev = list, *cur; + for (cur = prev->next; cur; cur = cur->next) { + if (cur == chunk) { + prev->next = cur->next; + cur->next = NULL; + return; + } + prev = cur; + } +} + +/** add a chunk to list header (the chunk must not be in the list) */ +static_inline void dyn_chunk_list_add(dyn_chunk *list, dyn_chunk *chunk) { + chunk->next = list->next; + list->next = chunk; +} + +static void *dyn_malloc(void *ctx_ptr, usize size) { + /* assert(size != 0) */ + const yyjson_alc def = YYJSON_DEFAULT_ALC; + dyn_ctx *ctx = (dyn_ctx *)ctx_ptr; + dyn_chunk *chunk, *prev, *next; + if (unlikely(!dyn_size_align(&size))) return NULL; + + /* freelist is empty, create new chunk */ + if (!ctx->free_list.next) { + chunk = (dyn_chunk *)def.malloc(def.ctx, size); + if (unlikely(!chunk)) return NULL; + chunk->size = size; + chunk->next = NULL; + dyn_chunk_list_add(&ctx->used_list, chunk); + return (void *)(chunk + 1); + } + + /* find a large enough chunk, or resize the largest chunk */ + prev = &ctx->free_list; + while (true) { + chunk = prev->next; + if (chunk->size >= size) { /* enough size, reuse this chunk */ + prev->next = chunk->next; + dyn_chunk_list_add(&ctx->used_list, chunk); + return (void *)(chunk + 1); + } + if (!chunk->next) { /* resize the largest chunk */ + chunk = (dyn_chunk *)def.realloc(def.ctx, chunk, chunk->size, size); + if (unlikely(!chunk)) return NULL; + prev->next = NULL; + chunk->size = size; + dyn_chunk_list_add(&ctx->used_list, chunk); + return (void *)(chunk + 1); + } + prev = chunk; + } +} + +static void *dyn_realloc(void *ctx_ptr, void *ptr, + usize old_size, usize size) { + /* assert(ptr != NULL && size != 0 && old_size < size) */ + const yyjson_alc def = YYJSON_DEFAULT_ALC; + dyn_ctx *ctx = (dyn_ctx *)ctx_ptr; + dyn_chunk *prev, *next, *new_chunk; + dyn_chunk *chunk = (dyn_chunk *)ptr - 1; + if (unlikely(!dyn_size_align(&size))) return NULL; + if (chunk->size >= size) return ptr; + + dyn_chunk_list_remove(&ctx->used_list, chunk); + new_chunk = (dyn_chunk *)def.realloc(def.ctx, chunk, chunk->size, size); + if (likely(new_chunk)) { + new_chunk->size = size; + chunk = new_chunk; + } + dyn_chunk_list_add(&ctx->used_list, chunk); + return new_chunk ? (void *)(new_chunk + 1) : NULL; +} + +static void dyn_free(void *ctx_ptr, void *ptr) { + /* assert(ptr != NULL) */ + dyn_ctx *ctx = (dyn_ctx *)ctx_ptr; + dyn_chunk *chunk = (dyn_chunk *)ptr - 1, *prev; + + dyn_chunk_list_remove(&ctx->used_list, chunk); + for (prev = &ctx->free_list; prev; prev = prev->next) { + if (!prev->next || prev->next->size >= chunk->size) { + chunk->next = prev->next; + prev->next = chunk; + break; + } + } +} + +yyjson_alc *yyjson_alc_dyn_new(void) { + const yyjson_alc def = YYJSON_DEFAULT_ALC; + usize hdr_len = sizeof(yyjson_alc) + sizeof(dyn_ctx); + yyjson_alc *alc = (yyjson_alc *)def.malloc(def.ctx, hdr_len); + dyn_ctx *ctx = (dyn_ctx *)(void *)(alc + 1); + if (unlikely(!alc)) return NULL; + alc->malloc = dyn_malloc; + alc->realloc = dyn_realloc; + alc->free = dyn_free; + alc->ctx = alc + 1; + memset(ctx, 0, sizeof(*ctx)); + return alc; +} + +void yyjson_alc_dyn_free(yyjson_alc *alc) { + const yyjson_alc def = YYJSON_DEFAULT_ALC; + dyn_ctx *ctx = (dyn_ctx *)(void *)(alc + 1); + dyn_chunk *chunk, *next; + if (unlikely(!alc)) return; + for (chunk = ctx->free_list.next; chunk; chunk = next) { + next = chunk->next; + def.free(def.ctx, chunk); + } + for (chunk = ctx->used_list.next; chunk; chunk = next) { + next = chunk->next; + def.free(def.ctx, chunk); + } + def.free(def.ctx, alc); +} + + + +/*============================================================================== + * JSON document and value + *============================================================================*/ + +static_inline void unsafe_yyjson_str_pool_release(yyjson_str_pool *pool, + yyjson_alc *alc) { + yyjson_str_chunk *chunk = pool->chunks, *next; + while (chunk) { + next = chunk->next; + alc->free(alc->ctx, chunk); + chunk = next; + } +} + +static_inline void unsafe_yyjson_val_pool_release(yyjson_val_pool *pool, + yyjson_alc *alc) { + yyjson_val_chunk *chunk = pool->chunks, *next; + while (chunk) { + next = chunk->next; + alc->free(alc->ctx, chunk); + chunk = next; + } +} + +bool unsafe_yyjson_str_pool_grow(yyjson_str_pool *pool, + const yyjson_alc *alc, usize len) { + yyjson_str_chunk *chunk; + usize size, max_len; + + /* create a new chunk */ + max_len = USIZE_MAX - sizeof(yyjson_str_chunk); + if (unlikely(len > max_len)) return false; + size = len + sizeof(yyjson_str_chunk); + size = yyjson_max(pool->chunk_size, size); + chunk = (yyjson_str_chunk *)alc->malloc(alc->ctx, size); + if (unlikely(!chunk)) return false; + + /* insert the new chunk as the head of the linked list */ + chunk->next = pool->chunks; + chunk->chunk_size = size; + pool->chunks = chunk; + pool->cur = (char *)chunk + sizeof(yyjson_str_chunk); + pool->end = (char *)chunk + size; + + /* the next chunk is twice the size of the current one */ + size = yyjson_min(pool->chunk_size * 2, pool->chunk_size_max); + if (size < pool->chunk_size) size = pool->chunk_size_max; /* overflow */ + pool->chunk_size = size; + return true; +} + +bool unsafe_yyjson_val_pool_grow(yyjson_val_pool *pool, + const yyjson_alc *alc, usize count) { + yyjson_val_chunk *chunk; + usize size, max_count; + + /* create a new chunk */ + max_count = USIZE_MAX / sizeof(yyjson_mut_val) - 1; + if (unlikely(count > max_count)) return false; + size = (count + 1) * sizeof(yyjson_mut_val); + size = yyjson_max(pool->chunk_size, size); + chunk = (yyjson_val_chunk *)alc->malloc(alc->ctx, size); + if (unlikely(!chunk)) return false; + + /* insert the new chunk as the head of the linked list */ + chunk->next = pool->chunks; + chunk->chunk_size = size; + pool->chunks = chunk; + pool->cur = (yyjson_mut_val *)(void *)((u8 *)chunk) + 1; + pool->end = (yyjson_mut_val *)(void *)((u8 *)chunk + size); + + /* the next chunk is twice the size of the current one */ + size = yyjson_min(pool->chunk_size * 2, pool->chunk_size_max); + if (size < pool->chunk_size) size = pool->chunk_size_max; /* overflow */ + pool->chunk_size = size; + return true; +} + +bool yyjson_mut_doc_set_str_pool_size(yyjson_mut_doc *doc, size_t len) { + usize max_size = USIZE_MAX - sizeof(yyjson_str_chunk); + if (!doc || !len || len > max_size) return false; + doc->str_pool.chunk_size = len + sizeof(yyjson_str_chunk); + return true; +} + +bool yyjson_mut_doc_set_val_pool_size(yyjson_mut_doc *doc, size_t count) { + usize max_count = USIZE_MAX / sizeof(yyjson_mut_val) - 1; + if (!doc || !count || count > max_count) return false; + doc->val_pool.chunk_size = (count + 1) * sizeof(yyjson_mut_val); + return true; +} + +void yyjson_mut_doc_free(yyjson_mut_doc *doc) { + if (doc) { + yyjson_alc alc = doc->alc; + memset(&doc->alc, 0, sizeof(alc)); + unsafe_yyjson_str_pool_release(&doc->str_pool, &alc); + unsafe_yyjson_val_pool_release(&doc->val_pool, &alc); + alc.free(alc.ctx, doc); + } +} + +yyjson_mut_doc *yyjson_mut_doc_new(const yyjson_alc *alc) { + yyjson_mut_doc *doc; + if (!alc) alc = &YYJSON_DEFAULT_ALC; + doc = (yyjson_mut_doc *)alc->malloc(alc->ctx, sizeof(yyjson_mut_doc)); + if (!doc) return NULL; + memset(doc, 0, sizeof(yyjson_mut_doc)); + + doc->alc = *alc; + doc->str_pool.chunk_size = YYJSON_MUT_DOC_STR_POOL_INIT_SIZE; + doc->str_pool.chunk_size_max = YYJSON_MUT_DOC_STR_POOL_MAX_SIZE; + doc->val_pool.chunk_size = YYJSON_MUT_DOC_VAL_POOL_INIT_SIZE; + doc->val_pool.chunk_size_max = YYJSON_MUT_DOC_VAL_POOL_MAX_SIZE; + return doc; +} + +yyjson_mut_doc *yyjson_doc_mut_copy(yyjson_doc *doc, const yyjson_alc *alc) { + yyjson_mut_doc *m_doc; + yyjson_mut_val *m_val; + + if (!doc || !doc->root) return NULL; + m_doc = yyjson_mut_doc_new(alc); + if (!m_doc) return NULL; + m_val = yyjson_val_mut_copy(m_doc, doc->root); + if (!m_val) { + yyjson_mut_doc_free(m_doc); + return NULL; + } + yyjson_mut_doc_set_root(m_doc, m_val); + return m_doc; +} + +yyjson_mut_doc *yyjson_mut_doc_mut_copy(yyjson_mut_doc *doc, + const yyjson_alc *alc) { + yyjson_mut_doc *m_doc; + yyjson_mut_val *m_val; + + if (!doc) return NULL; + if (!doc->root) return yyjson_mut_doc_new(alc); + + m_doc = yyjson_mut_doc_new(alc); + if (!m_doc) return NULL; + m_val = yyjson_mut_val_mut_copy(m_doc, doc->root); + if (!m_val) { + yyjson_mut_doc_free(m_doc); + return NULL; + } + yyjson_mut_doc_set_root(m_doc, m_val); + return m_doc; +} + +yyjson_mut_val *yyjson_val_mut_copy(yyjson_mut_doc *m_doc, + yyjson_val *i_vals) { + /* + The immutable object or array stores all sub-values in a contiguous memory, + We copy them to another contiguous memory as mutable values, + then reconnect the mutable values with the original relationship. + */ + usize i_vals_len; + yyjson_mut_val *m_vals, *m_val; + yyjson_val *i_val, *i_end; + + if (!m_doc || !i_vals) return NULL; + i_end = unsafe_yyjson_get_next(i_vals); + i_vals_len = (usize)(unsafe_yyjson_get_next(i_vals) - i_vals); + m_vals = unsafe_yyjson_mut_val(m_doc, i_vals_len); + if (!m_vals) return NULL; + i_val = i_vals; + m_val = m_vals; + + for (; i_val < i_end; i_val++, m_val++) { + yyjson_type type = unsafe_yyjson_get_type(i_val); + m_val->tag = i_val->tag; + m_val->uni.u64 = i_val->uni.u64; + if (type == YYJSON_TYPE_STR || type == YYJSON_TYPE_RAW) { + const char *str = i_val->uni.str; + usize str_len = unsafe_yyjson_get_len(i_val); + m_val->uni.str = unsafe_yyjson_mut_strncpy(m_doc, str, str_len); + if (!m_val->uni.str) return NULL; + } else if (type == YYJSON_TYPE_ARR) { + usize len = unsafe_yyjson_get_len(i_val); + if (len > 0) { + yyjson_val *ii_val = i_val + 1, *ii_next; + yyjson_mut_val *mm_val = m_val + 1, *mm_ctn = m_val, *mm_next; + while (len-- > 1) { + ii_next = unsafe_yyjson_get_next(ii_val); + mm_next = mm_val + (ii_next - ii_val); + mm_val->next = mm_next; + ii_val = ii_next; + mm_val = mm_next; + } + mm_val->next = mm_ctn + 1; + mm_ctn->uni.ptr = mm_val; + } + } else if (type == YYJSON_TYPE_OBJ) { + usize len = unsafe_yyjson_get_len(i_val); + if (len > 0) { + yyjson_val *ii_key = i_val + 1, *ii_nextkey; + yyjson_mut_val *mm_key = m_val + 1, *mm_ctn = m_val; + yyjson_mut_val *mm_nextkey; + while (len-- > 1) { + ii_nextkey = unsafe_yyjson_get_next(ii_key + 1); + mm_nextkey = mm_key + (ii_nextkey - ii_key); + mm_key->next = mm_key + 1; + mm_key->next->next = mm_nextkey; + ii_key = ii_nextkey; + mm_key = mm_nextkey; + } + mm_key->next = mm_key + 1; + mm_key->next->next = mm_ctn + 1; + mm_ctn->uni.ptr = mm_key; + } + } + } + + return m_vals; +} + +static yyjson_mut_val *unsafe_yyjson_mut_val_mut_copy(yyjson_mut_doc *m_doc, + yyjson_mut_val *m_vals) { + /* + The mutable object or array stores all sub-values in a circular linked + list, so we can traverse them in the same loop. The traversal starts from + the last item, continues with the first item in a list, and ends with the + second to last item, which needs to be linked to the last item to close the + circle. + */ + yyjson_mut_val *m_val = unsafe_yyjson_mut_val(m_doc, 1); + if (unlikely(!m_val)) return NULL; + m_val->tag = m_vals->tag; + + switch (unsafe_yyjson_get_type(m_vals)) { + case YYJSON_TYPE_OBJ: + case YYJSON_TYPE_ARR: + if (unsafe_yyjson_get_len(m_vals) > 0) { + yyjson_mut_val *last = (yyjson_mut_val *)m_vals->uni.ptr; + yyjson_mut_val *next = last->next, *prev; + prev = unsafe_yyjson_mut_val_mut_copy(m_doc, last); + if (!prev) return NULL; + m_val->uni.ptr = (void *)prev; + while (next != last) { + prev->next = unsafe_yyjson_mut_val_mut_copy(m_doc, next); + if (!prev->next) return NULL; + prev = prev->next; + next = next->next; + } + prev->next = (yyjson_mut_val *)m_val->uni.ptr; + } + break; + + case YYJSON_TYPE_RAW: + case YYJSON_TYPE_STR: { + const char *str = m_vals->uni.str; + usize str_len = unsafe_yyjson_get_len(m_vals); + m_val->uni.str = unsafe_yyjson_mut_strncpy(m_doc, str, str_len); + if (!m_val->uni.str) return NULL; + break; + } + + default: + m_val->uni = m_vals->uni; + break; + } + + return m_val; +} + +yyjson_mut_val *yyjson_mut_val_mut_copy(yyjson_mut_doc *doc, + yyjson_mut_val *val) { + if (doc && val) return unsafe_yyjson_mut_val_mut_copy(doc, val); + return NULL; +} + +/* Count the number of values and the total length of the strings. */ +static void yyjson_mut_stat(yyjson_mut_val *val, + usize *val_sum, usize *str_sum) { + yyjson_type type = unsafe_yyjson_get_type(val); + *val_sum += 1; + if (type == YYJSON_TYPE_ARR || type == YYJSON_TYPE_OBJ) { + yyjson_mut_val *child = (yyjson_mut_val *)val->uni.ptr; + usize len = unsafe_yyjson_get_len(val), i; + len <<= (u8)(type == YYJSON_TYPE_OBJ); + *val_sum += len; + for (i = 0; i < len; i++) { + yyjson_type stype = unsafe_yyjson_get_type(child); + if (stype == YYJSON_TYPE_STR || stype == YYJSON_TYPE_RAW) { + *str_sum += unsafe_yyjson_get_len(child) + 1; + } else if (stype == YYJSON_TYPE_ARR || stype == YYJSON_TYPE_OBJ) { + yyjson_mut_stat(child, val_sum, str_sum); + *val_sum -= 1; + } + child = child->next; + } + } else if (type == YYJSON_TYPE_STR || type == YYJSON_TYPE_RAW) { + *str_sum += unsafe_yyjson_get_len(val) + 1; + } +} + +/* Copy mutable values to immutable value pool. */ +static usize yyjson_imut_copy(yyjson_val **val_ptr, char **buf_ptr, + yyjson_mut_val *mval) { + yyjson_val *val = *val_ptr; + yyjson_type type = unsafe_yyjson_get_type(mval); + if (type == YYJSON_TYPE_ARR || type == YYJSON_TYPE_OBJ) { + yyjson_mut_val *child = (yyjson_mut_val *)mval->uni.ptr; + usize len = unsafe_yyjson_get_len(mval), i; + usize val_sum = 1; + if (type == YYJSON_TYPE_OBJ) { + if (len) child = child->next->next; + len <<= 1; + } else { + if (len) child = child->next; + } + *val_ptr = val + 1; + for (i = 0; i < len; i++) { + val_sum += yyjson_imut_copy(val_ptr, buf_ptr, child); + child = child->next; + } + val->tag = mval->tag; + val->uni.ofs = val_sum * sizeof(yyjson_val); + return val_sum; + } else if (type == YYJSON_TYPE_STR || type == YYJSON_TYPE_RAW) { + char *buf = *buf_ptr; + usize len = unsafe_yyjson_get_len(mval); + memcpy((void *)buf, (const void *)mval->uni.str, len); + buf[len] = '\0'; + val->tag = mval->tag; + val->uni.str = buf; + *val_ptr = val + 1; + *buf_ptr = buf + len + 1; + return 1; + } else { + val->tag = mval->tag; + val->uni = mval->uni; + *val_ptr = val + 1; + return 1; + } +} + +yyjson_doc *yyjson_mut_doc_imut_copy(yyjson_mut_doc *mdoc, + const yyjson_alc *alc) { + if (!mdoc) return NULL; + return yyjson_mut_val_imut_copy(mdoc->root, alc); +} + +yyjson_doc *yyjson_mut_val_imut_copy(yyjson_mut_val *mval, + const yyjson_alc *alc) { + usize val_num = 0, str_sum = 0, hdr_size, buf_size; + yyjson_doc *doc = NULL; + yyjson_val *val_hdr = NULL; + + /* This value should be NULL here. Setting a non-null value suppresses + warning from the clang analyzer. */ + char *str_hdr = (char *)(void *)&str_sum; + if (!mval) return NULL; + if (!alc) alc = &YYJSON_DEFAULT_ALC; + + /* traverse the input value to get pool size */ + yyjson_mut_stat(mval, &val_num, &str_sum); + + /* create doc and val pool */ + hdr_size = size_align_up(sizeof(yyjson_doc), sizeof(yyjson_val)); + buf_size = hdr_size + val_num * sizeof(yyjson_val); + doc = (yyjson_doc *)alc->malloc(alc->ctx, buf_size); + if (!doc) return NULL; + memset(doc, 0, sizeof(yyjson_doc)); + val_hdr = (yyjson_val *)(void *)((char *)(void *)doc + hdr_size); + doc->root = val_hdr; + doc->alc = *alc; + + /* create str pool */ + if (str_sum > 0) { + str_hdr = (char *)alc->malloc(alc->ctx, str_sum); + doc->str_pool = str_hdr; + if (!str_hdr) { + alc->free(alc->ctx, (void *)doc); + return NULL; + } + } + + /* copy vals and strs */ + doc->val_read = yyjson_imut_copy(&val_hdr, &str_hdr, mval); + doc->dat_read = str_sum + 1; + return doc; +} + +static_inline bool unsafe_yyjson_num_equals(void *lhs, void *rhs) { + yyjson_val_uni *luni = &((yyjson_val *)lhs)->uni; + yyjson_val_uni *runi = &((yyjson_val *)rhs)->uni; + yyjson_subtype lt = unsafe_yyjson_get_subtype(lhs); + yyjson_subtype rt = unsafe_yyjson_get_subtype(rhs); + if (lt == rt) return luni->u64 == runi->u64; + if (lt == YYJSON_SUBTYPE_SINT && rt == YYJSON_SUBTYPE_UINT) { + return luni->i64 >= 0 && luni->u64 == runi->u64; + } + if (lt == YYJSON_SUBTYPE_UINT && rt == YYJSON_SUBTYPE_SINT) { + return runi->i64 >= 0 && luni->u64 == runi->u64; + } + return false; +} + +static_inline bool unsafe_yyjson_str_equals(void *lhs, void *rhs) { + usize len = unsafe_yyjson_get_len(lhs); + if (len != unsafe_yyjson_get_len(rhs)) return false; + return !memcmp(unsafe_yyjson_get_str(lhs), + unsafe_yyjson_get_str(rhs), len); +} + +bool unsafe_yyjson_equals(yyjson_val *lhs, yyjson_val *rhs) { + yyjson_type type = unsafe_yyjson_get_type(lhs); + if (type != unsafe_yyjson_get_type(rhs)) return false; + + switch (type) { + case YYJSON_TYPE_OBJ: { + usize len = unsafe_yyjson_get_len(lhs); + if (len != unsafe_yyjson_get_len(rhs)) return false; + if (len > 0) { + yyjson_obj_iter iter; + yyjson_obj_iter_init(rhs, &iter); + lhs = unsafe_yyjson_get_first(lhs); + while (len-- > 0) { + rhs = yyjson_obj_iter_getn(&iter, lhs->uni.str, + unsafe_yyjson_get_len(lhs)); + if (!rhs) return false; + if (!unsafe_yyjson_equals(lhs + 1, rhs)) return false; + lhs = unsafe_yyjson_get_next(lhs + 1); + } + } + /* yyjson allows duplicate keys, so the check may be inaccurate */ + return true; + } + + case YYJSON_TYPE_ARR: { + usize len = unsafe_yyjson_get_len(lhs); + if (len != unsafe_yyjson_get_len(rhs)) return false; + if (len > 0) { + lhs = unsafe_yyjson_get_first(lhs); + rhs = unsafe_yyjson_get_first(rhs); + while (len-- > 0) { + if (!unsafe_yyjson_equals(lhs, rhs)) return false; + lhs = unsafe_yyjson_get_next(lhs); + rhs = unsafe_yyjson_get_next(rhs); + } + } + return true; + } + + case YYJSON_TYPE_NUM: + return unsafe_yyjson_num_equals(lhs, rhs); + + case YYJSON_TYPE_RAW: + case YYJSON_TYPE_STR: + return unsafe_yyjson_str_equals(lhs, rhs); + + case YYJSON_TYPE_NULL: + case YYJSON_TYPE_BOOL: + return lhs->tag == rhs->tag; + + default: + return false; + } +} + +bool unsafe_yyjson_mut_equals(yyjson_mut_val *lhs, yyjson_mut_val *rhs) { + yyjson_type type = unsafe_yyjson_get_type(lhs); + if (type != unsafe_yyjson_get_type(rhs)) return false; + + switch (type) { + case YYJSON_TYPE_OBJ: { + usize len = unsafe_yyjson_get_len(lhs); + if (len != unsafe_yyjson_get_len(rhs)) return false; + if (len > 0) { + yyjson_mut_obj_iter iter; + yyjson_mut_obj_iter_init(rhs, &iter); + lhs = (yyjson_mut_val *)lhs->uni.ptr; + while (len-- > 0) { + rhs = yyjson_mut_obj_iter_getn(&iter, lhs->uni.str, + unsafe_yyjson_get_len(lhs)); + if (!rhs) return false; + if (!unsafe_yyjson_mut_equals(lhs->next, rhs)) return false; + lhs = lhs->next->next; + } + } + /* yyjson allows duplicate keys, so the check may be inaccurate */ + return true; + } + + case YYJSON_TYPE_ARR: { + usize len = unsafe_yyjson_get_len(lhs); + if (len != unsafe_yyjson_get_len(rhs)) return false; + if (len > 0) { + lhs = (yyjson_mut_val *)lhs->uni.ptr; + rhs = (yyjson_mut_val *)rhs->uni.ptr; + while (len-- > 0) { + if (!unsafe_yyjson_mut_equals(lhs, rhs)) return false; + lhs = lhs->next; + rhs = rhs->next; + } + } + return true; + } + + case YYJSON_TYPE_NUM: + return unsafe_yyjson_num_equals(lhs, rhs); + + case YYJSON_TYPE_RAW: + case YYJSON_TYPE_STR: + return unsafe_yyjson_str_equals(lhs, rhs); + + case YYJSON_TYPE_NULL: + case YYJSON_TYPE_BOOL: + return lhs->tag == rhs->tag; + + default: + return false; + } +} + + + +#if !YYJSON_DISABLE_UTILS + +/*============================================================================== + * JSON Pointer API (RFC 6901) + *============================================================================*/ + +/** + Get a token from JSON pointer string. + @param ptr [in,out] + in: string that points to current token prefix `/` + out: string that points to next token prefix `/`, or string end + @param end [in] end of the entire JSON Pointer string + @param len [out] unescaped token length + @param esc [out] number of escaped characters in this token + @return head of the token, or NULL if syntax error + */ +static_inline const char *ptr_next_token(const char **ptr, const char *end, + usize *len, usize *esc) { + const char *hdr = *ptr + 1; + const char *cur = hdr; + /* skip unescaped characters */ + while (cur < end && *cur != '/' && *cur != '~') cur++; + if (likely(cur == end || *cur != '~')) { + /* no escaped characters, return */ + *ptr = cur; + *len = (usize)(cur - hdr); + *esc = 0; + return hdr; + } else { + /* handle escaped characters */ + usize esc_num = 0; + while (cur < end && *cur != '/') { + if (*cur++ == '~') { + if (cur == end || (*cur != '0' && *cur != '1')) { + *ptr = cur - 1; + return NULL; + } + esc_num++; + } + } + *ptr = cur; + *len = (usize)(cur - hdr) - esc_num; + *esc = esc_num; + return hdr; + } +} + +/** + Convert token string to index. + @param cur [in] token head + @param len [in] token length + @param idx [out] the index number, or USIZE_MAX if token is '-' + @return true if token is a valid array index + */ +static_inline bool ptr_token_to_idx(const char *cur, usize len, usize *idx) { + const char *end = cur + len; + usize num = 0, add; + if (unlikely(len == 0 || len > USIZE_SAFE_DIG)) return false; + if (*cur == '0') { + if (unlikely(len > 1)) return false; + *idx = 0; + return true; + } + if (*cur == '-') { + if (unlikely(len > 1)) return false; + *idx = USIZE_MAX; + return true; + } + for (; cur < end && (add = (usize)((u8)*cur - (u8)'0')) <= 9; cur++) { + num = num * 10 + add; + } + if (unlikely(num == 0 || cur < end)) return false; + *idx = num; + return true; +} + +/** + Compare JSON key with token. + @param key a string key (yyjson_val or yyjson_mut_val) + @param token a JSON pointer token + @param len unescaped token length + @param esc number of escaped characters in this token + @return true if `str` is equals to `token` + */ +static_inline bool ptr_token_eq(void *key, + const char *token, usize len, usize esc) { + yyjson_val *val = (yyjson_val *)key; + if (unsafe_yyjson_get_len(val) != len) return false; + if (likely(!esc)) { + return memcmp(val->uni.str, token, len) == 0; + } else { + const char *str = val->uni.str; + for (; len-- > 0; token++, str++) { + if (*token == '~') { + if (*str != (*++token == '0' ? '~' : '/')) return false; + } else { + if (*str != *token) return false; + } + } + return true; + } +} + +/** + Get a value from array by token. + @param arr an array, should not be NULL or non-array type + @param token a JSON pointer token + @param len unescaped token length + @param esc number of escaped characters in this token + @return value at index, or NULL if token is not index or index is out of range + */ +static_inline yyjson_val *ptr_arr_get(yyjson_val *arr, const char *token, + usize len, usize esc) { + yyjson_val *val = unsafe_yyjson_get_first(arr); + usize num = unsafe_yyjson_get_len(arr), idx = 0; + if (unlikely(num == 0)) return NULL; + if (unlikely(!ptr_token_to_idx(token, len, &idx))) return NULL; + if (unlikely(idx >= num)) return NULL; + if (unsafe_yyjson_arr_is_flat(arr)) { + return val + idx; + } else { + while (idx-- > 0) val = unsafe_yyjson_get_next(val); + return val; + } +} + +/** + Get a value from object by token. + @param obj [in] an object, should not be NULL or non-object type + @param token [in] a JSON pointer token + @param len [in] unescaped token length + @param esc [in] number of escaped characters in this token + @return value associated with the token, or NULL if no value + */ +static_inline yyjson_val *ptr_obj_get(yyjson_val *obj, const char *token, + usize len, usize esc) { + yyjson_val *key = unsafe_yyjson_get_first(obj); + usize num = unsafe_yyjson_get_len(obj); + if (unlikely(num == 0)) return NULL; + for (; num > 0; num--, key = unsafe_yyjson_get_next(key + 1)) { + if (ptr_token_eq(key, token, len, esc)) return key + 1; + } + return NULL; +} + +/** + Get a value from array by token. + @param arr [in] an array, should not be NULL or non-array type + @param token [in] a JSON pointer token + @param len [in] unescaped token length + @param esc [in] number of escaped characters in this token + @param pre [out] previous (sibling) value of the returned value + @param last [out] whether index is last + @return value at index, or NULL if token is not index or index is out of range + */ +static_inline yyjson_mut_val *ptr_mut_arr_get(yyjson_mut_val *arr, + const char *token, + usize len, usize esc, + yyjson_mut_val **pre, + bool *last) { + yyjson_mut_val *val = (yyjson_mut_val *)arr->uni.ptr; /* last (tail) */ + usize num = unsafe_yyjson_get_len(arr), idx; + if (last) *last = false; + if (pre) *pre = NULL; + if (unlikely(num == 0)) { + if (last && len == 1 && (*token == '0' || *token == '-')) *last = true; + return NULL; + } + if (unlikely(!ptr_token_to_idx(token, len, &idx))) return NULL; + if (last) *last = (idx == num || idx == USIZE_MAX); + if (unlikely(idx >= num)) return NULL; + while (idx-- > 0) val = val->next; + *pre = val; + return val->next; +} + +/** + Get a value from object by token. + @param obj [in] an object, should not be NULL or non-object type + @param token [in] a JSON pointer token + @param len [in] unescaped token length + @param esc [in] number of escaped characters in this token + @param pre [out] previous (sibling) key of the returned value's key + @return value associated with the token, or NULL if no value + */ +static_inline yyjson_mut_val *ptr_mut_obj_get(yyjson_mut_val *obj, + const char *token, + usize len, usize esc, + yyjson_mut_val **pre) { + yyjson_mut_val *pre_key = (yyjson_mut_val *)obj->uni.ptr, *key; + usize num = unsafe_yyjson_get_len(obj); + if (pre) *pre = NULL; + if (unlikely(num == 0)) return NULL; + for (; num > 0; num--, pre_key = key) { + key = pre_key->next->next; + if (ptr_token_eq(key, token, len, esc)) { + *pre = pre_key; + return key->next; + } + } + return NULL; +} + +/** + Create a string value with JSON pointer token. + @param token [in] a JSON pointer token + @param len [in] unescaped token length + @param esc [in] number of escaped characters in this token + @param doc [in] used for memory allocation when creating value + @return new string value, or NULL if memory allocation failed + */ +static_inline yyjson_mut_val *ptr_new_key(const char *token, + usize len, usize esc, + yyjson_mut_doc *doc) { + const char *src = token; + if (likely(!esc)) { + return yyjson_mut_strncpy(doc, src, len); + } else { + const char *end = src + len + esc; + char *dst = unsafe_yyjson_mut_str_alc(doc, len + esc); + char *str = dst; + if (unlikely(!dst)) return NULL; + for (; src < end; src++, dst++) { + if (*src != '~') *dst = *src; + else *dst = (*++src == '0' ? '~' : '/'); + } + *dst = '\0'; + return yyjson_mut_strn(doc, str, len); + } +} + +/* macros for yyjson_ptr */ +#define return_err(_ret, _code, _pos, _msg) do { \ + if (err) { \ + err->code = YYJSON_PTR_ERR_##_code; \ + err->msg = _msg; \ + err->pos = (usize)(_pos); \ + } \ + return _ret; \ +} while (false) + +#define return_err_resolve(_ret, _pos) \ + return_err(_ret, RESOLVE, _pos, "JSON pointer cannot be resolved") +#define return_err_syntax(_ret, _pos) \ + return_err(_ret, SYNTAX, _pos, "invalid escaped character") +#define return_err_alloc(_ret) \ + return_err(_ret, MEMORY_ALLOCATION, 0, "failed to create value") + +yyjson_val *unsafe_yyjson_ptr_getx(yyjson_val *val, + const char *ptr, size_t ptr_len, + yyjson_ptr_err *err) { + + const char *hdr = ptr, *end = ptr + ptr_len, *token; + usize len, esc; + yyjson_type type; + + while (true) { + token = ptr_next_token(&ptr, end, &len, &esc); + if (unlikely(!token)) return_err_syntax(NULL, ptr - hdr); + type = unsafe_yyjson_get_type(val); + if (type == YYJSON_TYPE_OBJ) { + val = ptr_obj_get(val, token, len, esc); + } else if (type == YYJSON_TYPE_ARR) { + val = ptr_arr_get(val, token, len, esc); + } else { + val = NULL; + } + if (!val) return_err_resolve(NULL, token - hdr); + if (ptr == end) return val; + } +} + +yyjson_mut_val *unsafe_yyjson_mut_ptr_getx(yyjson_mut_val *val, + const char *ptr, + size_t ptr_len, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err) { + + const char *hdr = ptr, *end = ptr + ptr_len, *token; + usize len, esc; + yyjson_mut_val *ctn, *pre = NULL; + yyjson_type type; + bool idx_is_last = false; + + while (true) { + token = ptr_next_token(&ptr, end, &len, &esc); + if (unlikely(!token)) return_err_syntax(NULL, ptr - hdr); + ctn = val; + type = unsafe_yyjson_get_type(val); + if (type == YYJSON_TYPE_OBJ) { + val = ptr_mut_obj_get(val, token, len, esc, &pre); + } else if (type == YYJSON_TYPE_ARR) { + val = ptr_mut_arr_get(val, token, len, esc, &pre, &idx_is_last); + } else { + val = NULL; + } + if (ctx && (ptr == end)) { + if (type == YYJSON_TYPE_OBJ || + (type == YYJSON_TYPE_ARR && (val || idx_is_last))) { + ctx->ctn = ctn; + ctx->pre = pre; + } + } + if (!val) return_err_resolve(NULL, token - hdr); + if (ptr == end) return val; + } +} + +bool unsafe_yyjson_mut_ptr_putx(yyjson_mut_val *val, + const char *ptr, size_t ptr_len, + yyjson_mut_val *new_val, + yyjson_mut_doc *doc, + bool create_parent, bool insert_new, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err) { + + const char *hdr = ptr, *end = ptr + ptr_len, *token; + usize token_len, esc, ctn_len; + yyjson_mut_val *ctn, *key, *pre = NULL; + yyjson_mut_val *sep_ctn = NULL, *sep_key = NULL, *sep_val = NULL; + yyjson_type ctn_type; + bool idx_is_last = false; + + /* skip exist parent nodes */ + while (true) { + token = ptr_next_token(&ptr, end, &token_len, &esc); + if (unlikely(!token)) return_err_syntax(false, ptr - hdr); + ctn = val; + ctn_type = unsafe_yyjson_get_type(ctn); + if (ctn_type == YYJSON_TYPE_OBJ) { + val = ptr_mut_obj_get(ctn, token, token_len, esc, &pre); + } else if (ctn_type == YYJSON_TYPE_ARR) { + val = ptr_mut_arr_get(ctn, token, token_len, esc, &pre, + &idx_is_last); + } else return_err_resolve(false, token - hdr); + if (!val) break; + if (ptr == end) break; /* is last token */ + } + + /* create parent nodes if not exist */ + if (unlikely(ptr != end)) { /* not last token */ + if (!create_parent) return_err_resolve(false, token - hdr); + + /* add value at last index if container is array */ + if (ctn_type == YYJSON_TYPE_ARR) { + if (!idx_is_last || !insert_new) { + return_err_resolve(false, token - hdr); + } + val = yyjson_mut_obj(doc); + if (!val) return_err_alloc(false); + + /* delay attaching until all operations are completed */ + sep_ctn = ctn; + sep_key = NULL; + sep_val = val; + + /* move to next token */ + ctn = val; + val = NULL; + ctn_type = YYJSON_TYPE_OBJ; + token = ptr_next_token(&ptr, end, &token_len, &esc); + if (unlikely(!token)) return_err_resolve(false, token - hdr); + } + + /* container is object, create parent nodes */ + while (ptr != end) { /* not last token */ + key = ptr_new_key(token, token_len, esc, doc); + if (!key) return_err_alloc(false); + val = yyjson_mut_obj(doc); + if (!val) return_err_alloc(false); + + /* delay attaching until all operations are completed */ + if (!sep_ctn) { + sep_ctn = ctn; + sep_key = key; + sep_val = val; + } else { + yyjson_mut_obj_add(ctn, key, val); + } + + /* move to next token */ + ctn = val; + val = NULL; + token = ptr_next_token(&ptr, end, &token_len, &esc); + if (unlikely(!token)) return_err_syntax(false, ptr - hdr); + } + } + + /* JSON pointer is resolved, insert or replace target value */ + ctn_len = unsafe_yyjson_get_len(ctn); + if (ctn_type == YYJSON_TYPE_OBJ) { + if (ctx) ctx->ctn = ctn; + if (!val || insert_new) { + /* insert new key-value pair */ + key = ptr_new_key(token, token_len, esc, doc); + if (unlikely(!key)) return_err_alloc(false); + if (ctx) ctx->pre = ctn_len ? (yyjson_mut_val *)ctn->uni.ptr : key; + unsafe_yyjson_mut_obj_add(ctn, key, new_val, ctn_len); + } else { + /* replace exist value */ + key = pre->next->next; + if (ctx) ctx->pre = pre; + if (ctx) ctx->old = val; + yyjson_mut_obj_put(ctn, key, new_val); + } + } else { + /* array */ + if (ctx && (val || idx_is_last)) ctx->ctn = ctn; + if (insert_new) { + /* append new value */ + if (val) { + pre->next = new_val; + new_val->next = val; + if (ctx) ctx->pre = pre; + unsafe_yyjson_set_len(ctn, ctn_len + 1); + } else if (idx_is_last) { + if (ctx) ctx->pre = ctn_len ? + (yyjson_mut_val *)ctn->uni.ptr : new_val; + yyjson_mut_arr_append(ctn, new_val); + } else { + return_err_resolve(false, token - hdr); + } + } else { + /* replace exist value */ + if (!val) return_err_resolve(false, token - hdr); + if (ctn_len > 1) { + new_val->next = val->next; + pre->next = new_val; + if (ctn->uni.ptr == val) ctn->uni.ptr = new_val; + } else { + new_val->next = new_val; + ctn->uni.ptr = new_val; + pre = new_val; + } + if (ctx) ctx->pre = pre; + if (ctx) ctx->old = val; + } + } + + /* all operations are completed, attach the new components to the target */ + if (unlikely(sep_ctn)) { + if (sep_key) yyjson_mut_obj_add(sep_ctn, sep_key, sep_val); + else yyjson_mut_arr_append(sep_ctn, sep_val); + } + return true; +} + +yyjson_mut_val *unsafe_yyjson_mut_ptr_replacex( + yyjson_mut_val *val, const char *ptr, size_t len, yyjson_mut_val *new_val, + yyjson_ptr_ctx *ctx, yyjson_ptr_err *err) { + + yyjson_mut_val *cur_val; + yyjson_ptr_ctx cur_ctx; + memset(&cur_ctx, 0, sizeof(cur_ctx)); + if (!ctx) ctx = &cur_ctx; + cur_val = unsafe_yyjson_mut_ptr_getx(val, ptr, len, ctx, err); + if (!cur_val) return NULL; + + if (yyjson_mut_is_obj(ctx->ctn)) { + yyjson_mut_val *key = ctx->pre->next->next; + yyjson_mut_obj_put(ctx->ctn, key, new_val); + } else { + yyjson_ptr_ctx_replace(ctx, new_val); + } + ctx->old = cur_val; + return cur_val; +} + +yyjson_mut_val *unsafe_yyjson_mut_ptr_removex(yyjson_mut_val *val, + const char *ptr, + size_t len, + yyjson_ptr_ctx *ctx, + yyjson_ptr_err *err) { + yyjson_mut_val *cur_val; + yyjson_ptr_ctx cur_ctx; + memset(&cur_ctx, 0, sizeof(cur_ctx)); + if (!ctx) ctx = &cur_ctx; + cur_val = unsafe_yyjson_mut_ptr_getx(val, ptr, len, ctx, err); + if (cur_val) { + if (yyjson_mut_is_obj(ctx->ctn)) { + yyjson_mut_val *key = ctx->pre->next->next; + yyjson_mut_obj_put(ctx->ctn, key, NULL); + } else { + yyjson_ptr_ctx_remove(ctx); + } + ctx->pre = NULL; + ctx->old = cur_val; + } + return cur_val; +} + +/* macros for yyjson_ptr */ +#undef return_err +#undef return_err_resolve +#undef return_err_syntax +#undef return_err_alloc + + + +/*============================================================================== + * JSON Patch API (RFC 6902) + *============================================================================*/ + +/* JSON Patch operation */ +typedef enum patch_op { + PATCH_OP_ADD, /* path, value */ + PATCH_OP_REMOVE, /* path */ + PATCH_OP_REPLACE, /* path, value */ + PATCH_OP_MOVE, /* from, path */ + PATCH_OP_COPY, /* from, path */ + PATCH_OP_TEST, /* path, value */ + PATCH_OP_NONE /* invalid */ +} patch_op; + +static patch_op patch_op_get(yyjson_val *op) { + const char *str = op->uni.str; + switch (unsafe_yyjson_get_len(op)) { + case 3: + if (!memcmp(str, "add", 3)) return PATCH_OP_ADD; + return PATCH_OP_NONE; + case 4: + if (!memcmp(str, "move", 4)) return PATCH_OP_MOVE; + if (!memcmp(str, "copy", 4)) return PATCH_OP_COPY; + if (!memcmp(str, "test", 4)) return PATCH_OP_TEST; + return PATCH_OP_NONE; + case 6: + if (!memcmp(str, "remove", 6)) return PATCH_OP_REMOVE; + return PATCH_OP_NONE; + case 7: + if (!memcmp(str, "replace", 7)) return PATCH_OP_REPLACE; + return PATCH_OP_NONE; + default: + return PATCH_OP_NONE; + } +} + +/* macros for yyjson_patch */ +#define return_err(_code, _msg) do { \ + if (err->ptr.code == YYJSON_PTR_ERR_MEMORY_ALLOCATION) { \ + err->code = YYJSON_PATCH_ERROR_MEMORY_ALLOCATION; \ + err->msg = _msg; \ + memset(&err->ptr, 0, sizeof(yyjson_ptr_err)); \ + } else { \ + err->code = YYJSON_PATCH_ERROR_##_code; \ + err->msg = _msg; \ + err->idx = iter.idx ? iter.idx - 1 : 0; \ + } \ + return NULL; \ +} while (false) + +#define return_err_copy() \ + return_err(MEMORY_ALLOCATION, "failed to copy value") +#define return_err_key(_key) \ + return_err(MISSING_KEY, "missing key " _key) +#define return_err_val(_key) \ + return_err(INVALID_MEMBER, "invalid member " _key) + +#define ptr_get(_ptr) yyjson_mut_ptr_getx( \ + root, _ptr->uni.str, _ptr##_len, NULL, &err->ptr) +#define ptr_add(_ptr, _val) yyjson_mut_ptr_addx( \ + root, _ptr->uni.str, _ptr##_len, _val, doc, false, NULL, &err->ptr) +#define ptr_remove(_ptr) yyjson_mut_ptr_removex( \ + root, _ptr->uni.str, _ptr##_len, NULL, &err->ptr) +#define ptr_replace(_ptr, _val)yyjson_mut_ptr_replacex( \ + root, _ptr->uni.str, _ptr##_len, _val, NULL, &err->ptr) + +yyjson_mut_val *yyjson_patch(yyjson_mut_doc *doc, + yyjson_val *orig, + yyjson_val *patch, + yyjson_patch_err *err) { + + yyjson_mut_val *root; + yyjson_val *obj; + yyjson_arr_iter iter; + yyjson_patch_err err_tmp; + if (!err) err = &err_tmp; + memset(err, 0, sizeof(*err)); + memset(&iter, 0, sizeof(iter)); + + if (unlikely(!doc || !orig || !patch)) { + return_err(INVALID_PARAMETER, "input parameter is NULL"); + } + if (unlikely(!yyjson_is_arr(patch))) { + return_err(INVALID_PARAMETER, "input patch is not array"); + } + root = yyjson_val_mut_copy(doc, orig); + if (unlikely(!root)) return_err_copy(); + + /* iterate through the patch array */ + yyjson_arr_iter_init(patch, &iter); + while ((obj = yyjson_arr_iter_next(&iter))) { + patch_op op_enum; + yyjson_val *op, *path, *from = NULL, *value; + yyjson_mut_val *val = NULL, *test; + usize path_len, from_len = 0; + if (unlikely(!unsafe_yyjson_is_obj(obj))) { + return_err(INVALID_OPERATION, "JSON patch operation is not object"); + } + + /* get required member: op */ + op = yyjson_obj_get(obj, "op"); + if (unlikely(!op)) return_err_key("`op`"); + if (unlikely(!yyjson_is_str(op))) return_err_val("`op`"); + op_enum = patch_op_get(op); + + /* get required member: path */ + path = yyjson_obj_get(obj, "path"); + if (unlikely(!path)) return_err_key("`path`"); + if (unlikely(!yyjson_is_str(path))) return_err_val("`path`"); + path_len = unsafe_yyjson_get_len(path); + + /* get required member: value, from */ + switch ((int)op_enum) { + case PATCH_OP_ADD: case PATCH_OP_REPLACE: case PATCH_OP_TEST: + value = yyjson_obj_get(obj, "value"); + if (unlikely(!value)) return_err_key("`value`"); + val = yyjson_val_mut_copy(doc, value); + if (unlikely(!val)) return_err_copy(); + break; + case PATCH_OP_MOVE: case PATCH_OP_COPY: + from = yyjson_obj_get(obj, "from"); + if (unlikely(!from)) return_err_key("`from`"); + if (unlikely(!yyjson_is_str(from))) return_err_val("`from`"); + from_len = unsafe_yyjson_get_len(from); + break; + default: + break; + } + + /* perform an operation */ + switch ((int)op_enum) { + case PATCH_OP_ADD: /* add(path, val) */ + if (unlikely(path_len == 0)) { root = val; break; } + if (unlikely(!ptr_add(path, val))) { + return_err(POINTER, "failed to add `path`"); + } + break; + case PATCH_OP_REMOVE: /* remove(path) */ + if (unlikely(!ptr_remove(path))) { + return_err(POINTER, "failed to remove `path`"); + } + break; + case PATCH_OP_REPLACE: /* replace(path, val) */ + if (unlikely(path_len == 0)) { root = val; break; } + if (unlikely(!ptr_replace(path, val))) { + return_err(POINTER, "failed to replace `path`"); + } + break; + case PATCH_OP_MOVE: /* val = remove(from), add(path, val) */ + if (unlikely(from_len == 0 && path_len == 0)) break; + val = ptr_remove(from); + if (unlikely(!val)) { + return_err(POINTER, "failed to remove `from`"); + } + if (unlikely(path_len == 0)) { root = val; break; } + if (unlikely(!ptr_add(path, val))) { + return_err(POINTER, "failed to add `path`"); + } + break; + case PATCH_OP_COPY: /* val = get(from).copy, add(path, val) */ + val = ptr_get(from); + if (unlikely(!val)) { + return_err(POINTER, "failed to get `from`"); + } + if (unlikely(path_len == 0)) { root = val; break; } + val = yyjson_mut_val_mut_copy(doc, val); + if (unlikely(!val)) return_err_copy(); + if (unlikely(!ptr_add(path, val))) { + return_err(POINTER, "failed to add `path`"); + } + break; + case PATCH_OP_TEST: /* test = get(path), test.eq(val) */ + test = ptr_get(path); + if (unlikely(!test)) { + return_err(POINTER, "failed to get `path`"); + } + if (unlikely(!yyjson_mut_equals(val, test))) { + return_err(EQUAL, "failed to test equal"); + } + break; + default: + return_err(INVALID_MEMBER, "unsupported `op`"); + } + } + return root; +} + +yyjson_mut_val *yyjson_mut_patch(yyjson_mut_doc *doc, + yyjson_mut_val *orig, + yyjson_mut_val *patch, + yyjson_patch_err *err) { + yyjson_mut_val *root, *obj; + yyjson_mut_arr_iter iter; + yyjson_patch_err err_tmp; + if (!err) err = &err_tmp; + memset(err, 0, sizeof(*err)); + memset(&iter, 0, sizeof(iter)); + + if (unlikely(!doc || !orig || !patch)) { + return_err(INVALID_PARAMETER, "input parameter is NULL"); + } + if (unlikely(!yyjson_mut_is_arr(patch))) { + return_err(INVALID_PARAMETER, "input patch is not array"); + } + root = yyjson_mut_val_mut_copy(doc, orig); + if (unlikely(!root)) return_err_copy(); + + /* iterate through the patch array */ + yyjson_mut_arr_iter_init(patch, &iter); + while ((obj = yyjson_mut_arr_iter_next(&iter))) { + patch_op op_enum; + yyjson_mut_val *op, *path, *from = NULL, *value; + yyjson_mut_val *val = NULL, *test; + usize path_len, from_len = 0; + if (!unsafe_yyjson_is_obj(obj)) { + return_err(INVALID_OPERATION, "JSON patch operation is not object"); + } + + /* get required member: op */ + op = yyjson_mut_obj_get(obj, "op"); + if (unlikely(!op)) return_err_key("`op`"); + if (unlikely(!yyjson_mut_is_str(op))) return_err_val("`op`"); + op_enum = patch_op_get((yyjson_val *)(void *)op); + + /* get required member: path */ + path = yyjson_mut_obj_get(obj, "path"); + if (unlikely(!path)) return_err_key("`path`"); + if (unlikely(!yyjson_mut_is_str(path))) return_err_val("`path`"); + path_len = unsafe_yyjson_get_len(path); + + /* get required member: value, from */ + switch ((int)op_enum) { + case PATCH_OP_ADD: case PATCH_OP_REPLACE: case PATCH_OP_TEST: + value = yyjson_mut_obj_get(obj, "value"); + if (unlikely(!value)) return_err_key("`value`"); + val = yyjson_mut_val_mut_copy(doc, value); + if (unlikely(!val)) return_err_copy(); + break; + case PATCH_OP_MOVE: case PATCH_OP_COPY: + from = yyjson_mut_obj_get(obj, "from"); + if (unlikely(!from)) return_err_key("`from`"); + if (unlikely(!yyjson_mut_is_str(from))) { + return_err_val("`from`"); + } + from_len = unsafe_yyjson_get_len(from); + break; + default: + break; + } + + /* perform an operation */ + switch ((int)op_enum) { + case PATCH_OP_ADD: /* add(path, val) */ + if (unlikely(path_len == 0)) { root = val; break; } + if (unlikely(!ptr_add(path, val))) { + return_err(POINTER, "failed to add `path`"); + } + break; + case PATCH_OP_REMOVE: /* remove(path) */ + if (unlikely(!ptr_remove(path))) { + return_err(POINTER, "failed to remove `path`"); + } + break; + case PATCH_OP_REPLACE: /* replace(path, val) */ + if (unlikely(path_len == 0)) { root = val; break; } + if (unlikely(!ptr_replace(path, val))) { + return_err(POINTER, "failed to replace `path`"); + } + break; + case PATCH_OP_MOVE: /* val = remove(from), add(path, val) */ + if (unlikely(from_len == 0 && path_len == 0)) break; + val = ptr_remove(from); + if (unlikely(!val)) { + return_err(POINTER, "failed to remove `from`"); + } + if (unlikely(path_len == 0)) { root = val; break; } + if (unlikely(!ptr_add(path, val))) { + return_err(POINTER, "failed to add `path`"); + } + break; + case PATCH_OP_COPY: /* val = get(from).copy, add(path, val) */ + val = ptr_get(from); + if (unlikely(!val)) { + return_err(POINTER, "failed to get `from`"); + } + if (unlikely(path_len == 0)) { root = val; break; } + val = yyjson_mut_val_mut_copy(doc, val); + if (unlikely(!val)) return_err_copy(); + if (unlikely(!ptr_add(path, val))) { + return_err(POINTER, "failed to add `path`"); + } + break; + case PATCH_OP_TEST: /* test = get(path), test.eq(val) */ + test = ptr_get(path); + if (unlikely(!test)) { + return_err(POINTER, "failed to get `path`"); + } + if (unlikely(!yyjson_mut_equals(val, test))) { + return_err(EQUAL, "failed to test equal"); + } + break; + default: + return_err(INVALID_MEMBER, "unsupported `op`"); + } + } + return root; +} + +/* macros for yyjson_patch */ +#undef return_err +#undef return_err_copy +#undef return_err_key +#undef return_err_val +#undef ptr_get +#undef ptr_add +#undef ptr_remove +#undef ptr_replace + + + +/*============================================================================== + * JSON Merge-Patch API (RFC 7386) + *============================================================================*/ + +yyjson_mut_val *yyjson_merge_patch(yyjson_mut_doc *doc, + yyjson_val *orig, + yyjson_val *patch) { + usize idx, max; + yyjson_val *key, *orig_val, *patch_val, local_orig; + yyjson_mut_val *builder, *mut_key, *mut_val, *merged_val; + + if (unlikely(!yyjson_is_obj(patch))) { + return yyjson_val_mut_copy(doc, patch); + } + + builder = yyjson_mut_obj(doc); + if (unlikely(!builder)) return NULL; + + memset(&local_orig, 0, sizeof(local_orig)); + if (!yyjson_is_obj(orig)) { + orig = &local_orig; + orig->tag = builder->tag; + orig->uni = builder->uni; + } + + /* If orig is contributing, copy any items not modified by the patch */ + if (orig != &local_orig) { + yyjson_obj_foreach(orig, idx, max, key, orig_val) { + patch_val = yyjson_obj_getn(patch, + unsafe_yyjson_get_str(key), + unsafe_yyjson_get_len(key)); + if (!patch_val) { + mut_key = yyjson_val_mut_copy(doc, key); + mut_val = yyjson_val_mut_copy(doc, orig_val); + if (!yyjson_mut_obj_add(builder, mut_key, mut_val)) return NULL; + } + } + } + + /* Merge items modified by the patch. */ + yyjson_obj_foreach(patch, idx, max, key, patch_val) { + /* null indicates the field is removed. */ + if (unsafe_yyjson_is_null(patch_val)) { + continue; + } + mut_key = yyjson_val_mut_copy(doc, key); + orig_val = yyjson_obj_getn(orig, + unsafe_yyjson_get_str(key), + unsafe_yyjson_get_len(key)); + merged_val = yyjson_merge_patch(doc, orig_val, patch_val); + if (!yyjson_mut_obj_add(builder, mut_key, merged_val)) return NULL; + } + + return builder; +} + +yyjson_mut_val *yyjson_mut_merge_patch(yyjson_mut_doc *doc, + yyjson_mut_val *orig, + yyjson_mut_val *patch) { + usize idx, max; + yyjson_mut_val *key, *orig_val, *patch_val, local_orig; + yyjson_mut_val *builder, *mut_key, *mut_val, *merged_val; + + if (unlikely(!yyjson_mut_is_obj(patch))) { + return yyjson_mut_val_mut_copy(doc, patch); + } + + builder = yyjson_mut_obj(doc); + if (unlikely(!builder)) return NULL; + + memset(&local_orig, 0, sizeof(local_orig)); + if (!yyjson_mut_is_obj(orig)) { + orig = &local_orig; + orig->tag = builder->tag; + orig->uni = builder->uni; + } + + /* If orig is contributing, copy any items not modified by the patch */ + if (orig != &local_orig) { + yyjson_mut_obj_foreach(orig, idx, max, key, orig_val) { + patch_val = yyjson_mut_obj_getn(patch, + unsafe_yyjson_get_str(key), + unsafe_yyjson_get_len(key)); + if (!patch_val) { + mut_key = yyjson_mut_val_mut_copy(doc, key); + mut_val = yyjson_mut_val_mut_copy(doc, orig_val); + if (!yyjson_mut_obj_add(builder, mut_key, mut_val)) return NULL; + } + } + } + + /* Merge items modified by the patch. */ + yyjson_mut_obj_foreach(patch, idx, max, key, patch_val) { + /* null indicates the field is removed. */ + if (unsafe_yyjson_is_null(patch_val)) { + continue; + } + mut_key = yyjson_mut_val_mut_copy(doc, key); + orig_val = yyjson_mut_obj_getn(orig, + unsafe_yyjson_get_str(key), + unsafe_yyjson_get_len(key)); + merged_val = yyjson_mut_merge_patch(doc, orig_val, patch_val); + if (!yyjson_mut_obj_add(builder, mut_key, merged_val)) return NULL; + } + + return builder; +} + +#endif /* YYJSON_DISABLE_UTILS */ + + + +/*============================================================================== + * Power10 Lookup Table + * These data are used by the floating-point number reader and writer. + *============================================================================*/ + +#if (!YYJSON_DISABLE_READER || !YYJSON_DISABLE_WRITER) && \ + (!YYJSON_DISABLE_FAST_FP_CONV) + +/** Minimum decimal exponent in pow10_sig_table. */ +#define POW10_SIG_TABLE_MIN_EXP -343 + +/** Maximum decimal exponent in pow10_sig_table. */ +#define POW10_SIG_TABLE_MAX_EXP 324 + +/** Minimum exact decimal exponent in pow10_sig_table */ +#define POW10_SIG_TABLE_MIN_EXACT_EXP 0 + +/** Maximum exact decimal exponent in pow10_sig_table */ +#define POW10_SIG_TABLE_MAX_EXACT_EXP 55 + +/** Normalized significant 128 bits of pow10, no rounded up (size: 10.4KB). + This lookup table is used by both the double number reader and writer. + (generate with misc/make_tables.c) */ +static const u64 pow10_sig_table[] = { + U64(0xBF29DCAB, 0xA82FDEAE), U64(0x7432EE87, 0x3880FC33), /* ~= 10^-343 */ + U64(0xEEF453D6, 0x923BD65A), U64(0x113FAA29, 0x06A13B3F), /* ~= 10^-342 */ + U64(0x9558B466, 0x1B6565F8), U64(0x4AC7CA59, 0xA424C507), /* ~= 10^-341 */ + U64(0xBAAEE17F, 0xA23EBF76), U64(0x5D79BCF0, 0x0D2DF649), /* ~= 10^-340 */ + U64(0xE95A99DF, 0x8ACE6F53), U64(0xF4D82C2C, 0x107973DC), /* ~= 10^-339 */ + U64(0x91D8A02B, 0xB6C10594), U64(0x79071B9B, 0x8A4BE869), /* ~= 10^-338 */ + U64(0xB64EC836, 0xA47146F9), U64(0x9748E282, 0x6CDEE284), /* ~= 10^-337 */ + U64(0xE3E27A44, 0x4D8D98B7), U64(0xFD1B1B23, 0x08169B25), /* ~= 10^-336 */ + U64(0x8E6D8C6A, 0xB0787F72), U64(0xFE30F0F5, 0xE50E20F7), /* ~= 10^-335 */ + U64(0xB208EF85, 0x5C969F4F), U64(0xBDBD2D33, 0x5E51A935), /* ~= 10^-334 */ + U64(0xDE8B2B66, 0xB3BC4723), U64(0xAD2C7880, 0x35E61382), /* ~= 10^-333 */ + U64(0x8B16FB20, 0x3055AC76), U64(0x4C3BCB50, 0x21AFCC31), /* ~= 10^-332 */ + U64(0xADDCB9E8, 0x3C6B1793), U64(0xDF4ABE24, 0x2A1BBF3D), /* ~= 10^-331 */ + U64(0xD953E862, 0x4B85DD78), U64(0xD71D6DAD, 0x34A2AF0D), /* ~= 10^-330 */ + U64(0x87D4713D, 0x6F33AA6B), U64(0x8672648C, 0x40E5AD68), /* ~= 10^-329 */ + U64(0xA9C98D8C, 0xCB009506), U64(0x680EFDAF, 0x511F18C2), /* ~= 10^-328 */ + U64(0xD43BF0EF, 0xFDC0BA48), U64(0x0212BD1B, 0x2566DEF2), /* ~= 10^-327 */ + U64(0x84A57695, 0xFE98746D), U64(0x014BB630, 0xF7604B57), /* ~= 10^-326 */ + U64(0xA5CED43B, 0x7E3E9188), U64(0x419EA3BD, 0x35385E2D), /* ~= 10^-325 */ + U64(0xCF42894A, 0x5DCE35EA), U64(0x52064CAC, 0x828675B9), /* ~= 10^-324 */ + U64(0x818995CE, 0x7AA0E1B2), U64(0x7343EFEB, 0xD1940993), /* ~= 10^-323 */ + U64(0xA1EBFB42, 0x19491A1F), U64(0x1014EBE6, 0xC5F90BF8), /* ~= 10^-322 */ + U64(0xCA66FA12, 0x9F9B60A6), U64(0xD41A26E0, 0x77774EF6), /* ~= 10^-321 */ + U64(0xFD00B897, 0x478238D0), U64(0x8920B098, 0x955522B4), /* ~= 10^-320 */ + U64(0x9E20735E, 0x8CB16382), U64(0x55B46E5F, 0x5D5535B0), /* ~= 10^-319 */ + U64(0xC5A89036, 0x2FDDBC62), U64(0xEB2189F7, 0x34AA831D), /* ~= 10^-318 */ + U64(0xF712B443, 0xBBD52B7B), U64(0xA5E9EC75, 0x01D523E4), /* ~= 10^-317 */ + U64(0x9A6BB0AA, 0x55653B2D), U64(0x47B233C9, 0x2125366E), /* ~= 10^-316 */ + U64(0xC1069CD4, 0xEABE89F8), U64(0x999EC0BB, 0x696E840A), /* ~= 10^-315 */ + U64(0xF148440A, 0x256E2C76), U64(0xC00670EA, 0x43CA250D), /* ~= 10^-314 */ + U64(0x96CD2A86, 0x5764DBCA), U64(0x38040692, 0x6A5E5728), /* ~= 10^-313 */ + U64(0xBC807527, 0xED3E12BC), U64(0xC6050837, 0x04F5ECF2), /* ~= 10^-312 */ + U64(0xEBA09271, 0xE88D976B), U64(0xF7864A44, 0xC633682E), /* ~= 10^-311 */ + U64(0x93445B87, 0x31587EA3), U64(0x7AB3EE6A, 0xFBE0211D), /* ~= 10^-310 */ + U64(0xB8157268, 0xFDAE9E4C), U64(0x5960EA05, 0xBAD82964), /* ~= 10^-309 */ + U64(0xE61ACF03, 0x3D1A45DF), U64(0x6FB92487, 0x298E33BD), /* ~= 10^-308 */ + U64(0x8FD0C162, 0x06306BAB), U64(0xA5D3B6D4, 0x79F8E056), /* ~= 10^-307 */ + U64(0xB3C4F1BA, 0x87BC8696), U64(0x8F48A489, 0x9877186C), /* ~= 10^-306 */ + U64(0xE0B62E29, 0x29ABA83C), U64(0x331ACDAB, 0xFE94DE87), /* ~= 10^-305 */ + U64(0x8C71DCD9, 0xBA0B4925), U64(0x9FF0C08B, 0x7F1D0B14), /* ~= 10^-304 */ + U64(0xAF8E5410, 0x288E1B6F), U64(0x07ECF0AE, 0x5EE44DD9), /* ~= 10^-303 */ + U64(0xDB71E914, 0x32B1A24A), U64(0xC9E82CD9, 0xF69D6150), /* ~= 10^-302 */ + U64(0x892731AC, 0x9FAF056E), U64(0xBE311C08, 0x3A225CD2), /* ~= 10^-301 */ + U64(0xAB70FE17, 0xC79AC6CA), U64(0x6DBD630A, 0x48AAF406), /* ~= 10^-300 */ + U64(0xD64D3D9D, 0xB981787D), U64(0x092CBBCC, 0xDAD5B108), /* ~= 10^-299 */ + U64(0x85F04682, 0x93F0EB4E), U64(0x25BBF560, 0x08C58EA5), /* ~= 10^-298 */ + U64(0xA76C5823, 0x38ED2621), U64(0xAF2AF2B8, 0x0AF6F24E), /* ~= 10^-297 */ + U64(0xD1476E2C, 0x07286FAA), U64(0x1AF5AF66, 0x0DB4AEE1), /* ~= 10^-296 */ + U64(0x82CCA4DB, 0x847945CA), U64(0x50D98D9F, 0xC890ED4D), /* ~= 10^-295 */ + U64(0xA37FCE12, 0x6597973C), U64(0xE50FF107, 0xBAB528A0), /* ~= 10^-294 */ + U64(0xCC5FC196, 0xFEFD7D0C), U64(0x1E53ED49, 0xA96272C8), /* ~= 10^-293 */ + U64(0xFF77B1FC, 0xBEBCDC4F), U64(0x25E8E89C, 0x13BB0F7A), /* ~= 10^-292 */ + U64(0x9FAACF3D, 0xF73609B1), U64(0x77B19161, 0x8C54E9AC), /* ~= 10^-291 */ + U64(0xC795830D, 0x75038C1D), U64(0xD59DF5B9, 0xEF6A2417), /* ~= 10^-290 */ + U64(0xF97AE3D0, 0xD2446F25), U64(0x4B057328, 0x6B44AD1D), /* ~= 10^-289 */ + U64(0x9BECCE62, 0x836AC577), U64(0x4EE367F9, 0x430AEC32), /* ~= 10^-288 */ + U64(0xC2E801FB, 0x244576D5), U64(0x229C41F7, 0x93CDA73F), /* ~= 10^-287 */ + U64(0xF3A20279, 0xED56D48A), U64(0x6B435275, 0x78C1110F), /* ~= 10^-286 */ + U64(0x9845418C, 0x345644D6), U64(0x830A1389, 0x6B78AAA9), /* ~= 10^-285 */ + U64(0xBE5691EF, 0x416BD60C), U64(0x23CC986B, 0xC656D553), /* ~= 10^-284 */ + U64(0xEDEC366B, 0x11C6CB8F), U64(0x2CBFBE86, 0xB7EC8AA8), /* ~= 10^-283 */ + U64(0x94B3A202, 0xEB1C3F39), U64(0x7BF7D714, 0x32F3D6A9), /* ~= 10^-282 */ + U64(0xB9E08A83, 0xA5E34F07), U64(0xDAF5CCD9, 0x3FB0CC53), /* ~= 10^-281 */ + U64(0xE858AD24, 0x8F5C22C9), U64(0xD1B3400F, 0x8F9CFF68), /* ~= 10^-280 */ + U64(0x91376C36, 0xD99995BE), U64(0x23100809, 0xB9C21FA1), /* ~= 10^-279 */ + U64(0xB5854744, 0x8FFFFB2D), U64(0xABD40A0C, 0x2832A78A), /* ~= 10^-278 */ + U64(0xE2E69915, 0xB3FFF9F9), U64(0x16C90C8F, 0x323F516C), /* ~= 10^-277 */ + U64(0x8DD01FAD, 0x907FFC3B), U64(0xAE3DA7D9, 0x7F6792E3), /* ~= 10^-276 */ + U64(0xB1442798, 0xF49FFB4A), U64(0x99CD11CF, 0xDF41779C), /* ~= 10^-275 */ + U64(0xDD95317F, 0x31C7FA1D), U64(0x40405643, 0xD711D583), /* ~= 10^-274 */ + U64(0x8A7D3EEF, 0x7F1CFC52), U64(0x482835EA, 0x666B2572), /* ~= 10^-273 */ + U64(0xAD1C8EAB, 0x5EE43B66), U64(0xDA324365, 0x0005EECF), /* ~= 10^-272 */ + U64(0xD863B256, 0x369D4A40), U64(0x90BED43E, 0x40076A82), /* ~= 10^-271 */ + U64(0x873E4F75, 0xE2224E68), U64(0x5A7744A6, 0xE804A291), /* ~= 10^-270 */ + U64(0xA90DE353, 0x5AAAE202), U64(0x711515D0, 0xA205CB36), /* ~= 10^-269 */ + U64(0xD3515C28, 0x31559A83), U64(0x0D5A5B44, 0xCA873E03), /* ~= 10^-268 */ + U64(0x8412D999, 0x1ED58091), U64(0xE858790A, 0xFE9486C2), /* ~= 10^-267 */ + U64(0xA5178FFF, 0x668AE0B6), U64(0x626E974D, 0xBE39A872), /* ~= 10^-266 */ + U64(0xCE5D73FF, 0x402D98E3), U64(0xFB0A3D21, 0x2DC8128F), /* ~= 10^-265 */ + U64(0x80FA687F, 0x881C7F8E), U64(0x7CE66634, 0xBC9D0B99), /* ~= 10^-264 */ + U64(0xA139029F, 0x6A239F72), U64(0x1C1FFFC1, 0xEBC44E80), /* ~= 10^-263 */ + U64(0xC9874347, 0x44AC874E), U64(0xA327FFB2, 0x66B56220), /* ~= 10^-262 */ + U64(0xFBE91419, 0x15D7A922), U64(0x4BF1FF9F, 0x0062BAA8), /* ~= 10^-261 */ + U64(0x9D71AC8F, 0xADA6C9B5), U64(0x6F773FC3, 0x603DB4A9), /* ~= 10^-260 */ + U64(0xC4CE17B3, 0x99107C22), U64(0xCB550FB4, 0x384D21D3), /* ~= 10^-259 */ + U64(0xF6019DA0, 0x7F549B2B), U64(0x7E2A53A1, 0x46606A48), /* ~= 10^-258 */ + U64(0x99C10284, 0x4F94E0FB), U64(0x2EDA7444, 0xCBFC426D), /* ~= 10^-257 */ + U64(0xC0314325, 0x637A1939), U64(0xFA911155, 0xFEFB5308), /* ~= 10^-256 */ + U64(0xF03D93EE, 0xBC589F88), U64(0x793555AB, 0x7EBA27CA), /* ~= 10^-255 */ + U64(0x96267C75, 0x35B763B5), U64(0x4BC1558B, 0x2F3458DE), /* ~= 10^-254 */ + U64(0xBBB01B92, 0x83253CA2), U64(0x9EB1AAED, 0xFB016F16), /* ~= 10^-253 */ + U64(0xEA9C2277, 0x23EE8BCB), U64(0x465E15A9, 0x79C1CADC), /* ~= 10^-252 */ + U64(0x92A1958A, 0x7675175F), U64(0x0BFACD89, 0xEC191EC9), /* ~= 10^-251 */ + U64(0xB749FAED, 0x14125D36), U64(0xCEF980EC, 0x671F667B), /* ~= 10^-250 */ + U64(0xE51C79A8, 0x5916F484), U64(0x82B7E127, 0x80E7401A), /* ~= 10^-249 */ + U64(0x8F31CC09, 0x37AE58D2), U64(0xD1B2ECB8, 0xB0908810), /* ~= 10^-248 */ + U64(0xB2FE3F0B, 0x8599EF07), U64(0x861FA7E6, 0xDCB4AA15), /* ~= 10^-247 */ + U64(0xDFBDCECE, 0x67006AC9), U64(0x67A791E0, 0x93E1D49A), /* ~= 10^-246 */ + U64(0x8BD6A141, 0x006042BD), U64(0xE0C8BB2C, 0x5C6D24E0), /* ~= 10^-245 */ + U64(0xAECC4991, 0x4078536D), U64(0x58FAE9F7, 0x73886E18), /* ~= 10^-244 */ + U64(0xDA7F5BF5, 0x90966848), U64(0xAF39A475, 0x506A899E), /* ~= 10^-243 */ + U64(0x888F9979, 0x7A5E012D), U64(0x6D8406C9, 0x52429603), /* ~= 10^-242 */ + U64(0xAAB37FD7, 0xD8F58178), U64(0xC8E5087B, 0xA6D33B83), /* ~= 10^-241 */ + U64(0xD5605FCD, 0xCF32E1D6), U64(0xFB1E4A9A, 0x90880A64), /* ~= 10^-240 */ + U64(0x855C3BE0, 0xA17FCD26), U64(0x5CF2EEA0, 0x9A55067F), /* ~= 10^-239 */ + U64(0xA6B34AD8, 0xC9DFC06F), U64(0xF42FAA48, 0xC0EA481E), /* ~= 10^-238 */ + U64(0xD0601D8E, 0xFC57B08B), U64(0xF13B94DA, 0xF124DA26), /* ~= 10^-237 */ + U64(0x823C1279, 0x5DB6CE57), U64(0x76C53D08, 0xD6B70858), /* ~= 10^-236 */ + U64(0xA2CB1717, 0xB52481ED), U64(0x54768C4B, 0x0C64CA6E), /* ~= 10^-235 */ + U64(0xCB7DDCDD, 0xA26DA268), U64(0xA9942F5D, 0xCF7DFD09), /* ~= 10^-234 */ + U64(0xFE5D5415, 0x0B090B02), U64(0xD3F93B35, 0x435D7C4C), /* ~= 10^-233 */ + U64(0x9EFA548D, 0x26E5A6E1), U64(0xC47BC501, 0x4A1A6DAF), /* ~= 10^-232 */ + U64(0xC6B8E9B0, 0x709F109A), U64(0x359AB641, 0x9CA1091B), /* ~= 10^-231 */ + U64(0xF867241C, 0x8CC6D4C0), U64(0xC30163D2, 0x03C94B62), /* ~= 10^-230 */ + U64(0x9B407691, 0xD7FC44F8), U64(0x79E0DE63, 0x425DCF1D), /* ~= 10^-229 */ + U64(0xC2109436, 0x4DFB5636), U64(0x985915FC, 0x12F542E4), /* ~= 10^-228 */ + U64(0xF294B943, 0xE17A2BC4), U64(0x3E6F5B7B, 0x17B2939D), /* ~= 10^-227 */ + U64(0x979CF3CA, 0x6CEC5B5A), U64(0xA705992C, 0xEECF9C42), /* ~= 10^-226 */ + U64(0xBD8430BD, 0x08277231), U64(0x50C6FF78, 0x2A838353), /* ~= 10^-225 */ + U64(0xECE53CEC, 0x4A314EBD), U64(0xA4F8BF56, 0x35246428), /* ~= 10^-224 */ + U64(0x940F4613, 0xAE5ED136), U64(0x871B7795, 0xE136BE99), /* ~= 10^-223 */ + U64(0xB9131798, 0x99F68584), U64(0x28E2557B, 0x59846E3F), /* ~= 10^-222 */ + U64(0xE757DD7E, 0xC07426E5), U64(0x331AEADA, 0x2FE589CF), /* ~= 10^-221 */ + U64(0x9096EA6F, 0x3848984F), U64(0x3FF0D2C8, 0x5DEF7621), /* ~= 10^-220 */ + U64(0xB4BCA50B, 0x065ABE63), U64(0x0FED077A, 0x756B53A9), /* ~= 10^-219 */ + U64(0xE1EBCE4D, 0xC7F16DFB), U64(0xD3E84959, 0x12C62894), /* ~= 10^-218 */ + U64(0x8D3360F0, 0x9CF6E4BD), U64(0x64712DD7, 0xABBBD95C), /* ~= 10^-217 */ + U64(0xB080392C, 0xC4349DEC), U64(0xBD8D794D, 0x96AACFB3), /* ~= 10^-216 */ + U64(0xDCA04777, 0xF541C567), U64(0xECF0D7A0, 0xFC5583A0), /* ~= 10^-215 */ + U64(0x89E42CAA, 0xF9491B60), U64(0xF41686C4, 0x9DB57244), /* ~= 10^-214 */ + U64(0xAC5D37D5, 0xB79B6239), U64(0x311C2875, 0xC522CED5), /* ~= 10^-213 */ + U64(0xD77485CB, 0x25823AC7), U64(0x7D633293, 0x366B828B), /* ~= 10^-212 */ + U64(0x86A8D39E, 0xF77164BC), U64(0xAE5DFF9C, 0x02033197), /* ~= 10^-211 */ + U64(0xA8530886, 0xB54DBDEB), U64(0xD9F57F83, 0x0283FDFC), /* ~= 10^-210 */ + U64(0xD267CAA8, 0x62A12D66), U64(0xD072DF63, 0xC324FD7B), /* ~= 10^-209 */ + U64(0x8380DEA9, 0x3DA4BC60), U64(0x4247CB9E, 0x59F71E6D), /* ~= 10^-208 */ + U64(0xA4611653, 0x8D0DEB78), U64(0x52D9BE85, 0xF074E608), /* ~= 10^-207 */ + U64(0xCD795BE8, 0x70516656), U64(0x67902E27, 0x6C921F8B), /* ~= 10^-206 */ + U64(0x806BD971, 0x4632DFF6), U64(0x00BA1CD8, 0xA3DB53B6), /* ~= 10^-205 */ + U64(0xA086CFCD, 0x97BF97F3), U64(0x80E8A40E, 0xCCD228A4), /* ~= 10^-204 */ + U64(0xC8A883C0, 0xFDAF7DF0), U64(0x6122CD12, 0x8006B2CD), /* ~= 10^-203 */ + U64(0xFAD2A4B1, 0x3D1B5D6C), U64(0x796B8057, 0x20085F81), /* ~= 10^-202 */ + U64(0x9CC3A6EE, 0xC6311A63), U64(0xCBE33036, 0x74053BB0), /* ~= 10^-201 */ + U64(0xC3F490AA, 0x77BD60FC), U64(0xBEDBFC44, 0x11068A9C), /* ~= 10^-200 */ + U64(0xF4F1B4D5, 0x15ACB93B), U64(0xEE92FB55, 0x15482D44), /* ~= 10^-199 */ + U64(0x99171105, 0x2D8BF3C5), U64(0x751BDD15, 0x2D4D1C4A), /* ~= 10^-198 */ + U64(0xBF5CD546, 0x78EEF0B6), U64(0xD262D45A, 0x78A0635D), /* ~= 10^-197 */ + U64(0xEF340A98, 0x172AACE4), U64(0x86FB8971, 0x16C87C34), /* ~= 10^-196 */ + U64(0x9580869F, 0x0E7AAC0E), U64(0xD45D35E6, 0xAE3D4DA0), /* ~= 10^-195 */ + U64(0xBAE0A846, 0xD2195712), U64(0x89748360, 0x59CCA109), /* ~= 10^-194 */ + U64(0xE998D258, 0x869FACD7), U64(0x2BD1A438, 0x703FC94B), /* ~= 10^-193 */ + U64(0x91FF8377, 0x5423CC06), U64(0x7B6306A3, 0x4627DDCF), /* ~= 10^-192 */ + U64(0xB67F6455, 0x292CBF08), U64(0x1A3BC84C, 0x17B1D542), /* ~= 10^-191 */ + U64(0xE41F3D6A, 0x7377EECA), U64(0x20CABA5F, 0x1D9E4A93), /* ~= 10^-190 */ + U64(0x8E938662, 0x882AF53E), U64(0x547EB47B, 0x7282EE9C), /* ~= 10^-189 */ + U64(0xB23867FB, 0x2A35B28D), U64(0xE99E619A, 0x4F23AA43), /* ~= 10^-188 */ + U64(0xDEC681F9, 0xF4C31F31), U64(0x6405FA00, 0xE2EC94D4), /* ~= 10^-187 */ + U64(0x8B3C113C, 0x38F9F37E), U64(0xDE83BC40, 0x8DD3DD04), /* ~= 10^-186 */ + U64(0xAE0B158B, 0x4738705E), U64(0x9624AB50, 0xB148D445), /* ~= 10^-185 */ + U64(0xD98DDAEE, 0x19068C76), U64(0x3BADD624, 0xDD9B0957), /* ~= 10^-184 */ + U64(0x87F8A8D4, 0xCFA417C9), U64(0xE54CA5D7, 0x0A80E5D6), /* ~= 10^-183 */ + U64(0xA9F6D30A, 0x038D1DBC), U64(0x5E9FCF4C, 0xCD211F4C), /* ~= 10^-182 */ + U64(0xD47487CC, 0x8470652B), U64(0x7647C320, 0x0069671F), /* ~= 10^-181 */ + U64(0x84C8D4DF, 0xD2C63F3B), U64(0x29ECD9F4, 0x0041E073), /* ~= 10^-180 */ + U64(0xA5FB0A17, 0xC777CF09), U64(0xF4681071, 0x00525890), /* ~= 10^-179 */ + U64(0xCF79CC9D, 0xB955C2CC), U64(0x7182148D, 0x4066EEB4), /* ~= 10^-178 */ + U64(0x81AC1FE2, 0x93D599BF), U64(0xC6F14CD8, 0x48405530), /* ~= 10^-177 */ + U64(0xA21727DB, 0x38CB002F), U64(0xB8ADA00E, 0x5A506A7C), /* ~= 10^-176 */ + U64(0xCA9CF1D2, 0x06FDC03B), U64(0xA6D90811, 0xF0E4851C), /* ~= 10^-175 */ + U64(0xFD442E46, 0x88BD304A), U64(0x908F4A16, 0x6D1DA663), /* ~= 10^-174 */ + U64(0x9E4A9CEC, 0x15763E2E), U64(0x9A598E4E, 0x043287FE), /* ~= 10^-173 */ + U64(0xC5DD4427, 0x1AD3CDBA), U64(0x40EFF1E1, 0x853F29FD), /* ~= 10^-172 */ + U64(0xF7549530, 0xE188C128), U64(0xD12BEE59, 0xE68EF47C), /* ~= 10^-171 */ + U64(0x9A94DD3E, 0x8CF578B9), U64(0x82BB74F8, 0x301958CE), /* ~= 10^-170 */ + U64(0xC13A148E, 0x3032D6E7), U64(0xE36A5236, 0x3C1FAF01), /* ~= 10^-169 */ + U64(0xF18899B1, 0xBC3F8CA1), U64(0xDC44E6C3, 0xCB279AC1), /* ~= 10^-168 */ + U64(0x96F5600F, 0x15A7B7E5), U64(0x29AB103A, 0x5EF8C0B9), /* ~= 10^-167 */ + U64(0xBCB2B812, 0xDB11A5DE), U64(0x7415D448, 0xF6B6F0E7), /* ~= 10^-166 */ + U64(0xEBDF6617, 0x91D60F56), U64(0x111B495B, 0x3464AD21), /* ~= 10^-165 */ + U64(0x936B9FCE, 0xBB25C995), U64(0xCAB10DD9, 0x00BEEC34), /* ~= 10^-164 */ + U64(0xB84687C2, 0x69EF3BFB), U64(0x3D5D514F, 0x40EEA742), /* ~= 10^-163 */ + U64(0xE65829B3, 0x046B0AFA), U64(0x0CB4A5A3, 0x112A5112), /* ~= 10^-162 */ + U64(0x8FF71A0F, 0xE2C2E6DC), U64(0x47F0E785, 0xEABA72AB), /* ~= 10^-161 */ + U64(0xB3F4E093, 0xDB73A093), U64(0x59ED2167, 0x65690F56), /* ~= 10^-160 */ + U64(0xE0F218B8, 0xD25088B8), U64(0x306869C1, 0x3EC3532C), /* ~= 10^-159 */ + U64(0x8C974F73, 0x83725573), U64(0x1E414218, 0xC73A13FB), /* ~= 10^-158 */ + U64(0xAFBD2350, 0x644EEACF), U64(0xE5D1929E, 0xF90898FA), /* ~= 10^-157 */ + U64(0xDBAC6C24, 0x7D62A583), U64(0xDF45F746, 0xB74ABF39), /* ~= 10^-156 */ + U64(0x894BC396, 0xCE5DA772), U64(0x6B8BBA8C, 0x328EB783), /* ~= 10^-155 */ + U64(0xAB9EB47C, 0x81F5114F), U64(0x066EA92F, 0x3F326564), /* ~= 10^-154 */ + U64(0xD686619B, 0xA27255A2), U64(0xC80A537B, 0x0EFEFEBD), /* ~= 10^-153 */ + U64(0x8613FD01, 0x45877585), U64(0xBD06742C, 0xE95F5F36), /* ~= 10^-152 */ + U64(0xA798FC41, 0x96E952E7), U64(0x2C481138, 0x23B73704), /* ~= 10^-151 */ + U64(0xD17F3B51, 0xFCA3A7A0), U64(0xF75A1586, 0x2CA504C5), /* ~= 10^-150 */ + U64(0x82EF8513, 0x3DE648C4), U64(0x9A984D73, 0xDBE722FB), /* ~= 10^-149 */ + U64(0xA3AB6658, 0x0D5FDAF5), U64(0xC13E60D0, 0xD2E0EBBA), /* ~= 10^-148 */ + U64(0xCC963FEE, 0x10B7D1B3), U64(0x318DF905, 0x079926A8), /* ~= 10^-147 */ + U64(0xFFBBCFE9, 0x94E5C61F), U64(0xFDF17746, 0x497F7052), /* ~= 10^-146 */ + U64(0x9FD561F1, 0xFD0F9BD3), U64(0xFEB6EA8B, 0xEDEFA633), /* ~= 10^-145 */ + U64(0xC7CABA6E, 0x7C5382C8), U64(0xFE64A52E, 0xE96B8FC0), /* ~= 10^-144 */ + U64(0xF9BD690A, 0x1B68637B), U64(0x3DFDCE7A, 0xA3C673B0), /* ~= 10^-143 */ + U64(0x9C1661A6, 0x51213E2D), U64(0x06BEA10C, 0xA65C084E), /* ~= 10^-142 */ + U64(0xC31BFA0F, 0xE5698DB8), U64(0x486E494F, 0xCFF30A62), /* ~= 10^-141 */ + U64(0xF3E2F893, 0xDEC3F126), U64(0x5A89DBA3, 0xC3EFCCFA), /* ~= 10^-140 */ + U64(0x986DDB5C, 0x6B3A76B7), U64(0xF8962946, 0x5A75E01C), /* ~= 10^-139 */ + U64(0xBE895233, 0x86091465), U64(0xF6BBB397, 0xF1135823), /* ~= 10^-138 */ + U64(0xEE2BA6C0, 0x678B597F), U64(0x746AA07D, 0xED582E2C), /* ~= 10^-137 */ + U64(0x94DB4838, 0x40B717EF), U64(0xA8C2A44E, 0xB4571CDC), /* ~= 10^-136 */ + U64(0xBA121A46, 0x50E4DDEB), U64(0x92F34D62, 0x616CE413), /* ~= 10^-135 */ + U64(0xE896A0D7, 0xE51E1566), U64(0x77B020BA, 0xF9C81D17), /* ~= 10^-134 */ + U64(0x915E2486, 0xEF32CD60), U64(0x0ACE1474, 0xDC1D122E), /* ~= 10^-133 */ + U64(0xB5B5ADA8, 0xAAFF80B8), U64(0x0D819992, 0x132456BA), /* ~= 10^-132 */ + U64(0xE3231912, 0xD5BF60E6), U64(0x10E1FFF6, 0x97ED6C69), /* ~= 10^-131 */ + U64(0x8DF5EFAB, 0xC5979C8F), U64(0xCA8D3FFA, 0x1EF463C1), /* ~= 10^-130 */ + U64(0xB1736B96, 0xB6FD83B3), U64(0xBD308FF8, 0xA6B17CB2), /* ~= 10^-129 */ + U64(0xDDD0467C, 0x64BCE4A0), U64(0xAC7CB3F6, 0xD05DDBDE), /* ~= 10^-128 */ + U64(0x8AA22C0D, 0xBEF60EE4), U64(0x6BCDF07A, 0x423AA96B), /* ~= 10^-127 */ + U64(0xAD4AB711, 0x2EB3929D), U64(0x86C16C98, 0xD2C953C6), /* ~= 10^-126 */ + U64(0xD89D64D5, 0x7A607744), U64(0xE871C7BF, 0x077BA8B7), /* ~= 10^-125 */ + U64(0x87625F05, 0x6C7C4A8B), U64(0x11471CD7, 0x64AD4972), /* ~= 10^-124 */ + U64(0xA93AF6C6, 0xC79B5D2D), U64(0xD598E40D, 0x3DD89BCF), /* ~= 10^-123 */ + U64(0xD389B478, 0x79823479), U64(0x4AFF1D10, 0x8D4EC2C3), /* ~= 10^-122 */ + U64(0x843610CB, 0x4BF160CB), U64(0xCEDF722A, 0x585139BA), /* ~= 10^-121 */ + U64(0xA54394FE, 0x1EEDB8FE), U64(0xC2974EB4, 0xEE658828), /* ~= 10^-120 */ + U64(0xCE947A3D, 0xA6A9273E), U64(0x733D2262, 0x29FEEA32), /* ~= 10^-119 */ + U64(0x811CCC66, 0x8829B887), U64(0x0806357D, 0x5A3F525F), /* ~= 10^-118 */ + U64(0xA163FF80, 0x2A3426A8), U64(0xCA07C2DC, 0xB0CF26F7), /* ~= 10^-117 */ + U64(0xC9BCFF60, 0x34C13052), U64(0xFC89B393, 0xDD02F0B5), /* ~= 10^-116 */ + U64(0xFC2C3F38, 0x41F17C67), U64(0xBBAC2078, 0xD443ACE2), /* ~= 10^-115 */ + U64(0x9D9BA783, 0x2936EDC0), U64(0xD54B944B, 0x84AA4C0D), /* ~= 10^-114 */ + U64(0xC5029163, 0xF384A931), U64(0x0A9E795E, 0x65D4DF11), /* ~= 10^-113 */ + U64(0xF64335BC, 0xF065D37D), U64(0x4D4617B5, 0xFF4A16D5), /* ~= 10^-112 */ + U64(0x99EA0196, 0x163FA42E), U64(0x504BCED1, 0xBF8E4E45), /* ~= 10^-111 */ + U64(0xC06481FB, 0x9BCF8D39), U64(0xE45EC286, 0x2F71E1D6), /* ~= 10^-110 */ + U64(0xF07DA27A, 0x82C37088), U64(0x5D767327, 0xBB4E5A4C), /* ~= 10^-109 */ + U64(0x964E858C, 0x91BA2655), U64(0x3A6A07F8, 0xD510F86F), /* ~= 10^-108 */ + U64(0xBBE226EF, 0xB628AFEA), U64(0x890489F7, 0x0A55368B), /* ~= 10^-107 */ + U64(0xEADAB0AB, 0xA3B2DBE5), U64(0x2B45AC74, 0xCCEA842E), /* ~= 10^-106 */ + U64(0x92C8AE6B, 0x464FC96F), U64(0x3B0B8BC9, 0x0012929D), /* ~= 10^-105 */ + U64(0xB77ADA06, 0x17E3BBCB), U64(0x09CE6EBB, 0x40173744), /* ~= 10^-104 */ + U64(0xE5599087, 0x9DDCAABD), U64(0xCC420A6A, 0x101D0515), /* ~= 10^-103 */ + U64(0x8F57FA54, 0xC2A9EAB6), U64(0x9FA94682, 0x4A12232D), /* ~= 10^-102 */ + U64(0xB32DF8E9, 0xF3546564), U64(0x47939822, 0xDC96ABF9), /* ~= 10^-101 */ + U64(0xDFF97724, 0x70297EBD), U64(0x59787E2B, 0x93BC56F7), /* ~= 10^-100 */ + U64(0x8BFBEA76, 0xC619EF36), U64(0x57EB4EDB, 0x3C55B65A), /* ~= 10^-99 */ + U64(0xAEFAE514, 0x77A06B03), U64(0xEDE62292, 0x0B6B23F1), /* ~= 10^-98 */ + U64(0xDAB99E59, 0x958885C4), U64(0xE95FAB36, 0x8E45ECED), /* ~= 10^-97 */ + U64(0x88B402F7, 0xFD75539B), U64(0x11DBCB02, 0x18EBB414), /* ~= 10^-96 */ + U64(0xAAE103B5, 0xFCD2A881), U64(0xD652BDC2, 0x9F26A119), /* ~= 10^-95 */ + U64(0xD59944A3, 0x7C0752A2), U64(0x4BE76D33, 0x46F0495F), /* ~= 10^-94 */ + U64(0x857FCAE6, 0x2D8493A5), U64(0x6F70A440, 0x0C562DDB), /* ~= 10^-93 */ + U64(0xA6DFBD9F, 0xB8E5B88E), U64(0xCB4CCD50, 0x0F6BB952), /* ~= 10^-92 */ + U64(0xD097AD07, 0xA71F26B2), U64(0x7E2000A4, 0x1346A7A7), /* ~= 10^-91 */ + U64(0x825ECC24, 0xC873782F), U64(0x8ED40066, 0x8C0C28C8), /* ~= 10^-90 */ + U64(0xA2F67F2D, 0xFA90563B), U64(0x72890080, 0x2F0F32FA), /* ~= 10^-89 */ + U64(0xCBB41EF9, 0x79346BCA), U64(0x4F2B40A0, 0x3AD2FFB9), /* ~= 10^-88 */ + U64(0xFEA126B7, 0xD78186BC), U64(0xE2F610C8, 0x4987BFA8), /* ~= 10^-87 */ + U64(0x9F24B832, 0xE6B0F436), U64(0x0DD9CA7D, 0x2DF4D7C9), /* ~= 10^-86 */ + U64(0xC6EDE63F, 0xA05D3143), U64(0x91503D1C, 0x79720DBB), /* ~= 10^-85 */ + U64(0xF8A95FCF, 0x88747D94), U64(0x75A44C63, 0x97CE912A), /* ~= 10^-84 */ + U64(0x9B69DBE1, 0xB548CE7C), U64(0xC986AFBE, 0x3EE11ABA), /* ~= 10^-83 */ + U64(0xC24452DA, 0x229B021B), U64(0xFBE85BAD, 0xCE996168), /* ~= 10^-82 */ + U64(0xF2D56790, 0xAB41C2A2), U64(0xFAE27299, 0x423FB9C3), /* ~= 10^-81 */ + U64(0x97C560BA, 0x6B0919A5), U64(0xDCCD879F, 0xC967D41A), /* ~= 10^-80 */ + U64(0xBDB6B8E9, 0x05CB600F), U64(0x5400E987, 0xBBC1C920), /* ~= 10^-79 */ + U64(0xED246723, 0x473E3813), U64(0x290123E9, 0xAAB23B68), /* ~= 10^-78 */ + U64(0x9436C076, 0x0C86E30B), U64(0xF9A0B672, 0x0AAF6521), /* ~= 10^-77 */ + U64(0xB9447093, 0x8FA89BCE), U64(0xF808E40E, 0x8D5B3E69), /* ~= 10^-76 */ + U64(0xE7958CB8, 0x7392C2C2), U64(0xB60B1D12, 0x30B20E04), /* ~= 10^-75 */ + U64(0x90BD77F3, 0x483BB9B9), U64(0xB1C6F22B, 0x5E6F48C2), /* ~= 10^-74 */ + U64(0xB4ECD5F0, 0x1A4AA828), U64(0x1E38AEB6, 0x360B1AF3), /* ~= 10^-73 */ + U64(0xE2280B6C, 0x20DD5232), U64(0x25C6DA63, 0xC38DE1B0), /* ~= 10^-72 */ + U64(0x8D590723, 0x948A535F), U64(0x579C487E, 0x5A38AD0E), /* ~= 10^-71 */ + U64(0xB0AF48EC, 0x79ACE837), U64(0x2D835A9D, 0xF0C6D851), /* ~= 10^-70 */ + U64(0xDCDB1B27, 0x98182244), U64(0xF8E43145, 0x6CF88E65), /* ~= 10^-69 */ + U64(0x8A08F0F8, 0xBF0F156B), U64(0x1B8E9ECB, 0x641B58FF), /* ~= 10^-68 */ + U64(0xAC8B2D36, 0xEED2DAC5), U64(0xE272467E, 0x3D222F3F), /* ~= 10^-67 */ + U64(0xD7ADF884, 0xAA879177), U64(0x5B0ED81D, 0xCC6ABB0F), /* ~= 10^-66 */ + U64(0x86CCBB52, 0xEA94BAEA), U64(0x98E94712, 0x9FC2B4E9), /* ~= 10^-65 */ + U64(0xA87FEA27, 0xA539E9A5), U64(0x3F2398D7, 0x47B36224), /* ~= 10^-64 */ + U64(0xD29FE4B1, 0x8E88640E), U64(0x8EEC7F0D, 0x19A03AAD), /* ~= 10^-63 */ + U64(0x83A3EEEE, 0xF9153E89), U64(0x1953CF68, 0x300424AC), /* ~= 10^-62 */ + U64(0xA48CEAAA, 0xB75A8E2B), U64(0x5FA8C342, 0x3C052DD7), /* ~= 10^-61 */ + U64(0xCDB02555, 0x653131B6), U64(0x3792F412, 0xCB06794D), /* ~= 10^-60 */ + U64(0x808E1755, 0x5F3EBF11), U64(0xE2BBD88B, 0xBEE40BD0), /* ~= 10^-59 */ + U64(0xA0B19D2A, 0xB70E6ED6), U64(0x5B6ACEAE, 0xAE9D0EC4), /* ~= 10^-58 */ + U64(0xC8DE0475, 0x64D20A8B), U64(0xF245825A, 0x5A445275), /* ~= 10^-57 */ + U64(0xFB158592, 0xBE068D2E), U64(0xEED6E2F0, 0xF0D56712), /* ~= 10^-56 */ + U64(0x9CED737B, 0xB6C4183D), U64(0x55464DD6, 0x9685606B), /* ~= 10^-55 */ + U64(0xC428D05A, 0xA4751E4C), U64(0xAA97E14C, 0x3C26B886), /* ~= 10^-54 */ + U64(0xF5330471, 0x4D9265DF), U64(0xD53DD99F, 0x4B3066A8), /* ~= 10^-53 */ + U64(0x993FE2C6, 0xD07B7FAB), U64(0xE546A803, 0x8EFE4029), /* ~= 10^-52 */ + U64(0xBF8FDB78, 0x849A5F96), U64(0xDE985204, 0x72BDD033), /* ~= 10^-51 */ + U64(0xEF73D256, 0xA5C0F77C), U64(0x963E6685, 0x8F6D4440), /* ~= 10^-50 */ + U64(0x95A86376, 0x27989AAD), U64(0xDDE70013, 0x79A44AA8), /* ~= 10^-49 */ + U64(0xBB127C53, 0xB17EC159), U64(0x5560C018, 0x580D5D52), /* ~= 10^-48 */ + U64(0xE9D71B68, 0x9DDE71AF), U64(0xAAB8F01E, 0x6E10B4A6), /* ~= 10^-47 */ + U64(0x92267121, 0x62AB070D), U64(0xCAB39613, 0x04CA70E8), /* ~= 10^-46 */ + U64(0xB6B00D69, 0xBB55C8D1), U64(0x3D607B97, 0xC5FD0D22), /* ~= 10^-45 */ + U64(0xE45C10C4, 0x2A2B3B05), U64(0x8CB89A7D, 0xB77C506A), /* ~= 10^-44 */ + U64(0x8EB98A7A, 0x9A5B04E3), U64(0x77F3608E, 0x92ADB242), /* ~= 10^-43 */ + U64(0xB267ED19, 0x40F1C61C), U64(0x55F038B2, 0x37591ED3), /* ~= 10^-42 */ + U64(0xDF01E85F, 0x912E37A3), U64(0x6B6C46DE, 0xC52F6688), /* ~= 10^-41 */ + U64(0x8B61313B, 0xBABCE2C6), U64(0x2323AC4B, 0x3B3DA015), /* ~= 10^-40 */ + U64(0xAE397D8A, 0xA96C1B77), U64(0xABEC975E, 0x0A0D081A), /* ~= 10^-39 */ + U64(0xD9C7DCED, 0x53C72255), U64(0x96E7BD35, 0x8C904A21), /* ~= 10^-38 */ + U64(0x881CEA14, 0x545C7575), U64(0x7E50D641, 0x77DA2E54), /* ~= 10^-37 */ + U64(0xAA242499, 0x697392D2), U64(0xDDE50BD1, 0xD5D0B9E9), /* ~= 10^-36 */ + U64(0xD4AD2DBF, 0xC3D07787), U64(0x955E4EC6, 0x4B44E864), /* ~= 10^-35 */ + U64(0x84EC3C97, 0xDA624AB4), U64(0xBD5AF13B, 0xEF0B113E), /* ~= 10^-34 */ + U64(0xA6274BBD, 0xD0FADD61), U64(0xECB1AD8A, 0xEACDD58E), /* ~= 10^-33 */ + U64(0xCFB11EAD, 0x453994BA), U64(0x67DE18ED, 0xA5814AF2), /* ~= 10^-32 */ + U64(0x81CEB32C, 0x4B43FCF4), U64(0x80EACF94, 0x8770CED7), /* ~= 10^-31 */ + U64(0xA2425FF7, 0x5E14FC31), U64(0xA1258379, 0xA94D028D), /* ~= 10^-30 */ + U64(0xCAD2F7F5, 0x359A3B3E), U64(0x096EE458, 0x13A04330), /* ~= 10^-29 */ + U64(0xFD87B5F2, 0x8300CA0D), U64(0x8BCA9D6E, 0x188853FC), /* ~= 10^-28 */ + U64(0x9E74D1B7, 0x91E07E48), U64(0x775EA264, 0xCF55347D), /* ~= 10^-27 */ + U64(0xC6120625, 0x76589DDA), U64(0x95364AFE, 0x032A819D), /* ~= 10^-26 */ + U64(0xF79687AE, 0xD3EEC551), U64(0x3A83DDBD, 0x83F52204), /* ~= 10^-25 */ + U64(0x9ABE14CD, 0x44753B52), U64(0xC4926A96, 0x72793542), /* ~= 10^-24 */ + U64(0xC16D9A00, 0x95928A27), U64(0x75B7053C, 0x0F178293), /* ~= 10^-23 */ + U64(0xF1C90080, 0xBAF72CB1), U64(0x5324C68B, 0x12DD6338), /* ~= 10^-22 */ + U64(0x971DA050, 0x74DA7BEE), U64(0xD3F6FC16, 0xEBCA5E03), /* ~= 10^-21 */ + U64(0xBCE50864, 0x92111AEA), U64(0x88F4BB1C, 0xA6BCF584), /* ~= 10^-20 */ + U64(0xEC1E4A7D, 0xB69561A5), U64(0x2B31E9E3, 0xD06C32E5), /* ~= 10^-19 */ + U64(0x9392EE8E, 0x921D5D07), U64(0x3AFF322E, 0x62439FCF), /* ~= 10^-18 */ + U64(0xB877AA32, 0x36A4B449), U64(0x09BEFEB9, 0xFAD487C2), /* ~= 10^-17 */ + U64(0xE69594BE, 0xC44DE15B), U64(0x4C2EBE68, 0x7989A9B3), /* ~= 10^-16 */ + U64(0x901D7CF7, 0x3AB0ACD9), U64(0x0F9D3701, 0x4BF60A10), /* ~= 10^-15 */ + U64(0xB424DC35, 0x095CD80F), U64(0x538484C1, 0x9EF38C94), /* ~= 10^-14 */ + U64(0xE12E1342, 0x4BB40E13), U64(0x2865A5F2, 0x06B06FB9), /* ~= 10^-13 */ + U64(0x8CBCCC09, 0x6F5088CB), U64(0xF93F87B7, 0x442E45D3), /* ~= 10^-12 */ + U64(0xAFEBFF0B, 0xCB24AAFE), U64(0xF78F69A5, 0x1539D748), /* ~= 10^-11 */ + U64(0xDBE6FECE, 0xBDEDD5BE), U64(0xB573440E, 0x5A884D1B), /* ~= 10^-10 */ + U64(0x89705F41, 0x36B4A597), U64(0x31680A88, 0xF8953030), /* ~= 10^-9 */ + U64(0xABCC7711, 0x8461CEFC), U64(0xFDC20D2B, 0x36BA7C3D), /* ~= 10^-8 */ + U64(0xD6BF94D5, 0xE57A42BC), U64(0x3D329076, 0x04691B4C), /* ~= 10^-7 */ + U64(0x8637BD05, 0xAF6C69B5), U64(0xA63F9A49, 0xC2C1B10F), /* ~= 10^-6 */ + U64(0xA7C5AC47, 0x1B478423), U64(0x0FCF80DC, 0x33721D53), /* ~= 10^-5 */ + U64(0xD1B71758, 0xE219652B), U64(0xD3C36113, 0x404EA4A8), /* ~= 10^-4 */ + U64(0x83126E97, 0x8D4FDF3B), U64(0x645A1CAC, 0x083126E9), /* ~= 10^-3 */ + U64(0xA3D70A3D, 0x70A3D70A), U64(0x3D70A3D7, 0x0A3D70A3), /* ~= 10^-2 */ + U64(0xCCCCCCCC, 0xCCCCCCCC), U64(0xCCCCCCCC, 0xCCCCCCCC), /* ~= 10^-1 */ + U64(0x80000000, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^0 */ + U64(0xA0000000, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^1 */ + U64(0xC8000000, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^2 */ + U64(0xFA000000, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^3 */ + U64(0x9C400000, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^4 */ + U64(0xC3500000, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^5 */ + U64(0xF4240000, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^6 */ + U64(0x98968000, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^7 */ + U64(0xBEBC2000, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^8 */ + U64(0xEE6B2800, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^9 */ + U64(0x9502F900, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^10 */ + U64(0xBA43B740, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^11 */ + U64(0xE8D4A510, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^12 */ + U64(0x9184E72A, 0x00000000), U64(0x00000000, 0x00000000), /* == 10^13 */ + U64(0xB5E620F4, 0x80000000), U64(0x00000000, 0x00000000), /* == 10^14 */ + U64(0xE35FA931, 0xA0000000), U64(0x00000000, 0x00000000), /* == 10^15 */ + U64(0x8E1BC9BF, 0x04000000), U64(0x00000000, 0x00000000), /* == 10^16 */ + U64(0xB1A2BC2E, 0xC5000000), U64(0x00000000, 0x00000000), /* == 10^17 */ + U64(0xDE0B6B3A, 0x76400000), U64(0x00000000, 0x00000000), /* == 10^18 */ + U64(0x8AC72304, 0x89E80000), U64(0x00000000, 0x00000000), /* == 10^19 */ + U64(0xAD78EBC5, 0xAC620000), U64(0x00000000, 0x00000000), /* == 10^20 */ + U64(0xD8D726B7, 0x177A8000), U64(0x00000000, 0x00000000), /* == 10^21 */ + U64(0x87867832, 0x6EAC9000), U64(0x00000000, 0x00000000), /* == 10^22 */ + U64(0xA968163F, 0x0A57B400), U64(0x00000000, 0x00000000), /* == 10^23 */ + U64(0xD3C21BCE, 0xCCEDA100), U64(0x00000000, 0x00000000), /* == 10^24 */ + U64(0x84595161, 0x401484A0), U64(0x00000000, 0x00000000), /* == 10^25 */ + U64(0xA56FA5B9, 0x9019A5C8), U64(0x00000000, 0x00000000), /* == 10^26 */ + U64(0xCECB8F27, 0xF4200F3A), U64(0x00000000, 0x00000000), /* == 10^27 */ + U64(0x813F3978, 0xF8940984), U64(0x40000000, 0x00000000), /* == 10^28 */ + U64(0xA18F07D7, 0x36B90BE5), U64(0x50000000, 0x00000000), /* == 10^29 */ + U64(0xC9F2C9CD, 0x04674EDE), U64(0xA4000000, 0x00000000), /* == 10^30 */ + U64(0xFC6F7C40, 0x45812296), U64(0x4D000000, 0x00000000), /* == 10^31 */ + U64(0x9DC5ADA8, 0x2B70B59D), U64(0xF0200000, 0x00000000), /* == 10^32 */ + U64(0xC5371912, 0x364CE305), U64(0x6C280000, 0x00000000), /* == 10^33 */ + U64(0xF684DF56, 0xC3E01BC6), U64(0xC7320000, 0x00000000), /* == 10^34 */ + U64(0x9A130B96, 0x3A6C115C), U64(0x3C7F4000, 0x00000000), /* == 10^35 */ + U64(0xC097CE7B, 0xC90715B3), U64(0x4B9F1000, 0x00000000), /* == 10^36 */ + U64(0xF0BDC21A, 0xBB48DB20), U64(0x1E86D400, 0x00000000), /* == 10^37 */ + U64(0x96769950, 0xB50D88F4), U64(0x13144480, 0x00000000), /* == 10^38 */ + U64(0xBC143FA4, 0xE250EB31), U64(0x17D955A0, 0x00000000), /* == 10^39 */ + U64(0xEB194F8E, 0x1AE525FD), U64(0x5DCFAB08, 0x00000000), /* == 10^40 */ + U64(0x92EFD1B8, 0xD0CF37BE), U64(0x5AA1CAE5, 0x00000000), /* == 10^41 */ + U64(0xB7ABC627, 0x050305AD), U64(0xF14A3D9E, 0x40000000), /* == 10^42 */ + U64(0xE596B7B0, 0xC643C719), U64(0x6D9CCD05, 0xD0000000), /* == 10^43 */ + U64(0x8F7E32CE, 0x7BEA5C6F), U64(0xE4820023, 0xA2000000), /* == 10^44 */ + U64(0xB35DBF82, 0x1AE4F38B), U64(0xDDA2802C, 0x8A800000), /* == 10^45 */ + U64(0xE0352F62, 0xA19E306E), U64(0xD50B2037, 0xAD200000), /* == 10^46 */ + U64(0x8C213D9D, 0xA502DE45), U64(0x4526F422, 0xCC340000), /* == 10^47 */ + U64(0xAF298D05, 0x0E4395D6), U64(0x9670B12B, 0x7F410000), /* == 10^48 */ + U64(0xDAF3F046, 0x51D47B4C), U64(0x3C0CDD76, 0x5F114000), /* == 10^49 */ + U64(0x88D8762B, 0xF324CD0F), U64(0xA5880A69, 0xFB6AC800), /* == 10^50 */ + U64(0xAB0E93B6, 0xEFEE0053), U64(0x8EEA0D04, 0x7A457A00), /* == 10^51 */ + U64(0xD5D238A4, 0xABE98068), U64(0x72A49045, 0x98D6D880), /* == 10^52 */ + U64(0x85A36366, 0xEB71F041), U64(0x47A6DA2B, 0x7F864750), /* == 10^53 */ + U64(0xA70C3C40, 0xA64E6C51), U64(0x999090B6, 0x5F67D924), /* == 10^54 */ + U64(0xD0CF4B50, 0xCFE20765), U64(0xFFF4B4E3, 0xF741CF6D), /* == 10^55 */ + U64(0x82818F12, 0x81ED449F), U64(0xBFF8F10E, 0x7A8921A4), /* ~= 10^56 */ + U64(0xA321F2D7, 0x226895C7), U64(0xAFF72D52, 0x192B6A0D), /* ~= 10^57 */ + U64(0xCBEA6F8C, 0xEB02BB39), U64(0x9BF4F8A6, 0x9F764490), /* ~= 10^58 */ + U64(0xFEE50B70, 0x25C36A08), U64(0x02F236D0, 0x4753D5B4), /* ~= 10^59 */ + U64(0x9F4F2726, 0x179A2245), U64(0x01D76242, 0x2C946590), /* ~= 10^60 */ + U64(0xC722F0EF, 0x9D80AAD6), U64(0x424D3AD2, 0xB7B97EF5), /* ~= 10^61 */ + U64(0xF8EBAD2B, 0x84E0D58B), U64(0xD2E08987, 0x65A7DEB2), /* ~= 10^62 */ + U64(0x9B934C3B, 0x330C8577), U64(0x63CC55F4, 0x9F88EB2F), /* ~= 10^63 */ + U64(0xC2781F49, 0xFFCFA6D5), U64(0x3CBF6B71, 0xC76B25FB), /* ~= 10^64 */ + U64(0xF316271C, 0x7FC3908A), U64(0x8BEF464E, 0x3945EF7A), /* ~= 10^65 */ + U64(0x97EDD871, 0xCFDA3A56), U64(0x97758BF0, 0xE3CBB5AC), /* ~= 10^66 */ + U64(0xBDE94E8E, 0x43D0C8EC), U64(0x3D52EEED, 0x1CBEA317), /* ~= 10^67 */ + U64(0xED63A231, 0xD4C4FB27), U64(0x4CA7AAA8, 0x63EE4BDD), /* ~= 10^68 */ + U64(0x945E455F, 0x24FB1CF8), U64(0x8FE8CAA9, 0x3E74EF6A), /* ~= 10^69 */ + U64(0xB975D6B6, 0xEE39E436), U64(0xB3E2FD53, 0x8E122B44), /* ~= 10^70 */ + U64(0xE7D34C64, 0xA9C85D44), U64(0x60DBBCA8, 0x7196B616), /* ~= 10^71 */ + U64(0x90E40FBE, 0xEA1D3A4A), U64(0xBC8955E9, 0x46FE31CD), /* ~= 10^72 */ + U64(0xB51D13AE, 0xA4A488DD), U64(0x6BABAB63, 0x98BDBE41), /* ~= 10^73 */ + U64(0xE264589A, 0x4DCDAB14), U64(0xC696963C, 0x7EED2DD1), /* ~= 10^74 */ + U64(0x8D7EB760, 0x70A08AEC), U64(0xFC1E1DE5, 0xCF543CA2), /* ~= 10^75 */ + U64(0xB0DE6538, 0x8CC8ADA8), U64(0x3B25A55F, 0x43294BCB), /* ~= 10^76 */ + U64(0xDD15FE86, 0xAFFAD912), U64(0x49EF0EB7, 0x13F39EBE), /* ~= 10^77 */ + U64(0x8A2DBF14, 0x2DFCC7AB), U64(0x6E356932, 0x6C784337), /* ~= 10^78 */ + U64(0xACB92ED9, 0x397BF996), U64(0x49C2C37F, 0x07965404), /* ~= 10^79 */ + U64(0xD7E77A8F, 0x87DAF7FB), U64(0xDC33745E, 0xC97BE906), /* ~= 10^80 */ + U64(0x86F0AC99, 0xB4E8DAFD), U64(0x69A028BB, 0x3DED71A3), /* ~= 10^81 */ + U64(0xA8ACD7C0, 0x222311BC), U64(0xC40832EA, 0x0D68CE0C), /* ~= 10^82 */ + U64(0xD2D80DB0, 0x2AABD62B), U64(0xF50A3FA4, 0x90C30190), /* ~= 10^83 */ + U64(0x83C7088E, 0x1AAB65DB), U64(0x792667C6, 0xDA79E0FA), /* ~= 10^84 */ + U64(0xA4B8CAB1, 0xA1563F52), U64(0x577001B8, 0x91185938), /* ~= 10^85 */ + U64(0xCDE6FD5E, 0x09ABCF26), U64(0xED4C0226, 0xB55E6F86), /* ~= 10^86 */ + U64(0x80B05E5A, 0xC60B6178), U64(0x544F8158, 0x315B05B4), /* ~= 10^87 */ + U64(0xA0DC75F1, 0x778E39D6), U64(0x696361AE, 0x3DB1C721), /* ~= 10^88 */ + U64(0xC913936D, 0xD571C84C), U64(0x03BC3A19, 0xCD1E38E9), /* ~= 10^89 */ + U64(0xFB587849, 0x4ACE3A5F), U64(0x04AB48A0, 0x4065C723), /* ~= 10^90 */ + U64(0x9D174B2D, 0xCEC0E47B), U64(0x62EB0D64, 0x283F9C76), /* ~= 10^91 */ + U64(0xC45D1DF9, 0x42711D9A), U64(0x3BA5D0BD, 0x324F8394), /* ~= 10^92 */ + U64(0xF5746577, 0x930D6500), U64(0xCA8F44EC, 0x7EE36479), /* ~= 10^93 */ + U64(0x9968BF6A, 0xBBE85F20), U64(0x7E998B13, 0xCF4E1ECB), /* ~= 10^94 */ + U64(0xBFC2EF45, 0x6AE276E8), U64(0x9E3FEDD8, 0xC321A67E), /* ~= 10^95 */ + U64(0xEFB3AB16, 0xC59B14A2), U64(0xC5CFE94E, 0xF3EA101E), /* ~= 10^96 */ + U64(0x95D04AEE, 0x3B80ECE5), U64(0xBBA1F1D1, 0x58724A12), /* ~= 10^97 */ + U64(0xBB445DA9, 0xCA61281F), U64(0x2A8A6E45, 0xAE8EDC97), /* ~= 10^98 */ + U64(0xEA157514, 0x3CF97226), U64(0xF52D09D7, 0x1A3293BD), /* ~= 10^99 */ + U64(0x924D692C, 0xA61BE758), U64(0x593C2626, 0x705F9C56), /* ~= 10^100 */ + U64(0xB6E0C377, 0xCFA2E12E), U64(0x6F8B2FB0, 0x0C77836C), /* ~= 10^101 */ + U64(0xE498F455, 0xC38B997A), U64(0x0B6DFB9C, 0x0F956447), /* ~= 10^102 */ + U64(0x8EDF98B5, 0x9A373FEC), U64(0x4724BD41, 0x89BD5EAC), /* ~= 10^103 */ + U64(0xB2977EE3, 0x00C50FE7), U64(0x58EDEC91, 0xEC2CB657), /* ~= 10^104 */ + U64(0xDF3D5E9B, 0xC0F653E1), U64(0x2F2967B6, 0x6737E3ED), /* ~= 10^105 */ + U64(0x8B865B21, 0x5899F46C), U64(0xBD79E0D2, 0x0082EE74), /* ~= 10^106 */ + U64(0xAE67F1E9, 0xAEC07187), U64(0xECD85906, 0x80A3AA11), /* ~= 10^107 */ + U64(0xDA01EE64, 0x1A708DE9), U64(0xE80E6F48, 0x20CC9495), /* ~= 10^108 */ + U64(0x884134FE, 0x908658B2), U64(0x3109058D, 0x147FDCDD), /* ~= 10^109 */ + U64(0xAA51823E, 0x34A7EEDE), U64(0xBD4B46F0, 0x599FD415), /* ~= 10^110 */ + U64(0xD4E5E2CD, 0xC1D1EA96), U64(0x6C9E18AC, 0x7007C91A), /* ~= 10^111 */ + U64(0x850FADC0, 0x9923329E), U64(0x03E2CF6B, 0xC604DDB0), /* ~= 10^112 */ + U64(0xA6539930, 0xBF6BFF45), U64(0x84DB8346, 0xB786151C), /* ~= 10^113 */ + U64(0xCFE87F7C, 0xEF46FF16), U64(0xE6126418, 0x65679A63), /* ~= 10^114 */ + U64(0x81F14FAE, 0x158C5F6E), U64(0x4FCB7E8F, 0x3F60C07E), /* ~= 10^115 */ + U64(0xA26DA399, 0x9AEF7749), U64(0xE3BE5E33, 0x0F38F09D), /* ~= 10^116 */ + U64(0xCB090C80, 0x01AB551C), U64(0x5CADF5BF, 0xD3072CC5), /* ~= 10^117 */ + U64(0xFDCB4FA0, 0x02162A63), U64(0x73D9732F, 0xC7C8F7F6), /* ~= 10^118 */ + U64(0x9E9F11C4, 0x014DDA7E), U64(0x2867E7FD, 0xDCDD9AFA), /* ~= 10^119 */ + U64(0xC646D635, 0x01A1511D), U64(0xB281E1FD, 0x541501B8), /* ~= 10^120 */ + U64(0xF7D88BC2, 0x4209A565), U64(0x1F225A7C, 0xA91A4226), /* ~= 10^121 */ + U64(0x9AE75759, 0x6946075F), U64(0x3375788D, 0xE9B06958), /* ~= 10^122 */ + U64(0xC1A12D2F, 0xC3978937), U64(0x0052D6B1, 0x641C83AE), /* ~= 10^123 */ + U64(0xF209787B, 0xB47D6B84), U64(0xC0678C5D, 0xBD23A49A), /* ~= 10^124 */ + U64(0x9745EB4D, 0x50CE6332), U64(0xF840B7BA, 0x963646E0), /* ~= 10^125 */ + U64(0xBD176620, 0xA501FBFF), U64(0xB650E5A9, 0x3BC3D898), /* ~= 10^126 */ + U64(0xEC5D3FA8, 0xCE427AFF), U64(0xA3E51F13, 0x8AB4CEBE), /* ~= 10^127 */ + U64(0x93BA47C9, 0x80E98CDF), U64(0xC66F336C, 0x36B10137), /* ~= 10^128 */ + U64(0xB8A8D9BB, 0xE123F017), U64(0xB80B0047, 0x445D4184), /* ~= 10^129 */ + U64(0xE6D3102A, 0xD96CEC1D), U64(0xA60DC059, 0x157491E5), /* ~= 10^130 */ + U64(0x9043EA1A, 0xC7E41392), U64(0x87C89837, 0xAD68DB2F), /* ~= 10^131 */ + U64(0xB454E4A1, 0x79DD1877), U64(0x29BABE45, 0x98C311FB), /* ~= 10^132 */ + U64(0xE16A1DC9, 0xD8545E94), U64(0xF4296DD6, 0xFEF3D67A), /* ~= 10^133 */ + U64(0x8CE2529E, 0x2734BB1D), U64(0x1899E4A6, 0x5F58660C), /* ~= 10^134 */ + U64(0xB01AE745, 0xB101E9E4), U64(0x5EC05DCF, 0xF72E7F8F), /* ~= 10^135 */ + U64(0xDC21A117, 0x1D42645D), U64(0x76707543, 0xF4FA1F73), /* ~= 10^136 */ + U64(0x899504AE, 0x72497EBA), U64(0x6A06494A, 0x791C53A8), /* ~= 10^137 */ + U64(0xABFA45DA, 0x0EDBDE69), U64(0x0487DB9D, 0x17636892), /* ~= 10^138 */ + U64(0xD6F8D750, 0x9292D603), U64(0x45A9D284, 0x5D3C42B6), /* ~= 10^139 */ + U64(0x865B8692, 0x5B9BC5C2), U64(0x0B8A2392, 0xBA45A9B2), /* ~= 10^140 */ + U64(0xA7F26836, 0xF282B732), U64(0x8E6CAC77, 0x68D7141E), /* ~= 10^141 */ + U64(0xD1EF0244, 0xAF2364FF), U64(0x3207D795, 0x430CD926), /* ~= 10^142 */ + U64(0x8335616A, 0xED761F1F), U64(0x7F44E6BD, 0x49E807B8), /* ~= 10^143 */ + U64(0xA402B9C5, 0xA8D3A6E7), U64(0x5F16206C, 0x9C6209A6), /* ~= 10^144 */ + U64(0xCD036837, 0x130890A1), U64(0x36DBA887, 0xC37A8C0F), /* ~= 10^145 */ + U64(0x80222122, 0x6BE55A64), U64(0xC2494954, 0xDA2C9789), /* ~= 10^146 */ + U64(0xA02AA96B, 0x06DEB0FD), U64(0xF2DB9BAA, 0x10B7BD6C), /* ~= 10^147 */ + U64(0xC83553C5, 0xC8965D3D), U64(0x6F928294, 0x94E5ACC7), /* ~= 10^148 */ + U64(0xFA42A8B7, 0x3ABBF48C), U64(0xCB772339, 0xBA1F17F9), /* ~= 10^149 */ + U64(0x9C69A972, 0x84B578D7), U64(0xFF2A7604, 0x14536EFB), /* ~= 10^150 */ + U64(0xC38413CF, 0x25E2D70D), U64(0xFEF51385, 0x19684ABA), /* ~= 10^151 */ + U64(0xF46518C2, 0xEF5B8CD1), U64(0x7EB25866, 0x5FC25D69), /* ~= 10^152 */ + U64(0x98BF2F79, 0xD5993802), U64(0xEF2F773F, 0xFBD97A61), /* ~= 10^153 */ + U64(0xBEEEFB58, 0x4AFF8603), U64(0xAAFB550F, 0xFACFD8FA), /* ~= 10^154 */ + U64(0xEEAABA2E, 0x5DBF6784), U64(0x95BA2A53, 0xF983CF38), /* ~= 10^155 */ + U64(0x952AB45C, 0xFA97A0B2), U64(0xDD945A74, 0x7BF26183), /* ~= 10^156 */ + U64(0xBA756174, 0x393D88DF), U64(0x94F97111, 0x9AEEF9E4), /* ~= 10^157 */ + U64(0xE912B9D1, 0x478CEB17), U64(0x7A37CD56, 0x01AAB85D), /* ~= 10^158 */ + U64(0x91ABB422, 0xCCB812EE), U64(0xAC62E055, 0xC10AB33A), /* ~= 10^159 */ + U64(0xB616A12B, 0x7FE617AA), U64(0x577B986B, 0x314D6009), /* ~= 10^160 */ + U64(0xE39C4976, 0x5FDF9D94), U64(0xED5A7E85, 0xFDA0B80B), /* ~= 10^161 */ + U64(0x8E41ADE9, 0xFBEBC27D), U64(0x14588F13, 0xBE847307), /* ~= 10^162 */ + U64(0xB1D21964, 0x7AE6B31C), U64(0x596EB2D8, 0xAE258FC8), /* ~= 10^163 */ + U64(0xDE469FBD, 0x99A05FE3), U64(0x6FCA5F8E, 0xD9AEF3BB), /* ~= 10^164 */ + U64(0x8AEC23D6, 0x80043BEE), U64(0x25DE7BB9, 0x480D5854), /* ~= 10^165 */ + U64(0xADA72CCC, 0x20054AE9), U64(0xAF561AA7, 0x9A10AE6A), /* ~= 10^166 */ + U64(0xD910F7FF, 0x28069DA4), U64(0x1B2BA151, 0x8094DA04), /* ~= 10^167 */ + U64(0x87AA9AFF, 0x79042286), U64(0x90FB44D2, 0xF05D0842), /* ~= 10^168 */ + U64(0xA99541BF, 0x57452B28), U64(0x353A1607, 0xAC744A53), /* ~= 10^169 */ + U64(0xD3FA922F, 0x2D1675F2), U64(0x42889B89, 0x97915CE8), /* ~= 10^170 */ + U64(0x847C9B5D, 0x7C2E09B7), U64(0x69956135, 0xFEBADA11), /* ~= 10^171 */ + U64(0xA59BC234, 0xDB398C25), U64(0x43FAB983, 0x7E699095), /* ~= 10^172 */ + U64(0xCF02B2C2, 0x1207EF2E), U64(0x94F967E4, 0x5E03F4BB), /* ~= 10^173 */ + U64(0x8161AFB9, 0x4B44F57D), U64(0x1D1BE0EE, 0xBAC278F5), /* ~= 10^174 */ + U64(0xA1BA1BA7, 0x9E1632DC), U64(0x6462D92A, 0x69731732), /* ~= 10^175 */ + U64(0xCA28A291, 0x859BBF93), U64(0x7D7B8F75, 0x03CFDCFE), /* ~= 10^176 */ + U64(0xFCB2CB35, 0xE702AF78), U64(0x5CDA7352, 0x44C3D43E), /* ~= 10^177 */ + U64(0x9DEFBF01, 0xB061ADAB), U64(0x3A088813, 0x6AFA64A7), /* ~= 10^178 */ + U64(0xC56BAEC2, 0x1C7A1916), U64(0x088AAA18, 0x45B8FDD0), /* ~= 10^179 */ + U64(0xF6C69A72, 0xA3989F5B), U64(0x8AAD549E, 0x57273D45), /* ~= 10^180 */ + U64(0x9A3C2087, 0xA63F6399), U64(0x36AC54E2, 0xF678864B), /* ~= 10^181 */ + U64(0xC0CB28A9, 0x8FCF3C7F), U64(0x84576A1B, 0xB416A7DD), /* ~= 10^182 */ + U64(0xF0FDF2D3, 0xF3C30B9F), U64(0x656D44A2, 0xA11C51D5), /* ~= 10^183 */ + U64(0x969EB7C4, 0x7859E743), U64(0x9F644AE5, 0xA4B1B325), /* ~= 10^184 */ + U64(0xBC4665B5, 0x96706114), U64(0x873D5D9F, 0x0DDE1FEE), /* ~= 10^185 */ + U64(0xEB57FF22, 0xFC0C7959), U64(0xA90CB506, 0xD155A7EA), /* ~= 10^186 */ + U64(0x9316FF75, 0xDD87CBD8), U64(0x09A7F124, 0x42D588F2), /* ~= 10^187 */ + U64(0xB7DCBF53, 0x54E9BECE), U64(0x0C11ED6D, 0x538AEB2F), /* ~= 10^188 */ + U64(0xE5D3EF28, 0x2A242E81), U64(0x8F1668C8, 0xA86DA5FA), /* ~= 10^189 */ + U64(0x8FA47579, 0x1A569D10), U64(0xF96E017D, 0x694487BC), /* ~= 10^190 */ + U64(0xB38D92D7, 0x60EC4455), U64(0x37C981DC, 0xC395A9AC), /* ~= 10^191 */ + U64(0xE070F78D, 0x3927556A), U64(0x85BBE253, 0xF47B1417), /* ~= 10^192 */ + U64(0x8C469AB8, 0x43B89562), U64(0x93956D74, 0x78CCEC8E), /* ~= 10^193 */ + U64(0xAF584166, 0x54A6BABB), U64(0x387AC8D1, 0x970027B2), /* ~= 10^194 */ + U64(0xDB2E51BF, 0xE9D0696A), U64(0x06997B05, 0xFCC0319E), /* ~= 10^195 */ + U64(0x88FCF317, 0xF22241E2), U64(0x441FECE3, 0xBDF81F03), /* ~= 10^196 */ + U64(0xAB3C2FDD, 0xEEAAD25A), U64(0xD527E81C, 0xAD7626C3), /* ~= 10^197 */ + U64(0xD60B3BD5, 0x6A5586F1), U64(0x8A71E223, 0xD8D3B074), /* ~= 10^198 */ + U64(0x85C70565, 0x62757456), U64(0xF6872D56, 0x67844E49), /* ~= 10^199 */ + U64(0xA738C6BE, 0xBB12D16C), U64(0xB428F8AC, 0x016561DB), /* ~= 10^200 */ + U64(0xD106F86E, 0x69D785C7), U64(0xE13336D7, 0x01BEBA52), /* ~= 10^201 */ + U64(0x82A45B45, 0x0226B39C), U64(0xECC00246, 0x61173473), /* ~= 10^202 */ + U64(0xA34D7216, 0x42B06084), U64(0x27F002D7, 0xF95D0190), /* ~= 10^203 */ + U64(0xCC20CE9B, 0xD35C78A5), U64(0x31EC038D, 0xF7B441F4), /* ~= 10^204 */ + U64(0xFF290242, 0xC83396CE), U64(0x7E670471, 0x75A15271), /* ~= 10^205 */ + U64(0x9F79A169, 0xBD203E41), U64(0x0F0062C6, 0xE984D386), /* ~= 10^206 */ + U64(0xC75809C4, 0x2C684DD1), U64(0x52C07B78, 0xA3E60868), /* ~= 10^207 */ + U64(0xF92E0C35, 0x37826145), U64(0xA7709A56, 0xCCDF8A82), /* ~= 10^208 */ + U64(0x9BBCC7A1, 0x42B17CCB), U64(0x88A66076, 0x400BB691), /* ~= 10^209 */ + U64(0xC2ABF989, 0x935DDBFE), U64(0x6ACFF893, 0xD00EA435), /* ~= 10^210 */ + U64(0xF356F7EB, 0xF83552FE), U64(0x0583F6B8, 0xC4124D43), /* ~= 10^211 */ + U64(0x98165AF3, 0x7B2153DE), U64(0xC3727A33, 0x7A8B704A), /* ~= 10^212 */ + U64(0xBE1BF1B0, 0x59E9A8D6), U64(0x744F18C0, 0x592E4C5C), /* ~= 10^213 */ + U64(0xEDA2EE1C, 0x7064130C), U64(0x1162DEF0, 0x6F79DF73), /* ~= 10^214 */ + U64(0x9485D4D1, 0xC63E8BE7), U64(0x8ADDCB56, 0x45AC2BA8), /* ~= 10^215 */ + U64(0xB9A74A06, 0x37CE2EE1), U64(0x6D953E2B, 0xD7173692), /* ~= 10^216 */ + U64(0xE8111C87, 0xC5C1BA99), U64(0xC8FA8DB6, 0xCCDD0437), /* ~= 10^217 */ + U64(0x910AB1D4, 0xDB9914A0), U64(0x1D9C9892, 0x400A22A2), /* ~= 10^218 */ + U64(0xB54D5E4A, 0x127F59C8), U64(0x2503BEB6, 0xD00CAB4B), /* ~= 10^219 */ + U64(0xE2A0B5DC, 0x971F303A), U64(0x2E44AE64, 0x840FD61D), /* ~= 10^220 */ + U64(0x8DA471A9, 0xDE737E24), U64(0x5CEAECFE, 0xD289E5D2), /* ~= 10^221 */ + U64(0xB10D8E14, 0x56105DAD), U64(0x7425A83E, 0x872C5F47), /* ~= 10^222 */ + U64(0xDD50F199, 0x6B947518), U64(0xD12F124E, 0x28F77719), /* ~= 10^223 */ + U64(0x8A5296FF, 0xE33CC92F), U64(0x82BD6B70, 0xD99AAA6F), /* ~= 10^224 */ + U64(0xACE73CBF, 0xDC0BFB7B), U64(0x636CC64D, 0x1001550B), /* ~= 10^225 */ + U64(0xD8210BEF, 0xD30EFA5A), U64(0x3C47F7E0, 0x5401AA4E), /* ~= 10^226 */ + U64(0x8714A775, 0xE3E95C78), U64(0x65ACFAEC, 0x34810A71), /* ~= 10^227 */ + U64(0xA8D9D153, 0x5CE3B396), U64(0x7F1839A7, 0x41A14D0D), /* ~= 10^228 */ + U64(0xD31045A8, 0x341CA07C), U64(0x1EDE4811, 0x1209A050), /* ~= 10^229 */ + U64(0x83EA2B89, 0x2091E44D), U64(0x934AED0A, 0xAB460432), /* ~= 10^230 */ + U64(0xA4E4B66B, 0x68B65D60), U64(0xF81DA84D, 0x5617853F), /* ~= 10^231 */ + U64(0xCE1DE406, 0x42E3F4B9), U64(0x36251260, 0xAB9D668E), /* ~= 10^232 */ + U64(0x80D2AE83, 0xE9CE78F3), U64(0xC1D72B7C, 0x6B426019), /* ~= 10^233 */ + U64(0xA1075A24, 0xE4421730), U64(0xB24CF65B, 0x8612F81F), /* ~= 10^234 */ + U64(0xC94930AE, 0x1D529CFC), U64(0xDEE033F2, 0x6797B627), /* ~= 10^235 */ + U64(0xFB9B7CD9, 0xA4A7443C), U64(0x169840EF, 0x017DA3B1), /* ~= 10^236 */ + U64(0x9D412E08, 0x06E88AA5), U64(0x8E1F2895, 0x60EE864E), /* ~= 10^237 */ + U64(0xC491798A, 0x08A2AD4E), U64(0xF1A6F2BA, 0xB92A27E2), /* ~= 10^238 */ + U64(0xF5B5D7EC, 0x8ACB58A2), U64(0xAE10AF69, 0x6774B1DB), /* ~= 10^239 */ + U64(0x9991A6F3, 0xD6BF1765), U64(0xACCA6DA1, 0xE0A8EF29), /* ~= 10^240 */ + U64(0xBFF610B0, 0xCC6EDD3F), U64(0x17FD090A, 0x58D32AF3), /* ~= 10^241 */ + U64(0xEFF394DC, 0xFF8A948E), U64(0xDDFC4B4C, 0xEF07F5B0), /* ~= 10^242 */ + U64(0x95F83D0A, 0x1FB69CD9), U64(0x4ABDAF10, 0x1564F98E), /* ~= 10^243 */ + U64(0xBB764C4C, 0xA7A4440F), U64(0x9D6D1AD4, 0x1ABE37F1), /* ~= 10^244 */ + U64(0xEA53DF5F, 0xD18D5513), U64(0x84C86189, 0x216DC5ED), /* ~= 10^245 */ + U64(0x92746B9B, 0xE2F8552C), U64(0x32FD3CF5, 0xB4E49BB4), /* ~= 10^246 */ + U64(0xB7118682, 0xDBB66A77), U64(0x3FBC8C33, 0x221DC2A1), /* ~= 10^247 */ + U64(0xE4D5E823, 0x92A40515), U64(0x0FABAF3F, 0xEAA5334A), /* ~= 10^248 */ + U64(0x8F05B116, 0x3BA6832D), U64(0x29CB4D87, 0xF2A7400E), /* ~= 10^249 */ + U64(0xB2C71D5B, 0xCA9023F8), U64(0x743E20E9, 0xEF511012), /* ~= 10^250 */ + U64(0xDF78E4B2, 0xBD342CF6), U64(0x914DA924, 0x6B255416), /* ~= 10^251 */ + U64(0x8BAB8EEF, 0xB6409C1A), U64(0x1AD089B6, 0xC2F7548E), /* ~= 10^252 */ + U64(0xAE9672AB, 0xA3D0C320), U64(0xA184AC24, 0x73B529B1), /* ~= 10^253 */ + U64(0xDA3C0F56, 0x8CC4F3E8), U64(0xC9E5D72D, 0x90A2741E), /* ~= 10^254 */ + U64(0x88658996, 0x17FB1871), U64(0x7E2FA67C, 0x7A658892), /* ~= 10^255 */ + U64(0xAA7EEBFB, 0x9DF9DE8D), U64(0xDDBB901B, 0x98FEEAB7), /* ~= 10^256 */ + U64(0xD51EA6FA, 0x85785631), U64(0x552A7422, 0x7F3EA565), /* ~= 10^257 */ + U64(0x8533285C, 0x936B35DE), U64(0xD53A8895, 0x8F87275F), /* ~= 10^258 */ + U64(0xA67FF273, 0xB8460356), U64(0x8A892ABA, 0xF368F137), /* ~= 10^259 */ + U64(0xD01FEF10, 0xA657842C), U64(0x2D2B7569, 0xB0432D85), /* ~= 10^260 */ + U64(0x8213F56A, 0x67F6B29B), U64(0x9C3B2962, 0x0E29FC73), /* ~= 10^261 */ + U64(0xA298F2C5, 0x01F45F42), U64(0x8349F3BA, 0x91B47B8F), /* ~= 10^262 */ + U64(0xCB3F2F76, 0x42717713), U64(0x241C70A9, 0x36219A73), /* ~= 10^263 */ + U64(0xFE0EFB53, 0xD30DD4D7), U64(0xED238CD3, 0x83AA0110), /* ~= 10^264 */ + U64(0x9EC95D14, 0x63E8A506), U64(0xF4363804, 0x324A40AA), /* ~= 10^265 */ + U64(0xC67BB459, 0x7CE2CE48), U64(0xB143C605, 0x3EDCD0D5), /* ~= 10^266 */ + U64(0xF81AA16F, 0xDC1B81DA), U64(0xDD94B786, 0x8E94050A), /* ~= 10^267 */ + U64(0x9B10A4E5, 0xE9913128), U64(0xCA7CF2B4, 0x191C8326), /* ~= 10^268 */ + U64(0xC1D4CE1F, 0x63F57D72), U64(0xFD1C2F61, 0x1F63A3F0), /* ~= 10^269 */ + U64(0xF24A01A7, 0x3CF2DCCF), U64(0xBC633B39, 0x673C8CEC), /* ~= 10^270 */ + U64(0x976E4108, 0x8617CA01), U64(0xD5BE0503, 0xE085D813), /* ~= 10^271 */ + U64(0xBD49D14A, 0xA79DBC82), U64(0x4B2D8644, 0xD8A74E18), /* ~= 10^272 */ + U64(0xEC9C459D, 0x51852BA2), U64(0xDDF8E7D6, 0x0ED1219E), /* ~= 10^273 */ + U64(0x93E1AB82, 0x52F33B45), U64(0xCABB90E5, 0xC942B503), /* ~= 10^274 */ + U64(0xB8DA1662, 0xE7B00A17), U64(0x3D6A751F, 0x3B936243), /* ~= 10^275 */ + U64(0xE7109BFB, 0xA19C0C9D), U64(0x0CC51267, 0x0A783AD4), /* ~= 10^276 */ + U64(0x906A617D, 0x450187E2), U64(0x27FB2B80, 0x668B24C5), /* ~= 10^277 */ + U64(0xB484F9DC, 0x9641E9DA), U64(0xB1F9F660, 0x802DEDF6), /* ~= 10^278 */ + U64(0xE1A63853, 0xBBD26451), U64(0x5E7873F8, 0xA0396973), /* ~= 10^279 */ + U64(0x8D07E334, 0x55637EB2), U64(0xDB0B487B, 0x6423E1E8), /* ~= 10^280 */ + U64(0xB049DC01, 0x6ABC5E5F), U64(0x91CE1A9A, 0x3D2CDA62), /* ~= 10^281 */ + U64(0xDC5C5301, 0xC56B75F7), U64(0x7641A140, 0xCC7810FB), /* ~= 10^282 */ + U64(0x89B9B3E1, 0x1B6329BA), U64(0xA9E904C8, 0x7FCB0A9D), /* ~= 10^283 */ + U64(0xAC2820D9, 0x623BF429), U64(0x546345FA, 0x9FBDCD44), /* ~= 10^284 */ + U64(0xD732290F, 0xBACAF133), U64(0xA97C1779, 0x47AD4095), /* ~= 10^285 */ + U64(0x867F59A9, 0xD4BED6C0), U64(0x49ED8EAB, 0xCCCC485D), /* ~= 10^286 */ + U64(0xA81F3014, 0x49EE8C70), U64(0x5C68F256, 0xBFFF5A74), /* ~= 10^287 */ + U64(0xD226FC19, 0x5C6A2F8C), U64(0x73832EEC, 0x6FFF3111), /* ~= 10^288 */ + U64(0x83585D8F, 0xD9C25DB7), U64(0xC831FD53, 0xC5FF7EAB), /* ~= 10^289 */ + U64(0xA42E74F3, 0xD032F525), U64(0xBA3E7CA8, 0xB77F5E55), /* ~= 10^290 */ + U64(0xCD3A1230, 0xC43FB26F), U64(0x28CE1BD2, 0xE55F35EB), /* ~= 10^291 */ + U64(0x80444B5E, 0x7AA7CF85), U64(0x7980D163, 0xCF5B81B3), /* ~= 10^292 */ + U64(0xA0555E36, 0x1951C366), U64(0xD7E105BC, 0xC332621F), /* ~= 10^293 */ + U64(0xC86AB5C3, 0x9FA63440), U64(0x8DD9472B, 0xF3FEFAA7), /* ~= 10^294 */ + U64(0xFA856334, 0x878FC150), U64(0xB14F98F6, 0xF0FEB951), /* ~= 10^295 */ + U64(0x9C935E00, 0xD4B9D8D2), U64(0x6ED1BF9A, 0x569F33D3), /* ~= 10^296 */ + U64(0xC3B83581, 0x09E84F07), U64(0x0A862F80, 0xEC4700C8), /* ~= 10^297 */ + U64(0xF4A642E1, 0x4C6262C8), U64(0xCD27BB61, 0x2758C0FA), /* ~= 10^298 */ + U64(0x98E7E9CC, 0xCFBD7DBD), U64(0x8038D51C, 0xB897789C), /* ~= 10^299 */ + U64(0xBF21E440, 0x03ACDD2C), U64(0xE0470A63, 0xE6BD56C3), /* ~= 10^300 */ + U64(0xEEEA5D50, 0x04981478), U64(0x1858CCFC, 0xE06CAC74), /* ~= 10^301 */ + U64(0x95527A52, 0x02DF0CCB), U64(0x0F37801E, 0x0C43EBC8), /* ~= 10^302 */ + U64(0xBAA718E6, 0x8396CFFD), U64(0xD3056025, 0x8F54E6BA), /* ~= 10^303 */ + U64(0xE950DF20, 0x247C83FD), U64(0x47C6B82E, 0xF32A2069), /* ~= 10^304 */ + U64(0x91D28B74, 0x16CDD27E), U64(0x4CDC331D, 0x57FA5441), /* ~= 10^305 */ + U64(0xB6472E51, 0x1C81471D), U64(0xE0133FE4, 0xADF8E952), /* ~= 10^306 */ + U64(0xE3D8F9E5, 0x63A198E5), U64(0x58180FDD, 0xD97723A6), /* ~= 10^307 */ + U64(0x8E679C2F, 0x5E44FF8F), U64(0x570F09EA, 0xA7EA7648), /* ~= 10^308 */ + U64(0xB201833B, 0x35D63F73), U64(0x2CD2CC65, 0x51E513DA), /* ~= 10^309 */ + U64(0xDE81E40A, 0x034BCF4F), U64(0xF8077F7E, 0xA65E58D1), /* ~= 10^310 */ + U64(0x8B112E86, 0x420F6191), U64(0xFB04AFAF, 0x27FAF782), /* ~= 10^311 */ + U64(0xADD57A27, 0xD29339F6), U64(0x79C5DB9A, 0xF1F9B563), /* ~= 10^312 */ + U64(0xD94AD8B1, 0xC7380874), U64(0x18375281, 0xAE7822BC), /* ~= 10^313 */ + U64(0x87CEC76F, 0x1C830548), U64(0x8F229391, 0x0D0B15B5), /* ~= 10^314 */ + U64(0xA9C2794A, 0xE3A3C69A), U64(0xB2EB3875, 0x504DDB22), /* ~= 10^315 */ + U64(0xD433179D, 0x9C8CB841), U64(0x5FA60692, 0xA46151EB), /* ~= 10^316 */ + U64(0x849FEEC2, 0x81D7F328), U64(0xDBC7C41B, 0xA6BCD333), /* ~= 10^317 */ + U64(0xA5C7EA73, 0x224DEFF3), U64(0x12B9B522, 0x906C0800), /* ~= 10^318 */ + U64(0xCF39E50F, 0xEAE16BEF), U64(0xD768226B, 0x34870A00), /* ~= 10^319 */ + U64(0x81842F29, 0xF2CCE375), U64(0xE6A11583, 0x00D46640), /* ~= 10^320 */ + U64(0xA1E53AF4, 0x6F801C53), U64(0x60495AE3, 0xC1097FD0), /* ~= 10^321 */ + U64(0xCA5E89B1, 0x8B602368), U64(0x385BB19C, 0xB14BDFC4), /* ~= 10^322 */ + U64(0xFCF62C1D, 0xEE382C42), U64(0x46729E03, 0xDD9ED7B5), /* ~= 10^323 */ + U64(0x9E19DB92, 0xB4E31BA9), U64(0x6C07A2C2, 0x6A8346D1) /* ~= 10^324 */ +}; + +/** + Get the cached pow10 value from pow10_sig_table. + @param exp10 The exponent of pow(10, e). This value must in range + POW10_SIG_TABLE_MIN_EXP to POW10_SIG_TABLE_MAX_EXP. + @param hi The highest 64 bits of pow(10, e). + @param lo The lower 64 bits after `hi`. + */ +static_inline void pow10_table_get_sig(i32 exp10, u64 *hi, u64 *lo) { + i32 idx = exp10 - (POW10_SIG_TABLE_MIN_EXP); + *hi = pow10_sig_table[idx * 2]; + *lo = pow10_sig_table[idx * 2 + 1]; +} + +/** + Get the exponent (base 2) for highest 64 bits significand in pow10_sig_table. + */ +static_inline void pow10_table_get_exp(i32 exp10, i32 *exp2) { + /* e2 = floor(log2(pow(10, e))) - 64 + 1 */ + /* = floor(e * log2(10) - 63) */ + *exp2 = (exp10 * 217706 - 4128768) >> 16; +} + +#endif + + + +/*============================================================================== + * JSON Character Matcher + *============================================================================*/ + +/** Character type */ +typedef u8 char_type; + +/** Whitespace character: ' ', '\\t', '\\n', '\\r'. */ +static const char_type CHAR_TYPE_SPACE = 1 << 0; + +/** Number character: '-', [0-9]. */ +static const char_type CHAR_TYPE_NUMBER = 1 << 1; + +/** JSON Escaped character: '"', '\', [0x00-0x1F]. */ +static const char_type CHAR_TYPE_ESC_ASCII = 1 << 2; + +/** Non-ASCII character: [0x80-0xFF]. */ +static const char_type CHAR_TYPE_NON_ASCII = 1 << 3; + +/** JSON container character: '{', '['. */ +static const char_type CHAR_TYPE_CONTAINER = 1 << 4; + +/** Comment character: '/'. */ +static const char_type CHAR_TYPE_COMMENT = 1 << 5; + +/** Line end character: '\\n', '\\r', '\0'. */ +static const char_type CHAR_TYPE_LINE_END = 1 << 6; + +/** Hexadecimal numeric character: [0-9a-fA-F]. */ +static const char_type CHAR_TYPE_HEX = 1 << 7; + +/** Character type table (generate with misc/make_tables.c) */ +static const char_type char_table[256] = { + 0x44, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x45, 0x04, 0x04, 0x45, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20, + 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, + 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +}; + +/** Match a character with specified type. */ +static_inline bool char_is_type(u8 c, char_type type) { + return (char_table[c] & type) != 0; +} + +/** Match a whitespace: ' ', '\\t', '\\n', '\\r'. */ +static_inline bool char_is_space(u8 c) { + return char_is_type(c, (char_type)CHAR_TYPE_SPACE); +} + +/** Match a whitespace or comment: ' ', '\\t', '\\n', '\\r', '/'. */ +static_inline bool char_is_space_or_comment(u8 c) { + return char_is_type(c, (char_type)(CHAR_TYPE_SPACE | CHAR_TYPE_COMMENT)); +} + +/** Match a JSON number: '-', [0-9]. */ +static_inline bool char_is_number(u8 c) { + return char_is_type(c, (char_type)CHAR_TYPE_NUMBER); +} + +/** Match a JSON container: '{', '['. */ +static_inline bool char_is_container(u8 c) { + return char_is_type(c, (char_type)CHAR_TYPE_CONTAINER); +} + +/** Match a stop character in ASCII string: '"', '\', [0x00-0x1F,0x80-0xFF]. */ +static_inline bool char_is_ascii_stop(u8 c) { + return char_is_type(c, (char_type)(CHAR_TYPE_ESC_ASCII | + CHAR_TYPE_NON_ASCII)); +} + +/** Match a line end character: '\\n', '\\r', '\0'. */ +static_inline bool char_is_line_end(u8 c) { + return char_is_type(c, (char_type)CHAR_TYPE_LINE_END); +} + +/** Match a hexadecimal numeric character: [0-9a-fA-F]. */ +static_inline bool char_is_hex(u8 c) { + return char_is_type(c, (char_type)CHAR_TYPE_HEX); +} + + + +/*============================================================================== + * Digit Character Matcher + *============================================================================*/ + +/** Digit type */ +typedef u8 digi_type; + +/** Digit: '0'. */ +static const digi_type DIGI_TYPE_ZERO = 1 << 0; + +/** Digit: [1-9]. */ +static const digi_type DIGI_TYPE_NONZERO = 1 << 1; + +/** Plus sign (positive): '+'. */ +static const digi_type DIGI_TYPE_POS = 1 << 2; + +/** Minus sign (negative): '-'. */ +static const digi_type DIGI_TYPE_NEG = 1 << 3; + +/** Decimal point: '.' */ +static const digi_type DIGI_TYPE_DOT = 1 << 4; + +/** Exponent sign: 'e, 'E'. */ +static const digi_type DIGI_TYPE_EXP = 1 << 5; + +/** Digit type table (generate with misc/make_tables.c) */ +static const digi_type digi_table[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x10, 0x00, + 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +/** Match a character with specified type. */ +static_inline bool digi_is_type(u8 d, digi_type type) { + return (digi_table[d] & type) != 0; +} + +/** Match a sign: '+', '-' */ +static_inline bool digi_is_sign(u8 d) { + return digi_is_type(d, (digi_type)(DIGI_TYPE_POS | DIGI_TYPE_NEG)); +} + +/** Match a none zero digit: [1-9] */ +static_inline bool digi_is_nonzero(u8 d) { + return digi_is_type(d, (digi_type)DIGI_TYPE_NONZERO); +} + +/** Match a digit: [0-9] */ +static_inline bool digi_is_digit(u8 d) { + return digi_is_type(d, (digi_type)(DIGI_TYPE_ZERO | DIGI_TYPE_NONZERO)); +} + +/** Match an exponent sign: 'e', 'E'. */ +static_inline bool digi_is_exp(u8 d) { + return digi_is_type(d, (digi_type)DIGI_TYPE_EXP); +} + +/** Match a floating point indicator: '.', 'e', 'E'. */ +static_inline bool digi_is_fp(u8 d) { + return digi_is_type(d, (digi_type)(DIGI_TYPE_DOT | DIGI_TYPE_EXP)); +} + +/** Match a digit or floating point indicator: [0-9], '.', 'e', 'E'. */ +static_inline bool digi_is_digit_or_fp(u8 d) { + return digi_is_type(d, (digi_type)(DIGI_TYPE_ZERO | DIGI_TYPE_NONZERO | + DIGI_TYPE_DOT | DIGI_TYPE_EXP)); +} + + + +#if !YYJSON_DISABLE_READER + +/*============================================================================== + * Hex Character Reader + * This function is used by JSON reader to read escaped characters. + *============================================================================*/ + +/** + This table is used to convert 4 hex character sequence to a number. + A valid hex character [0-9A-Fa-f] will mapped to it's raw number [0x00, 0x0F], + an invalid hex character will mapped to [0xF0]. + (generate with misc/make_tables.c) + */ +static const u8 hex_conv_table[256] = { + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0 +}; + +/** + Scans an escaped character sequence as a UTF-16 code unit (branchless). + e.g. "\\u005C" should pass "005C" as `cur`. + + This requires the string has 4-byte zero padding. + */ +static_inline bool read_hex_u16(const u8 *cur, u16 *val) { + u16 c0, c1, c2, c3, t0, t1; + c0 = hex_conv_table[cur[0]]; + c1 = hex_conv_table[cur[1]]; + c2 = hex_conv_table[cur[2]]; + c3 = hex_conv_table[cur[3]]; + t0 = (u16)((c0 << 8) | c2); + t1 = (u16)((c1 << 8) | c3); + *val = (u16)((t0 << 4) | t1); + return ((t0 | t1) & (u16)0xF0F0) == 0; +} + + + +/*============================================================================== + * JSON Reader Utils + * These functions are used by JSON reader to read literals and comments. + *============================================================================*/ + +/** Read 'true' literal, '*cur' should be 't'. */ +static_inline bool read_true(u8 **ptr, yyjson_val *val) { + u8 *cur = *ptr; + u8 **end = ptr; + if (likely(byte_match_4(cur, "true"))) { + val->tag = YYJSON_TYPE_BOOL | YYJSON_SUBTYPE_TRUE; + *end = cur + 4; + return true; + } + return false; +} + +/** Read 'false' literal, '*cur' should be 'f'. */ +static_inline bool read_false(u8 **ptr, yyjson_val *val) { + u8 *cur = *ptr; + u8 **end = ptr; + if (likely(byte_match_4(cur + 1, "alse"))) { + val->tag = YYJSON_TYPE_BOOL | YYJSON_SUBTYPE_FALSE; + *end = cur + 5; + return true; + } + return false; +} + +/** Read 'null' literal, '*cur' should be 'n'. */ +static_inline bool read_null(u8 **ptr, yyjson_val *val) { + u8 *cur = *ptr; + u8 **end = ptr; + if (likely(byte_match_4(cur, "null"))) { + val->tag = YYJSON_TYPE_NULL; + *end = cur + 4; + return true; + } + return false; +} + +/** Read 'Inf' or 'Infinity' literal (ignoring case). */ +static_inline bool read_inf(bool sign, u8 **ptr, u8 **pre, yyjson_val *val) { + u8 *hdr = *ptr - sign; + u8 *cur = *ptr; + u8 **end = ptr; + if ((cur[0] == 'I' || cur[0] == 'i') && + (cur[1] == 'N' || cur[1] == 'n') && + (cur[2] == 'F' || cur[2] == 'f')) { + if ((cur[3] == 'I' || cur[3] == 'i') && + (cur[4] == 'N' || cur[4] == 'n') && + (cur[5] == 'I' || cur[5] == 'i') && + (cur[6] == 'T' || cur[6] == 't') && + (cur[7] == 'Y' || cur[7] == 'y')) { + cur += 8; + } else { + cur += 3; + } + *end = cur; + if (pre) { + /* add null-terminator for previous raw string */ + if (*pre) **pre = '\0'; + *pre = cur; + val->tag = ((u64)(cur - hdr) << YYJSON_TAG_BIT) | YYJSON_TYPE_RAW; + val->uni.str = (const char *)hdr; + } else { + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; + val->uni.u64 = f64_raw_get_inf(sign); + } + return true; + } + return false; +} + +/** Read 'NaN' literal (ignoring case). */ +static_inline bool read_nan(bool sign, u8 **ptr, u8 **pre, yyjson_val *val) { + u8 *hdr = *ptr - sign; + u8 *cur = *ptr; + u8 **end = ptr; + if ((cur[0] == 'N' || cur[0] == 'n') && + (cur[1] == 'A' || cur[1] == 'a') && + (cur[2] == 'N' || cur[2] == 'n')) { + cur += 3; + *end = cur; + if (pre) { + /* add null-terminator for previous raw string */ + if (*pre) **pre = '\0'; + *pre = cur; + val->tag = ((u64)(cur - hdr) << YYJSON_TAG_BIT) | YYJSON_TYPE_RAW; + val->uni.str = (const char *)hdr; + } else { + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; + val->uni.u64 = f64_raw_get_nan(sign); + } + return true; + } + return false; +} + +/** Read 'Inf', 'Infinity' or 'NaN' literal (ignoring case). */ +static_inline bool read_inf_or_nan(bool sign, u8 **ptr, u8 **pre, + yyjson_val *val) { + if (read_inf(sign, ptr, pre, val)) return true; + if (read_nan(sign, ptr, pre, val)) return true; + return false; +} + +/** Read a JSON number as raw string. */ +static_noinline bool read_number_raw(u8 **ptr, + u8 **pre, + yyjson_read_flag flg, + yyjson_val *val, + const char **msg) { + +#define return_err(_pos, _msg) do { \ + *msg = _msg; \ + *end = _pos; \ + return false; \ +} while (false) + +#define return_raw() do { \ + val->tag = ((u64)(cur - hdr) << YYJSON_TAG_BIT) | YYJSON_TYPE_RAW; \ + val->uni.str = (const char *)hdr; \ + *pre = cur; *end = cur; return true; \ +} while (false) + + u8 *hdr = *ptr; + u8 *cur = *ptr; + u8 **end = ptr; + + /* add null-terminator for previous raw string */ + if (*pre) **pre = '\0'; + + /* skip sign */ + cur += (*cur == '-'); + + /* read first digit, check leading zero */ + if (unlikely(!digi_is_digit(*cur))) { + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (read_inf_or_nan(*hdr == '-', &cur, pre, val)) return_raw(); + } + return_err(cur, "no digit after minus sign"); + } + + /* read integral part */ + if (*cur == '0') { + cur++; + if (unlikely(digi_is_digit(*cur))) { + return_err(cur - 1, "number with leading zero is not allowed"); + } + if (!digi_is_fp(*cur)) return_raw(); + } else { + while (digi_is_digit(*cur)) cur++; + if (!digi_is_fp(*cur)) return_raw(); + } + + /* read fraction part */ + if (*cur == '.') { + cur++; + if (!digi_is_digit(*cur++)) { + return_err(cur, "no digit after decimal point"); + } + while (digi_is_digit(*cur)) cur++; + } + + /* read exponent part */ + if (digi_is_exp(*cur)) { + cur += 1 + digi_is_sign(cur[1]); + if (!digi_is_digit(*cur++)) { + return_err(cur, "no digit after exponent sign"); + } + while (digi_is_digit(*cur)) cur++; + } + + return_raw(); + +#undef return_err +#undef return_raw +} + +/** + Skips spaces and comments as many as possible. + + It will return false in these cases: + 1. No character is skipped. The 'end' pointer is set as input cursor. + 2. A multiline comment is not closed. The 'end' pointer is set as the head + of this comment block. + */ +static_noinline bool skip_spaces_and_comments(u8 **ptr) { + u8 *hdr = *ptr; + u8 *cur = *ptr; + u8 **end = ptr; + while (true) { + if (byte_match_2(cur, "/*")) { + hdr = cur; + cur += 2; + while (true) { + if (byte_match_2(cur, "*/")) { + cur += 2; + break; + } + if (*cur == 0) { + *end = hdr; + return false; + } + cur++; + } + continue; + } + if (byte_match_2(cur, "//")) { + cur += 2; + while (!char_is_line_end(*cur)) cur++; + continue; + } + if (char_is_space(*cur)) { + cur += 1; + while (char_is_space(*cur)) cur++; + continue; + } + break; + } + *end = cur; + return hdr != cur; +} + +/** + Check truncated string. + Returns true if `cur` match `str` but is truncated. + */ +static_inline bool is_truncated_str(u8 *cur, u8 *end, + const char *str, + bool case_sensitive) { + usize len = strlen(str); + if (cur + len <= end || end <= cur) return false; + if (case_sensitive) { + return memcmp(cur, str, (usize)(end - cur)) == 0; + } + for (; cur < end; cur++, str++) { + if ((*cur != (u8)*str) && (*cur != (u8)*str - 'a' + 'A')) { + return false; + } + } + return true; +} + +/** + Check truncated JSON on parsing errors. + Returns true if the input is valid but truncated. + */ +static_noinline bool is_truncated_end(u8 *hdr, u8 *cur, u8 *end, + yyjson_read_code code, + yyjson_read_flag flg) { + if (cur >= end) return true; + if (code == YYJSON_READ_ERROR_LITERAL) { + if (is_truncated_str(cur, end, "true", true) || + is_truncated_str(cur, end, "false", true) || + is_truncated_str(cur, end, "null", true)) { + return true; + } + } + if (code == YYJSON_READ_ERROR_UNEXPECTED_CHARACTER || + code == YYJSON_READ_ERROR_INVALID_NUMBER || + code == YYJSON_READ_ERROR_LITERAL) { + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (*cur == '-') cur++; + if (is_truncated_str(cur, end, "infinity", false) || + is_truncated_str(cur, end, "nan", false)) { + return true; + } + } + } + if (code == YYJSON_READ_ERROR_UNEXPECTED_CONTENT) { + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (hdr + 3 <= cur && + is_truncated_str(cur - 3, end, "infinity", false)) { + return true; /* e.g. infin would be read as inf + in */ + } + } + } + if (code == YYJSON_READ_ERROR_INVALID_STRING) { + usize len = (usize)(end - cur); + + /* unicode escape sequence */ + if (*cur == '\\') { + if (len == 1) return true; + if (len <= 5) { + if (*++cur != 'u') return false; + for (++cur; cur < end; cur++) { + if (!char_is_hex(*cur)) return false; + } + return true; + } + return false; + } + + /* 2 to 4 bytes UTF-8, see `read_string()` for details. */ + if (*cur & 0x80) { + u8 c0 = cur[0], c1 = cur[1], c2 = cur[2]; + if (len == 1) { + /* 2 bytes UTF-8, truncated */ + if ((c0 & 0xE0) == 0xC0 && (c0 & 0x1E) != 0x00) return true; + /* 3 bytes UTF-8, truncated */ + if ((c0 & 0xF0) == 0xE0) return true; + /* 4 bytes UTF-8, truncated */ + if ((c0 & 0xF8) == 0xF0 && (c0 & 0x07) <= 0x04) return true; + } + if (len == 2) { + /* 3 bytes UTF-8, truncated */ + if ((c0 & 0xF0) == 0xE0 && + (c1 & 0xC0) == 0x80) { + u8 pat = (u8)(((c0 & 0x0F) << 1) | ((c1 & 0x20) >> 5)); + return 0x01 <= pat && pat != 0x1B; + } + /* 4 bytes UTF-8, truncated */ + if ((c0 & 0xF8) == 0xF0 && + (c1 & 0xC0) == 0x80) { + u8 pat = (u8)(((c0 & 0x07) << 2) | ((c1 & 0x30) >> 4)); + return 0x01 <= pat && pat <= 0x10; + } + } + if (len == 3) { + /* 4 bytes UTF-8, truncated */ + if ((c0 & 0xF8) == 0xF0 && + (c1 & 0xC0) == 0x80 && + (c2 & 0xC0) == 0x80) { + u8 pat = (u8)(((c0 & 0x07) << 2) | ((c1 & 0x30) >> 4)); + return 0x01 <= pat && pat <= 0x10; + } + } + } + } + return false; +} + + + +#if YYJSON_HAS_IEEE_754 && !YYJSON_DISABLE_FAST_FP_CONV /* FP_READER */ + +/*============================================================================== + * BigInt For Floating Point Number Reader + * + * The bigint algorithm is used by floating-point number reader to get correctly + * rounded result for numbers with lots of digits. This part of code is rarely + * used for common numbers. + *============================================================================*/ + +/** Maximum exponent of exact pow10 */ +#define U64_POW10_MAX_EXP 19 + +/** Table: [ 10^0, ..., 10^19 ] (generate with misc/make_tables.c) */ +static const u64 u64_pow10_table[U64_POW10_MAX_EXP + 1] = { + U64(0x00000000, 0x00000001), U64(0x00000000, 0x0000000A), + U64(0x00000000, 0x00000064), U64(0x00000000, 0x000003E8), + U64(0x00000000, 0x00002710), U64(0x00000000, 0x000186A0), + U64(0x00000000, 0x000F4240), U64(0x00000000, 0x00989680), + U64(0x00000000, 0x05F5E100), U64(0x00000000, 0x3B9ACA00), + U64(0x00000002, 0x540BE400), U64(0x00000017, 0x4876E800), + U64(0x000000E8, 0xD4A51000), U64(0x00000918, 0x4E72A000), + U64(0x00005AF3, 0x107A4000), U64(0x00038D7E, 0xA4C68000), + U64(0x002386F2, 0x6FC10000), U64(0x01634578, 0x5D8A0000), + U64(0x0DE0B6B3, 0xA7640000), U64(0x8AC72304, 0x89E80000) +}; + +/** Maximum numbers of chunks used by a bigint (58 is enough here). */ +#define BIGINT_MAX_CHUNKS 64 + +/** Unsigned arbitrarily large integer */ +typedef struct bigint { + u32 used; /* used chunks count, should not be 0 */ + u64 bits[BIGINT_MAX_CHUNKS]; /* chunks */ +} bigint; + +/** + Evaluate 'big += val'. + @param big A big number (can be 0). + @param val An unsigned integer (can be 0). + */ +static_inline void bigint_add_u64(bigint *big, u64 val) { + u32 idx, max; + u64 num = big->bits[0]; + u64 add = num + val; + big->bits[0] = add; + if (likely((add >= num) || (add >= val))) return; + for ((void)(idx = 1), max = big->used; idx < max; idx++) { + if (likely(big->bits[idx] != U64_MAX)) { + big->bits[idx] += 1; + return; + } + big->bits[idx] = 0; + } + big->bits[big->used++] = 1; +} + +/** + Evaluate 'big *= val'. + @param big A big number (can be 0). + @param val An unsigned integer (cannot be 0). + */ +static_inline void bigint_mul_u64(bigint *big, u64 val) { + u32 idx = 0, max = big->used; + u64 hi, lo, carry = 0; + for (; idx < max; idx++) { + if (big->bits[idx]) break; + } + for (; idx < max; idx++) { + u128_mul_add(big->bits[idx], val, carry, &hi, &lo); + big->bits[idx] = lo; + carry = hi; + } + if (carry) big->bits[big->used++] = carry; +} + +/** + Evaluate 'big *= 2^exp'. + @param big A big number (can be 0). + @param exp An exponent integer (can be 0). + */ +static_inline void bigint_mul_pow2(bigint *big, u32 exp) { + u32 shft = exp % 64; + u32 move = exp / 64; + u32 idx = big->used; + if (unlikely(shft == 0)) { + for (; idx > 0; idx--) { + big->bits[idx + move - 1] = big->bits[idx - 1]; + } + big->used += move; + while (move) big->bits[--move] = 0; + } else { + big->bits[idx] = 0; + for (; idx > 0; idx--) { + u64 num = big->bits[idx] << shft; + num |= big->bits[idx - 1] >> (64 - shft); + big->bits[idx + move] = num; + } + big->bits[move] = big->bits[0] << shft; + big->used += move + (big->bits[big->used + move] > 0); + while (move) big->bits[--move] = 0; + } +} + +/** + Evaluate 'big *= 10^exp'. + @param big A big number (can be 0). + @param exp An exponent integer (cannot be 0). + */ +static_inline void bigint_mul_pow10(bigint *big, i32 exp) { + for (; exp >= U64_POW10_MAX_EXP; exp -= U64_POW10_MAX_EXP) { + bigint_mul_u64(big, u64_pow10_table[U64_POW10_MAX_EXP]); + } + if (exp) { + bigint_mul_u64(big, u64_pow10_table[exp]); + } +} + +/** + Compare two bigint. + @return -1 if 'a < b', +1 if 'a > b', 0 if 'a == b'. + */ +static_inline i32 bigint_cmp(bigint *a, bigint *b) { + u32 idx = a->used; + if (a->used < b->used) return -1; + if (a->used > b->used) return +1; + while (idx-- > 0) { + u64 av = a->bits[idx]; + u64 bv = b->bits[idx]; + if (av < bv) return -1; + if (av > bv) return +1; + } + return 0; +} + +/** + Evaluate 'big = val'. + @param big A big number (can be 0). + @param val An unsigned integer (can be 0). + */ +static_inline void bigint_set_u64(bigint *big, u64 val) { + big->used = 1; + big->bits[0] = val; +} + +/** Set a bigint with floating point number string. */ +static_noinline void bigint_set_buf(bigint *big, u64 sig, i32 *exp, + u8 *sig_cut, u8 *sig_end, u8 *dot_pos) { + + if (unlikely(!sig_cut)) { + /* no digit cut, set significant part only */ + bigint_set_u64(big, sig); + return; + + } else { + /* some digits were cut, read them from 'sig_cut' to 'sig_end' */ + u8 *hdr = sig_cut; + u8 *cur = hdr; + u32 len = 0; + u64 val = 0; + bool dig_big_cut = false; + bool has_dot = (hdr < dot_pos) & (dot_pos < sig_end); + u32 dig_len_total = U64_SAFE_DIG + (u32)(sig_end - hdr) - has_dot; + + sig -= (*sig_cut >= '5'); /* sig was rounded before */ + if (dig_len_total > F64_MAX_DEC_DIG) { + dig_big_cut = true; + sig_end -= dig_len_total - (F64_MAX_DEC_DIG + 1); + sig_end -= (dot_pos + 1 == sig_end); + dig_len_total = (F64_MAX_DEC_DIG + 1); + } + *exp -= (i32)dig_len_total - U64_SAFE_DIG; + + big->used = 1; + big->bits[0] = sig; + while (cur < sig_end) { + if (likely(cur != dot_pos)) { + val = val * 10 + (u8)(*cur++ - '0'); + len++; + if (unlikely(cur == sig_end && dig_big_cut)) { + /* The last digit must be non-zero, */ + /* set it to '1' for correct rounding. */ + val = val - (val % 10) + 1; + } + if (len == U64_SAFE_DIG || cur == sig_end) { + bigint_mul_pow10(big, (i32)len); + bigint_add_u64(big, val); + val = 0; + len = 0; + } + } else { + cur++; + } + } + } +} + + + +/*============================================================================== + * Diy Floating Point + *============================================================================*/ + +/** "Do It Yourself Floating Point" struct. */ +typedef struct diy_fp { + u64 sig; /* significand */ + i32 exp; /* exponent, base 2 */ + i32 pad; /* padding, useless */ +} diy_fp; + +/** Get cached rounded diy_fp with pow(10, e) The input value must in range + [POW10_SIG_TABLE_MIN_EXP, POW10_SIG_TABLE_MAX_EXP]. */ +static_inline diy_fp diy_fp_get_cached_pow10(i32 exp10) { + diy_fp fp; + u64 sig_ext; + pow10_table_get_sig(exp10, &fp.sig, &sig_ext); + pow10_table_get_exp(exp10, &fp.exp); + fp.sig += (sig_ext >> 63); + return fp; +} + +/** Returns fp * fp2. */ +static_inline diy_fp diy_fp_mul(diy_fp fp, diy_fp fp2) { + u64 hi, lo; + u128_mul(fp.sig, fp2.sig, &hi, &lo); + fp.sig = hi + (lo >> 63); + fp.exp += fp2.exp + 64; + return fp; +} + +/** Convert diy_fp to IEEE-754 raw value. */ +static_inline u64 diy_fp_to_ieee_raw(diy_fp fp) { + u64 sig = fp.sig; + i32 exp = fp.exp; + u32 lz_bits; + if (unlikely(fp.sig == 0)) return 0; + + lz_bits = u64_lz_bits(sig); + sig <<= lz_bits; + sig >>= F64_BITS - F64_SIG_FULL_BITS; + exp -= (i32)lz_bits; + exp += F64_BITS - F64_SIG_FULL_BITS; + exp += F64_SIG_BITS; + + if (unlikely(exp >= F64_MAX_BIN_EXP)) { + /* overflow */ + return F64_RAW_INF; + } else if (likely(exp >= F64_MIN_BIN_EXP - 1)) { + /* normal */ + exp += F64_EXP_BIAS; + return ((u64)exp << F64_SIG_BITS) | (sig & F64_SIG_MASK); + } else if (likely(exp >= F64_MIN_BIN_EXP - F64_SIG_FULL_BITS)) { + /* subnormal */ + return sig >> (F64_MIN_BIN_EXP - exp - 1); + } else { + /* underflow */ + return 0; + } +} + + + +/*============================================================================== + * JSON Number Reader (IEEE-754) + *============================================================================*/ + +/** Maximum exact pow10 exponent for double value. */ +#define F64_POW10_EXP_MAX_EXACT 22 + +/** Cached pow10 table. */ +static const f64 f64_pow10_table[] = { + 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, + 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22 +}; + +/** + Read a JSON number. + + 1. This function assume that the floating-point number is in IEEE-754 format. + 2. This function support uint64/int64/double number. If an integer number + cannot fit in uint64/int64, it will returns as a double number. If a double + number is infinite, the return value is based on flag. + 3. This function (with inline attribute) may generate a lot of instructions. + */ +static_inline bool read_number(u8 **ptr, + u8 **pre, + yyjson_read_flag flg, + yyjson_val *val, + const char **msg) { + +#define return_err(_pos, _msg) do { \ + *msg = _msg; \ + *end = _pos; \ + return false; \ +} while (false) + +#define return_0() do { \ + val->tag = YYJSON_TYPE_NUM | (u8)((u8)sign << 3); \ + val->uni.u64 = 0; \ + *end = cur; return true; \ +} while (false) + +#define return_i64(_v) do { \ + val->tag = YYJSON_TYPE_NUM | (u8)((u8)sign << 3); \ + val->uni.u64 = (u64)(sign ? (u64)(~(_v) + 1) : (u64)(_v)); \ + *end = cur; return true; \ +} while (false) + +#define return_f64(_v) do { \ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; \ + val->uni.f64 = sign ? -(f64)(_v) : (f64)(_v); \ + *end = cur; return true; \ +} while (false) + +#define return_f64_bin(_v) do { \ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; \ + val->uni.u64 = ((u64)sign << 63) | (u64)(_v); \ + *end = cur; return true; \ +} while (false) + +#define return_inf() do { \ + if (has_read_flag(BIGNUM_AS_RAW)) return_raw(); \ + if (has_read_flag(ALLOW_INF_AND_NAN)) return_f64_bin(F64_RAW_INF); \ + else return_err(hdr, "number is infinity when parsed as double"); \ +} while (false) + +#define return_raw() do { \ + if (*pre) **pre = '\0'; /* add null-terminator for previous raw string */ \ + val->tag = ((u64)(cur - hdr) << YYJSON_TAG_BIT) | YYJSON_TYPE_RAW; \ + val->uni.str = (const char *)hdr; \ + *pre = cur; *end = cur; return true; \ +} while (false) + + u8 *sig_cut = NULL; /* significant part cutting position for long number */ + u8 *sig_end = NULL; /* significant part ending position */ + u8 *dot_pos = NULL; /* decimal point position */ + + u64 sig = 0; /* significant part of the number */ + i32 exp = 0; /* exponent part of the number */ + + bool exp_sign; /* temporary exponent sign from literal part */ + i64 exp_sig = 0; /* temporary exponent number from significant part */ + i64 exp_lit = 0; /* temporary exponent number from exponent literal part */ + u64 num; /* temporary number for reading */ + u8 *tmp; /* temporary cursor for reading */ + + u8 *hdr = *ptr; + u8 *cur = *ptr; + u8 **end = ptr; + bool sign; + + /* read number as raw string if has `YYJSON_READ_NUMBER_AS_RAW` flag */ + if (unlikely(pre && !has_read_flag(BIGNUM_AS_RAW))) { + return read_number_raw(ptr, pre, flg, val, msg); + } + + sign = (*hdr == '-'); + cur += sign; + + /* begin with a leading zero or non-digit */ + if (unlikely(!digi_is_nonzero(*cur))) { /* 0 or non-digit char */ + if (unlikely(*cur != '0')) { /* non-digit char */ + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (read_inf_or_nan(sign, &cur, pre, val)) { + *end = cur; + return true; + } + } + return_err(cur, "no digit after minus sign"); + } + /* begin with 0 */ + if (likely(!digi_is_digit_or_fp(*++cur))) return_0(); + if (likely(*cur == '.')) { + dot_pos = cur++; + if (unlikely(!digi_is_digit(*cur))) { + return_err(cur, "no digit after decimal point"); + } + while (unlikely(*cur == '0')) cur++; + if (likely(digi_is_digit(*cur))) { + /* first non-zero digit after decimal point */ + sig = (u64)(*cur - '0'); /* read first digit */ + cur--; + goto digi_frac_1; /* continue read fraction part */ + } + } + if (unlikely(digi_is_digit(*cur))) { + return_err(cur - 1, "number with leading zero is not allowed"); + } + if (unlikely(digi_is_exp(*cur))) { /* 0 with any exponent is still 0 */ + cur += (usize)1 + digi_is_sign(cur[1]); + if (unlikely(!digi_is_digit(*cur))) { + return_err(cur, "no digit after exponent sign"); + } + while (digi_is_digit(*++cur)); + } + return_f64_bin(0); + } + + /* begin with non-zero digit */ + sig = (u64)(*cur - '0'); + + /* + Read integral part, same as the following code. + + for (int i = 1; i <= 18; i++) { + num = cur[i] - '0'; + if (num <= 9) sig = num + sig * 10; + else goto digi_sepr_i; + } + */ +#define expr_intg(i) \ + if (likely((num = (u64)(cur[i] - (u8)'0')) <= 9)) sig = num + sig * 10; \ + else { goto digi_sepr_##i; } + repeat_in_1_18(expr_intg) +#undef expr_intg + + + cur += 19; /* skip continuous 19 digits */ + if (!digi_is_digit_or_fp(*cur)) { + /* this number is an integer consisting of 19 digits */ + if (sign && (sig > ((u64)1 << 63))) { /* overflow */ + if (has_read_flag(BIGNUM_AS_RAW)) return_raw(); + return_f64(normalized_u64_to_f64(sig)); + } + return_i64(sig); + } + goto digi_intg_more; /* read more digits in integral part */ + + + /* process first non-digit character */ +#define expr_sepr(i) \ + digi_sepr_##i: \ + if (likely(!digi_is_fp(cur[i]))) { cur += i; return_i64(sig); } \ + dot_pos = cur + i; \ + if (likely(cur[i] == '.')) goto digi_frac_##i; \ + cur += i; sig_end = cur; goto digi_exp_more; + repeat_in_1_18(expr_sepr) +#undef expr_sepr + + + /* read fraction part */ +#define expr_frac(i) \ + digi_frac_##i: \ + if (likely((num = (u64)(cur[i + 1] - (u8)'0')) <= 9)) \ + sig = num + sig * 10; \ + else { goto digi_stop_##i; } + repeat_in_1_18(expr_frac) +#undef expr_frac + + cur += 20; /* skip 19 digits and 1 decimal point */ + if (!digi_is_digit(*cur)) goto digi_frac_end; /* fraction part end */ + goto digi_frac_more; /* read more digits in fraction part */ + + + /* significant part end */ +#define expr_stop(i) \ + digi_stop_##i: \ + cur += i + 1; \ + goto digi_frac_end; + repeat_in_1_18(expr_stop) +#undef expr_stop + + + /* read more digits in integral part */ +digi_intg_more: + if (digi_is_digit(*cur)) { + if (!digi_is_digit_or_fp(cur[1])) { + /* this number is an integer consisting of 20 digits */ + num = (u64)(*cur - '0'); + if ((sig < (U64_MAX / 10)) || + (sig == (U64_MAX / 10) && num <= (U64_MAX % 10))) { + sig = num + sig * 10; + cur++; + /* convert to double if overflow */ + if (sign) { + if (has_read_flag(BIGNUM_AS_RAW)) return_raw(); + return_f64(normalized_u64_to_f64(sig)); + } + return_i64(sig); + } + } + } + + if (digi_is_exp(*cur)) { + dot_pos = cur; + goto digi_exp_more; + } + + if (*cur == '.') { + dot_pos = cur++; + if (!digi_is_digit(*cur)) { + return_err(cur, "no digit after decimal point"); + } + } + + + /* read more digits in fraction part */ +digi_frac_more: + sig_cut = cur; /* too large to fit in u64, excess digits need to be cut */ + sig += (*cur >= '5'); /* round */ + while (digi_is_digit(*++cur)); + if (!dot_pos) { + if (!digi_is_fp(*cur) && has_read_flag(BIGNUM_AS_RAW)) { + return_raw(); /* it's a large integer */ + } + dot_pos = cur; + if (*cur == '.') { + if (!digi_is_digit(*++cur)) { + return_err(cur, "no digit after decimal point"); + } + while (digi_is_digit(*cur)) cur++; + } + } + exp_sig = (i64)(dot_pos - sig_cut); + exp_sig += (dot_pos < sig_cut); + + /* ignore trailing zeros */ + tmp = cur - 1; + while (*tmp == '0' || *tmp == '.') tmp--; + if (tmp < sig_cut) { + sig_cut = NULL; + } else { + sig_end = cur; + } + + if (digi_is_exp(*cur)) goto digi_exp_more; + goto digi_exp_finish; + + + /* fraction part end */ +digi_frac_end: + if (unlikely(dot_pos + 1 == cur)) { + return_err(cur, "no digit after decimal point"); + } + sig_end = cur; + exp_sig = -(i64)((u64)(cur - dot_pos) - 1); + if (likely(!digi_is_exp(*cur))) { + if (unlikely(exp_sig < F64_MIN_DEC_EXP - 19)) { + return_f64_bin(0); /* underflow */ + } + exp = (i32)exp_sig; + goto digi_finish; + } else { + goto digi_exp_more; + } + + + /* read exponent part */ +digi_exp_more: + exp_sign = (*++cur == '-'); + cur += digi_is_sign(*cur); + if (unlikely(!digi_is_digit(*cur))) { + return_err(cur, "no digit after exponent sign"); + } + while (*cur == '0') cur++; + + /* read exponent literal */ + tmp = cur; + while (digi_is_digit(*cur)) { + exp_lit = (i64)((u8)(*cur++ - '0') + (u64)exp_lit * 10); + } + if (unlikely(cur - tmp >= U64_SAFE_DIG)) { + if (exp_sign) { + return_f64_bin(0); /* underflow */ + } else { + return_inf(); /* overflow */ + } + } + exp_sig += exp_sign ? -exp_lit : exp_lit; + + + /* validate exponent value */ +digi_exp_finish: + if (unlikely(exp_sig < F64_MIN_DEC_EXP - 19)) { + return_f64_bin(0); /* underflow */ + } + if (unlikely(exp_sig > F64_MAX_DEC_EXP)) { + return_inf(); /* overflow */ + } + exp = (i32)exp_sig; + + + /* all digit read finished */ +digi_finish: + + /* + Fast path 1: + + 1. The floating-point number calculation should be accurate, see the + comments of macro `YYJSON_DOUBLE_MATH_CORRECT`. + 2. Correct rounding should be performed (fegetround() == FE_TONEAREST). + 3. The input of floating point number calculation does not lose precision, + which means: 64 - leading_zero(input) - trailing_zero(input) < 53. + + We don't check all available inputs here, because that would make the code + more complicated, and not friendly to branch predictor. + */ +#if YYJSON_DOUBLE_MATH_CORRECT + if (sig < ((u64)1 << 53) && + exp >= -F64_POW10_EXP_MAX_EXACT && + exp <= +F64_POW10_EXP_MAX_EXACT) { + f64 dbl = (f64)sig; + if (exp < 0) { + dbl /= f64_pow10_table[-exp]; + } else { + dbl *= f64_pow10_table[+exp]; + } + return_f64(dbl); + } +#endif + + /* + Fast path 2: + + To keep it simple, we only accept normal number here, + let the slow path to handle subnormal and infinity number. + */ + if (likely(!sig_cut && + exp > -F64_MAX_DEC_EXP + 1 && + exp < +F64_MAX_DEC_EXP - 20)) { + /* + The result value is exactly equal to (sig * 10^exp), + the exponent part (10^exp) can be converted to (sig2 * 2^exp2). + + The sig2 can be an infinite length number, only the highest 128 bits + is cached in the pow10_sig_table. + + Now we have these bits: + sig1 (normalized 64bit) : aaaaaaaa + sig2 (higher 64bit) : bbbbbbbb + sig2_ext (lower 64bit) : cccccccc + sig2_cut (extra unknown bits) : dddddddddddd.... + + And the calculation process is: + ---------------------------------------- + aaaaaaaa * + bbbbbbbbccccccccdddddddddddd.... + ---------------------------------------- + abababababababab + + acacacacacacacac + + adadadadadadadadadad.... + ---------------------------------------- + [hi____][lo____] + + [hi2___][lo2___] + + [unknown___________....] + ---------------------------------------- + + The addition with carry may affect higher bits, but if there is a 0 + in higher bits, the bits higher than 0 will not be affected. + + `lo2` + `unknown` may get a carry bit and may affect `hi2`, the max + value of `hi2` is 0xFFFFFFFFFFFFFFFE, so `hi2` will not overflow. + + `lo` + `hi2` may also get a carry bit and may affect `hi`, but only + the highest significant 53 bits of `hi` is needed. If there is a 0 + in the lower bits of `hi`, then all the following bits can be dropped. + + To convert the result to IEEE-754 double number, we need to perform + correct rounding: + 1. if bit 54 is 0, round down, + 2. if bit 54 is 1 and any bit beyond bit 54 is 1, round up, + 3. if bit 54 is 1 and all bits beyond bit 54 are 0, round to even, + as the extra bits is unknown, this case will not be handled here. + */ + + u64 raw; + u64 sig1, sig2, sig2_ext, hi, lo, hi2, lo2, add, bits; + i32 exp2; + u32 lz; + bool exact = false, carry, round_up; + + /* convert (10^exp) to (sig2 * 2^exp2) */ + pow10_table_get_sig(exp, &sig2, &sig2_ext); + pow10_table_get_exp(exp, &exp2); + + /* normalize and multiply */ + lz = u64_lz_bits(sig); + sig1 = sig << lz; + exp2 -= (i32)lz; + u128_mul(sig1, sig2, &hi, &lo); + + /* + The `hi` is in range [0x4000000000000000, 0xFFFFFFFFFFFFFFFE], + To get normalized value, `hi` should be shifted to the left by 0 or 1. + + The highest significant 53 bits is used by IEEE-754 double number, + and the bit 54 is used to detect rounding direction. + + The lowest (64 - 54 - 1) bits is used to check whether it contains 0. + */ + bits = hi & (((u64)1 << (64 - 54 - 1)) - 1); + if (bits - 1 < (((u64)1 << (64 - 54 - 1)) - 2)) { + /* + (bits != 0 && bits != 0x1FF) => (bits - 1 < 0x1FF - 1) + The `bits` is not zero, so we don't need to check `round to even` + case. The `bits` contains bit `0`, so we can drop the extra bits + after `0`. + */ + exact = true; + + } else { + /* + (bits == 0 || bits == 0x1FF) + The `bits` is filled with all `0` or all `1`, so we need to check + lower bits with another 64-bit multiplication. + */ + u128_mul(sig1, sig2_ext, &hi2, &lo2); + + add = lo + hi2; + if (add + 1 > (u64)1) { + /* + (add != 0 && add != U64_MAX) => (add + 1 > 1) + The `add` is not zero, so we don't need to check `round to + even` case. The `add` contains bit `0`, so we can drop the + extra bits after `0`. The `hi` cannot be U64_MAX, so it will + not overflow. + */ + carry = add < lo || add < hi2; + hi += carry; + exact = true; + } + } + + if (exact) { + /* normalize */ + lz = hi < ((u64)1 << 63); + hi <<= lz; + exp2 -= (i32)lz; + exp2 += 64; + + /* test the bit 54 and get rounding direction */ + round_up = (hi & ((u64)1 << (64 - 54))) > (u64)0; + hi += (round_up ? ((u64)1 << (64 - 54)) : (u64)0); + + /* test overflow */ + if (hi < ((u64)1 << (64 - 54))) { + hi = ((u64)1 << 63); + exp2 += 1; + } + + /* This is a normal number, convert it to IEEE-754 format. */ + hi >>= F64_BITS - F64_SIG_FULL_BITS; + exp2 += F64_BITS - F64_SIG_FULL_BITS + F64_SIG_BITS; + exp2 += F64_EXP_BIAS; + raw = ((u64)exp2 << F64_SIG_BITS) | (hi & F64_SIG_MASK); + return_f64_bin(raw); + } + } + + /* + Slow path: read double number exactly with diyfp. + 1. Use cached diyfp to get an approximation value. + 2. Use bigcomp to check the approximation value if needed. + + This algorithm refers to google's double-conversion project: + https://github.com/google/double-conversion + */ + { + const i32 ERR_ULP_LOG = 3; + const i32 ERR_ULP = 1 << ERR_ULP_LOG; + const i32 ERR_CACHED_POW = ERR_ULP / 2; + const i32 ERR_MUL_FIXED = ERR_ULP / 2; + const i32 DIY_SIG_BITS = 64; + const i32 EXP_BIAS = F64_EXP_BIAS + F64_SIG_BITS; + const i32 EXP_SUBNORMAL = -EXP_BIAS + 1; + + u64 fp_err; + u32 bits; + i32 order_of_magnitude; + i32 effective_significand_size; + i32 precision_digits_count; + u64 precision_bits; + u64 half_way; + + u64 raw; + diy_fp fp, fp_upper; + bigint big_full, big_comp; + i32 cmp; + + fp.sig = sig; + fp.exp = 0; + fp_err = sig_cut ? (u64)(ERR_ULP / 2) : (u64)0; + + /* normalize */ + bits = u64_lz_bits(fp.sig); + fp.sig <<= bits; + fp.exp -= (i32)bits; + fp_err <<= bits; + + /* multiply and add error */ + fp = diy_fp_mul(fp, diy_fp_get_cached_pow10(exp)); + fp_err += (u64)ERR_CACHED_POW + (fp_err != 0) + (u64)ERR_MUL_FIXED; + + /* normalize */ + bits = u64_lz_bits(fp.sig); + fp.sig <<= bits; + fp.exp -= (i32)bits; + fp_err <<= bits; + + /* effective significand */ + order_of_magnitude = DIY_SIG_BITS + fp.exp; + if (likely(order_of_magnitude >= EXP_SUBNORMAL + F64_SIG_FULL_BITS)) { + effective_significand_size = F64_SIG_FULL_BITS; + } else if (order_of_magnitude <= EXP_SUBNORMAL) { + effective_significand_size = 0; + } else { + effective_significand_size = order_of_magnitude - EXP_SUBNORMAL; + } + + /* precision digits count */ + precision_digits_count = DIY_SIG_BITS - effective_significand_size; + if (unlikely(precision_digits_count + ERR_ULP_LOG >= DIY_SIG_BITS)) { + i32 shr = (precision_digits_count + ERR_ULP_LOG) - DIY_SIG_BITS + 1; + fp.sig >>= shr; + fp.exp += shr; + fp_err = (fp_err >> shr) + 1 + (u32)ERR_ULP; + precision_digits_count -= shr; + } + + /* half way */ + precision_bits = fp.sig & (((u64)1 << precision_digits_count) - 1); + precision_bits *= (u32)ERR_ULP; + half_way = (u64)1 << (precision_digits_count - 1); + half_way *= (u32)ERR_ULP; + + /* rounding */ + fp.sig >>= precision_digits_count; + fp.sig += (precision_bits >= half_way + fp_err); + fp.exp += precision_digits_count; + + /* get IEEE double raw value */ + raw = diy_fp_to_ieee_raw(fp); + if (unlikely(raw == F64_RAW_INF)) return_inf(); + if (likely(precision_bits <= half_way - fp_err || + precision_bits >= half_way + fp_err)) { + return_f64_bin(raw); /* number is accurate */ + } + /* now the number is the correct value, or the next lower value */ + + /* upper boundary */ + if (raw & F64_EXP_MASK) { + fp_upper.sig = (raw & F64_SIG_MASK) + ((u64)1 << F64_SIG_BITS); + fp_upper.exp = (i32)((raw & F64_EXP_MASK) >> F64_SIG_BITS); + } else { + fp_upper.sig = (raw & F64_SIG_MASK); + fp_upper.exp = 1; + } + fp_upper.exp -= F64_EXP_BIAS + F64_SIG_BITS; + fp_upper.sig <<= 1; + fp_upper.exp -= 1; + fp_upper.sig += 1; /* add half ulp */ + + /* compare with bigint */ + bigint_set_buf(&big_full, sig, &exp, sig_cut, sig_end, dot_pos); + bigint_set_u64(&big_comp, fp_upper.sig); + if (exp >= 0) { + bigint_mul_pow10(&big_full, +exp); + } else { + bigint_mul_pow10(&big_comp, -exp); + } + if (fp_upper.exp > 0) { + bigint_mul_pow2(&big_comp, (u32)+fp_upper.exp); + } else { + bigint_mul_pow2(&big_full, (u32)-fp_upper.exp); + } + cmp = bigint_cmp(&big_full, &big_comp); + if (likely(cmp != 0)) { + /* round down or round up */ + raw += (cmp > 0); + } else { + /* falls midway, round to even */ + raw += (raw & 1); + } + + if (unlikely(raw == F64_RAW_INF)) return_inf(); + return_f64_bin(raw); + } + +#undef return_err +#undef return_inf +#undef return_0 +#undef return_i64 +#undef return_f64 +#undef return_f64_bin +#undef return_raw +} + + + +#else /* FP_READER */ + +/** + Read a JSON number. + This is a fallback function if the custom number reader is disabled. + This function use libc's strtod() to read floating-point number. + */ +static_inline bool read_number(u8 **ptr, + u8 **pre, + yyjson_read_flag flg, + yyjson_val *val, + const char **msg) { + +#define return_err(_pos, _msg) do { \ + *msg = _msg; \ + *end = _pos; \ + return false; \ +} while (false) + +#define return_0() do { \ + val->tag = YYJSON_TYPE_NUM | (u64)((u8)sign << 3); \ + val->uni.u64 = 0; \ + *end = cur; return true; \ +} while (false) + +#define return_i64(_v) do { \ + val->tag = YYJSON_TYPE_NUM | (u64)((u8)sign << 3); \ + val->uni.u64 = (u64)(sign ? (u64)(~(_v) + 1) : (u64)(_v)); \ + *end = cur; return true; \ +} while (false) + +#define return_f64(_v) do { \ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; \ + val->uni.f64 = sign ? -(f64)(_v) : (f64)(_v); \ + *end = cur; return true; \ +} while (false) + +#define return_f64_bin(_v) do { \ + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; \ + val->uni.u64 = ((u64)sign << 63) | (u64)(_v); \ + *end = cur; return true; \ +} while (false) + +#define return_inf() do { \ + if (has_read_flag(BIGNUM_AS_RAW)) return_raw(); \ + if (has_read_flag(ALLOW_INF_AND_NAN)) return_f64_bin(F64_RAW_INF); \ + else return_err(hdr, "number is infinity when parsed as double"); \ +} while (false) + +#define return_raw() do { \ + if (*pre) **pre = '\0'; /* add null-terminator for previous raw string */ \ + val->tag = ((u64)(cur - hdr) << YYJSON_TAG_BIT) | YYJSON_TYPE_RAW; \ + val->uni.str = (const char *)hdr; \ + *pre = cur; *end = cur; return true; \ +} while (false) + + u64 sig, num; + u8 *hdr = *ptr; + u8 *cur = *ptr; + u8 **end = ptr; + u8 *dot = NULL; + u8 *f64_end = NULL; + bool sign; + + /* read number as raw string if has `YYJSON_READ_NUMBER_AS_RAW` flag */ + if (unlikely(pre && !has_read_flag(BIGNUM_AS_RAW))) { + return read_number_raw(ptr, pre, flg, val, msg); + } + + sign = (*hdr == '-'); + cur += sign; + sig = (u8)(*cur - '0'); + + /* read first digit, check leading zero */ + if (unlikely(!digi_is_digit(*cur))) { + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (read_inf_or_nan(sign, &cur, pre, val)) { + *end = cur; + return true; + } + } + return_err(cur, "no digit after minus sign"); + } + if (*cur == '0') { + cur++; + if (unlikely(digi_is_digit(*cur))) { + return_err(cur - 1, "number with leading zero is not allowed"); + } + if (!digi_is_fp(*cur)) return_0(); + goto read_double; + } + + /* read continuous digits, up to 19 characters */ +#define expr_intg(i) \ + if (likely((num = (u64)(cur[i] - (u8)'0')) <= 9)) sig = num + sig * 10; \ + else { cur += i; goto intg_end; } + repeat_in_1_18(expr_intg) +#undef expr_intg + + /* here are 19 continuous digits, skip them */ + cur += 19; + if (digi_is_digit(cur[0]) && !digi_is_digit_or_fp(cur[1])) { + /* this number is an integer consisting of 20 digits */ + num = (u8)(*cur - '0'); + if ((sig < (U64_MAX / 10)) || + (sig == (U64_MAX / 10) && num <= (U64_MAX % 10))) { + sig = num + sig * 10; + cur++; + if (sign) { + if (has_read_flag(BIGNUM_AS_RAW)) return_raw(); + return_f64(normalized_u64_to_f64(sig)); + } + return_i64(sig); + } + } + +intg_end: + /* continuous digits ended */ + if (!digi_is_digit_or_fp(*cur)) { + /* this number is an integer consisting of 1 to 19 digits */ + if (sign && (sig > ((u64)1 << 63))) { + if (has_read_flag(BIGNUM_AS_RAW)) return_raw(); + return_f64(normalized_u64_to_f64(sig)); + } + return_i64(sig); + } + +read_double: + /* this number should be read as double */ + while (digi_is_digit(*cur)) cur++; + if (!digi_is_fp(*cur) && has_read_flag(BIGNUM_AS_RAW)) { + return_raw(); /* it's a large integer */ + } + if (*cur == '.') { + /* skip fraction part */ + dot = cur; + cur++; + if (!digi_is_digit(*cur)) { + return_err(cur, "no digit after decimal point"); + } + cur++; + while (digi_is_digit(*cur)) cur++; + } + if (digi_is_exp(*cur)) { + /* skip exponent part */ + cur += 1 + digi_is_sign(cur[1]); + if (!digi_is_digit(*cur)) { + return_err(cur, "no digit after exponent sign"); + } + cur++; + while (digi_is_digit(*cur)) cur++; + } + + /* + libc's strtod() is used to parse the floating-point number. + + Note that the decimal point character used by strtod() is locale-dependent, + and the rounding direction may affected by fesetround(). + + For currently known locales, (en, zh, ja, ko, am, he, hi) use '.' as the + decimal point, while other locales use ',' as the decimal point. + + Here strtod() is called twice for different locales, but if another thread + happens calls setlocale() between two strtod(), parsing may still fail. + */ + val->uni.f64 = strtod((const char *)hdr, (char **)&f64_end); + if (unlikely(f64_end != cur)) { + /* replace '.' with ',' for locale */ + bool cut = (*cur == ','); + if (cut) *cur = ' '; + if (dot) *dot = ','; + val->uni.f64 = strtod((const char *)hdr, (char **)&f64_end); + /* restore ',' to '.' */ + if (cut) *cur = ','; + if (dot) *dot = '.'; + if (unlikely(f64_end != cur)) { + return_err(hdr, "strtod() failed to parse the number"); + } + } + if (unlikely(val->uni.f64 >= HUGE_VAL || val->uni.f64 <= -HUGE_VAL)) { + return_inf(); + } + val->tag = YYJSON_TYPE_NUM | YYJSON_SUBTYPE_REAL; + *end = cur; + return true; + +#undef return_err +#undef return_0 +#undef return_i64 +#undef return_f64 +#undef return_f64_bin +#undef return_inf +#undef return_raw +} + +#endif /* FP_READER */ + + + +/*============================================================================== + * JSON String Reader + *============================================================================*/ + +/** + Read a JSON string. + @param ptr The head pointer of string before '"' prefix (inout). + @param lst JSON last position. + @param inv Allow invalid unicode. + @param val The string value to be written. + @param msg The error message pointer. + @return Whether success. + */ +static_inline bool read_string(u8 **ptr, + u8 *lst, + bool inv, + yyjson_val *val, + const char **msg) { + /* + Each unicode code point is encoded as 1 to 4 bytes in UTF-8 encoding, + we use 4-byte mask and pattern value to validate UTF-8 byte sequence, + this requires the input data to have 4-byte zero padding. + --------------------------------------------------- + 1 byte + unicode range [U+0000, U+007F] + unicode min [.......0] + unicode max [.1111111] + bit pattern [0.......] + --------------------------------------------------- + 2 byte + unicode range [U+0080, U+07FF] + unicode min [......10 ..000000] + unicode max [...11111 ..111111] + bit require [...xxxx. ........] (1E 00) + bit mask [xxx..... xx......] (E0 C0) + bit pattern [110..... 10......] (C0 80) + --------------------------------------------------- + 3 byte + unicode range [U+0800, U+FFFF] + unicode min [........ ..100000 ..000000] + unicode max [....1111 ..111111 ..111111] + bit require [....xxxx ..x..... ........] (0F 20 00) + bit mask [xxxx.... xx...... xx......] (F0 C0 C0) + bit pattern [1110.... 10...... 10......] (E0 80 80) + --------------------------------------------------- + 3 byte invalid (reserved for surrogate halves) + unicode range [U+D800, U+DFFF] + unicode min [....1101 ..100000 ..000000] + unicode max [....1101 ..111111 ..111111] + bit mask [....xxxx ..x..... ........] (0F 20 00) + bit pattern [....1101 ..1..... ........] (0D 20 00) + --------------------------------------------------- + 4 byte + unicode range [U+10000, U+10FFFF] + unicode min [........ ...10000 ..000000 ..000000] + unicode max [.....100 ..001111 ..111111 ..111111] + bit require [.....xxx ..xx.... ........ ........] (07 30 00 00) + bit mask [xxxxx... xx...... xx...... xx......] (F8 C0 C0 C0) + bit pattern [11110... 10...... 10...... 10......] (F0 80 80 80) + --------------------------------------------------- + */ +#if YYJSON_ENDIAN == YYJSON_BIG_ENDIAN + const u32 b1_mask = 0x80000000UL; + const u32 b1_patt = 0x00000000UL; + const u32 b2_mask = 0xE0C00000UL; + const u32 b2_patt = 0xC0800000UL; + const u32 b2_requ = 0x1E000000UL; + const u32 b3_mask = 0xF0C0C000UL; + const u32 b3_patt = 0xE0808000UL; + const u32 b3_requ = 0x0F200000UL; + const u32 b3_erro = 0x0D200000UL; + const u32 b4_mask = 0xF8C0C0C0UL; + const u32 b4_patt = 0xF0808080UL; + const u32 b4_requ = 0x07300000UL; + const u32 b4_err0 = 0x04000000UL; + const u32 b4_err1 = 0x03300000UL; +#elif YYJSON_ENDIAN == YYJSON_LITTLE_ENDIAN + const u32 b1_mask = 0x00000080UL; + const u32 b1_patt = 0x00000000UL; + const u32 b2_mask = 0x0000C0E0UL; + const u32 b2_patt = 0x000080C0UL; + const u32 b2_requ = 0x0000001EUL; + const u32 b3_mask = 0x00C0C0F0UL; + const u32 b3_patt = 0x008080E0UL; + const u32 b3_requ = 0x0000200FUL; + const u32 b3_erro = 0x0000200DUL; + const u32 b4_mask = 0xC0C0C0F8UL; + const u32 b4_patt = 0x808080F0UL; + const u32 b4_requ = 0x00003007UL; + const u32 b4_err0 = 0x00000004UL; + const u32 b4_err1 = 0x00003003UL; +#else + /* this should be evaluated at compile-time */ + v32_uni b1_mask_uni = {{ 0x80, 0x00, 0x00, 0x00 }}; + v32_uni b1_patt_uni = {{ 0x00, 0x00, 0x00, 0x00 }}; + v32_uni b2_mask_uni = {{ 0xE0, 0xC0, 0x00, 0x00 }}; + v32_uni b2_patt_uni = {{ 0xC0, 0x80, 0x00, 0x00 }}; + v32_uni b2_requ_uni = {{ 0x1E, 0x00, 0x00, 0x00 }}; + v32_uni b3_mask_uni = {{ 0xF0, 0xC0, 0xC0, 0x00 }}; + v32_uni b3_patt_uni = {{ 0xE0, 0x80, 0x80, 0x00 }}; + v32_uni b3_requ_uni = {{ 0x0F, 0x20, 0x00, 0x00 }}; + v32_uni b3_erro_uni = {{ 0x0D, 0x20, 0x00, 0x00 }}; + v32_uni b4_mask_uni = {{ 0xF8, 0xC0, 0xC0, 0xC0 }}; + v32_uni b4_patt_uni = {{ 0xF0, 0x80, 0x80, 0x80 }}; + v32_uni b4_requ_uni = {{ 0x07, 0x30, 0x00, 0x00 }}; + v32_uni b4_err0_uni = {{ 0x04, 0x00, 0x00, 0x00 }}; + v32_uni b4_err1_uni = {{ 0x03, 0x30, 0x00, 0x00 }}; + u32 b1_mask = b1_mask_uni.u; + u32 b1_patt = b1_patt_uni.u; + u32 b2_mask = b2_mask_uni.u; + u32 b2_patt = b2_patt_uni.u; + u32 b2_requ = b2_requ_uni.u; + u32 b3_mask = b3_mask_uni.u; + u32 b3_patt = b3_patt_uni.u; + u32 b3_requ = b3_requ_uni.u; + u32 b3_erro = b3_erro_uni.u; + u32 b4_mask = b4_mask_uni.u; + u32 b4_patt = b4_patt_uni.u; + u32 b4_requ = b4_requ_uni.u; + u32 b4_err0 = b4_err0_uni.u; + u32 b4_err1 = b4_err1_uni.u; +#endif + +#define is_valid_seq_1(uni) ( \ + ((uni & b1_mask) == b1_patt) \ +) + +#define is_valid_seq_2(uni) ( \ + ((uni & b2_mask) == b2_patt) && \ + ((uni & b2_requ)) \ +) + +#define is_valid_seq_3(uni) ( \ + ((uni & b3_mask) == b3_patt) && \ + ((tmp = (uni & b3_requ))) && \ + ((tmp != b3_erro)) \ +) + +#define is_valid_seq_4(uni) ( \ + ((uni & b4_mask) == b4_patt) && \ + ((tmp = (uni & b4_requ))) && \ + ((tmp & b4_err0) == 0 || (tmp & b4_err1) == 0) \ +) + +#define return_err(_end, _msg) do { \ + *msg = _msg; \ + *end = _end; \ + return false; \ +} while (false) + + u8 *cur = *ptr; + u8 **end = ptr; + u8 *src = ++cur, *dst, *pos; + u16 hi, lo; + u32 uni, tmp; + +skip_ascii: + /* Most strings have no escaped characters, so we can jump them quickly. */ + +skip_ascii_begin: + /* + We want to make loop unrolling, as shown in the following code. Some + compiler may not generate instructions as expected, so we rewrite it with + explicit goto statements. We hope the compiler can generate instructions + like this: https://godbolt.org/z/8vjsYq + + while (true) repeat16({ + if (likely(!(char_is_ascii_stop(*src)))) src++; + else break; + }) + */ +#define expr_jump(i) \ + if (likely(!char_is_ascii_stop(src[i]))) {} \ + else goto skip_ascii_stop##i; + +#define expr_stop(i) \ + skip_ascii_stop##i: \ + src += i; \ + goto skip_ascii_end; + + repeat16_incr(expr_jump) + src += 16; + goto skip_ascii_begin; + repeat16_incr(expr_stop) + +#undef expr_jump +#undef expr_stop + +skip_ascii_end: + + /* + GCC may store src[i] in a register at each line of expr_jump(i) above. + These instructions are useless and will degrade performance. + This inline asm is a hint for gcc: "the memory has been modified, + do not cache it". + + MSVC, Clang, ICC can generate expected instructions without this hint. + */ +#if YYJSON_IS_REAL_GCC + __asm__ volatile("":"=m"(*src)); +#endif + if (likely(*src == '"')) { + val->tag = ((u64)(src - cur) << YYJSON_TAG_BIT) | + (u64)(YYJSON_TYPE_STR | YYJSON_SUBTYPE_NOESC); + val->uni.str = (const char *)cur; + *src = '\0'; + *end = src + 1; + return true; + } + +skip_utf8: + if (*src & 0x80) { /* non-ASCII character */ + /* + Non-ASCII character appears here, which means that the text is likely + to be written in non-English or emoticons. According to some common + data set statistics, byte sequences of the same length may appear + consecutively. We process the byte sequences of the same length in each + loop, which is more friendly to branch prediction. + */ + pos = src; +#if YYJSON_DISABLE_UTF8_VALIDATION + while (true) repeat8({ + if (likely((*src & 0xF0) == 0xE0)) src += 3; + else break; + }) + if (*src < 0x80) goto skip_ascii; + while (true) repeat8({ + if (likely((*src & 0xE0) == 0xC0)) src += 2; + else break; + }) + while (true) repeat8({ + if (likely((*src & 0xF8) == 0xF0)) src += 4; + else break; + }) +#else + uni = byte_load_4(src); + while (is_valid_seq_3(uni)) { + src += 3; + uni = byte_load_4(src); + } + if (is_valid_seq_1(uni)) goto skip_ascii; + while (is_valid_seq_2(uni)) { + src += 2; + uni = byte_load_4(src); + } + while (is_valid_seq_4(uni)) { + src += 4; + uni = byte_load_4(src); + } +#endif + if (unlikely(pos == src)) { + if (!inv) return_err(src, "invalid UTF-8 encoding in string"); + ++src; + } + goto skip_ascii; + } + + /* The escape character appears, we need to copy it. */ + dst = src; +copy_escape: + if (likely(*src == '\\')) { + switch (*++src) { + case '"': *dst++ = '"'; src++; break; + case '\\': *dst++ = '\\'; src++; break; + case '/': *dst++ = '/'; src++; break; + case 'b': *dst++ = '\b'; src++; break; + case 'f': *dst++ = '\f'; src++; break; + case 'n': *dst++ = '\n'; src++; break; + case 'r': *dst++ = '\r'; src++; break; + case 't': *dst++ = '\t'; src++; break; + case 'u': + if (unlikely(!read_hex_u16(++src, &hi))) { + return_err(src - 2, "invalid escaped sequence in string"); + } + src += 4; + if (likely((hi & 0xF800) != 0xD800)) { + /* a BMP character */ + if (hi >= 0x800) { + *dst++ = (u8)(0xE0 | (hi >> 12)); + *dst++ = (u8)(0x80 | ((hi >> 6) & 0x3F)); + *dst++ = (u8)(0x80 | (hi & 0x3F)); + } else if (hi >= 0x80) { + *dst++ = (u8)(0xC0 | (hi >> 6)); + *dst++ = (u8)(0x80 | (hi & 0x3F)); + } else { + *dst++ = (u8)hi; + } + } else { + /* a non-BMP character, represented as a surrogate pair */ + if (unlikely((hi & 0xFC00) != 0xD800)) { + return_err(src - 6, "invalid high surrogate in string"); + } + if (unlikely(!byte_match_2(src, "\\u"))) { + return_err(src, "no low surrogate in string"); + } + if (unlikely(!read_hex_u16(src + 2, &lo))) { + return_err(src, "invalid escaped sequence in string"); + } + if (unlikely((lo & 0xFC00) != 0xDC00)) { + return_err(src, "invalid low surrogate in string"); + } + uni = ((((u32)hi - 0xD800) << 10) | + ((u32)lo - 0xDC00)) + 0x10000; + *dst++ = (u8)(0xF0 | (uni >> 18)); + *dst++ = (u8)(0x80 | ((uni >> 12) & 0x3F)); + *dst++ = (u8)(0x80 | ((uni >> 6) & 0x3F)); + *dst++ = (u8)(0x80 | (uni & 0x3F)); + src += 6; + } + break; + default: return_err(src, "invalid escaped character in string"); + } + } else if (likely(*src == '"')) { + val->tag = ((u64)(dst - cur) << YYJSON_TAG_BIT) | YYJSON_TYPE_STR; + val->uni.str = (const char *)cur; + *dst = '\0'; + *end = src + 1; + return true; + } else { + if (!inv) return_err(src, "unexpected control character in string"); + if (src >= lst) return_err(src, "unclosed string"); + *dst++ = *src++; + } + +copy_ascii: + /* + Copy continuous ASCII, loop unrolling, same as the following code: + + while (true) repeat16({ + if (unlikely(char_is_ascii_stop(*src))) break; + *dst++ = *src++; + }) + */ +#if YYJSON_IS_REAL_GCC +# define expr_jump(i) \ + if (likely(!(char_is_ascii_stop(src[i])))) {} \ + else { __asm__ volatile("":"=m"(src[i])); goto copy_ascii_stop_##i; } +#else +# define expr_jump(i) \ + if (likely(!(char_is_ascii_stop(src[i])))) {} \ + else { goto copy_ascii_stop_##i; } +#endif + repeat16_incr(expr_jump) +#undef expr_jump + + byte_move_16(dst, src); + src += 16; + dst += 16; + goto copy_ascii; + + /* + The memory will be moved forward by at least 1 byte. So the `byte_move` + can be one byte more than needed to reduce the number of instructions. + */ +copy_ascii_stop_0: + goto copy_utf8; +copy_ascii_stop_1: + byte_move_2(dst, src); + src += 1; + dst += 1; + goto copy_utf8; +copy_ascii_stop_2: + byte_move_2(dst, src); + src += 2; + dst += 2; + goto copy_utf8; +copy_ascii_stop_3: + byte_move_4(dst, src); + src += 3; + dst += 3; + goto copy_utf8; +copy_ascii_stop_4: + byte_move_4(dst, src); + src += 4; + dst += 4; + goto copy_utf8; +copy_ascii_stop_5: + byte_move_4(dst, src); + byte_move_2(dst + 4, src + 4); + src += 5; + dst += 5; + goto copy_utf8; +copy_ascii_stop_6: + byte_move_4(dst, src); + byte_move_2(dst + 4, src + 4); + src += 6; + dst += 6; + goto copy_utf8; +copy_ascii_stop_7: + byte_move_8(dst, src); + src += 7; + dst += 7; + goto copy_utf8; +copy_ascii_stop_8: + byte_move_8(dst, src); + src += 8; + dst += 8; + goto copy_utf8; +copy_ascii_stop_9: + byte_move_8(dst, src); + byte_move_2(dst + 8, src + 8); + src += 9; + dst += 9; + goto copy_utf8; +copy_ascii_stop_10: + byte_move_8(dst, src); + byte_move_2(dst + 8, src + 8); + src += 10; + dst += 10; + goto copy_utf8; +copy_ascii_stop_11: + byte_move_8(dst, src); + byte_move_4(dst + 8, src + 8); + src += 11; + dst += 11; + goto copy_utf8; +copy_ascii_stop_12: + byte_move_8(dst, src); + byte_move_4(dst + 8, src + 8); + src += 12; + dst += 12; + goto copy_utf8; +copy_ascii_stop_13: + byte_move_8(dst, src); + byte_move_4(dst + 8, src + 8); + byte_move_2(dst + 12, src + 12); + src += 13; + dst += 13; + goto copy_utf8; +copy_ascii_stop_14: + byte_move_8(dst, src); + byte_move_4(dst + 8, src + 8); + byte_move_2(dst + 12, src + 12); + src += 14; + dst += 14; + goto copy_utf8; +copy_ascii_stop_15: + byte_move_16(dst, src); + src += 15; + dst += 15; + goto copy_utf8; + +copy_utf8: + if (*src & 0x80) { /* non-ASCII character */ + pos = src; + uni = byte_load_4(src); +#if YYJSON_DISABLE_UTF8_VALIDATION + while (true) repeat4({ + if ((uni & b3_mask) == b3_patt) { + byte_copy_4(dst, &uni); + dst += 3; + src += 3; + uni = byte_load_4(src); + } else break; + }) + if ((uni & b1_mask) == b1_patt) goto copy_ascii; + while (true) repeat4({ + if ((uni & b2_mask) == b2_patt) { + byte_copy_2(dst, &uni); + dst += 2; + src += 2; + uni = byte_load_4(src); + } else break; + }) + while (true) repeat4({ + if ((uni & b4_mask) == b4_patt) { + byte_copy_4(dst, &uni); + dst += 4; + src += 4; + uni = byte_load_4(src); + } else break; + }) +#else + while (is_valid_seq_3(uni)) { + byte_copy_4(dst, &uni); + dst += 3; + src += 3; + uni = byte_load_4(src); + } + if (is_valid_seq_1(uni)) goto copy_ascii; + while (is_valid_seq_2(uni)) { + byte_copy_2(dst, &uni); + dst += 2; + src += 2; + uni = byte_load_4(src); + } + while (is_valid_seq_4(uni)) { + byte_copy_4(dst, &uni); + dst += 4; + src += 4; + uni = byte_load_4(src); + } +#endif + if (unlikely(pos == src)) { + if (!inv) return_err(src, "invalid UTF-8 encoding in string"); + goto copy_ascii_stop_1; + } + goto copy_ascii; + } + goto copy_escape; + +#undef return_err +#undef is_valid_seq_1 +#undef is_valid_seq_2 +#undef is_valid_seq_3 +#undef is_valid_seq_4 +} + + + +/*============================================================================== + * JSON Reader Implementation + * + * We use goto statements to build the finite state machine (FSM). + * The FSM's state was held by program counter (PC) and the 'goto' make the + * state transitions. + *============================================================================*/ + +/** Read single value JSON document. */ +static_noinline yyjson_doc *read_root_single(u8 *hdr, + u8 *cur, + u8 *end, + yyjson_alc alc, + yyjson_read_flag flg, + yyjson_read_err *err) { + +#define return_err(_pos, _code, _msg) do { \ + if (is_truncated_end(hdr, _pos, end, YYJSON_READ_ERROR_##_code, flg)) { \ + err->pos = (usize)(end - hdr); \ + err->code = YYJSON_READ_ERROR_UNEXPECTED_END; \ + err->msg = "unexpected end of data"; \ + } else { \ + err->pos = (usize)(_pos - hdr); \ + err->code = YYJSON_READ_ERROR_##_code; \ + err->msg = _msg; \ + } \ + if (val_hdr) alc.free(alc.ctx, (void *)val_hdr); \ + return NULL; \ +} while (false) + + usize hdr_len; /* value count used by doc */ + usize alc_num; /* value count capacity */ + yyjson_val *val_hdr; /* the head of allocated values */ + yyjson_val *val; /* current value */ + yyjson_doc *doc; /* the JSON document, equals to val_hdr */ + const char *msg; /* error message */ + + bool raw; /* read number as raw */ + bool inv; /* allow invalid unicode */ + u8 *raw_end; /* raw end for null-terminator */ + u8 **pre; /* previous raw end pointer */ + + hdr_len = sizeof(yyjson_doc) / sizeof(yyjson_val); + hdr_len += (sizeof(yyjson_doc) % sizeof(yyjson_val)) > 0; + alc_num = hdr_len + 1; /* single value */ + + val_hdr = (yyjson_val *)alc.malloc(alc.ctx, alc_num * sizeof(yyjson_val)); + if (unlikely(!val_hdr)) goto fail_alloc; + val = val_hdr + hdr_len; + raw = has_read_flag(NUMBER_AS_RAW) || has_read_flag(BIGNUM_AS_RAW); + inv = has_read_flag(ALLOW_INVALID_UNICODE) != 0; + raw_end = NULL; + pre = raw ? &raw_end : NULL; + + if (char_is_number(*cur)) { + if (likely(read_number(&cur, pre, flg, val, &msg))) goto doc_end; + goto fail_number; + } + if (*cur == '"') { + if (likely(read_string(&cur, end, inv, val, &msg))) goto doc_end; + goto fail_string; + } + if (*cur == 't') { + if (likely(read_true(&cur, val))) goto doc_end; + goto fail_literal; + } + if (*cur == 'f') { + if (likely(read_false(&cur, val))) goto doc_end; + goto fail_literal; + } + if (*cur == 'n') { + if (likely(read_null(&cur, val))) goto doc_end; + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (read_nan(false, &cur, pre, val)) goto doc_end; + } + goto fail_literal; + } + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (read_inf_or_nan(false, &cur, pre, val)) goto doc_end; + } + goto fail_character; + +doc_end: + /* check invalid contents after json document */ + if (unlikely(cur < end) && !has_read_flag(STOP_WHEN_DONE)) { + if (has_read_flag(ALLOW_COMMENTS)) { + if (!skip_spaces_and_comments(&cur)) { + if (byte_match_2(cur, "/*")) goto fail_comment; + } + } else { + while (char_is_space(*cur)) cur++; + } + if (unlikely(cur < end)) goto fail_garbage; + } + + if (pre && *pre) **pre = '\0'; + doc = (yyjson_doc *)val_hdr; + doc->root = val_hdr + hdr_len; + doc->alc = alc; + doc->dat_read = (usize)(cur - hdr); + doc->val_read = 1; + doc->str_pool = has_read_flag(INSITU) ? NULL : (char *)hdr; + return doc; + +fail_string: + return_err(cur, INVALID_STRING, msg); +fail_number: + return_err(cur, INVALID_NUMBER, msg); +fail_alloc: + return_err(cur, MEMORY_ALLOCATION, "memory allocation failed"); +fail_literal: + return_err(cur, LITERAL, "invalid literal"); +fail_comment: + return_err(cur, INVALID_COMMENT, "unclosed multiline comment"); +fail_character: + return_err(cur, UNEXPECTED_CHARACTER, "unexpected character"); +fail_garbage: + return_err(cur, UNEXPECTED_CONTENT, "unexpected content after document"); + +#undef return_err +} + +/** Read JSON document (accept all style, but optimized for minify). */ +static_inline yyjson_doc *read_root_minify(u8 *hdr, + u8 *cur, + u8 *end, + yyjson_alc alc, + yyjson_read_flag flg, + yyjson_read_err *err) { + +#define return_err(_pos, _code, _msg) do { \ + if (is_truncated_end(hdr, _pos, end, YYJSON_READ_ERROR_##_code, flg)) { \ + err->pos = (usize)(end - hdr); \ + err->code = YYJSON_READ_ERROR_UNEXPECTED_END; \ + err->msg = "unexpected end of data"; \ + } else { \ + err->pos = (usize)(_pos - hdr); \ + err->code = YYJSON_READ_ERROR_##_code; \ + err->msg = _msg; \ + } \ + if (val_hdr) alc.free(alc.ctx, (void *)val_hdr); \ + return NULL; \ +} while (false) + +#define val_incr() do { \ + val++; \ + if (unlikely(val >= val_end)) { \ + usize alc_old = alc_len; \ + alc_len += alc_len / 2; \ + if ((sizeof(usize) < 8) && (alc_len >= alc_max)) goto fail_alloc; \ + val_tmp = (yyjson_val *)alc.realloc(alc.ctx, (void *)val_hdr, \ + alc_old * sizeof(yyjson_val), \ + alc_len * sizeof(yyjson_val)); \ + if ((!val_tmp)) goto fail_alloc; \ + val = val_tmp + (usize)(val - val_hdr); \ + ctn = val_tmp + (usize)(ctn - val_hdr); \ + val_hdr = val_tmp; \ + val_end = val_tmp + (alc_len - 2); \ + } \ +} while (false) + + usize dat_len; /* data length in bytes, hint for allocator */ + usize hdr_len; /* value count used by yyjson_doc */ + usize alc_len; /* value count allocated */ + usize alc_max; /* maximum value count for allocator */ + usize ctn_len; /* the number of elements in current container */ + yyjson_val *val_hdr; /* the head of allocated values */ + yyjson_val *val_end; /* the end of allocated values */ + yyjson_val *val_tmp; /* temporary pointer for realloc */ + yyjson_val *val; /* current JSON value */ + yyjson_val *ctn; /* current container */ + yyjson_val *ctn_parent; /* parent of current container */ + yyjson_doc *doc; /* the JSON document, equals to val_hdr */ + const char *msg; /* error message */ + + bool raw; /* read number as raw */ + bool inv; /* allow invalid unicode */ + u8 *raw_end; /* raw end for null-terminator */ + u8 **pre; /* previous raw end pointer */ + + dat_len = has_read_flag(STOP_WHEN_DONE) ? 256 : (usize)(end - cur); + hdr_len = sizeof(yyjson_doc) / sizeof(yyjson_val); + hdr_len += (sizeof(yyjson_doc) % sizeof(yyjson_val)) > 0; + alc_max = USIZE_MAX / sizeof(yyjson_val); + alc_len = hdr_len + (dat_len / YYJSON_READER_ESTIMATED_MINIFY_RATIO) + 4; + alc_len = yyjson_min(alc_len, alc_max); + + val_hdr = (yyjson_val *)alc.malloc(alc.ctx, alc_len * sizeof(yyjson_val)); + if (unlikely(!val_hdr)) goto fail_alloc; + val_end = val_hdr + (alc_len - 2); /* padding for key-value pair reading */ + val = val_hdr + hdr_len; + ctn = val; + ctn_len = 0; + raw = has_read_flag(NUMBER_AS_RAW) || has_read_flag(BIGNUM_AS_RAW); + inv = has_read_flag(ALLOW_INVALID_UNICODE) != 0; + raw_end = NULL; + pre = raw ? &raw_end : NULL; + + if (*cur++ == '{') { + ctn->tag = YYJSON_TYPE_OBJ; + ctn->uni.ofs = 0; + goto obj_key_begin; + } else { + ctn->tag = YYJSON_TYPE_ARR; + ctn->uni.ofs = 0; + goto arr_val_begin; + } + +arr_begin: + /* save current container */ + ctn->tag = (((u64)ctn_len + 1) << YYJSON_TAG_BIT) | + (ctn->tag & YYJSON_TAG_MASK); + + /* create a new array value, save parent container offset */ + val_incr(); + val->tag = YYJSON_TYPE_ARR; + val->uni.ofs = (usize)((u8 *)val - (u8 *)ctn); + + /* push the new array value as current container */ + ctn = val; + ctn_len = 0; + +arr_val_begin: + if (*cur == '{') { + cur++; + goto obj_begin; + } + if (*cur == '[') { + cur++; + goto arr_begin; + } + if (char_is_number(*cur)) { + val_incr(); + ctn_len++; + if (likely(read_number(&cur, pre, flg, val, &msg))) goto arr_val_end; + goto fail_number; + } + if (*cur == '"') { + val_incr(); + ctn_len++; + if (likely(read_string(&cur, end, inv, val, &msg))) goto arr_val_end; + goto fail_string; + } + if (*cur == 't') { + val_incr(); + ctn_len++; + if (likely(read_true(&cur, val))) goto arr_val_end; + goto fail_literal; + } + if (*cur == 'f') { + val_incr(); + ctn_len++; + if (likely(read_false(&cur, val))) goto arr_val_end; + goto fail_literal; + } + if (*cur == 'n') { + val_incr(); + ctn_len++; + if (likely(read_null(&cur, val))) goto arr_val_end; + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (read_nan(false, &cur, pre, val)) goto arr_val_end; + } + goto fail_literal; + } + if (*cur == ']') { + cur++; + if (likely(ctn_len == 0)) goto arr_end; + if (has_read_flag(ALLOW_TRAILING_COMMAS)) goto arr_end; + while (*cur != ',') cur--; + goto fail_trailing_comma; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto arr_val_begin; + } + if (has_read_flag(ALLOW_INF_AND_NAN) && + (*cur == 'i' || *cur == 'I' || *cur == 'N')) { + val_incr(); + ctn_len++; + if (read_inf_or_nan(false, &cur, pre, val)) goto arr_val_end; + goto fail_character; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto arr_val_begin; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +arr_val_end: + if (*cur == ',') { + cur++; + goto arr_val_begin; + } + if (*cur == ']') { + cur++; + goto arr_end; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto arr_val_end; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto arr_val_end; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +arr_end: + /* get parent container */ + ctn_parent = (yyjson_val *)(void *)((u8 *)ctn - ctn->uni.ofs); + + /* save the next sibling value offset */ + ctn->uni.ofs = (usize)((u8 *)val - (u8 *)ctn) + sizeof(yyjson_val); + ctn->tag = ((ctn_len) << YYJSON_TAG_BIT) | YYJSON_TYPE_ARR; + if (unlikely(ctn == ctn_parent)) goto doc_end; + + /* pop parent as current container */ + ctn = ctn_parent; + ctn_len = (usize)(ctn->tag >> YYJSON_TAG_BIT); + if ((ctn->tag & YYJSON_TYPE_MASK) == YYJSON_TYPE_OBJ) { + goto obj_val_end; + } else { + goto arr_val_end; + } + +obj_begin: + /* push container */ + ctn->tag = (((u64)ctn_len + 1) << YYJSON_TAG_BIT) | + (ctn->tag & YYJSON_TAG_MASK); + val_incr(); + val->tag = YYJSON_TYPE_OBJ; + /* offset to the parent */ + val->uni.ofs = (usize)((u8 *)val - (u8 *)ctn); + ctn = val; + ctn_len = 0; + +obj_key_begin: + if (likely(*cur == '"')) { + val_incr(); + ctn_len++; + if (likely(read_string(&cur, end, inv, val, &msg))) goto obj_key_end; + goto fail_string; + } + if (likely(*cur == '}')) { + cur++; + if (likely(ctn_len == 0)) goto obj_end; + if (has_read_flag(ALLOW_TRAILING_COMMAS)) goto obj_end; + while (*cur != ',') cur--; + goto fail_trailing_comma; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto obj_key_begin; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto obj_key_begin; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +obj_key_end: + if (*cur == ':') { + cur++; + goto obj_val_begin; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto obj_key_end; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto obj_key_end; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +obj_val_begin: + if (*cur == '"') { + val++; + ctn_len++; + if (likely(read_string(&cur, end, inv, val, &msg))) goto obj_val_end; + goto fail_string; + } + if (char_is_number(*cur)) { + val++; + ctn_len++; + if (likely(read_number(&cur, pre, flg, val, &msg))) goto obj_val_end; + goto fail_number; + } + if (*cur == '{') { + cur++; + goto obj_begin; + } + if (*cur == '[') { + cur++; + goto arr_begin; + } + if (*cur == 't') { + val++; + ctn_len++; + if (likely(read_true(&cur, val))) goto obj_val_end; + goto fail_literal; + } + if (*cur == 'f') { + val++; + ctn_len++; + if (likely(read_false(&cur, val))) goto obj_val_end; + goto fail_literal; + } + if (*cur == 'n') { + val++; + ctn_len++; + if (likely(read_null(&cur, val))) goto obj_val_end; + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (read_nan(false, &cur, pre, val)) goto obj_val_end; + } + goto fail_literal; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto obj_val_begin; + } + if (has_read_flag(ALLOW_INF_AND_NAN) && + (*cur == 'i' || *cur == 'I' || *cur == 'N')) { + val++; + ctn_len++; + if (read_inf_or_nan(false, &cur, pre, val)) goto obj_val_end; + goto fail_character; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto obj_val_begin; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +obj_val_end: + if (likely(*cur == ',')) { + cur++; + goto obj_key_begin; + } + if (likely(*cur == '}')) { + cur++; + goto obj_end; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto obj_val_end; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto obj_val_end; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +obj_end: + /* pop container */ + ctn_parent = (yyjson_val *)(void *)((u8 *)ctn - ctn->uni.ofs); + /* point to the next value */ + ctn->uni.ofs = (usize)((u8 *)val - (u8 *)ctn) + sizeof(yyjson_val); + ctn->tag = (ctn_len << (YYJSON_TAG_BIT - 1)) | YYJSON_TYPE_OBJ; + if (unlikely(ctn == ctn_parent)) goto doc_end; + ctn = ctn_parent; + ctn_len = (usize)(ctn->tag >> YYJSON_TAG_BIT); + if ((ctn->tag & YYJSON_TYPE_MASK) == YYJSON_TYPE_OBJ) { + goto obj_val_end; + } else { + goto arr_val_end; + } + +doc_end: + /* check invalid contents after json document */ + if (unlikely(cur < end) && !has_read_flag(STOP_WHEN_DONE)) { + if (has_read_flag(ALLOW_COMMENTS)) { + skip_spaces_and_comments(&cur); + if (byte_match_2(cur, "/*")) goto fail_comment; + } else { + while (char_is_space(*cur)) cur++; + } + if (unlikely(cur < end)) goto fail_garbage; + } + + if (pre && *pre) **pre = '\0'; + doc = (yyjson_doc *)val_hdr; + doc->root = val_hdr + hdr_len; + doc->alc = alc; + doc->dat_read = (usize)(cur - hdr); + doc->val_read = (usize)((val - doc->root) + 1); + doc->str_pool = has_read_flag(INSITU) ? NULL : (char *)hdr; + return doc; + +fail_string: + return_err(cur, INVALID_STRING, msg); +fail_number: + return_err(cur, INVALID_NUMBER, msg); +fail_alloc: + return_err(cur, MEMORY_ALLOCATION, "memory allocation failed"); +fail_trailing_comma: + return_err(cur, JSON_STRUCTURE, "trailing comma is not allowed"); +fail_literal: + return_err(cur, LITERAL, "invalid literal"); +fail_comment: + return_err(cur, INVALID_COMMENT, "unclosed multiline comment"); +fail_character: + return_err(cur, UNEXPECTED_CHARACTER, "unexpected character"); +fail_garbage: + return_err(cur, UNEXPECTED_CONTENT, "unexpected content after document"); + +#undef val_incr +#undef return_err +} + +/** Read JSON document (accept all style, but optimized for pretty). */ +static_inline yyjson_doc *read_root_pretty(u8 *hdr, + u8 *cur, + u8 *end, + yyjson_alc alc, + yyjson_read_flag flg, + yyjson_read_err *err) { + +#define return_err(_pos, _code, _msg) do { \ + if (is_truncated_end(hdr, _pos, end, YYJSON_READ_ERROR_##_code, flg)) { \ + err->pos = (usize)(end - hdr); \ + err->code = YYJSON_READ_ERROR_UNEXPECTED_END; \ + err->msg = "unexpected end of data"; \ + } else { \ + err->pos = (usize)(_pos - hdr); \ + err->code = YYJSON_READ_ERROR_##_code; \ + err->msg = _msg; \ + } \ + if (val_hdr) alc.free(alc.ctx, (void *)val_hdr); \ + return NULL; \ +} while (false) + +#define val_incr() do { \ + val++; \ + if (unlikely(val >= val_end)) { \ + usize alc_old = alc_len; \ + alc_len += alc_len / 2; \ + if ((sizeof(usize) < 8) && (alc_len >= alc_max)) goto fail_alloc; \ + val_tmp = (yyjson_val *)alc.realloc(alc.ctx, (void *)val_hdr, \ + alc_old * sizeof(yyjson_val), \ + alc_len * sizeof(yyjson_val)); \ + if ((!val_tmp)) goto fail_alloc; \ + val = val_tmp + (usize)(val - val_hdr); \ + ctn = val_tmp + (usize)(ctn - val_hdr); \ + val_hdr = val_tmp; \ + val_end = val_tmp + (alc_len - 2); \ + } \ +} while (false) + + usize dat_len; /* data length in bytes, hint for allocator */ + usize hdr_len; /* value count used by yyjson_doc */ + usize alc_len; /* value count allocated */ + usize alc_max; /* maximum value count for allocator */ + usize ctn_len; /* the number of elements in current container */ + yyjson_val *val_hdr; /* the head of allocated values */ + yyjson_val *val_end; /* the end of allocated values */ + yyjson_val *val_tmp; /* temporary pointer for realloc */ + yyjson_val *val; /* current JSON value */ + yyjson_val *ctn; /* current container */ + yyjson_val *ctn_parent; /* parent of current container */ + yyjson_doc *doc; /* the JSON document, equals to val_hdr */ + const char *msg; /* error message */ + + bool raw; /* read number as raw */ + bool inv; /* allow invalid unicode */ + u8 *raw_end; /* raw end for null-terminator */ + u8 **pre; /* previous raw end pointer */ + + dat_len = has_read_flag(STOP_WHEN_DONE) ? 256 : (usize)(end - cur); + hdr_len = sizeof(yyjson_doc) / sizeof(yyjson_val); + hdr_len += (sizeof(yyjson_doc) % sizeof(yyjson_val)) > 0; + alc_max = USIZE_MAX / sizeof(yyjson_val); + alc_len = hdr_len + (dat_len / YYJSON_READER_ESTIMATED_PRETTY_RATIO) + 4; + alc_len = yyjson_min(alc_len, alc_max); + + val_hdr = (yyjson_val *)alc.malloc(alc.ctx, alc_len * sizeof(yyjson_val)); + if (unlikely(!val_hdr)) goto fail_alloc; + val_end = val_hdr + (alc_len - 2); /* padding for key-value pair reading */ + val = val_hdr + hdr_len; + ctn = val; + ctn_len = 0; + raw = has_read_flag(NUMBER_AS_RAW) || has_read_flag(BIGNUM_AS_RAW); + inv = has_read_flag(ALLOW_INVALID_UNICODE) != 0; + raw_end = NULL; + pre = raw ? &raw_end : NULL; + + if (*cur++ == '{') { + ctn->tag = YYJSON_TYPE_OBJ; + ctn->uni.ofs = 0; + if (*cur == '\n') cur++; + goto obj_key_begin; + } else { + ctn->tag = YYJSON_TYPE_ARR; + ctn->uni.ofs = 0; + if (*cur == '\n') cur++; + goto arr_val_begin; + } + +arr_begin: + /* save current container */ + ctn->tag = (((u64)ctn_len + 1) << YYJSON_TAG_BIT) | + (ctn->tag & YYJSON_TAG_MASK); + + /* create a new array value, save parent container offset */ + val_incr(); + val->tag = YYJSON_TYPE_ARR; + val->uni.ofs = (usize)((u8 *)val - (u8 *)ctn); + + /* push the new array value as current container */ + ctn = val; + ctn_len = 0; + if (*cur == '\n') cur++; + +arr_val_begin: +#if YYJSON_IS_REAL_GCC + while (true) repeat16({ + if (byte_match_2(cur, " ")) cur += 2; + else break; + }) +#else + while (true) repeat16({ + if (likely(byte_match_2(cur, " "))) cur += 2; + else break; + }) +#endif + + if (*cur == '{') { + cur++; + goto obj_begin; + } + if (*cur == '[') { + cur++; + goto arr_begin; + } + if (char_is_number(*cur)) { + val_incr(); + ctn_len++; + if (likely(read_number(&cur, pre, flg, val, &msg))) goto arr_val_end; + goto fail_number; + } + if (*cur == '"') { + val_incr(); + ctn_len++; + if (likely(read_string(&cur, end, inv, val, &msg))) goto arr_val_end; + goto fail_string; + } + if (*cur == 't') { + val_incr(); + ctn_len++; + if (likely(read_true(&cur, val))) goto arr_val_end; + goto fail_literal; + } + if (*cur == 'f') { + val_incr(); + ctn_len++; + if (likely(read_false(&cur, val))) goto arr_val_end; + goto fail_literal; + } + if (*cur == 'n') { + val_incr(); + ctn_len++; + if (likely(read_null(&cur, val))) goto arr_val_end; + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (read_nan(false, &cur, pre, val)) goto arr_val_end; + } + goto fail_literal; + } + if (*cur == ']') { + cur++; + if (likely(ctn_len == 0)) goto arr_end; + if (has_read_flag(ALLOW_TRAILING_COMMAS)) goto arr_end; + while (*cur != ',') cur--; + goto fail_trailing_comma; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto arr_val_begin; + } + if (has_read_flag(ALLOW_INF_AND_NAN) && + (*cur == 'i' || *cur == 'I' || *cur == 'N')) { + val_incr(); + ctn_len++; + if (read_inf_or_nan(false, &cur, pre, val)) goto arr_val_end; + goto fail_character; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto arr_val_begin; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +arr_val_end: + if (byte_match_2(cur, ",\n")) { + cur += 2; + goto arr_val_begin; + } + if (*cur == ',') { + cur++; + goto arr_val_begin; + } + if (*cur == ']') { + cur++; + goto arr_end; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto arr_val_end; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto arr_val_end; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +arr_end: + /* get parent container */ + ctn_parent = (yyjson_val *)(void *)((u8 *)ctn - ctn->uni.ofs); + + /* save the next sibling value offset */ + ctn->uni.ofs = (usize)((u8 *)val - (u8 *)ctn) + sizeof(yyjson_val); + ctn->tag = ((ctn_len) << YYJSON_TAG_BIT) | YYJSON_TYPE_ARR; + if (unlikely(ctn == ctn_parent)) goto doc_end; + + /* pop parent as current container */ + ctn = ctn_parent; + ctn_len = (usize)(ctn->tag >> YYJSON_TAG_BIT); + if (*cur == '\n') cur++; + if ((ctn->tag & YYJSON_TYPE_MASK) == YYJSON_TYPE_OBJ) { + goto obj_val_end; + } else { + goto arr_val_end; + } + +obj_begin: + /* push container */ + ctn->tag = (((u64)ctn_len + 1) << YYJSON_TAG_BIT) | + (ctn->tag & YYJSON_TAG_MASK); + val_incr(); + val->tag = YYJSON_TYPE_OBJ; + /* offset to the parent */ + val->uni.ofs = (usize)((u8 *)val - (u8 *)ctn); + ctn = val; + ctn_len = 0; + if (*cur == '\n') cur++; + +obj_key_begin: +#if YYJSON_IS_REAL_GCC + while (true) repeat16({ + if (byte_match_2(cur, " ")) cur += 2; + else break; + }) +#else + while (true) repeat16({ + if (likely(byte_match_2(cur, " "))) cur += 2; + else break; + }) +#endif + if (likely(*cur == '"')) { + val_incr(); + ctn_len++; + if (likely(read_string(&cur, end, inv, val, &msg))) goto obj_key_end; + goto fail_string; + } + if (likely(*cur == '}')) { + cur++; + if (likely(ctn_len == 0)) goto obj_end; + if (has_read_flag(ALLOW_TRAILING_COMMAS)) goto obj_end; + while (*cur != ',') cur--; + goto fail_trailing_comma; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto obj_key_begin; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto obj_key_begin; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +obj_key_end: + if (byte_match_2(cur, ": ")) { + cur += 2; + goto obj_val_begin; + } + if (*cur == ':') { + cur++; + goto obj_val_begin; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto obj_key_end; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto obj_key_end; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +obj_val_begin: + if (*cur == '"') { + val++; + ctn_len++; + if (likely(read_string(&cur, end, inv, val, &msg))) goto obj_val_end; + goto fail_string; + } + if (char_is_number(*cur)) { + val++; + ctn_len++; + if (likely(read_number(&cur, pre, flg, val, &msg))) goto obj_val_end; + goto fail_number; + } + if (*cur == '{') { + cur++; + goto obj_begin; + } + if (*cur == '[') { + cur++; + goto arr_begin; + } + if (*cur == 't') { + val++; + ctn_len++; + if (likely(read_true(&cur, val))) goto obj_val_end; + goto fail_literal; + } + if (*cur == 'f') { + val++; + ctn_len++; + if (likely(read_false(&cur, val))) goto obj_val_end; + goto fail_literal; + } + if (*cur == 'n') { + val++; + ctn_len++; + if (likely(read_null(&cur, val))) goto obj_val_end; + if (has_read_flag(ALLOW_INF_AND_NAN)) { + if (read_nan(false, &cur, pre, val)) goto obj_val_end; + } + goto fail_literal; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto obj_val_begin; + } + if (has_read_flag(ALLOW_INF_AND_NAN) && + (*cur == 'i' || *cur == 'I' || *cur == 'N')) { + val++; + ctn_len++; + if (read_inf_or_nan(false, &cur, pre, val)) goto obj_val_end; + goto fail_character; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto obj_val_begin; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +obj_val_end: + if (byte_match_2(cur, ",\n")) { + cur += 2; + goto obj_key_begin; + } + if (likely(*cur == ',')) { + cur++; + goto obj_key_begin; + } + if (likely(*cur == '}')) { + cur++; + goto obj_end; + } + if (char_is_space(*cur)) { + while (char_is_space(*++cur)); + goto obj_val_end; + } + if (has_read_flag(ALLOW_COMMENTS)) { + if (skip_spaces_and_comments(&cur)) goto obj_val_end; + if (byte_match_2(cur, "/*")) goto fail_comment; + } + goto fail_character; + +obj_end: + /* pop container */ + ctn_parent = (yyjson_val *)(void *)((u8 *)ctn - ctn->uni.ofs); + /* point to the next value */ + ctn->uni.ofs = (usize)((u8 *)val - (u8 *)ctn) + sizeof(yyjson_val); + ctn->tag = (ctn_len << (YYJSON_TAG_BIT - 1)) | YYJSON_TYPE_OBJ; + if (unlikely(ctn == ctn_parent)) goto doc_end; + ctn = ctn_parent; + ctn_len = (usize)(ctn->tag >> YYJSON_TAG_BIT); + if (*cur == '\n') cur++; + if ((ctn->tag & YYJSON_TYPE_MASK) == YYJSON_TYPE_OBJ) { + goto obj_val_end; + } else { + goto arr_val_end; + } + +doc_end: + /* check invalid contents after json document */ + if (unlikely(cur < end) && !has_read_flag(STOP_WHEN_DONE)) { + if (has_read_flag(ALLOW_COMMENTS)) { + skip_spaces_and_comments(&cur); + if (byte_match_2(cur, "/*")) goto fail_comment; + } else { + while (char_is_space(*cur)) cur++; + } + if (unlikely(cur < end)) goto fail_garbage; + } + + if (pre && *pre) **pre = '\0'; + doc = (yyjson_doc *)val_hdr; + doc->root = val_hdr + hdr_len; + doc->alc = alc; + doc->dat_read = (usize)(cur - hdr); + doc->val_read = (usize)((val - val_hdr)) - hdr_len + 1; + doc->str_pool = has_read_flag(INSITU) ? NULL : (char *)hdr; + return doc; + +fail_string: + return_err(cur, INVALID_STRING, msg); +fail_number: + return_err(cur, INVALID_NUMBER, msg); +fail_alloc: + return_err(cur, MEMORY_ALLOCATION, "memory allocation failed"); +fail_trailing_comma: + return_err(cur, JSON_STRUCTURE, "trailing comma is not allowed"); +fail_literal: + return_err(cur, LITERAL, "invalid literal"); +fail_comment: + return_err(cur, INVALID_COMMENT, "unclosed multiline comment"); +fail_character: + return_err(cur, UNEXPECTED_CHARACTER, "unexpected character"); +fail_garbage: + return_err(cur, UNEXPECTED_CONTENT, "unexpected content after document"); + +#undef val_incr +#undef return_err +} + + + +/*============================================================================== + * JSON Reader Entrance + *============================================================================*/ + +yyjson_doc *yyjson_read_opts(char *dat, + usize len, + yyjson_read_flag flg, + const yyjson_alc *alc_ptr, + yyjson_read_err *err) { + +#define return_err(_pos, _code, _msg) do { \ + err->pos = (usize)(_pos); \ + err->msg = _msg; \ + err->code = YYJSON_READ_ERROR_##_code; \ + if (!has_read_flag(INSITU) && hdr) alc.free(alc.ctx, (void *)hdr); \ + return NULL; \ +} while (false) + + yyjson_read_err dummy_err; + yyjson_alc alc; + yyjson_doc *doc; + u8 *hdr = NULL, *end, *cur; + + /* validate input parameters */ + if (!err) err = &dummy_err; + if (likely(!alc_ptr)) { + alc = YYJSON_DEFAULT_ALC; + } else { + alc = *alc_ptr; + } + if (unlikely(!dat)) { + return_err(0, INVALID_PARAMETER, "input data is NULL"); + } + if (unlikely(!len)) { + return_err(0, INVALID_PARAMETER, "input length is 0"); + } + + /* add 4-byte zero padding for input data if necessary */ + if (has_read_flag(INSITU)) { + hdr = (u8 *)dat; + end = (u8 *)dat + len; + cur = (u8 *)dat; + } else { + if (unlikely(len >= USIZE_MAX - YYJSON_PADDING_SIZE)) { + return_err(0, MEMORY_ALLOCATION, "memory allocation failed"); + } + hdr = (u8 *)alc.malloc(alc.ctx, len + YYJSON_PADDING_SIZE); + if (unlikely(!hdr)) { + return_err(0, MEMORY_ALLOCATION, "memory allocation failed"); + } + end = hdr + len; + cur = hdr; + memcpy(hdr, dat, len); + memset(end, 0, YYJSON_PADDING_SIZE); + } + + /* skip empty contents before json document */ + if (unlikely(char_is_space_or_comment(*cur))) { + if (has_read_flag(ALLOW_COMMENTS)) { + if (!skip_spaces_and_comments(&cur)) { + return_err(cur - hdr, INVALID_COMMENT, + "unclosed multiline comment"); + } + } else { + if (likely(char_is_space(*cur))) { + while (char_is_space(*++cur)); + } + } + if (unlikely(cur >= end)) { + return_err(0, EMPTY_CONTENT, "input data is empty"); + } + } + + /* read json document */ + if (likely(char_is_container(*cur))) { + if (char_is_space(cur[1]) && char_is_space(cur[2])) { + doc = read_root_pretty(hdr, cur, end, alc, flg, err); + } else { + doc = read_root_minify(hdr, cur, end, alc, flg, err); + } + } else { + doc = read_root_single(hdr, cur, end, alc, flg, err); + } + + /* check result */ + if (likely(doc)) { + memset(err, 0, sizeof(yyjson_read_err)); + } else { + /* RFC 8259: JSON text MUST be encoded using UTF-8 */ + if (err->pos == 0 && err->code != YYJSON_READ_ERROR_MEMORY_ALLOCATION) { + if ((hdr[0] == 0xEF && hdr[1] == 0xBB && hdr[2] == 0xBF)) { + err->msg = "byte order mark (BOM) is not supported"; + } else if (len >= 4 && + ((hdr[0] == 0x00 && hdr[1] == 0x00 && + hdr[2] == 0xFE && hdr[3] == 0xFF) || + (hdr[0] == 0xFF && hdr[1] == 0xFE && + hdr[2] == 0x00 && hdr[3] == 0x00))) { + err->msg = "UTF-32 encoding is not supported"; + } else if (len >= 2 && + ((hdr[0] == 0xFE && hdr[1] == 0xFF) || + (hdr[0] == 0xFF && hdr[1] == 0xFE))) { + err->msg = "UTF-16 encoding is not supported"; + } + } + if (!has_read_flag(INSITU)) alc.free(alc.ctx, (void *)hdr); + } + return doc; + +#undef return_err +} + +yyjson_doc *yyjson_read_file(const char *path, + yyjson_read_flag flg, + const yyjson_alc *alc_ptr, + yyjson_read_err *err) { +#define return_err(_code, _msg) do { \ + err->pos = 0; \ + err->msg = _msg; \ + err->code = YYJSON_READ_ERROR_##_code; \ + return NULL; \ +} while (false) + + yyjson_read_err dummy_err; + yyjson_doc *doc; + FILE *file; + + if (!err) err = &dummy_err; + if (unlikely(!path)) return_err(INVALID_PARAMETER, "input path is NULL"); + + file = fopen_readonly(path); + if (unlikely(!file)) return_err(FILE_OPEN, "file opening failed"); + + doc = yyjson_read_fp(file, flg, alc_ptr, err); + fclose(file); + return doc; + +#undef return_err +} + +yyjson_doc *yyjson_read_fp(FILE *file, + yyjson_read_flag flg, + const yyjson_alc *alc_ptr, + yyjson_read_err *err) { +#define return_err(_code, _msg) do { \ + err->pos = 0; \ + err->msg = _msg; \ + err->code = YYJSON_READ_ERROR_##_code; \ + if (buf) alc.free(alc.ctx, buf); \ + return NULL; \ +} while (false) + + yyjson_read_err dummy_err; + yyjson_alc alc = alc_ptr ? *alc_ptr : YYJSON_DEFAULT_ALC; + yyjson_doc *doc; + + long file_size = 0, file_pos; + void *buf = NULL; + usize buf_size = 0; + + /* validate input parameters */ + if (!err) err = &dummy_err; + if (unlikely(!file)) return_err(INVALID_PARAMETER, "input file is NULL"); + + /* get current position */ + file_pos = ftell(file); + if (file_pos != -1) { + /* get total file size, may fail */ + if (fseek(file, 0, SEEK_END) == 0) file_size = ftell(file); + /* reset to original position, may fail */ + if (fseek(file, file_pos, SEEK_SET) != 0) file_size = 0; + /* get file size from current postion to end */ + if (file_size > 0) file_size -= file_pos; + } + + /* read file */ + if (file_size > 0) { + /* read the entire file in one call */ + buf_size = (usize)file_size + YYJSON_PADDING_SIZE; + buf = alc.malloc(alc.ctx, buf_size); + if (buf == NULL) { + return_err(MEMORY_ALLOCATION, "fail to alloc memory"); + } + if (fread_safe(buf, (usize)file_size, file) != (usize)file_size) { + return_err(FILE_READ, "file reading failed"); + } + } else { + /* failed to get file size, read it as a stream */ + usize chunk_min = (usize)64; + usize chunk_max = (usize)512 * 1024 * 1024; + usize chunk_now = chunk_min; + usize read_size; + void *tmp; + + buf_size = YYJSON_PADDING_SIZE; + while (true) { + if (buf_size + chunk_now < buf_size) { /* overflow */ + return_err(MEMORY_ALLOCATION, "fail to alloc memory"); + } + buf_size += chunk_now; + if (!buf) { + buf = alc.malloc(alc.ctx, buf_size); + if (!buf) return_err(MEMORY_ALLOCATION, "fail to alloc memory"); + } else { + tmp = alc.realloc(alc.ctx, buf, buf_size - chunk_now, buf_size); + if (!tmp) return_err(MEMORY_ALLOCATION, "fail to alloc memory"); + buf = tmp; + } + tmp = ((u8 *)buf) + buf_size - YYJSON_PADDING_SIZE - chunk_now; + read_size = fread_safe(tmp, chunk_now, file); + file_size += (long)read_size; + if (read_size != chunk_now) break; + + chunk_now *= 2; + if (chunk_now > chunk_max) chunk_now = chunk_max; + } + } + + /* read JSON */ + memset((u8 *)buf + file_size, 0, YYJSON_PADDING_SIZE); + flg |= YYJSON_READ_INSITU; + doc = yyjson_read_opts((char *)buf, (usize)file_size, flg, &alc, err); + if (doc) { + doc->str_pool = (char *)buf; + return doc; + } else { + alc.free(alc.ctx, buf); + return NULL; + } + +#undef return_err +} + +const char *yyjson_read_number(const char *dat, + yyjson_val *val, + yyjson_read_flag flg, + const yyjson_alc *alc, + yyjson_read_err *err) { +#define return_err(_pos, _code, _msg) do { \ + err->pos = _pos > hdr ? (usize)(_pos - hdr) : 0; \ + err->msg = _msg; \ + err->code = YYJSON_READ_ERROR_##_code; \ + return NULL; \ +} while (false) + + u8 *hdr = constcast(u8 *)dat, *cur = hdr; + bool raw; /* read number as raw */ + u8 *raw_end; /* raw end for null-terminator */ + u8 **pre; /* previous raw end pointer */ + const char *msg; + yyjson_read_err dummy_err; + +#if !YYJSON_HAS_IEEE_754 || YYJSON_DISABLE_FAST_FP_CONV + u8 buf[128]; + usize dat_len; +#endif + + if (!err) err = &dummy_err; + if (unlikely(!dat)) { + return_err(cur, INVALID_PARAMETER, "input data is NULL"); + } + if (unlikely(!val)) { + return_err(cur, INVALID_PARAMETER, "output value is NULL"); + } + +#if !YYJSON_HAS_IEEE_754 || YYJSON_DISABLE_FAST_FP_CONV + if (!alc) alc = &YYJSON_DEFAULT_ALC; + dat_len = strlen(dat); + if (dat_len < sizeof(buf)) { + memcpy(buf, dat, dat_len + 1); + hdr = buf; + cur = hdr; + } else { + hdr = (u8 *)alc->malloc(alc->ctx, dat_len + 1); + cur = hdr; + if (unlikely(!hdr)) { + return_err(cur, MEMORY_ALLOCATION, "memory allocation failed"); + } + memcpy(hdr, dat, dat_len + 1); + } + hdr[dat_len] = 0; +#endif + + raw = (flg & (YYJSON_READ_NUMBER_AS_RAW | YYJSON_READ_BIGNUM_AS_RAW)) != 0; + raw_end = NULL; + pre = raw ? &raw_end : NULL; + +#if !YYJSON_HAS_IEEE_754 || YYJSON_DISABLE_FAST_FP_CONV + if (!read_number(&cur, pre, flg, val, &msg)) { + if (dat_len >= sizeof(buf)) alc->free(alc->ctx, hdr); + return_err(cur, INVALID_NUMBER, msg); + } + if (dat_len >= sizeof(buf)) alc->free(alc->ctx, hdr); + if (yyjson_is_raw(val)) val->uni.str = dat; + return dat + (cur - hdr); +#else + if (!read_number(&cur, pre, flg, val, &msg)) { + return_err(cur, INVALID_NUMBER, msg); + } + return (const char *)cur; +#endif + +#undef return_err +} + +#endif /* YYJSON_DISABLE_READER */ + + + +#if !YYJSON_DISABLE_WRITER + +/*============================================================================== + * Integer Writer + * + * The maximum value of uint32_t is 4294967295 (10 digits), + * these digits are named as 'aabbccddee' here. + * + * Although most compilers may convert the "division by constant value" into + * "multiply and shift", manual conversion can still help some compilers + * generate fewer and better instructions. + * + * Reference: + * Division by Invariant Integers using Multiplication, 1994. + * https://gmplib.org/~tege/divcnst-pldi94.pdf + * Improved division by invariant integers, 2011. + * https://gmplib.org/~tege/division-paper.pdf + *============================================================================*/ + +/** Digit table from 00 to 99. */ +yyjson_align(2) +static const char digit_table[200] = { + '0', '0', '0', '1', '0', '2', '0', '3', '0', '4', + '0', '5', '0', '6', '0', '7', '0', '8', '0', '9', + '1', '0', '1', '1', '1', '2', '1', '3', '1', '4', + '1', '5', '1', '6', '1', '7', '1', '8', '1', '9', + '2', '0', '2', '1', '2', '2', '2', '3', '2', '4', + '2', '5', '2', '6', '2', '7', '2', '8', '2', '9', + '3', '0', '3', '1', '3', '2', '3', '3', '3', '4', + '3', '5', '3', '6', '3', '7', '3', '8', '3', '9', + '4', '0', '4', '1', '4', '2', '4', '3', '4', '4', + '4', '5', '4', '6', '4', '7', '4', '8', '4', '9', + '5', '0', '5', '1', '5', '2', '5', '3', '5', '4', + '5', '5', '5', '6', '5', '7', '5', '8', '5', '9', + '6', '0', '6', '1', '6', '2', '6', '3', '6', '4', + '6', '5', '6', '6', '6', '7', '6', '8', '6', '9', + '7', '0', '7', '1', '7', '2', '7', '3', '7', '4', + '7', '5', '7', '6', '7', '7', '7', '8', '7', '9', + '8', '0', '8', '1', '8', '2', '8', '3', '8', '4', + '8', '5', '8', '6', '8', '7', '8', '8', '8', '9', + '9', '0', '9', '1', '9', '2', '9', '3', '9', '4', + '9', '5', '9', '6', '9', '7', '9', '8', '9', '9' +}; + +static_inline u8 *write_u32_len_8(u32 val, u8 *buf) { + u32 aa, bb, cc, dd, aabb, ccdd; /* 8 digits: aabbccdd */ + aabb = (u32)(((u64)val * 109951163) >> 40); /* (val / 10000) */ + ccdd = val - aabb * 10000; /* (val % 10000) */ + aa = (aabb * 5243) >> 19; /* (aabb / 100) */ + cc = (ccdd * 5243) >> 19; /* (ccdd / 100) */ + bb = aabb - aa * 100; /* (aabb % 100) */ + dd = ccdd - cc * 100; /* (ccdd % 100) */ + byte_copy_2(buf + 0, digit_table + aa * 2); + byte_copy_2(buf + 2, digit_table + bb * 2); + byte_copy_2(buf + 4, digit_table + cc * 2); + byte_copy_2(buf + 6, digit_table + dd * 2); + return buf + 8; +} + +static_inline u8 *write_u32_len_4(u32 val, u8 *buf) { + u32 aa, bb; /* 4 digits: aabb */ + aa = (val * 5243) >> 19; /* (val / 100) */ + bb = val - aa * 100; /* (val % 100) */ + byte_copy_2(buf + 0, digit_table + aa * 2); + byte_copy_2(buf + 2, digit_table + bb * 2); + return buf + 4; +} + +static_inline u8 *write_u32_len_1_8(u32 val, u8 *buf) { + u32 aa, bb, cc, dd, aabb, bbcc, ccdd, lz; + + if (val < 100) { /* 1-2 digits: aa */ + lz = val < 10; /* leading zero: 0 or 1 */ + byte_copy_2(buf + 0, digit_table + val * 2 + lz); + buf -= lz; + return buf + 2; + + } else if (val < 10000) { /* 3-4 digits: aabb */ + aa = (val * 5243) >> 19; /* (val / 100) */ + bb = val - aa * 100; /* (val % 100) */ + lz = aa < 10; /* leading zero: 0 or 1 */ + byte_copy_2(buf + 0, digit_table + aa * 2 + lz); + buf -= lz; + byte_copy_2(buf + 2, digit_table + bb * 2); + return buf + 4; + + } else if (val < 1000000) { /* 5-6 digits: aabbcc */ + aa = (u32)(((u64)val * 429497) >> 32); /* (val / 10000) */ + bbcc = val - aa * 10000; /* (val % 10000) */ + bb = (bbcc * 5243) >> 19; /* (bbcc / 100) */ + cc = bbcc - bb * 100; /* (bbcc % 100) */ + lz = aa < 10; /* leading zero: 0 or 1 */ + byte_copy_2(buf + 0, digit_table + aa * 2 + lz); + buf -= lz; + byte_copy_2(buf + 2, digit_table + bb * 2); + byte_copy_2(buf + 4, digit_table + cc * 2); + return buf + 6; + + } else { /* 7-8 digits: aabbccdd */ + aabb = (u32)(((u64)val * 109951163) >> 40); /* (val / 10000) */ + ccdd = val - aabb * 10000; /* (val % 10000) */ + aa = (aabb * 5243) >> 19; /* (aabb / 100) */ + cc = (ccdd * 5243) >> 19; /* (ccdd / 100) */ + bb = aabb - aa * 100; /* (aabb % 100) */ + dd = ccdd - cc * 100; /* (ccdd % 100) */ + lz = aa < 10; /* leading zero: 0 or 1 */ + byte_copy_2(buf + 0, digit_table + aa * 2 + lz); + buf -= lz; + byte_copy_2(buf + 2, digit_table + bb * 2); + byte_copy_2(buf + 4, digit_table + cc * 2); + byte_copy_2(buf + 6, digit_table + dd * 2); + return buf + 8; + } +} + +static_inline u8 *write_u64_len_5_8(u32 val, u8 *buf) { + u32 aa, bb, cc, dd, aabb, bbcc, ccdd, lz; + + if (val < 1000000) { /* 5-6 digits: aabbcc */ + aa = (u32)(((u64)val * 429497) >> 32); /* (val / 10000) */ + bbcc = val - aa * 10000; /* (val % 10000) */ + bb = (bbcc * 5243) >> 19; /* (bbcc / 100) */ + cc = bbcc - bb * 100; /* (bbcc % 100) */ + lz = aa < 10; /* leading zero: 0 or 1 */ + byte_copy_2(buf + 0, digit_table + aa * 2 + lz); + buf -= lz; + byte_copy_2(buf + 2, digit_table + bb * 2); + byte_copy_2(buf + 4, digit_table + cc * 2); + return buf + 6; + + } else { /* 7-8 digits: aabbccdd */ + aabb = (u32)(((u64)val * 109951163) >> 40); /* (val / 10000) */ + ccdd = val - aabb * 10000; /* (val % 10000) */ + aa = (aabb * 5243) >> 19; /* (aabb / 100) */ + cc = (ccdd * 5243) >> 19; /* (ccdd / 100) */ + bb = aabb - aa * 100; /* (aabb % 100) */ + dd = ccdd - cc * 100; /* (ccdd % 100) */ + lz = aa < 10; /* leading zero: 0 or 1 */ + byte_copy_2(buf + 0, digit_table + aa * 2 + lz); + buf -= lz; + byte_copy_2(buf + 2, digit_table + bb * 2); + byte_copy_2(buf + 4, digit_table + cc * 2); + byte_copy_2(buf + 6, digit_table + dd * 2); + return buf + 8; + } +} + +static_inline u8 *write_u64(u64 val, u8 *buf) { + u64 tmp, hgh; + u32 mid, low; + + if (val < 100000000) { /* 1-8 digits */ + buf = write_u32_len_1_8((u32)val, buf); + return buf; + + } else if (val < (u64)100000000 * 100000000) { /* 9-16 digits */ + hgh = val / 100000000; /* (val / 100000000) */ + low = (u32)(val - hgh * 100000000); /* (val % 100000000) */ + buf = write_u32_len_1_8((u32)hgh, buf); + buf = write_u32_len_8(low, buf); + return buf; + + } else { /* 17-20 digits */ + tmp = val / 100000000; /* (val / 100000000) */ + low = (u32)(val - tmp * 100000000); /* (val % 100000000) */ + hgh = (u32)(tmp / 10000); /* (tmp / 10000) */ + mid = (u32)(tmp - hgh * 10000); /* (tmp % 10000) */ + buf = write_u64_len_5_8((u32)hgh, buf); + buf = write_u32_len_4(mid, buf); + buf = write_u32_len_8(low, buf); + return buf; + } +} + + + +/*============================================================================== + * Number Writer + *============================================================================*/ + +#if YYJSON_HAS_IEEE_754 && !YYJSON_DISABLE_FAST_FP_CONV /* FP_WRITER */ + +/** Trailing zero count table for number 0 to 99. + (generate with misc/make_tables.c) */ +static const u8 dec_trailing_zero_table[] = { + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/** Write an unsigned integer with a length of 1 to 16. */ +static_inline u8 *write_u64_len_1_to_16(u64 val, u8 *buf) { + u64 hgh; + u32 low; + if (val < 100000000) { /* 1-8 digits */ + buf = write_u32_len_1_8((u32)val, buf); + return buf; + } else { /* 9-16 digits */ + hgh = val / 100000000; /* (val / 100000000) */ + low = (u32)(val - hgh * 100000000); /* (val % 100000000) */ + buf = write_u32_len_1_8((u32)hgh, buf); + buf = write_u32_len_8(low, buf); + return buf; + } +} + +/** Write an unsigned integer with a length of 1 to 17. */ +static_inline u8 *write_u64_len_1_to_17(u64 val, u8 *buf) { + u64 hgh; + u32 mid, low, one; + if (val >= (u64)100000000 * 10000000) { /* len: 16 to 17 */ + hgh = val / 100000000; /* (val / 100000000) */ + low = (u32)(val - hgh * 100000000); /* (val % 100000000) */ + one = (u32)(hgh / 100000000); /* (hgh / 100000000) */ + mid = (u32)(hgh - (u64)one * 100000000); /* (hgh % 100000000) */ + *buf = (u8)((u8)one + (u8)'0'); + buf += one > 0; + buf = write_u32_len_8(mid, buf); + buf = write_u32_len_8(low, buf); + return buf; + } else if (val >= (u64)100000000){ /* len: 9 to 15 */ + hgh = val / 100000000; /* (val / 100000000) */ + low = (u32)(val - hgh * 100000000); /* (val % 100000000) */ + buf = write_u32_len_1_8((u32)hgh, buf); + buf = write_u32_len_8(low, buf); + return buf; + } else { /* len: 1 to 8 */ + buf = write_u32_len_1_8((u32)val, buf); + return buf; + } +} + +/** + Write an unsigned integer with a length of 15 to 17 with trailing zero trimmed. + These digits are named as "aabbccddeeffgghhii" here. + For example, input 1234567890123000, output "1234567890123". + */ +static_inline u8 *write_u64_len_15_to_17_trim(u8 *buf, u64 sig) { + bool lz; /* leading zero */ + u32 tz1, tz2, tz; /* trailing zero */ + + u32 abbccddee = (u32)(sig / 100000000); + u32 ffgghhii = (u32)(sig - (u64)abbccddee * 100000000); + u32 abbcc = abbccddee / 10000; /* (abbccddee / 10000) */ + u32 ddee = abbccddee - abbcc * 10000; /* (abbccddee % 10000) */ + u32 abb = (u32)(((u64)abbcc * 167773) >> 24); /* (abbcc / 100) */ + u32 a = (abb * 41) >> 12; /* (abb / 100) */ + u32 bb = abb - a * 100; /* (abb % 100) */ + u32 cc = abbcc - abb * 100; /* (abbcc % 100) */ + + /* write abbcc */ + buf[0] = (u8)(a + '0'); + buf += a > 0; + lz = bb < 10 && a == 0; + byte_copy_2(buf + 0, digit_table + bb * 2 + lz); + buf -= lz; + byte_copy_2(buf + 2, digit_table + cc * 2); + + if (ffgghhii) { + u32 dd = (ddee * 5243) >> 19; /* (ddee / 100) */ + u32 ee = ddee - dd * 100; /* (ddee % 100) */ + u32 ffgg = (u32)(((u64)ffgghhii * 109951163) >> 40); /* (val / 10000) */ + u32 hhii = ffgghhii - ffgg * 10000; /* (val % 10000) */ + u32 ff = (ffgg * 5243) >> 19; /* (aabb / 100) */ + u32 gg = ffgg - ff * 100; /* (aabb % 100) */ + byte_copy_2(buf + 4, digit_table + dd * 2); + byte_copy_2(buf + 6, digit_table + ee * 2); + byte_copy_2(buf + 8, digit_table + ff * 2); + byte_copy_2(buf + 10, digit_table + gg * 2); + if (hhii) { + u32 hh = (hhii * 5243) >> 19; /* (ccdd / 100) */ + u32 ii = hhii - hh * 100; /* (ccdd % 100) */ + byte_copy_2(buf + 12, digit_table + hh * 2); + byte_copy_2(buf + 14, digit_table + ii * 2); + tz1 = dec_trailing_zero_table[hh]; + tz2 = dec_trailing_zero_table[ii]; + tz = ii ? tz2 : (tz1 + 2); + buf += 16 - tz; + return buf; + } else { + tz1 = dec_trailing_zero_table[ff]; + tz2 = dec_trailing_zero_table[gg]; + tz = gg ? tz2 : (tz1 + 2); + buf += 12 - tz; + return buf; + } + } else { + if (ddee) { + u32 dd = (ddee * 5243) >> 19; /* (ddee / 100) */ + u32 ee = ddee - dd * 100; /* (ddee % 100) */ + byte_copy_2(buf + 4, digit_table + dd * 2); + byte_copy_2(buf + 6, digit_table + ee * 2); + tz1 = dec_trailing_zero_table[dd]; + tz2 = dec_trailing_zero_table[ee]; + tz = ee ? tz2 : (tz1 + 2); + buf += 8 - tz; + return buf; + } else { + tz1 = dec_trailing_zero_table[bb]; + tz2 = dec_trailing_zero_table[cc]; + tz = cc ? tz2 : (tz1 + tz2); + buf += 4 - tz; + return buf; + } + } +} + +/** Write a signed integer in the range -324 to 308. */ +static_inline u8 *write_f64_exp(i32 exp, u8 *buf) { + buf[0] = '-'; + buf += exp < 0; + exp = exp < 0 ? -exp : exp; + if (exp < 100) { + u32 lz = exp < 10; + byte_copy_2(buf + 0, digit_table + (u32)exp * 2 + lz); + return buf + 2 - lz; + } else { + u32 hi = ((u32)exp * 656) >> 16; /* exp / 100 */ + u32 lo = (u32)exp - hi * 100; /* exp % 100 */ + buf[0] = (u8)((u8)hi + (u8)'0'); + byte_copy_2(buf + 1, digit_table + lo * 2); + return buf + 3; + } +} + +/** Multiplies 128-bit integer and returns highest 64-bit rounded value. */ +static_inline u64 round_to_odd(u64 hi, u64 lo, u64 cp) { + u64 x_hi, x_lo, y_hi, y_lo; + u128_mul(cp, lo, &x_hi, &x_lo); + u128_mul_add(cp, hi, x_hi, &y_hi, &y_lo); + return y_hi | (y_lo > 1); +} + +/** + Convert double number from binary to decimal. + The output significand is shortest decimal but may have trailing zeros. + + This function use the Schubfach algorithm: + Raffaello Giulietti, The Schubfach way to render doubles (5th version), 2022. + https://drive.google.com/file/d/1gp5xv4CAa78SVgCeWfGqqI4FfYYYuNFb + https://mail.openjdk.java.net/pipermail/core-libs-dev/2021-November/083536.html + https://github.com/openjdk/jdk/pull/3402 (Java implementation) + https://github.com/abolz/Drachennest (C++ implementation) + + See also: + Dragonbox: A New Floating-Point Binary-to-Decimal Conversion Algorithm, 2022. + https://github.com/jk-jeon/dragonbox/blob/master/other_files/Dragonbox.pdf + https://github.com/jk-jeon/dragonbox + + @param sig_raw The raw value of significand in IEEE 754 format. + @param exp_raw The raw value of exponent in IEEE 754 format. + @param sig_bin The decoded value of significand in binary. + @param exp_bin The decoded value of exponent in binary. + @param sig_dec The output value of significand in decimal. + @param exp_dec The output value of exponent in decimal. + @warning The input double number should not be 0, inf, nan. + */ +static_inline void f64_bin_to_dec(u64 sig_raw, u32 exp_raw, + u64 sig_bin, i32 exp_bin, + u64 *sig_dec, i32 *exp_dec) { + + bool is_even, regular_spacing, u_inside, w_inside, round_up; + u64 s, sp, cb, cbl, cbr, vb, vbl, vbr, pow10hi, pow10lo, upper, lower, mid; + i32 k, h, exp10; + + is_even = !(sig_bin & 1); + regular_spacing = (sig_raw == 0 && exp_raw > 1); + + cbl = 4 * sig_bin - 2 + regular_spacing; + cb = 4 * sig_bin; + cbr = 4 * sig_bin + 2; + + /* exp_bin: [-1074, 971] */ + /* k = regular_spacing ? floor(log10(pow(2, exp_bin))) */ + /* : floor(log10(pow(2, exp_bin) * 3.0 / 4.0)) */ + /* = regular_spacing ? floor(exp_bin * log10(2)) */ + /* : floor(exp_bin * log10(2) + log10(3.0 / 4.0)) */ + k = (i32)(exp_bin * 315653 - (regular_spacing ? 131237 : 0)) >> 20; + + /* k: [-324, 292] */ + /* h = exp_bin + floor(log2(pow(10, e))) */ + /* = exp_bin + floor(log2(10) * e) */ + exp10 = -k; + h = exp_bin + ((exp10 * 217707) >> 16) + 1; + + pow10_table_get_sig(exp10, &pow10hi, &pow10lo); + pow10lo += (exp10 < POW10_SIG_TABLE_MIN_EXACT_EXP || + exp10 > POW10_SIG_TABLE_MAX_EXACT_EXP); + vbl = round_to_odd(pow10hi, pow10lo, cbl << h); + vb = round_to_odd(pow10hi, pow10lo, cb << h); + vbr = round_to_odd(pow10hi, pow10lo, cbr << h); + + lower = vbl + !is_even; + upper = vbr - !is_even; + + s = vb / 4; + if (s >= 10) { + sp = s / 10; + u_inside = (lower <= 40 * sp); + w_inside = (upper >= 40 * sp + 40); + if (u_inside != w_inside) { + *sig_dec = sp + w_inside; + *exp_dec = k + 1; + return; + } + } + + u_inside = (lower <= 4 * s); + w_inside = (upper >= 4 * s + 4); + + mid = 4 * s + 2; + round_up = (vb > mid) || (vb == mid && (s & 1) != 0); + + *sig_dec = s + ((u_inside != w_inside) ? w_inside : round_up); + *exp_dec = k; +} + +/** + Write a double number (requires 32 bytes buffer). + + We follows the ECMAScript specification to print floating point numbers, + but with the following changes: + 1. Keep the negative sign of 0.0 to preserve input information. + 2. Keep decimal point to indicate the number is floating point. + 3. Remove positive sign of exponent part. + */ +static_inline u8 *write_f64_raw(u8 *buf, u64 raw, yyjson_write_flag flg) { + u64 sig_bin, sig_dec, sig_raw; + i32 exp_bin, exp_dec, sig_len, dot_pos, i, max; + u32 exp_raw, hi, lo; + u8 *hdr, *num_hdr, *num_end, *dot_end; + bool sign; + + /* decode raw bytes from IEEE-754 double format. */ + sign = (bool)(raw >> (F64_BITS - 1)); + sig_raw = raw & F64_SIG_MASK; + exp_raw = (u32)((raw & F64_EXP_MASK) >> F64_SIG_BITS); + + /* return inf and nan */ + if (unlikely(exp_raw == ((u32)1 << F64_EXP_BITS) - 1)) { + if (has_write_flag(INF_AND_NAN_AS_NULL)) { + byte_copy_4(buf, "null"); + return buf + 4; + } + else if (has_write_flag(ALLOW_INF_AND_NAN)) { + if (sig_raw == 0) { + buf[0] = '-'; + buf += sign; + byte_copy_8(buf, "Infinity"); + buf += 8; + return buf; + } else { + byte_copy_4(buf, "NaN"); + return buf + 3; + } + } + return NULL; + } + + /* add sign for all finite double value, including 0.0 and inf */ + buf[0] = '-'; + buf += sign; + hdr = buf; + + /* return zero */ + if ((raw << 1) == 0) { + byte_copy_4(buf, "0.0"); + buf += 3; + return buf; + } + + if (likely(exp_raw != 0)) { + /* normal number */ + sig_bin = sig_raw | ((u64)1 << F64_SIG_BITS); + exp_bin = (i32)exp_raw - F64_EXP_BIAS - F64_SIG_BITS; + + /* fast path for small integer number without fraction */ + if (-F64_SIG_BITS <= exp_bin && exp_bin <= 0) { + if (u64_tz_bits(sig_bin) >= (u32)-exp_bin) { + /* number is integer in range 1 to 0x1FFFFFFFFFFFFF */ + sig_dec = sig_bin >> -exp_bin; + buf = write_u64_len_1_to_16(sig_dec, buf); + byte_copy_2(buf, ".0"); + buf += 2; + return buf; + } + } + + /* binary to decimal */ + f64_bin_to_dec(sig_raw, exp_raw, sig_bin, exp_bin, &sig_dec, &exp_dec); + + /* the sig length is 15 to 17 */ + sig_len = 17; + sig_len -= (sig_dec < (u64)100000000 * 100000000); + sig_len -= (sig_dec < (u64)100000000 * 10000000); + + /* the decimal point position relative to the first digit */ + dot_pos = sig_len + exp_dec; + + if (-6 < dot_pos && dot_pos <= 21) { + /* no need to write exponent part */ + if (dot_pos <= 0) { + /* dot before first digit */ + /* such as 0.1234, 0.000001234 */ + num_hdr = hdr + (2 - dot_pos); + num_end = write_u64_len_15_to_17_trim(num_hdr, sig_dec); + hdr[0] = '0'; + hdr[1] = '.'; + hdr += 2; + max = -dot_pos; + for (i = 0; i < max; i++) hdr[i] = '0'; + return num_end; + } else { + /* dot after first digit */ + /* such as 1.234, 1234.0, 123400000000000000000.0 */ + memset(hdr + 0, '0', 8); + memset(hdr + 8, '0', 8); + memset(hdr + 16, '0', 8); + num_hdr = hdr + 1; + num_end = write_u64_len_15_to_17_trim(num_hdr, sig_dec); + for (i = 0; i < dot_pos; i++) hdr[i] = hdr[i + 1]; + hdr[dot_pos] = '.'; + dot_end = hdr + dot_pos + 2; + return dot_end < num_end ? num_end : dot_end; + } + } else { + /* write with scientific notation */ + /* such as 1.234e56 */ + u8 *end = write_u64_len_15_to_17_trim(buf + 1, sig_dec); + end -= (end == buf + 2); /* remove '.0', e.g. 2.0e34 -> 2e34 */ + exp_dec += sig_len - 1; + hdr[0] = hdr[1]; + hdr[1] = '.'; + end[0] = 'e'; + buf = write_f64_exp(exp_dec, end + 1); + return buf; + } + + } else { + /* subnormal number */ + sig_bin = sig_raw; + exp_bin = 1 - F64_EXP_BIAS - F64_SIG_BITS; + + /* binary to decimal */ + f64_bin_to_dec(sig_raw, exp_raw, sig_bin, exp_bin, &sig_dec, &exp_dec); + + /* write significand part */ + buf = write_u64_len_1_to_17(sig_dec, buf + 1); + hdr[0] = hdr[1]; + hdr[1] = '.'; + do { + buf--; + exp_dec++; + } while (*buf == '0'); + exp_dec += (i32)(buf - hdr - 2); + buf += (*buf != '.'); + buf[0] = 'e'; + buf++; + + /* write exponent part */ + buf[0] = '-'; + buf++; + exp_dec = -exp_dec; + hi = ((u32)exp_dec * 656) >> 16; /* exp / 100 */ + lo = (u32)exp_dec - hi * 100; /* exp % 100 */ + buf[0] = (u8)((u8)hi + (u8)'0'); + byte_copy_2(buf + 1, digit_table + lo * 2); + buf += 3; + return buf; + } +} + +#else /* FP_WRITER */ + +/** Write a double number (requires 32 bytes buffer). */ +static_inline u8 *write_f64_raw(u8 *buf, u64 raw, yyjson_write_flag flg) { + /* + For IEEE 754, `DBL_DECIMAL_DIG` is 17 for round-trip. + For non-IEEE formats, 17 is used to avoid buffer overflow, + round-trip is not guaranteed. + */ +#if defined(DBL_DECIMAL_DIG) && DBL_DECIMAL_DIG != 17 + int dig = DBL_DECIMAL_DIG > 17 ? 17 : DBL_DECIMAL_DIG; +#else + int dig = 17; +#endif + + /* + The snprintf() function is locale-dependent. For currently known locales, + (en, zh, ja, ko, am, he, hi) use '.' as the decimal point, while other + locales use ',' as the decimal point. we need to replace ',' with '.' + to avoid the locale setting. + */ + f64 val = f64_from_raw(raw); +#if YYJSON_MSC_VER >= 1400 + int len = sprintf_s((char *)buf, 32, "%.*g", dig, val); +#elif defined(snprintf) || (YYJSON_STDC_VER >= 199901L) + int len = snprintf((char *)buf, 32, "%.*g", dig, val); +#else + int len = sprintf((char *)buf, "%.*g", dig, val); +#endif + + u8 *cur = buf; + if (unlikely(len < 1)) return NULL; + cur += (*cur == '-'); + if (unlikely(!digi_is_digit(*cur))) { + /* nan, inf, or bad output */ + if (has_write_flag(INF_AND_NAN_AS_NULL)) { + byte_copy_4(buf, "null"); + return buf + 4; + } + else if (has_write_flag(ALLOW_INF_AND_NAN)) { + if (*cur == 'i') { + byte_copy_8(cur, "Infinity"); + cur += 8; + return cur; + } else if (*cur == 'n') { + byte_copy_4(buf, "NaN"); + return buf + 3; + } + } + return NULL; + } else { + /* finite number */ + int i = 0; + bool fp = false; + for (; i < len; i++) { + if (buf[i] == ',') buf[i] = '.'; + if (digi_is_fp((u8)buf[i])) fp = true; + } + if (!fp) { + buf[len++] = '.'; + buf[len++] = '0'; + } + } + return buf + len; +} + +#endif /* FP_WRITER */ + +/** Write a JSON number (requires 32 bytes buffer). */ +static_inline u8 *write_number(u8 *cur, yyjson_val *val, + yyjson_write_flag flg) { + if (val->tag & YYJSON_SUBTYPE_REAL) { + u64 raw = val->uni.u64; + return write_f64_raw(cur, raw, flg); + } else { + u64 pos = val->uni.u64; + u64 neg = ~pos + 1; + usize sgn = ((val->tag & YYJSON_SUBTYPE_SINT) > 0) & ((i64)pos < 0); + *cur = '-'; + return write_u64(sgn ? neg : pos, cur + sgn); + } +} + + + +/*============================================================================== + * String Writer + *============================================================================*/ + +/** Character encode type, if (type > CHAR_ENC_ERR_1) bytes = type / 2; */ +typedef u8 char_enc_type; +#define CHAR_ENC_CPY_1 0 /* 1-byte UTF-8, copy. */ +#define CHAR_ENC_ERR_1 1 /* 1-byte UTF-8, error. */ +#define CHAR_ENC_ESC_A 2 /* 1-byte ASCII, escaped as '\x'. */ +#define CHAR_ENC_ESC_1 3 /* 1-byte UTF-8, escaped as '\uXXXX'. */ +#define CHAR_ENC_CPY_2 4 /* 2-byte UTF-8, copy. */ +#define CHAR_ENC_ESC_2 5 /* 2-byte UTF-8, escaped as '\uXXXX'. */ +#define CHAR_ENC_CPY_3 6 /* 3-byte UTF-8, copy. */ +#define CHAR_ENC_ESC_3 7 /* 3-byte UTF-8, escaped as '\uXXXX'. */ +#define CHAR_ENC_CPY_4 8 /* 4-byte UTF-8, copy. */ +#define CHAR_ENC_ESC_4 9 /* 4-byte UTF-8, escaped as '\uXXXX\uXXXX'. */ + +/** Character encode type table: don't escape unicode, don't escape '/'. + (generate with misc/make_tables.c) */ +static const char_enc_type enc_table_cpy[256] = { + 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 3, 2, 2, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1 +}; + +/** Character encode type table: don't escape unicode, escape '/'. + (generate with misc/make_tables.c) */ +static const char_enc_type enc_table_cpy_slash[256] = { + 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 3, 2, 2, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1 +}; + +/** Character encode type table: escape unicode, don't escape '/'. + (generate with misc/make_tables.c) */ +static const char_enc_type enc_table_esc[256] = { + 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 3, 2, 2, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1 +}; + +/** Character encode type table: escape unicode, escape '/'. + (generate with misc/make_tables.c) */ +static const char_enc_type enc_table_esc_slash[256] = { + 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 3, 2, 2, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1 +}; + +/** Escaped hex character table: ["00" "01" "02" ... "FD" "FE" "FF"]. + (generate with misc/make_tables.c) */ +yyjson_align(2) +static const u8 esc_hex_char_table[512] = { + '0', '0', '0', '1', '0', '2', '0', '3', + '0', '4', '0', '5', '0', '6', '0', '7', + '0', '8', '0', '9', '0', 'A', '0', 'B', + '0', 'C', '0', 'D', '0', 'E', '0', 'F', + '1', '0', '1', '1', '1', '2', '1', '3', + '1', '4', '1', '5', '1', '6', '1', '7', + '1', '8', '1', '9', '1', 'A', '1', 'B', + '1', 'C', '1', 'D', '1', 'E', '1', 'F', + '2', '0', '2', '1', '2', '2', '2', '3', + '2', '4', '2', '5', '2', '6', '2', '7', + '2', '8', '2', '9', '2', 'A', '2', 'B', + '2', 'C', '2', 'D', '2', 'E', '2', 'F', + '3', '0', '3', '1', '3', '2', '3', '3', + '3', '4', '3', '5', '3', '6', '3', '7', + '3', '8', '3', '9', '3', 'A', '3', 'B', + '3', 'C', '3', 'D', '3', 'E', '3', 'F', + '4', '0', '4', '1', '4', '2', '4', '3', + '4', '4', '4', '5', '4', '6', '4', '7', + '4', '8', '4', '9', '4', 'A', '4', 'B', + '4', 'C', '4', 'D', '4', 'E', '4', 'F', + '5', '0', '5', '1', '5', '2', '5', '3', + '5', '4', '5', '5', '5', '6', '5', '7', + '5', '8', '5', '9', '5', 'A', '5', 'B', + '5', 'C', '5', 'D', '5', 'E', '5', 'F', + '6', '0', '6', '1', '6', '2', '6', '3', + '6', '4', '6', '5', '6', '6', '6', '7', + '6', '8', '6', '9', '6', 'A', '6', 'B', + '6', 'C', '6', 'D', '6', 'E', '6', 'F', + '7', '0', '7', '1', '7', '2', '7', '3', + '7', '4', '7', '5', '7', '6', '7', '7', + '7', '8', '7', '9', '7', 'A', '7', 'B', + '7', 'C', '7', 'D', '7', 'E', '7', 'F', + '8', '0', '8', '1', '8', '2', '8', '3', + '8', '4', '8', '5', '8', '6', '8', '7', + '8', '8', '8', '9', '8', 'A', '8', 'B', + '8', 'C', '8', 'D', '8', 'E', '8', 'F', + '9', '0', '9', '1', '9', '2', '9', '3', + '9', '4', '9', '5', '9', '6', '9', '7', + '9', '8', '9', '9', '9', 'A', '9', 'B', + '9', 'C', '9', 'D', '9', 'E', '9', 'F', + 'A', '0', 'A', '1', 'A', '2', 'A', '3', + 'A', '4', 'A', '5', 'A', '6', 'A', '7', + 'A', '8', 'A', '9', 'A', 'A', 'A', 'B', + 'A', 'C', 'A', 'D', 'A', 'E', 'A', 'F', + 'B', '0', 'B', '1', 'B', '2', 'B', '3', + 'B', '4', 'B', '5', 'B', '6', 'B', '7', + 'B', '8', 'B', '9', 'B', 'A', 'B', 'B', + 'B', 'C', 'B', 'D', 'B', 'E', 'B', 'F', + 'C', '0', 'C', '1', 'C', '2', 'C', '3', + 'C', '4', 'C', '5', 'C', '6', 'C', '7', + 'C', '8', 'C', '9', 'C', 'A', 'C', 'B', + 'C', 'C', 'C', 'D', 'C', 'E', 'C', 'F', + 'D', '0', 'D', '1', 'D', '2', 'D', '3', + 'D', '4', 'D', '5', 'D', '6', 'D', '7', + 'D', '8', 'D', '9', 'D', 'A', 'D', 'B', + 'D', 'C', 'D', 'D', 'D', 'E', 'D', 'F', + 'E', '0', 'E', '1', 'E', '2', 'E', '3', + 'E', '4', 'E', '5', 'E', '6', 'E', '7', + 'E', '8', 'E', '9', 'E', 'A', 'E', 'B', + 'E', 'C', 'E', 'D', 'E', 'E', 'E', 'F', + 'F', '0', 'F', '1', 'F', '2', 'F', '3', + 'F', '4', 'F', '5', 'F', '6', 'F', '7', + 'F', '8', 'F', '9', 'F', 'A', 'F', 'B', + 'F', 'C', 'F', 'D', 'F', 'E', 'F', 'F' +}; + +/** Escaped single character table. (generate with misc/make_tables.c) */ +yyjson_align(2) +static const u8 esc_single_char_table[512] = { + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + '\\', 'b', '\\', 't', '\\', 'n', ' ', ' ', + '\\', 'f', '\\', 'r', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', '\\', '"', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', '\\', '/', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + '\\', '\\', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' +}; + +/** Returns the encode table with options. */ +static_inline const char_enc_type *get_enc_table_with_flag( + yyjson_read_flag flg) { + if (has_write_flag(ESCAPE_UNICODE)) { + if (has_write_flag(ESCAPE_SLASHES)) { + return enc_table_esc_slash; + } else { + return enc_table_esc; + } + } else { + if (has_write_flag(ESCAPE_SLASHES)) { + return enc_table_cpy_slash; + } else { + return enc_table_cpy; + } + } +} + +/** Write raw string. */ +static_inline u8 *write_raw(u8 *cur, const u8 *raw, usize raw_len) { + memcpy(cur, raw, raw_len); + return cur + raw_len; +} + +/** + Write string no-escape. + @param cur Buffer cursor. + @param str A UTF-8 string, null-terminator is not required. + @param str_len Length of string in bytes. + @return The buffer cursor after string. + */ +static_inline u8 *write_string_noesc(u8 *cur, const u8 *str, usize str_len) { + *cur++ = '"'; + while (str_len >= 16) { + byte_copy_16(cur, str); + cur += 16; + str += 16; + str_len -= 16; + } + while (str_len >= 4) { + byte_copy_4(cur, str); + cur += 4; + str += 4; + str_len -= 4; + } + while (str_len) { + *cur++ = *str++; + str_len -= 1; + } + *cur++ = '"'; + return cur; +} + +/** + Write UTF-8 string (requires len * 6 + 2 bytes buffer). + @param cur Buffer cursor. + @param esc Escape unicode. + @param inv Allow invalid unicode. + @param str A UTF-8 string, null-terminator is not required. + @param str_len Length of string in bytes. + @param enc_table Encode type table for character. + @return The buffer cursor after string, or NULL on invalid unicode. + */ +static_inline u8 *write_string(u8 *cur, bool esc, bool inv, + const u8 *str, usize str_len, + const char_enc_type *enc_table) { + + /* UTF-8 character mask and pattern, see `read_string()` for details. */ +#if YYJSON_ENDIAN == YYJSON_BIG_ENDIAN + const u16 b2_mask = 0xE0C0UL; + const u16 b2_patt = 0xC080UL; + const u16 b2_requ = 0x1E00UL; + const u32 b3_mask = 0xF0C0C000UL; + const u32 b3_patt = 0xE0808000UL; + const u32 b3_requ = 0x0F200000UL; + const u32 b3_erro = 0x0D200000UL; + const u32 b4_mask = 0xF8C0C0C0UL; + const u32 b4_patt = 0xF0808080UL; + const u32 b4_requ = 0x07300000UL; + const u32 b4_err0 = 0x04000000UL; + const u32 b4_err1 = 0x03300000UL; +#elif YYJSON_ENDIAN == YYJSON_LITTLE_ENDIAN + const u16 b2_mask = 0xC0E0UL; + const u16 b2_patt = 0x80C0UL; + const u16 b2_requ = 0x001EUL; + const u32 b3_mask = 0x00C0C0F0UL; + const u32 b3_patt = 0x008080E0UL; + const u32 b3_requ = 0x0000200FUL; + const u32 b3_erro = 0x0000200DUL; + const u32 b4_mask = 0xC0C0C0F8UL; + const u32 b4_patt = 0x808080F0UL; + const u32 b4_requ = 0x00003007UL; + const u32 b4_err0 = 0x00000004UL; + const u32 b4_err1 = 0x00003003UL; +#else + /* this should be evaluated at compile-time */ + v16_uni b2_mask_uni = {{ 0xE0, 0xC0 }}; + v16_uni b2_patt_uni = {{ 0xC0, 0x80 }}; + v16_uni b2_requ_uni = {{ 0x1E, 0x00 }}; + v32_uni b3_mask_uni = {{ 0xF0, 0xC0, 0xC0, 0x00 }}; + v32_uni b3_patt_uni = {{ 0xE0, 0x80, 0x80, 0x00 }}; + v32_uni b3_requ_uni = {{ 0x0F, 0x20, 0x00, 0x00 }}; + v32_uni b3_erro_uni = {{ 0x0D, 0x20, 0x00, 0x00 }}; + v32_uni b4_mask_uni = {{ 0xF8, 0xC0, 0xC0, 0xC0 }}; + v32_uni b4_patt_uni = {{ 0xF0, 0x80, 0x80, 0x80 }}; + v32_uni b4_requ_uni = {{ 0x07, 0x30, 0x00, 0x00 }}; + v32_uni b4_err0_uni = {{ 0x04, 0x00, 0x00, 0x00 }}; + v32_uni b4_err1_uni = {{ 0x03, 0x30, 0x00, 0x00 }}; + u16 b2_mask = b2_mask_uni.u; + u16 b2_patt = b2_patt_uni.u; + u16 b2_requ = b2_requ_uni.u; + u32 b3_mask = b3_mask_uni.u; + u32 b3_patt = b3_patt_uni.u; + u32 b3_requ = b3_requ_uni.u; + u32 b3_erro = b3_erro_uni.u; + u32 b4_mask = b4_mask_uni.u; + u32 b4_patt = b4_patt_uni.u; + u32 b4_requ = b4_requ_uni.u; + u32 b4_err0 = b4_err0_uni.u; + u32 b4_err1 = b4_err1_uni.u; +#endif + +#define is_valid_seq_2(uni) ( \ + ((uni & b2_mask) == b2_patt) && \ + ((uni & b2_requ)) \ +) + +#define is_valid_seq_3(uni) ( \ + ((uni & b3_mask) == b3_patt) && \ + ((tmp = (uni & b3_requ))) && \ + ((tmp != b3_erro)) \ +) + +#define is_valid_seq_4(uni) ( \ + ((uni & b4_mask) == b4_patt) && \ + ((tmp = (uni & b4_requ))) && \ + ((tmp & b4_err0) == 0 || (tmp & b4_err1) == 0) \ +) + + /* The replacement character U+FFFD, used to indicate invalid character. */ + const v32 rep = {{ 'F', 'F', 'F', 'D' }}; + const v32 pre = {{ '\\', 'u', '0', '0' }}; + + const u8 *src = str; + const u8 *end = str + str_len; + *cur++ = '"'; + +copy_ascii: + /* + Copy continuous ASCII, loop unrolling, same as the following code: + + while (end > src) ( + if (unlikely(enc_table[*src])) break; + *cur++ = *src++; + ); + */ +#define expr_jump(i) \ + if (unlikely(enc_table[src[i]])) goto stop_char_##i; + +#define expr_stop(i) \ + stop_char_##i: \ + memcpy(cur, src, i); \ + cur += i; src += i; goto copy_utf8; + + while (end - src >= 16) { + repeat16_incr(expr_jump) + byte_copy_16(cur, src); + cur += 16; src += 16; + } + + while (end - src >= 4) { + repeat4_incr(expr_jump) + byte_copy_4(cur, src); + cur += 4; src += 4; + } + + while (end > src) { + expr_jump(0) + *cur++ = *src++; + } + + *cur++ = '"'; + return cur; + + repeat16_incr(expr_stop) + +#undef expr_jump +#undef expr_stop + +copy_utf8: + if (unlikely(src + 4 > end)) { + if (end == src) goto copy_end; + if (end - src < enc_table[*src] / 2) goto err_one; + } + switch (enc_table[*src]) { + case CHAR_ENC_CPY_1: { + *cur++ = *src++; + goto copy_ascii; + } + case CHAR_ENC_CPY_2: { + u16 v; +#if YYJSON_DISABLE_UTF8_VALIDATION + byte_copy_2(cur, src); +#else + v = byte_load_2(src); + if (unlikely(!is_valid_seq_2(v))) goto err_cpy; + byte_copy_2(cur, src); +#endif + cur += 2; + src += 2; + goto copy_utf8; + } + case CHAR_ENC_CPY_3: { + u32 v, tmp; +#if YYJSON_DISABLE_UTF8_VALIDATION + if (likely(src + 4 <= end)) { + byte_copy_4(cur, src); + } else { + byte_copy_2(cur, src); + cur[2] = src[2]; + } +#else + if (likely(src + 4 <= end)) { + v = byte_load_4(src); + if (unlikely(!is_valid_seq_3(v))) goto err_cpy; + byte_copy_4(cur, src); + } else { + v = byte_load_3(src); + if (unlikely(!is_valid_seq_3(v))) goto err_cpy; + byte_copy_4(cur, &v); + } +#endif + cur += 3; + src += 3; + goto copy_utf8; + } + case CHAR_ENC_CPY_4: { + u32 v, tmp; +#if YYJSON_DISABLE_UTF8_VALIDATION + byte_copy_4(cur, src); +#else + v = byte_load_4(src); + if (unlikely(!is_valid_seq_4(v))) goto err_cpy; + byte_copy_4(cur, src); +#endif + cur += 4; + src += 4; + goto copy_utf8; + } + case CHAR_ENC_ESC_A: { + byte_copy_2(cur, &esc_single_char_table[*src * 2]); + cur += 2; + src += 1; + goto copy_utf8; + } + case CHAR_ENC_ESC_1: { + byte_copy_4(cur + 0, &pre); + byte_copy_2(cur + 4, &esc_hex_char_table[*src * 2]); + cur += 6; + src += 1; + goto copy_utf8; + } + case CHAR_ENC_ESC_2: { + u16 u, v; +#if !YYJSON_DISABLE_UTF8_VALIDATION + v = byte_load_2(src); + if (unlikely(!is_valid_seq_2(v))) goto err_esc; +#endif + u = (u16)(((u16)(src[0] & 0x1F) << 6) | + ((u16)(src[1] & 0x3F) << 0)); + byte_copy_2(cur + 0, &pre); + byte_copy_2(cur + 2, &esc_hex_char_table[(u >> 8) * 2]); + byte_copy_2(cur + 4, &esc_hex_char_table[(u & 0xFF) * 2]); + cur += 6; + src += 2; + goto copy_utf8; + } + case CHAR_ENC_ESC_3: { + u16 u; + u32 v, tmp; +#if !YYJSON_DISABLE_UTF8_VALIDATION + v = byte_load_3(src); + if (unlikely(!is_valid_seq_3(v))) goto err_esc; +#endif + u = (u16)(((u16)(src[0] & 0x0F) << 12) | + ((u16)(src[1] & 0x3F) << 6) | + ((u16)(src[2] & 0x3F) << 0)); + byte_copy_2(cur + 0, &pre); + byte_copy_2(cur + 2, &esc_hex_char_table[(u >> 8) * 2]); + byte_copy_2(cur + 4, &esc_hex_char_table[(u & 0xFF) * 2]); + cur += 6; + src += 3; + goto copy_utf8; + } + case CHAR_ENC_ESC_4: { + u32 hi, lo, u, v, tmp; +#if !YYJSON_DISABLE_UTF8_VALIDATION + v = byte_load_4(src); + if (unlikely(!is_valid_seq_4(v))) goto err_esc; +#endif + u = ((u32)(src[0] & 0x07) << 18) | + ((u32)(src[1] & 0x3F) << 12) | + ((u32)(src[2] & 0x3F) << 6) | + ((u32)(src[3] & 0x3F) << 0); + u -= 0x10000; + hi = (u >> 10) + 0xD800; + lo = (u & 0x3FF) + 0xDC00; + byte_copy_2(cur + 0, &pre); + byte_copy_2(cur + 2, &esc_hex_char_table[(hi >> 8) * 2]); + byte_copy_2(cur + 4, &esc_hex_char_table[(hi & 0xFF) * 2]); + byte_copy_2(cur + 6, &pre); + byte_copy_2(cur + 8, &esc_hex_char_table[(lo >> 8) * 2]); + byte_copy_2(cur + 10, &esc_hex_char_table[(lo & 0xFF) * 2]); + cur += 12; + src += 4; + goto copy_utf8; + } + case CHAR_ENC_ERR_1: { + goto err_one; + } + default: break; + } + +copy_end: + *cur++ = '"'; + return cur; + +err_one: + if (esc) goto err_esc; + else goto err_cpy; + +err_cpy: + if (!inv) return NULL; + *cur++ = *src++; + goto copy_utf8; + +err_esc: + if (!inv) return NULL; + byte_copy_2(cur + 0, &pre); + byte_copy_4(cur + 2, &rep); + cur += 6; + src += 1; + goto copy_utf8; + +#undef is_valid_seq_2 +#undef is_valid_seq_3 +#undef is_valid_seq_4 +} + + + +/*============================================================================== + * Writer Utilities + *============================================================================*/ + +/** Write null (requires 8 bytes buffer). */ +static_inline u8 *write_null(u8 *cur) { + v64 v = {{ 'n', 'u', 'l', 'l', ',', '\n', 0, 0 }}; + byte_copy_8(cur, &v); + return cur + 4; +} + +/** Write bool (requires 8 bytes buffer). */ +static_inline u8 *write_bool(u8 *cur, bool val) { + v64 v0 = {{ 'f', 'a', 'l', 's', 'e', ',', '\n', 0 }}; + v64 v1 = {{ 't', 'r', 'u', 'e', ',', '\n', 0, 0 }}; + if (val) { + byte_copy_8(cur, &v1); + } else { + byte_copy_8(cur, &v0); + } + return cur + 5 - val; +} + +/** Write indent (requires level x 4 bytes buffer). + Param spaces should not larger than 4. */ +static_inline u8 *write_indent(u8 *cur, usize level, usize spaces) { + while (level-- > 0) { + byte_copy_4(cur, " "); + cur += spaces; + } + return cur; +} + +/** Write data to file pointer. */ +static bool write_dat_to_fp(FILE *fp, u8 *dat, usize len, + yyjson_write_err *err) { + if (fwrite(dat, len, 1, fp) != 1) { + err->msg = "file writing failed"; + err->code = YYJSON_WRITE_ERROR_FILE_WRITE; + return false; + } + return true; +} + +/** Write data to file. */ +static bool write_dat_to_file(const char *path, u8 *dat, usize len, + yyjson_write_err *err) { + +#define return_err(_code, _msg) do { \ + err->msg = _msg; \ + err->code = YYJSON_WRITE_ERROR_##_code; \ + if (file) fclose(file); \ + return false; \ +} while (false) + + FILE *file = fopen_writeonly(path); + if (file == NULL) { + return_err(FILE_OPEN, "file opening failed"); + } + if (fwrite(dat, len, 1, file) != 1) { + return_err(FILE_WRITE, "file writing failed"); + } + if (fclose(file) != 0) { + file = NULL; + return_err(FILE_WRITE, "file closing failed"); + } + return true; + +#undef return_err +} + + + +/*============================================================================== + * JSON Writer Implementation + *============================================================================*/ + +typedef struct yyjson_write_ctx { + usize tag; +} yyjson_write_ctx; + +static_inline void yyjson_write_ctx_set(yyjson_write_ctx *ctx, + usize size, bool is_obj) { + ctx->tag = (size << 1) | (usize)is_obj; +} + +static_inline void yyjson_write_ctx_get(yyjson_write_ctx *ctx, + usize *size, bool *is_obj) { + usize tag = ctx->tag; + *size = tag >> 1; + *is_obj = (bool)(tag & 1); +} + +/** Write single JSON value. */ +static_inline u8 *yyjson_write_single(yyjson_val *val, + yyjson_write_flag flg, + yyjson_alc alc, + usize *dat_len, + yyjson_write_err *err) { + +#define return_err(_code, _msg) do { \ + if (hdr) alc.free(alc.ctx, (void *)hdr); \ + *dat_len = 0; \ + err->code = YYJSON_WRITE_ERROR_##_code; \ + err->msg = _msg; \ + return NULL; \ +} while (false) + +#define incr_len(_len) do { \ + hdr = (u8 *)alc.malloc(alc.ctx, _len); \ + if (!hdr) goto fail_alloc; \ + cur = hdr; \ +} while (false) + +#define check_str_len(_len) do { \ + if ((sizeof(usize) < 8) && (_len >= (USIZE_MAX - 16) / 6)) \ + goto fail_alloc; \ +} while (false) + + u8 *hdr = NULL, *cur; + usize str_len; + const u8 *str_ptr; + const char_enc_type *enc_table = get_enc_table_with_flag(flg); + bool cpy = (enc_table == enc_table_cpy); + bool esc = has_write_flag(ESCAPE_UNICODE) != 0; + bool inv = has_write_flag(ALLOW_INVALID_UNICODE) != 0; + bool newline = has_write_flag(NEWLINE_AT_END) != 0; + const usize end_len = 2; /* '\n' and '\0' */ + + switch (unsafe_yyjson_get_type(val)) { + case YYJSON_TYPE_RAW: + str_len = unsafe_yyjson_get_len(val); + str_ptr = (const u8 *)unsafe_yyjson_get_str(val); + check_str_len(str_len); + incr_len(str_len + end_len); + cur = write_raw(cur, str_ptr, str_len); + break; + + case YYJSON_TYPE_STR: + str_len = unsafe_yyjson_get_len(val); + str_ptr = (const u8 *)unsafe_yyjson_get_str(val); + check_str_len(str_len); + incr_len(str_len * 6 + 2 + end_len); + if (likely(cpy) && unsafe_yyjson_get_subtype(val)) { + cur = write_string_noesc(cur, str_ptr, str_len); + } else { + cur = write_string(cur, esc, inv, str_ptr, str_len, enc_table); + if (unlikely(!cur)) goto fail_str; + } + break; + + case YYJSON_TYPE_NUM: + incr_len(32 + end_len); + cur = write_number(cur, val, flg); + if (unlikely(!cur)) goto fail_num; + break; + + case YYJSON_TYPE_BOOL: + incr_len(8); + cur = write_bool(cur, unsafe_yyjson_get_bool(val)); + break; + + case YYJSON_TYPE_NULL: + incr_len(8); + cur = write_null(cur); + break; + + case YYJSON_TYPE_ARR: + incr_len(2 + end_len); + byte_copy_2(cur, "[]"); + cur += 2; + break; + + case YYJSON_TYPE_OBJ: + incr_len(2 + end_len); + byte_copy_2(cur, "{}"); + cur += 2; + break; + + default: + goto fail_type; + } + + if (newline) *cur++ = '\n'; + *cur = '\0'; + *dat_len = (usize)(cur - hdr); + memset(err, 0, sizeof(yyjson_write_err)); + return hdr; + +fail_alloc: + return_err(MEMORY_ALLOCATION, "memory allocation failed"); +fail_type: + return_err(INVALID_VALUE_TYPE, "invalid JSON value type"); +fail_num: + return_err(NAN_OR_INF, "nan or inf number is not allowed"); +fail_str: + return_err(INVALID_STRING, "invalid utf-8 encoding in string"); + +#undef return_err +#undef check_str_len +#undef incr_len +} + +/** Write JSON document minify. + The root of this document should be a non-empty container. */ +static_inline u8 *yyjson_write_minify(const yyjson_val *root, + const yyjson_write_flag flg, + const yyjson_alc alc, + usize *dat_len, + yyjson_write_err *err) { + +#define return_err(_code, _msg) do { \ + *dat_len = 0; \ + err->code = YYJSON_WRITE_ERROR_##_code; \ + err->msg = _msg; \ + if (hdr) alc.free(alc.ctx, hdr); \ + return NULL; \ +} while (false) + +#define incr_len(_len) do { \ + ext_len = (usize)(_len); \ + if (unlikely((u8 *)(cur + ext_len) >= (u8 *)ctx)) { \ + alc_inc = yyjson_max(alc_len / 2, ext_len); \ + alc_inc = size_align_up(alc_inc, sizeof(yyjson_write_ctx)); \ + if ((sizeof(usize) < 8) && size_add_is_overflow(alc_len, alc_inc)) \ + goto fail_alloc; \ + alc_len += alc_inc; \ + tmp = (u8 *)alc.realloc(alc.ctx, hdr, alc_len - alc_inc, alc_len); \ + if (unlikely(!tmp)) goto fail_alloc; \ + ctx_len = (usize)(end - (u8 *)ctx); \ + ctx_tmp = (yyjson_write_ctx *)(void *)(tmp + (alc_len - ctx_len)); \ + memmove((void *)ctx_tmp, (void *)(tmp + ((u8 *)ctx - hdr)), ctx_len); \ + ctx = ctx_tmp; \ + cur = tmp + (cur - hdr); \ + end = tmp + alc_len; \ + hdr = tmp; \ + } \ +} while (false) + +#define check_str_len(_len) do { \ + if ((sizeof(usize) < 8) && (_len >= (USIZE_MAX - 16) / 6)) \ + goto fail_alloc; \ +} while (false) + + yyjson_val *val; + yyjson_type val_type; + usize ctn_len, ctn_len_tmp; + bool ctn_obj, ctn_obj_tmp, is_key; + u8 *hdr, *cur, *end, *tmp; + yyjson_write_ctx *ctx, *ctx_tmp; + usize alc_len, alc_inc, ctx_len, ext_len, str_len; + const u8 *str_ptr; + const char_enc_type *enc_table = get_enc_table_with_flag(flg); + bool cpy = (enc_table == enc_table_cpy); + bool esc = has_write_flag(ESCAPE_UNICODE) != 0; + bool inv = has_write_flag(ALLOW_INVALID_UNICODE) != 0; + bool newline = has_write_flag(NEWLINE_AT_END) != 0; + + alc_len = root->uni.ofs / sizeof(yyjson_val); + alc_len = alc_len * YYJSON_WRITER_ESTIMATED_MINIFY_RATIO + 64; + alc_len = size_align_up(alc_len, sizeof(yyjson_write_ctx)); + hdr = (u8 *)alc.malloc(alc.ctx, alc_len); + if (!hdr) goto fail_alloc; + cur = hdr; + end = hdr + alc_len; + ctx = (yyjson_write_ctx *)(void *)end; + +doc_begin: + val = constcast(yyjson_val *)root; + val_type = unsafe_yyjson_get_type(val); + ctn_obj = (val_type == YYJSON_TYPE_OBJ); + ctn_len = unsafe_yyjson_get_len(val) << (u8)ctn_obj; + *cur++ = (u8)('[' | ((u8)ctn_obj << 5)); + val++; + +val_begin: + val_type = unsafe_yyjson_get_type(val); + if (val_type == YYJSON_TYPE_STR) { + is_key = ((u8)ctn_obj & (u8)~ctn_len); + str_len = unsafe_yyjson_get_len(val); + str_ptr = (const u8 *)unsafe_yyjson_get_str(val); + check_str_len(str_len); + incr_len(str_len * 6 + 16); + if (likely(cpy) && unsafe_yyjson_get_subtype(val)) { + cur = write_string_noesc(cur, str_ptr, str_len); + } else { + cur = write_string(cur, esc, inv, str_ptr, str_len, enc_table); + if (unlikely(!cur)) goto fail_str; + } + *cur++ = is_key ? ':' : ','; + goto val_end; + } + if (val_type == YYJSON_TYPE_NUM) { + incr_len(32); + cur = write_number(cur, val, flg); + if (unlikely(!cur)) goto fail_num; + *cur++ = ','; + goto val_end; + } + if ((val_type & (YYJSON_TYPE_ARR & YYJSON_TYPE_OBJ)) == + (YYJSON_TYPE_ARR & YYJSON_TYPE_OBJ)) { + ctn_len_tmp = unsafe_yyjson_get_len(val); + ctn_obj_tmp = (val_type == YYJSON_TYPE_OBJ); + incr_len(16); + if (unlikely(ctn_len_tmp == 0)) { + /* write empty container */ + *cur++ = (u8)('[' | ((u8)ctn_obj_tmp << 5)); + *cur++ = (u8)(']' | ((u8)ctn_obj_tmp << 5)); + *cur++ = ','; + goto val_end; + } else { + /* push context, setup new container */ + yyjson_write_ctx_set(--ctx, ctn_len, ctn_obj); + ctn_len = ctn_len_tmp << (u8)ctn_obj_tmp; + ctn_obj = ctn_obj_tmp; + *cur++ = (u8)('[' | ((u8)ctn_obj << 5)); + val++; + goto val_begin; + } + } + if (val_type == YYJSON_TYPE_BOOL) { + incr_len(16); + cur = write_bool(cur, unsafe_yyjson_get_bool(val)); + cur++; + goto val_end; + } + if (val_type == YYJSON_TYPE_NULL) { + incr_len(16); + cur = write_null(cur); + cur++; + goto val_end; + } + if (val_type == YYJSON_TYPE_RAW) { + str_len = unsafe_yyjson_get_len(val); + str_ptr = (const u8 *)unsafe_yyjson_get_str(val); + check_str_len(str_len); + incr_len(str_len + 2); + cur = write_raw(cur, str_ptr, str_len); + *cur++ = ','; + goto val_end; + } + goto fail_type; + +val_end: + val++; + ctn_len--; + if (unlikely(ctn_len == 0)) goto ctn_end; + goto val_begin; + +ctn_end: + cur--; + *cur++ = (u8)(']' | ((u8)ctn_obj << 5)); + *cur++ = ','; + if (unlikely((u8 *)ctx >= end)) goto doc_end; + yyjson_write_ctx_get(ctx++, &ctn_len, &ctn_obj); + ctn_len--; + if (likely(ctn_len > 0)) { + goto val_begin; + } else { + goto ctn_end; + } + +doc_end: + if (newline) { + incr_len(2); + *(cur - 1) = '\n'; + cur++; + } + *--cur = '\0'; + *dat_len = (usize)(cur - hdr); + memset(err, 0, sizeof(yyjson_write_err)); + return hdr; + +fail_alloc: + return_err(MEMORY_ALLOCATION, "memory allocation failed"); +fail_type: + return_err(INVALID_VALUE_TYPE, "invalid JSON value type"); +fail_num: + return_err(NAN_OR_INF, "nan or inf number is not allowed"); +fail_str: + return_err(INVALID_STRING, "invalid utf-8 encoding in string"); + +#undef return_err +#undef incr_len +#undef check_str_len +} + +/** Write JSON document pretty. + The root of this document should be a non-empty container. */ +static_inline u8 *yyjson_write_pretty(const yyjson_val *root, + const yyjson_write_flag flg, + const yyjson_alc alc, + usize *dat_len, + yyjson_write_err *err) { + +#define return_err(_code, _msg) do { \ + *dat_len = 0; \ + err->code = YYJSON_WRITE_ERROR_##_code; \ + err->msg = _msg; \ + if (hdr) alc.free(alc.ctx, hdr); \ + return NULL; \ +} while (false) + +#define incr_len(_len) do { \ + ext_len = (usize)(_len); \ + if (unlikely((u8 *)(cur + ext_len) >= (u8 *)ctx)) { \ + alc_inc = yyjson_max(alc_len / 2, ext_len); \ + alc_inc = size_align_up(alc_inc, sizeof(yyjson_write_ctx)); \ + if ((sizeof(usize) < 8) && size_add_is_overflow(alc_len, alc_inc)) \ + goto fail_alloc; \ + alc_len += alc_inc; \ + tmp = (u8 *)alc.realloc(alc.ctx, hdr, alc_len - alc_inc, alc_len); \ + if (unlikely(!tmp)) goto fail_alloc; \ + ctx_len = (usize)(end - (u8 *)ctx); \ + ctx_tmp = (yyjson_write_ctx *)(void *)(tmp + (alc_len - ctx_len)); \ + memmove((void *)ctx_tmp, (void *)(tmp + ((u8 *)ctx - hdr)), ctx_len); \ + ctx = ctx_tmp; \ + cur = tmp + (cur - hdr); \ + end = tmp + alc_len; \ + hdr = tmp; \ + } \ +} while (false) + +#define check_str_len(_len) do { \ + if ((sizeof(usize) < 8) && (_len >= (USIZE_MAX - 16) / 6)) \ + goto fail_alloc; \ +} while (false) + + yyjson_val *val; + yyjson_type val_type; + usize ctn_len, ctn_len_tmp; + bool ctn_obj, ctn_obj_tmp, is_key, no_indent; + u8 *hdr, *cur, *end, *tmp; + yyjson_write_ctx *ctx, *ctx_tmp; + usize alc_len, alc_inc, ctx_len, ext_len, str_len, level; + const u8 *str_ptr; + const char_enc_type *enc_table = get_enc_table_with_flag(flg); + bool cpy = (enc_table == enc_table_cpy); + bool esc = has_write_flag(ESCAPE_UNICODE) != 0; + bool inv = has_write_flag(ALLOW_INVALID_UNICODE) != 0; + usize spaces = has_write_flag(PRETTY_TWO_SPACES) ? 2 : 4; + bool newline = has_write_flag(NEWLINE_AT_END) != 0; + + alc_len = root->uni.ofs / sizeof(yyjson_val); + alc_len = alc_len * YYJSON_WRITER_ESTIMATED_PRETTY_RATIO + 64; + alc_len = size_align_up(alc_len, sizeof(yyjson_write_ctx)); + hdr = (u8 *)alc.malloc(alc.ctx, alc_len); + if (!hdr) goto fail_alloc; + cur = hdr; + end = hdr + alc_len; + ctx = (yyjson_write_ctx *)(void *)end; + +doc_begin: + val = constcast(yyjson_val *)root; + val_type = unsafe_yyjson_get_type(val); + ctn_obj = (val_type == YYJSON_TYPE_OBJ); + ctn_len = unsafe_yyjson_get_len(val) << (u8)ctn_obj; + *cur++ = (u8)('[' | ((u8)ctn_obj << 5)); + *cur++ = '\n'; + val++; + level = 1; + +val_begin: + val_type = unsafe_yyjson_get_type(val); + if (val_type == YYJSON_TYPE_STR) { + is_key = (bool)((u8)ctn_obj & (u8)~ctn_len); + no_indent = (bool)((u8)ctn_obj & (u8)ctn_len); + str_len = unsafe_yyjson_get_len(val); + str_ptr = (const u8 *)unsafe_yyjson_get_str(val); + check_str_len(str_len); + incr_len(str_len * 6 + 16 + (no_indent ? 0 : level * 4)); + cur = write_indent(cur, no_indent ? 0 : level, spaces); + if (likely(cpy) && unsafe_yyjson_get_subtype(val)) { + cur = write_string_noesc(cur, str_ptr, str_len); + } else { + cur = write_string(cur, esc, inv, str_ptr, str_len, enc_table); + if (unlikely(!cur)) goto fail_str; + } + *cur++ = is_key ? ':' : ','; + *cur++ = is_key ? ' ' : '\n'; + goto val_end; + } + if (val_type == YYJSON_TYPE_NUM) { + no_indent = (bool)((u8)ctn_obj & (u8)ctn_len); + incr_len(32 + (no_indent ? 0 : level * 4)); + cur = write_indent(cur, no_indent ? 0 : level, spaces); + cur = write_number(cur, val, flg); + if (unlikely(!cur)) goto fail_num; + *cur++ = ','; + *cur++ = '\n'; + goto val_end; + } + if ((val_type & (YYJSON_TYPE_ARR & YYJSON_TYPE_OBJ)) == + (YYJSON_TYPE_ARR & YYJSON_TYPE_OBJ)) { + no_indent = (bool)((u8)ctn_obj & (u8)ctn_len); + ctn_len_tmp = unsafe_yyjson_get_len(val); + ctn_obj_tmp = (val_type == YYJSON_TYPE_OBJ); + if (unlikely(ctn_len_tmp == 0)) { + /* write empty container */ + incr_len(16 + (no_indent ? 0 : level * 4)); + cur = write_indent(cur, no_indent ? 0 : level, spaces); + *cur++ = (u8)('[' | ((u8)ctn_obj_tmp << 5)); + *cur++ = (u8)(']' | ((u8)ctn_obj_tmp << 5)); + *cur++ = ','; + *cur++ = '\n'; + goto val_end; + } else { + /* push context, setup new container */ + incr_len(32 + (no_indent ? 0 : level * 4)); + yyjson_write_ctx_set(--ctx, ctn_len, ctn_obj); + ctn_len = ctn_len_tmp << (u8)ctn_obj_tmp; + ctn_obj = ctn_obj_tmp; + cur = write_indent(cur, no_indent ? 0 : level, spaces); + level++; + *cur++ = (u8)('[' | ((u8)ctn_obj << 5)); + *cur++ = '\n'; + val++; + goto val_begin; + } + } + if (val_type == YYJSON_TYPE_BOOL) { + no_indent = (bool)((u8)ctn_obj & (u8)ctn_len); + incr_len(16 + (no_indent ? 0 : level * 4)); + cur = write_indent(cur, no_indent ? 0 : level, spaces); + cur = write_bool(cur, unsafe_yyjson_get_bool(val)); + cur += 2; + goto val_end; + } + if (val_type == YYJSON_TYPE_NULL) { + no_indent = (bool)((u8)ctn_obj & (u8)ctn_len); + incr_len(16 + (no_indent ? 0 : level * 4)); + cur = write_indent(cur, no_indent ? 0 : level, spaces); + cur = write_null(cur); + cur += 2; + goto val_end; + } + if (val_type == YYJSON_TYPE_RAW) { + str_len = unsafe_yyjson_get_len(val); + str_ptr = (const u8 *)unsafe_yyjson_get_str(val); + check_str_len(str_len); + incr_len(str_len + 3); + cur = write_raw(cur, str_ptr, str_len); + *cur++ = ','; + *cur++ = '\n'; + goto val_end; + } + goto fail_type; + +val_end: + val++; + ctn_len--; + if (unlikely(ctn_len == 0)) goto ctn_end; + goto val_begin; + +ctn_end: + cur -= 2; + *cur++ = '\n'; + incr_len(level * 4); + cur = write_indent(cur, --level, spaces); + *cur++ = (u8)(']' | ((u8)ctn_obj << 5)); + if (unlikely((u8 *)ctx >= end)) goto doc_end; + yyjson_write_ctx_get(ctx++, &ctn_len, &ctn_obj); + ctn_len--; + *cur++ = ','; + *cur++ = '\n'; + if (likely(ctn_len > 0)) { + goto val_begin; + } else { + goto ctn_end; + } + +doc_end: + if (newline) { + incr_len(2); + *cur++ = '\n'; + } + *cur = '\0'; + *dat_len = (usize)(cur - hdr); + memset(err, 0, sizeof(yyjson_write_err)); + return hdr; + +fail_alloc: + return_err(MEMORY_ALLOCATION, "memory allocation failed"); +fail_type: + return_err(INVALID_VALUE_TYPE, "invalid JSON value type"); +fail_num: + return_err(NAN_OR_INF, "nan or inf number is not allowed"); +fail_str: + return_err(INVALID_STRING, "invalid utf-8 encoding in string"); + +#undef return_err +#undef incr_len +#undef check_str_len +} + +char *yyjson_val_write_opts(const yyjson_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + usize *dat_len, + yyjson_write_err *err) { + yyjson_write_err dummy_err; + usize dummy_dat_len; + yyjson_alc alc = alc_ptr ? *alc_ptr : YYJSON_DEFAULT_ALC; + yyjson_val *root = constcast(yyjson_val *)val; + + err = err ? err : &dummy_err; + dat_len = dat_len ? dat_len : &dummy_dat_len; + + if (unlikely(!root)) { + *dat_len = 0; + err->msg = "input JSON is NULL"; + err->code = YYJSON_READ_ERROR_INVALID_PARAMETER; + return NULL; + } + + if (!unsafe_yyjson_is_ctn(root) || unsafe_yyjson_get_len(root) == 0) { + return (char *)yyjson_write_single(root, flg, alc, dat_len, err); + } else if (flg & (YYJSON_WRITE_PRETTY | YYJSON_WRITE_PRETTY_TWO_SPACES)) { + return (char *)yyjson_write_pretty(root, flg, alc, dat_len, err); + } else { + return (char *)yyjson_write_minify(root, flg, alc, dat_len, err); + } +} + +char *yyjson_write_opts(const yyjson_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + usize *dat_len, + yyjson_write_err *err) { + yyjson_val *root = doc ? doc->root : NULL; + return yyjson_val_write_opts(root, flg, alc_ptr, dat_len, err); +} + +bool yyjson_val_write_file(const char *path, + const yyjson_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + yyjson_write_err *err) { + yyjson_write_err dummy_err; + u8 *dat; + usize dat_len = 0; + yyjson_val *root = constcast(yyjson_val *)val; + bool suc; + + alc_ptr = alc_ptr ? alc_ptr : &YYJSON_DEFAULT_ALC; + err = err ? err : &dummy_err; + if (unlikely(!path || !*path)) { + err->msg = "input path is invalid"; + err->code = YYJSON_READ_ERROR_INVALID_PARAMETER; + return false; + } + + dat = (u8 *)yyjson_val_write_opts(root, flg, alc_ptr, &dat_len, err); + if (unlikely(!dat)) return false; + suc = write_dat_to_file(path, dat, dat_len, err); + alc_ptr->free(alc_ptr->ctx, dat); + return suc; +} + +bool yyjson_val_write_fp(FILE *fp, + const yyjson_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + yyjson_write_err *err) { + yyjson_write_err dummy_err; + u8 *dat; + usize dat_len = 0; + yyjson_val *root = constcast(yyjson_val *)val; + bool suc; + + alc_ptr = alc_ptr ? alc_ptr : &YYJSON_DEFAULT_ALC; + err = err ? err : &dummy_err; + if (unlikely(!fp)) { + err->msg = "input fp is invalid"; + err->code = YYJSON_READ_ERROR_INVALID_PARAMETER; + return false; + } + + dat = (u8 *)yyjson_val_write_opts(root, flg, alc_ptr, &dat_len, err); + if (unlikely(!dat)) return false; + suc = write_dat_to_fp(fp, dat, dat_len, err); + alc_ptr->free(alc_ptr->ctx, dat); + return suc; +} + +bool yyjson_write_file(const char *path, + const yyjson_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + yyjson_write_err *err) { + yyjson_val *root = doc ? doc->root : NULL; + return yyjson_val_write_file(path, root, flg, alc_ptr, err); +} + +bool yyjson_write_fp(FILE *fp, + const yyjson_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + yyjson_write_err *err) { + yyjson_val *root = doc ? doc->root : NULL; + return yyjson_val_write_fp(fp, root, flg, alc_ptr, err); +} + + + +/*============================================================================== + * Mutable JSON Writer Implementation + *============================================================================*/ + +typedef struct yyjson_mut_write_ctx { + usize tag; + yyjson_mut_val *ctn; +} yyjson_mut_write_ctx; + +static_inline void yyjson_mut_write_ctx_set(yyjson_mut_write_ctx *ctx, + yyjson_mut_val *ctn, + usize size, bool is_obj) { + ctx->tag = (size << 1) | (usize)is_obj; + ctx->ctn = ctn; +} + +static_inline void yyjson_mut_write_ctx_get(yyjson_mut_write_ctx *ctx, + yyjson_mut_val **ctn, + usize *size, bool *is_obj) { + usize tag = ctx->tag; + *size = tag >> 1; + *is_obj = (bool)(tag & 1); + *ctn = ctx->ctn; +} + +/** Get the estimated number of values for the mutable JSON document. */ +static_inline usize yyjson_mut_doc_estimated_val_num( + const yyjson_mut_doc *doc) { + usize sum = 0; + yyjson_val_chunk *chunk = doc->val_pool.chunks; + while (chunk) { + sum += chunk->chunk_size / sizeof(yyjson_mut_val) - 1; + if (chunk == doc->val_pool.chunks) { + sum -= (usize)(doc->val_pool.end - doc->val_pool.cur); + } + chunk = chunk->next; + } + return sum; +} + +/** Write single JSON value. */ +static_inline u8 *yyjson_mut_write_single(yyjson_mut_val *val, + yyjson_write_flag flg, + yyjson_alc alc, + usize *dat_len, + yyjson_write_err *err) { + return yyjson_write_single((yyjson_val *)val, flg, alc, dat_len, err); +} + +/** Write JSON document minify. + The root of this document should be a non-empty container. */ +static_inline u8 *yyjson_mut_write_minify(const yyjson_mut_val *root, + usize estimated_val_num, + yyjson_write_flag flg, + yyjson_alc alc, + usize *dat_len, + yyjson_write_err *err) { + +#define return_err(_code, _msg) do { \ + *dat_len = 0; \ + err->code = YYJSON_WRITE_ERROR_##_code; \ + err->msg = _msg; \ + if (hdr) alc.free(alc.ctx, hdr); \ + return NULL; \ +} while (false) + +#define incr_len(_len) do { \ + ext_len = (usize)(_len); \ + if (unlikely((u8 *)(cur + ext_len) >= (u8 *)ctx)) { \ + alc_inc = yyjson_max(alc_len / 2, ext_len); \ + alc_inc = size_align_up(alc_inc, sizeof(yyjson_mut_write_ctx)); \ + if ((sizeof(usize) < 8) && size_add_is_overflow(alc_len, alc_inc)) \ + goto fail_alloc; \ + alc_len += alc_inc; \ + tmp = (u8 *)alc.realloc(alc.ctx, hdr, alc_len - alc_inc, alc_len); \ + if (unlikely(!tmp)) goto fail_alloc; \ + ctx_len = (usize)(end - (u8 *)ctx); \ + ctx_tmp = (yyjson_mut_write_ctx *)(void *)(tmp + (alc_len - ctx_len)); \ + memmove((void *)ctx_tmp, (void *)(tmp + ((u8 *)ctx - hdr)), ctx_len); \ + ctx = ctx_tmp; \ + cur = tmp + (cur - hdr); \ + end = tmp + alc_len; \ + hdr = tmp; \ + } \ +} while (false) + +#define check_str_len(_len) do { \ + if ((sizeof(usize) < 8) && (_len >= (USIZE_MAX - 16) / 6)) \ + goto fail_alloc; \ +} while (false) + + yyjson_mut_val *val, *ctn; + yyjson_type val_type; + usize ctn_len, ctn_len_tmp; + bool ctn_obj, ctn_obj_tmp, is_key; + u8 *hdr, *cur, *end, *tmp; + yyjson_mut_write_ctx *ctx, *ctx_tmp; + usize alc_len, alc_inc, ctx_len, ext_len, str_len; + const u8 *str_ptr; + const char_enc_type *enc_table = get_enc_table_with_flag(flg); + bool cpy = (enc_table == enc_table_cpy); + bool esc = has_write_flag(ESCAPE_UNICODE) != 0; + bool inv = has_write_flag(ALLOW_INVALID_UNICODE) != 0; + bool newline = has_write_flag(NEWLINE_AT_END) != 0; + + alc_len = estimated_val_num * YYJSON_WRITER_ESTIMATED_MINIFY_RATIO + 64; + alc_len = size_align_up(alc_len, sizeof(yyjson_mut_write_ctx)); + hdr = (u8 *)alc.malloc(alc.ctx, alc_len); + if (!hdr) goto fail_alloc; + cur = hdr; + end = hdr + alc_len; + ctx = (yyjson_mut_write_ctx *)(void *)end; + +doc_begin: + val = constcast(yyjson_mut_val *)root; + val_type = unsafe_yyjson_get_type(val); + ctn_obj = (val_type == YYJSON_TYPE_OBJ); + ctn_len = unsafe_yyjson_get_len(val) << (u8)ctn_obj; + *cur++ = (u8)('[' | ((u8)ctn_obj << 5)); + ctn = val; + val = (yyjson_mut_val *)val->uni.ptr; /* tail */ + val = ctn_obj ? val->next->next : val->next; + +val_begin: + val_type = unsafe_yyjson_get_type(val); + if (val_type == YYJSON_TYPE_STR) { + is_key = ((u8)ctn_obj & (u8)~ctn_len); + str_len = unsafe_yyjson_get_len(val); + str_ptr = (const u8 *)unsafe_yyjson_get_str(val); + check_str_len(str_len); + incr_len(str_len * 6 + 16); + if (likely(cpy) && unsafe_yyjson_get_subtype(val)) { + cur = write_string_noesc(cur, str_ptr, str_len); + } else { + cur = write_string(cur, esc, inv, str_ptr, str_len, enc_table); + if (unlikely(!cur)) goto fail_str; + } + *cur++ = is_key ? ':' : ','; + goto val_end; + } + if (val_type == YYJSON_TYPE_NUM) { + incr_len(32); + cur = write_number(cur, (yyjson_val *)val, flg); + if (unlikely(!cur)) goto fail_num; + *cur++ = ','; + goto val_end; + } + if ((val_type & (YYJSON_TYPE_ARR & YYJSON_TYPE_OBJ)) == + (YYJSON_TYPE_ARR & YYJSON_TYPE_OBJ)) { + ctn_len_tmp = unsafe_yyjson_get_len(val); + ctn_obj_tmp = (val_type == YYJSON_TYPE_OBJ); + incr_len(16); + if (unlikely(ctn_len_tmp == 0)) { + /* write empty container */ + *cur++ = (u8)('[' | ((u8)ctn_obj_tmp << 5)); + *cur++ = (u8)(']' | ((u8)ctn_obj_tmp << 5)); + *cur++ = ','; + goto val_end; + } else { + /* push context, setup new container */ + yyjson_mut_write_ctx_set(--ctx, ctn, ctn_len, ctn_obj); + ctn_len = ctn_len_tmp << (u8)ctn_obj_tmp; + ctn_obj = ctn_obj_tmp; + *cur++ = (u8)('[' | ((u8)ctn_obj << 5)); + ctn = val; + val = (yyjson_mut_val *)ctn->uni.ptr; /* tail */ + val = ctn_obj ? val->next->next : val->next; + goto val_begin; + } + } + if (val_type == YYJSON_TYPE_BOOL) { + incr_len(16); + cur = write_bool(cur, unsafe_yyjson_get_bool(val)); + cur++; + goto val_end; + } + if (val_type == YYJSON_TYPE_NULL) { + incr_len(16); + cur = write_null(cur); + cur++; + goto val_end; + } + if (val_type == YYJSON_TYPE_RAW) { + str_len = unsafe_yyjson_get_len(val); + str_ptr = (const u8 *)unsafe_yyjson_get_str(val); + check_str_len(str_len); + incr_len(str_len + 2); + cur = write_raw(cur, str_ptr, str_len); + *cur++ = ','; + goto val_end; + } + goto fail_type; + +val_end: + ctn_len--; + if (unlikely(ctn_len == 0)) goto ctn_end; + val = val->next; + goto val_begin; + +ctn_end: + cur--; + *cur++ = (u8)(']' | ((u8)ctn_obj << 5)); + *cur++ = ','; + if (unlikely((u8 *)ctx >= end)) goto doc_end; + val = ctn->next; + yyjson_mut_write_ctx_get(ctx++, &ctn, &ctn_len, &ctn_obj); + ctn_len--; + if (likely(ctn_len > 0)) { + goto val_begin; + } else { + goto ctn_end; + } + +doc_end: + if (newline) { + incr_len(2); + *(cur - 1) = '\n'; + cur++; + } + *--cur = '\0'; + *dat_len = (usize)(cur - hdr); + err->code = YYJSON_WRITE_SUCCESS; + err->msg = "success"; + return hdr; + +fail_alloc: + return_err(MEMORY_ALLOCATION, "memory allocation failed"); +fail_type: + return_err(INVALID_VALUE_TYPE, "invalid JSON value type"); +fail_num: + return_err(NAN_OR_INF, "nan or inf number is not allowed"); +fail_str: + return_err(INVALID_STRING, "invalid utf-8 encoding in string"); + +#undef return_err +#undef incr_len +#undef check_str_len +} + +/** Write JSON document pretty. + The root of this document should be a non-empty container. */ +static_inline u8 *yyjson_mut_write_pretty(const yyjson_mut_val *root, + usize estimated_val_num, + yyjson_write_flag flg, + yyjson_alc alc, + usize *dat_len, + yyjson_write_err *err) { + +#define return_err(_code, _msg) do { \ + *dat_len = 0; \ + err->code = YYJSON_WRITE_ERROR_##_code; \ + err->msg = _msg; \ + if (hdr) alc.free(alc.ctx, hdr); \ + return NULL; \ +} while (false) + +#define incr_len(_len) do { \ + ext_len = (usize)(_len); \ + if (unlikely((u8 *)(cur + ext_len) >= (u8 *)ctx)) { \ + alc_inc = yyjson_max(alc_len / 2, ext_len); \ + alc_inc = size_align_up(alc_inc, sizeof(yyjson_mut_write_ctx)); \ + if ((sizeof(usize) < 8) && size_add_is_overflow(alc_len, alc_inc)) \ + goto fail_alloc; \ + alc_len += alc_inc; \ + tmp = (u8 *)alc.realloc(alc.ctx, hdr, alc_len - alc_inc, alc_len); \ + if (unlikely(!tmp)) goto fail_alloc; \ + ctx_len = (usize)(end - (u8 *)ctx); \ + ctx_tmp = (yyjson_mut_write_ctx *)(void *)(tmp + (alc_len - ctx_len)); \ + memmove((void *)ctx_tmp, (void *)(tmp + ((u8 *)ctx - hdr)), ctx_len); \ + ctx = ctx_tmp; \ + cur = tmp + (cur - hdr); \ + end = tmp + alc_len; \ + hdr = tmp; \ + } \ +} while (false) + +#define check_str_len(_len) do { \ + if ((sizeof(usize) < 8) && (_len >= (USIZE_MAX - 16) / 6)) \ + goto fail_alloc; \ +} while (false) + + yyjson_mut_val *val, *ctn; + yyjson_type val_type; + usize ctn_len, ctn_len_tmp; + bool ctn_obj, ctn_obj_tmp, is_key, no_indent; + u8 *hdr, *cur, *end, *tmp; + yyjson_mut_write_ctx *ctx, *ctx_tmp; + usize alc_len, alc_inc, ctx_len, ext_len, str_len, level; + const u8 *str_ptr; + const char_enc_type *enc_table = get_enc_table_with_flag(flg); + bool cpy = (enc_table == enc_table_cpy); + bool esc = has_write_flag(ESCAPE_UNICODE) != 0; + bool inv = has_write_flag(ALLOW_INVALID_UNICODE) != 0; + usize spaces = has_write_flag(PRETTY_TWO_SPACES) ? 2 : 4; + bool newline = has_write_flag(NEWLINE_AT_END) != 0; + + alc_len = estimated_val_num * YYJSON_WRITER_ESTIMATED_PRETTY_RATIO + 64; + alc_len = size_align_up(alc_len, sizeof(yyjson_mut_write_ctx)); + hdr = (u8 *)alc.malloc(alc.ctx, alc_len); + if (!hdr) goto fail_alloc; + cur = hdr; + end = hdr + alc_len; + ctx = (yyjson_mut_write_ctx *)(void *)end; + +doc_begin: + val = constcast(yyjson_mut_val *)root; + val_type = unsafe_yyjson_get_type(val); + ctn_obj = (val_type == YYJSON_TYPE_OBJ); + ctn_len = unsafe_yyjson_get_len(val) << (u8)ctn_obj; + *cur++ = (u8)('[' | ((u8)ctn_obj << 5)); + *cur++ = '\n'; + ctn = val; + val = (yyjson_mut_val *)val->uni.ptr; /* tail */ + val = ctn_obj ? val->next->next : val->next; + level = 1; + +val_begin: + val_type = unsafe_yyjson_get_type(val); + if (val_type == YYJSON_TYPE_STR) { + is_key = (bool)((u8)ctn_obj & (u8)~ctn_len); + no_indent = (bool)((u8)ctn_obj & (u8)ctn_len); + str_len = unsafe_yyjson_get_len(val); + str_ptr = (const u8 *)unsafe_yyjson_get_str(val); + check_str_len(str_len); + incr_len(str_len * 6 + 16 + (no_indent ? 0 : level * 4)); + cur = write_indent(cur, no_indent ? 0 : level, spaces); + if (likely(cpy) && unsafe_yyjson_get_subtype(val)) { + cur = write_string_noesc(cur, str_ptr, str_len); + } else { + cur = write_string(cur, esc, inv, str_ptr, str_len, enc_table); + if (unlikely(!cur)) goto fail_str; + } + *cur++ = is_key ? ':' : ','; + *cur++ = is_key ? ' ' : '\n'; + goto val_end; + } + if (val_type == YYJSON_TYPE_NUM) { + no_indent = (bool)((u8)ctn_obj & (u8)ctn_len); + incr_len(32 + (no_indent ? 0 : level * 4)); + cur = write_indent(cur, no_indent ? 0 : level, spaces); + cur = write_number(cur, (yyjson_val *)val, flg); + if (unlikely(!cur)) goto fail_num; + *cur++ = ','; + *cur++ = '\n'; + goto val_end; + } + if ((val_type & (YYJSON_TYPE_ARR & YYJSON_TYPE_OBJ)) == + (YYJSON_TYPE_ARR & YYJSON_TYPE_OBJ)) { + no_indent = (bool)((u8)ctn_obj & (u8)ctn_len); + ctn_len_tmp = unsafe_yyjson_get_len(val); + ctn_obj_tmp = (val_type == YYJSON_TYPE_OBJ); + if (unlikely(ctn_len_tmp == 0)) { + /* write empty container */ + incr_len(16 + (no_indent ? 0 : level * 4)); + cur = write_indent(cur, no_indent ? 0 : level, spaces); + *cur++ = (u8)('[' | ((u8)ctn_obj_tmp << 5)); + *cur++ = (u8)(']' | ((u8)ctn_obj_tmp << 5)); + *cur++ = ','; + *cur++ = '\n'; + goto val_end; + } else { + /* push context, setup new container */ + incr_len(32 + (no_indent ? 0 : level * 4)); + yyjson_mut_write_ctx_set(--ctx, ctn, ctn_len, ctn_obj); + ctn_len = ctn_len_tmp << (u8)ctn_obj_tmp; + ctn_obj = ctn_obj_tmp; + cur = write_indent(cur, no_indent ? 0 : level, spaces); + level++; + *cur++ = (u8)('[' | ((u8)ctn_obj << 5)); + *cur++ = '\n'; + ctn = val; + val = (yyjson_mut_val *)ctn->uni.ptr; /* tail */ + val = ctn_obj ? val->next->next : val->next; + goto val_begin; + } + } + if (val_type == YYJSON_TYPE_BOOL) { + no_indent = (bool)((u8)ctn_obj & (u8)ctn_len); + incr_len(16 + (no_indent ? 0 : level * 4)); + cur = write_indent(cur, no_indent ? 0 : level, spaces); + cur = write_bool(cur, unsafe_yyjson_get_bool(val)); + cur += 2; + goto val_end; + } + if (val_type == YYJSON_TYPE_NULL) { + no_indent = (bool)((u8)ctn_obj & (u8)ctn_len); + incr_len(16 + (no_indent ? 0 : level * 4)); + cur = write_indent(cur, no_indent ? 0 : level, spaces); + cur = write_null(cur); + cur += 2; + goto val_end; + } + if (val_type == YYJSON_TYPE_RAW) { + str_len = unsafe_yyjson_get_len(val); + str_ptr = (const u8 *)unsafe_yyjson_get_str(val); + check_str_len(str_len); + incr_len(str_len + 3); + cur = write_raw(cur, str_ptr, str_len); + *cur++ = ','; + *cur++ = '\n'; + goto val_end; + } + goto fail_type; + +val_end: + ctn_len--; + if (unlikely(ctn_len == 0)) goto ctn_end; + val = val->next; + goto val_begin; + +ctn_end: + cur -= 2; + *cur++ = '\n'; + incr_len(level * 4); + cur = write_indent(cur, --level, spaces); + *cur++ = (u8)(']' | ((u8)ctn_obj << 5)); + if (unlikely((u8 *)ctx >= end)) goto doc_end; + val = ctn->next; + yyjson_mut_write_ctx_get(ctx++, &ctn, &ctn_len, &ctn_obj); + ctn_len--; + *cur++ = ','; + *cur++ = '\n'; + if (likely(ctn_len > 0)) { + goto val_begin; + } else { + goto ctn_end; + } + +doc_end: + if (newline) { + incr_len(2); + *cur++ = '\n'; + } + *cur = '\0'; + *dat_len = (usize)(cur - hdr); + err->code = YYJSON_WRITE_SUCCESS; + err->msg = "success"; + return hdr; + +fail_alloc: + return_err(MEMORY_ALLOCATION, "memory allocation failed"); +fail_type: + return_err(INVALID_VALUE_TYPE, "invalid JSON value type"); +fail_num: + return_err(NAN_OR_INF, "nan or inf number is not allowed"); +fail_str: + return_err(INVALID_STRING, "invalid utf-8 encoding in string"); + +#undef return_err +#undef incr_len +#undef check_str_len +} + +static char *yyjson_mut_write_opts_impl(const yyjson_mut_val *val, + usize estimated_val_num, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + usize *dat_len, + yyjson_write_err *err) { + yyjson_write_err dummy_err; + usize dummy_dat_len; + yyjson_alc alc = alc_ptr ? *alc_ptr : YYJSON_DEFAULT_ALC; + yyjson_mut_val *root = constcast(yyjson_mut_val *)val; + + err = err ? err : &dummy_err; + dat_len = dat_len ? dat_len : &dummy_dat_len; + + if (unlikely(!root)) { + *dat_len = 0; + err->msg = "input JSON is NULL"; + err->code = YYJSON_WRITE_ERROR_INVALID_PARAMETER; + return NULL; + } + + if (!unsafe_yyjson_is_ctn(root) || unsafe_yyjson_get_len(root) == 0) { + return (char *)yyjson_mut_write_single(root, flg, alc, dat_len, err); + } else if (flg & (YYJSON_WRITE_PRETTY | YYJSON_WRITE_PRETTY_TWO_SPACES)) { + return (char *)yyjson_mut_write_pretty(root, estimated_val_num, + flg, alc, dat_len, err); + } else { + return (char *)yyjson_mut_write_minify(root, estimated_val_num, + flg, alc, dat_len, err); + } +} + +char *yyjson_mut_val_write_opts(const yyjson_mut_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + usize *dat_len, + yyjson_write_err *err) { + return yyjson_mut_write_opts_impl(val, 0, flg, alc_ptr, dat_len, err); +} + +char *yyjson_mut_write_opts(const yyjson_mut_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + usize *dat_len, + yyjson_write_err *err) { + yyjson_mut_val *root; + usize estimated_val_num; + if (likely(doc)) { + root = doc->root; + estimated_val_num = yyjson_mut_doc_estimated_val_num(doc); + } else { + root = NULL; + estimated_val_num = 0; + } + return yyjson_mut_write_opts_impl(root, estimated_val_num, + flg, alc_ptr, dat_len, err); +} + +bool yyjson_mut_val_write_file(const char *path, + const yyjson_mut_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + yyjson_write_err *err) { + yyjson_write_err dummy_err; + u8 *dat; + usize dat_len = 0; + yyjson_mut_val *root = constcast(yyjson_mut_val *)val; + bool suc; + + alc_ptr = alc_ptr ? alc_ptr : &YYJSON_DEFAULT_ALC; + err = err ? err : &dummy_err; + if (unlikely(!path || !*path)) { + err->msg = "input path is invalid"; + err->code = YYJSON_WRITE_ERROR_INVALID_PARAMETER; + return false; + } + + dat = (u8 *)yyjson_mut_val_write_opts(root, flg, alc_ptr, &dat_len, err); + if (unlikely(!dat)) return false; + suc = write_dat_to_file(path, dat, dat_len, err); + alc_ptr->free(alc_ptr->ctx, dat); + return suc; +} + +bool yyjson_mut_val_write_fp(FILE *fp, + const yyjson_mut_val *val, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + yyjson_write_err *err) { + yyjson_write_err dummy_err; + u8 *dat; + usize dat_len = 0; + yyjson_mut_val *root = constcast(yyjson_mut_val *)val; + bool suc; + + alc_ptr = alc_ptr ? alc_ptr : &YYJSON_DEFAULT_ALC; + err = err ? err : &dummy_err; + if (unlikely(!fp)) { + err->msg = "input fp is invalid"; + err->code = YYJSON_WRITE_ERROR_INVALID_PARAMETER; + return false; + } + + dat = (u8 *)yyjson_mut_val_write_opts(root, flg, alc_ptr, &dat_len, err); + if (unlikely(!dat)) return false; + suc = write_dat_to_fp(fp, dat, dat_len, err); + alc_ptr->free(alc_ptr->ctx, dat); + return suc; +} + +bool yyjson_mut_write_file(const char *path, + const yyjson_mut_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + yyjson_write_err *err) { + yyjson_mut_val *root = doc ? doc->root : NULL; + return yyjson_mut_val_write_file(path, root, flg, alc_ptr, err); +} + +bool yyjson_mut_write_fp(FILE *fp, + const yyjson_mut_doc *doc, + yyjson_write_flag flg, + const yyjson_alc *alc_ptr, + yyjson_write_err *err) { + yyjson_mut_val *root = doc ? doc->root : NULL; + return yyjson_mut_val_write_fp(fp, root, flg, alc_ptr, err); +} + +#if defined(__clang__) +# pragma clang diagnostic pop +#elif defined(__GNUC__) +# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# pragma GCC diagnostic pop +# endif +#elif defined(_MSC_VER) +# pragma warning(pop) +#endif /* warning suppress end */ + +#endif /* YYJSON_DISABLE_WRITER */ + +} // namespace duckdb_yyjson diff --git a/src/duckdb/ub_src_catalog.cpp b/src/duckdb/ub_src_catalog.cpp index 717a9aa3..5578f46a 100644 --- a/src/duckdb/ub_src_catalog.cpp +++ b/src/duckdb/ub_src_catalog.cpp @@ -1,5 +1,7 @@ #include "src/catalog/catalog_entry.cpp" +#include "src/catalog/catalog_entry_retriever.cpp" + #include "src/catalog/catalog.cpp" #include "src/catalog/catalog_search_path.cpp" diff --git a/src/duckdb/ub_src_common.cpp b/src/duckdb/ub_src_common.cpp index 948f1c10..1203ccd4 100644 --- a/src/duckdb/ub_src_common.cpp +++ b/src/duckdb/ub_src_common.cpp @@ -36,6 +36,8 @@ #include "src/common/local_file_system.cpp" +#include "src/common/multi_file_list.cpp" + #include "src/common/multi_file_reader.cpp" #include "src/common/error_data.cpp" diff --git a/src/duckdb/ub_src_execution_index.cpp b/src/duckdb/ub_src_execution_index.cpp index 6d5926bd..3e02d30a 100644 --- a/src/duckdb/ub_src_execution_index.cpp +++ b/src/duckdb/ub_src_execution_index.cpp @@ -2,7 +2,9 @@ #include "src/execution/index/fixed_size_buffer.cpp" -#include "src/execution/index/unknown_index.cpp" +#include "src/execution/index/unbound_index.cpp" #include "src/execution/index/index_type_set.cpp" +#include "src/execution/index/bound_index.cpp" + diff --git a/src/duckdb/ub_src_execution_operator_helper.cpp b/src/duckdb/ub_src_execution_operator_helper.cpp index 42693ecc..cb2965eb 100644 --- a/src/duckdb/ub_src_execution_operator_helper.cpp +++ b/src/duckdb/ub_src_execution_operator_helper.cpp @@ -34,6 +34,8 @@ #include "src/execution/operator/helper/physical_transaction.cpp" +#include "src/execution/operator/helper/physical_update_extensions.cpp" + #include "src/execution/operator/helper/physical_vacuum.cpp" #include "src/execution/operator/helper/physical_verify_vector.cpp" diff --git a/src/duckdb/ub_src_function_table_system.cpp b/src/duckdb/ub_src_function_table_system.cpp index a16a9d1a..3f7a0a7d 100644 --- a/src/duckdb/ub_src_function_table_system.cpp +++ b/src/duckdb/ub_src_function_table_system.cpp @@ -22,6 +22,8 @@ #include "src/function/table/system/duckdb_secrets.cpp" +#include "src/function/table/system/duckdb_which_secret.cpp" + #include "src/function/table/system/duckdb_sequences.cpp" #include "src/function/table/system/duckdb_settings.cpp" diff --git a/src/duckdb/ub_src_main.cpp b/src/duckdb/ub_src_main.cpp index 9bbd9634..466449c0 100644 --- a/src/duckdb/ub_src_main.cpp +++ b/src/duckdb/ub_src_main.cpp @@ -6,6 +6,8 @@ #include "src/main/client_context.cpp" +#include "src/main/client_context_wrapper.cpp" + #include "src/main/client_data.cpp" #include "src/main/client_verify.cpp" @@ -30,6 +32,8 @@ #include "src/main/extension.cpp" +#include "src/main/extension_install_info.cpp" + #include "src/main/materialized_query_result.cpp" #include "src/main/pending_query_result.cpp" diff --git a/src/duckdb/ub_src_main_relation.cpp b/src/duckdb/ub_src_main_relation.cpp index 57b5f3f2..e2ac9be3 100644 --- a/src/duckdb/ub_src_main_relation.cpp +++ b/src/duckdb/ub_src_main_relation.cpp @@ -42,6 +42,8 @@ #include "src/main/relation/value_relation.cpp" +#include "src/main/relation/materialized_relation.cpp" + #include "src/main/relation/view_relation.cpp" #include "src/main/relation/write_parquet_relation.cpp" diff --git a/src/duckdb/ub_src_optimizer.cpp b/src/duckdb/ub_src_optimizer.cpp index d7e5a7b7..fadbad96 100644 --- a/src/duckdb/ub_src_optimizer.cpp +++ b/src/duckdb/ub_src_optimizer.cpp @@ -1,5 +1,7 @@ #include "src/optimizer/column_binding_replacer.cpp" +#include "src/optimizer/column_lifetime_analyzer.cpp" + #include "src/optimizer/common_aggregate_optimizer.cpp" #include "src/optimizer/compressed_materialization.cpp" @@ -8,24 +10,20 @@ #include "src/optimizer/deliminator.cpp" -#include "src/optimizer/unnest_rewriter.cpp" - -#include "src/optimizer/column_lifetime_analyzer.cpp" - #include "src/optimizer/expression_heuristics.cpp" -#include "src/optimizer/filter_combiner.cpp" +#include "src/optimizer/expression_rewriter.cpp" -#include "src/optimizer/filter_pushdown.cpp" +#include "src/optimizer/filter_combiner.cpp" #include "src/optimizer/filter_pullup.cpp" +#include "src/optimizer/filter_pushdown.cpp" + #include "src/optimizer/in_clause_rewriter.cpp" #include "src/optimizer/optimizer.cpp" -#include "src/optimizer/expression_rewriter.cpp" - #include "src/optimizer/regex_range_filter.cpp" #include "src/optimizer/remove_duplicate_groups.cpp" @@ -36,3 +34,5 @@ #include "src/optimizer/topn_optimizer.cpp" +#include "src/optimizer/unnest_rewriter.cpp" + diff --git a/src/duckdb/ub_src_optimizer_join_order.cpp b/src/duckdb/ub_src_optimizer_join_order.cpp index a600f40e..dd3f7753 100644 --- a/src/duckdb/ub_src_optimizer_join_order.cpp +++ b/src/duckdb/ub_src_optimizer_join_order.cpp @@ -4,8 +4,6 @@ #include "src/optimizer/join_order/join_node.cpp" -#include "src/optimizer/join_order/estimated_properties.cpp" - #include "src/optimizer/join_order/join_order_optimizer.cpp" #include "src/optimizer/join_order/cardinality_estimator.cpp" diff --git a/src/duckdb/ub_src_optimizer_rule.cpp b/src/duckdb/ub_src_optimizer_rule.cpp index 08621cce..5e248493 100644 --- a/src/duckdb/ub_src_optimizer_rule.cpp +++ b/src/duckdb/ub_src_optimizer_rule.cpp @@ -18,13 +18,15 @@ #include "src/optimizer/rule/equal_or_null_simplification.cpp" -#include "src/optimizer/rule/move_constants.cpp" +#include "src/optimizer/rule/in_clause_simplification_rule.cpp" #include "src/optimizer/rule/like_optimizations.cpp" -#include "src/optimizer/rule/in_clause_simplification_rule.cpp" +#include "src/optimizer/rule/move_constants.cpp" #include "src/optimizer/rule/ordered_aggregate_optimizer.cpp" #include "src/optimizer/rule/regex_optimizations.cpp" +#include "src/optimizer/rule/timestamp_comparison.cpp" + diff --git a/src/duckdb/ub_src_parser_parsed_data.cpp b/src/duckdb/ub_src_parser_parsed_data.cpp index cfc15712..47459ee1 100644 --- a/src/duckdb/ub_src_parser_parsed_data.cpp +++ b/src/duckdb/ub_src_parser_parsed_data.cpp @@ -10,6 +10,8 @@ #include "src/parser/parsed_data/comment_on_column_info.cpp" +#include "src/parser/parsed_data/copy_info.cpp" + #include "src/parser/parsed_data/create_info.cpp" #include "src/parser/parsed_data/create_index_info.cpp" @@ -28,6 +30,8 @@ #include "src/parser/parsed_data/create_sequence_info.cpp" +#include "src/parser/parsed_data/create_schema_info.cpp" + #include "src/parser/parsed_data/create_scalar_function_info.cpp" #include "src/parser/parsed_data/create_table_function_info.cpp" @@ -44,9 +48,15 @@ #include "src/parser/parsed_data/extra_drop_info.cpp" +#include "src/parser/parsed_data/load_info.cpp" + #include "src/parser/parsed_data/sample_options.cpp" +#include "src/parser/parsed_data/parse_info.cpp" + #include "src/parser/parsed_data/transaction_info.cpp" +#include "src/parser/parsed_data/pragma_info.cpp" + #include "src/parser/parsed_data/vacuum_info.cpp" diff --git a/src/duckdb/ub_src_parser_statement.cpp b/src/duckdb/ub_src_parser_statement.cpp index a2f3d2b5..b6230e85 100644 --- a/src/duckdb/ub_src_parser_statement.cpp +++ b/src/duckdb/ub_src_parser_statement.cpp @@ -44,5 +44,7 @@ #include "src/parser/statement/update_statement.cpp" +#include "src/parser/statement/update_extensions_statement.cpp" + #include "src/parser/statement/vacuum_statement.cpp" diff --git a/src/duckdb/ub_src_parser_tableref.cpp b/src/duckdb/ub_src_parser_tableref.cpp index b6075a88..cb48de65 100644 --- a/src/duckdb/ub_src_parser_tableref.cpp +++ b/src/duckdb/ub_src_parser_tableref.cpp @@ -4,6 +4,8 @@ #include "src/parser/tableref/expressionlistref.cpp" +#include "src/parser/tableref/column_data_ref.cpp" + #include "src/parser/tableref/joinref.cpp" #include "src/parser/tableref/pivotref.cpp" diff --git a/src/duckdb/ub_src_planner_binder_statement.cpp b/src/duckdb/ub_src_planner_binder_statement.cpp index fc5303ed..2abfc423 100644 --- a/src/duckdb/ub_src_planner_binder_statement.cpp +++ b/src/duckdb/ub_src_planner_binder_statement.cpp @@ -46,5 +46,7 @@ #include "src/planner/binder/statement/bind_update.cpp" +#include "src/planner/binder/statement/bind_update_extensions.cpp" + #include "src/planner/binder/statement/bind_vacuum.cpp" diff --git a/src/duckdb/ub_src_planner_binder_tableref.cpp b/src/duckdb/ub_src_planner_binder_tableref.cpp index f07091a2..997bfbff 100644 --- a/src/duckdb/ub_src_planner_binder_tableref.cpp +++ b/src/duckdb/ub_src_planner_binder_tableref.cpp @@ -4,6 +4,8 @@ #include "src/planner/binder/tableref/bind_expressionlistref.cpp" +#include "src/planner/binder/tableref/bind_column_data_ref.cpp" + #include "src/planner/binder/tableref/bind_joinref.cpp" #include "src/planner/binder/tableref/bind_pivot.cpp" @@ -22,6 +24,8 @@ #include "src/planner/binder/tableref/plan_expressionlistref.cpp" +#include "src/planner/binder/tableref/plan_column_data_ref.cpp" + #include "src/planner/binder/tableref/plan_joinref.cpp" #include "src/planner/binder/tableref/plan_subqueryref.cpp" diff --git a/src/duckdb/ub_src_storage_serialization.cpp b/src/duckdb/ub_src_storage_serialization.cpp index 3e6bfd73..93c3e445 100644 --- a/src/duckdb/ub_src_storage_serialization.cpp +++ b/src/duckdb/ub_src_storage_serialization.cpp @@ -2,8 +2,12 @@ #include "src/storage/serialization/serialize_create_info.cpp" +#include "src/storage/serialization/serialize_dependency.cpp" + #include "src/storage/serialization/serialize_expression.cpp" +#include "src/storage/serialization/serialize_extension_install_info.cpp" + #include "src/storage/serialization/serialize_extra_drop_info.cpp" #include "src/storage/serialization/serialize_logical_operator.cpp" From 493e925712dc9a8dd8c48c3cc4e3e5d9194d7797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20M=C3=BChleisen?= Date: Wed, 22 May 2024 10:51:07 +0200 Subject: [PATCH 2/3] updating type registration for test --- src/jni/duckdb_java.cpp | 47 ++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/src/jni/duckdb_java.cpp b/src/jni/duckdb_java.cpp index ae6a829f..bf2d7523 100644 --- a/src/jni/duckdb_java.cpp +++ b/src/jni/duckdb_java.cpp @@ -1,17 +1,19 @@ #include "functions.hpp" #include "duckdb.hpp" -#include "duckdb/main/client_context.hpp" -#include "duckdb/common/shared_ptr.hpp" -#include "duckdb/main/client_data.hpp" #include "duckdb/catalog/catalog_search_path.hpp" -#include "duckdb/main/appender.hpp" -#include "duckdb/common/operator/cast_operators.hpp" -#include "duckdb/main/db_instance_cache.hpp" #include "duckdb/common/arrow/result_arrow_wrapper.hpp" +#include "duckdb/common/operator/cast_operators.hpp" +#include "duckdb/common/shared_ptr.hpp" #include "duckdb/function/table/arrow.hpp" +#include "duckdb/main/appender.hpp" +#include "duckdb/main/client_context.hpp" +#include "duckdb/main/client_data.hpp" #include "duckdb/main/database_manager.hpp" +#include "duckdb/main/db_instance_cache.hpp" +#include "duckdb/main/extension_util.hpp" #include "duckdb/parser/parsed_data/create_type_info.hpp" + using namespace duckdb; using namespace std; @@ -1152,27 +1154,18 @@ void _duckdb_jdbc_arrow_register(JNIEnv *env, jclass, jobject conn_ref_buf, jlon void _duckdb_jdbc_create_extension_type(JNIEnv *env, jclass, jobject conn_buf) { - auto connection = get_connection(env, conn_buf); - if (!connection) { - return; - } - - connection->BeginTransaction(); - - child_list_t children = {{"hello", LogicalType::VARCHAR}, {"world", LogicalType::VARCHAR}}; - auto id = LogicalType::STRUCT(children); - auto type_name = "test_type"; - id.SetAlias(type_name); - CreateTypeInfo info(type_name, id); - - auto &catalog_name = DatabaseManager::GetDefaultDatabase(*connection->context); - auto &catalog = Catalog::GetCatalog(*connection->context, catalog_name); - catalog.CreateType(*connection->context, info); + auto connection = get_connection(env, conn_buf); + if (!connection) { + return; + } - LogicalType byte_test_type_type = LogicalTypeId::BLOB; - byte_test_type_type.SetAlias("byte_test_type"); - CreateTypeInfo byte_test_type("byte_test_type", byte_test_type_type); - catalog.CreateType(*connection->context, byte_test_type); + auto &db_instance = DatabaseInstance::GetDatabase(*connection->context); + child_list_t children = {{"hello", LogicalType::VARCHAR}, {"world", LogicalType::VARCHAR}}; + auto hello_world_type = LogicalType::STRUCT(children); + hello_world_type.SetAlias("test_type"); + ExtensionUtil::RegisterType(db_instance, "test_type", hello_world_type); - connection->Commit(); + LogicalType byte_test_type_type = LogicalTypeId::BLOB; + byte_test_type_type.SetAlias("byte_test_type"); + ExtensionUtil::RegisterType(db_instance, "byte_test_type", byte_test_type_type); } From fc6c3f61d1ea1f15d56299aa0f175ef940ea1a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20M=C3=BChleisen?= Date: Wed, 22 May 2024 12:23:00 +0200 Subject: [PATCH 3/3] update vendored sources again --- src/duckdb/src/function/table/version/pragma_version.cpp | 2 +- src/duckdb/src/planner/binder/statement/bind_create.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index 0f59f375..e4a43ea0 100644 --- a/src/duckdb/src/function/table/version/pragma_version.cpp +++ b/src/duckdb/src/function/table/version/pragma_version.cpp @@ -11,7 +11,7 @@ #define DUCKDB_VERSION "v0.10.3" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "62d61a417f" +#define DUCKDB_SOURCE_ID "70fd6a8a24" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp" diff --git a/src/duckdb/src/planner/binder/statement/bind_create.cpp b/src/duckdb/src/planner/binder/statement/bind_create.cpp index eb31c952..ece53e6d 100644 --- a/src/duckdb/src/planner/binder/statement/bind_create.cpp +++ b/src/duckdb/src/planner/binder/statement/bind_create.cpp @@ -613,9 +613,6 @@ BoundStatement Binder::Bind(CreateStatement &stmt) { case CatalogType::INDEX_ENTRY: { auto &base = stmt.info->Cast(); - auto catalog = BindCatalog(base.catalog); - properties.modified_databases.insert(catalog); - // visit the table reference auto table_ref = make_uniq(); table_ref->catalog_name = base.catalog; @@ -631,6 +628,8 @@ BoundStatement Binder::Bind(CreateStatement &stmt) { if (table.temporary) { stmt.info->temporary = true; } + properties.modified_databases.insert(table.catalog.GetName()); + // create a plan over the bound table auto plan = CreatePlan(*bound_table); if (plan->type != LogicalOperatorType::LOGICAL_GET) {