duckdb 0.10.2-dev0.0 → 0.10.2-dev3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (699) hide show
  1. package/binding.gyp +22 -18
  2. package/binding.gyp.in +3 -0
  3. package/package.json +1 -1
  4. package/src/duckdb/extension/icu/icu-timezone.cpp +3 -1
  5. package/src/duckdb/extension/icu/icu_extension.cpp +6 -2
  6. package/src/duckdb/extension/json/buffered_json_reader.cpp +10 -3
  7. package/src/duckdb/extension/json/include/buffered_json_reader.hpp +2 -0
  8. package/src/duckdb/extension/json/include/json_scan.hpp +13 -7
  9. package/src/duckdb/extension/json/include/json_serializer.hpp +5 -4
  10. package/src/duckdb/extension/json/include/json_structure.hpp +3 -3
  11. package/src/duckdb/extension/json/json_functions/json_serialize_plan.cpp +15 -5
  12. package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +15 -6
  13. package/src/duckdb/extension/json/json_functions/json_structure.cpp +21 -20
  14. package/src/duckdb/extension/json/json_functions/read_json.cpp +37 -3
  15. package/src/duckdb/extension/json/json_functions.cpp +7 -2
  16. package/src/duckdb/extension/json/json_scan.cpp +57 -33
  17. package/src/duckdb/extension/parquet/column_reader.cpp +12 -3
  18. package/src/duckdb/extension/parquet/column_writer.cpp +44 -7
  19. package/src/duckdb/extension/parquet/include/parquet_writer.hpp +5 -1
  20. package/src/duckdb/extension/parquet/parquet_extension.cpp +30 -3
  21. package/src/duckdb/extension/parquet/parquet_metadata.cpp +1 -1
  22. package/src/duckdb/extension/parquet/parquet_writer.cpp +4 -2
  23. package/src/duckdb/extension/parquet/zstd_file_system.cpp +1 -1
  24. package/src/duckdb/src/catalog/catalog.cpp +5 -1
  25. package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +21 -5
  26. package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +8 -9
  27. package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +3 -7
  28. package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +1 -1
  29. package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +6 -7
  30. package/src/duckdb/src/catalog/catalog_entry.cpp +8 -0
  31. package/src/duckdb/src/catalog/catalog_search_path.cpp +5 -0
  32. package/src/duckdb/src/catalog/catalog_set.cpp +2 -2
  33. package/src/duckdb/src/catalog/default/default_functions.cpp +6 -6
  34. package/src/duckdb/src/catalog/default/default_schemas.cpp +1 -1
  35. package/src/duckdb/src/catalog/default/default_views.cpp +7 -7
  36. package/src/duckdb/src/catalog/dependency_catalog_set.cpp +2 -1
  37. package/src/duckdb/src/catalog/dependency_list.cpp +92 -8
  38. package/src/duckdb/src/catalog/dependency_manager.cpp +53 -68
  39. package/src/duckdb/src/catalog/duck_catalog.cpp +1 -1
  40. package/src/duckdb/src/common/adbc/adbc.cpp +287 -45
  41. package/src/duckdb/src/common/arrow/appender/union_data.cpp +2 -2
  42. package/src/duckdb/src/common/box_renderer.cpp +12 -12
  43. package/src/duckdb/src/common/crypto/md5.cpp +2 -1
  44. package/src/duckdb/src/common/enum_util.cpp +307 -1
  45. package/src/duckdb/src/common/enums/expression_type.cpp +4 -0
  46. package/src/duckdb/src/common/enums/optimizer_type.cpp +1 -1
  47. package/src/duckdb/src/common/file_system.cpp +60 -13
  48. package/src/duckdb/src/common/filename_pattern.cpp +13 -13
  49. package/src/duckdb/src/common/gzip_file_system.cpp +1 -1
  50. package/src/duckdb/src/common/http_state.cpp +1 -1
  51. package/src/duckdb/src/common/local_file_system.cpp +72 -71
  52. package/src/duckdb/src/common/multi_file_reader.cpp +48 -28
  53. package/src/duckdb/src/common/row_operations/row_matcher.cpp +2 -2
  54. package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +13 -1
  55. package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +32 -13
  56. package/src/duckdb/src/common/string_util.cpp +2 -3
  57. package/src/duckdb/src/common/tree_renderer.cpp +32 -67
  58. package/src/duckdb/src/common/types/bit.cpp +6 -6
  59. package/src/duckdb/src/common/types/data_chunk.cpp +2 -2
  60. package/src/duckdb/src/common/types/hash.cpp +6 -6
  61. package/src/duckdb/src/common/types/hyperloglog.cpp +2 -0
  62. package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +13 -0
  63. package/src/duckdb/src/common/types/row/tuple_data_layout.cpp +5 -7
  64. package/src/duckdb/src/common/types/uuid.cpp +1 -1
  65. package/src/duckdb/src/common/types/vector.cpp +22 -14
  66. package/src/duckdb/src/common/types.cpp +8 -1
  67. package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +20 -18
  68. package/src/duckdb/src/common/vector_operations/generators.cpp +1 -1
  69. package/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +267 -110
  70. package/src/duckdb/src/common/vector_operations/vector_hash.cpp +52 -23
  71. package/src/duckdb/src/common/virtual_file_system.cpp +33 -20
  72. package/src/duckdb/src/core_functions/aggregate/algebraic/avg.cpp +2 -2
  73. package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +3 -3
  74. package/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp +31 -16
  75. package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +3 -0
  76. package/src/duckdb/src/core_functions/aggregate/nested/list.cpp +2 -0
  77. package/src/duckdb/src/core_functions/core_functions.cpp +1 -1
  78. package/src/duckdb/src/core_functions/function_list.cpp +2 -2
  79. package/src/duckdb/src/core_functions/scalar/date/time_bucket.cpp +1 -1
  80. package/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp +46 -17
  81. package/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +1 -1
  82. package/src/duckdb/src/core_functions/scalar/list/flatten.cpp +82 -45
  83. package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +2 -2
  84. package/src/duckdb/src/core_functions/scalar/list/list_sort.cpp +3 -0
  85. package/src/duckdb/src/core_functions/scalar/math/numeric.cpp +3 -2
  86. package/src/duckdb/src/core_functions/scalar/string/hex.cpp +2 -4
  87. package/src/duckdb/src/core_functions/scalar/string/repeat.cpp +12 -21
  88. package/src/duckdb/src/execution/column_binding_resolver.cpp +2 -10
  89. package/src/duckdb/src/execution/expression_executor/execute_comparison.cpp +133 -66
  90. package/src/duckdb/src/execution/expression_executor/execute_function.cpp +0 -2
  91. package/src/duckdb/src/execution/expression_executor.cpp +0 -4
  92. package/src/duckdb/src/execution/expression_executor_state.cpp +1 -1
  93. package/src/duckdb/src/execution/index/art/art.cpp +2 -2
  94. package/src/duckdb/src/execution/index/unknown_index.cpp +13 -13
  95. package/src/duckdb/src/execution/join_hashtable.cpp +1 -1
  96. package/src/duckdb/src/execution/nested_loop_join/nested_loop_join_mark.cpp +0 -1
  97. package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp +10 -7
  98. package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +32 -1
  99. package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp +16 -2
  100. package/src/duckdb/src/execution/operator/csv_scanner/scanner/scanner_boundary.cpp +7 -7
  101. package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +354 -159
  102. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +11 -2
  103. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +22 -7
  104. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +1 -1
  105. package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine_cache.cpp +10 -10
  106. package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +9 -18
  107. package/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +180 -47
  108. package/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp +100 -58
  109. package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +88 -21
  110. package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +12 -13
  111. package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +2 -0
  112. package/src/duckdb/src/execution/operator/persistent/csv_rejects_table.cpp +118 -23
  113. package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +2 -2
  114. package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +14 -5
  115. package/src/duckdb/src/execution/operator/persistent/physical_copy_database.cpp +1 -1
  116. package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +5 -5
  117. package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +1 -1
  118. package/src/duckdb/src/execution/physical_plan/plan_simple.cpp +0 -9
  119. package/src/duckdb/src/execution/physical_plan/plan_vacuum.cpp +18 -0
  120. package/src/duckdb/src/execution/physical_plan_generator.cpp +5 -3
  121. package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +81 -106
  122. package/src/duckdb/src/execution/reservoir_sample.cpp +1 -1
  123. package/src/duckdb/src/execution/window_executor.cpp +48 -28
  124. package/src/duckdb/src/execution/window_segment_tree.cpp +20 -23
  125. package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +1 -1
  126. package/src/duckdb/src/function/cast/enum_casts.cpp +20 -55
  127. package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +10 -9
  128. package/src/duckdb/src/function/cast_rules.cpp +9 -1
  129. package/src/duckdb/src/function/compression_config.cpp +1 -1
  130. package/src/duckdb/src/function/function_binder.cpp +45 -44
  131. package/src/duckdb/src/function/function_set.cpp +9 -9
  132. package/src/duckdb/src/function/pragma/pragma_queries.cpp +1 -2
  133. package/src/duckdb/src/function/scalar/compressed_materialization/compress_integral.cpp +21 -5
  134. package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +2 -2
  135. package/src/duckdb/src/function/scalar/list/list_select.cpp +5 -2
  136. package/src/duckdb/src/function/scalar/list/list_zip.cpp +5 -4
  137. package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +60 -32
  138. package/src/duckdb/src/function/scalar/sequence/nextval.cpp +1 -1
  139. package/src/duckdb/src/function/scalar/strftime_format.cpp +31 -25
  140. package/src/duckdb/src/function/scalar/string/caseconvert.cpp +6 -6
  141. package/src/duckdb/src/function/scalar/string/length.cpp +23 -2
  142. package/src/duckdb/src/function/scalar/string/like.cpp +1 -1
  143. package/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +1 -1
  144. package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +3 -3
  145. package/src/duckdb/src/function/table/arrow/arrow_array_scan_state.cpp +1 -1
  146. package/src/duckdb/src/function/table/arrow.cpp +7 -1
  147. package/src/duckdb/src/function/table/copy_csv.cpp +17 -13
  148. package/src/duckdb/src/function/table/read_csv.cpp +52 -39
  149. package/src/duckdb/src/function/table/sniff_csv.cpp +7 -13
  150. package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +1 -1
  151. package/src/duckdb/src/function/table/system/duckdb_databases.cpp +7 -1
  152. package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +12 -2
  153. package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +1 -2
  154. package/src/duckdb/src/function/table/system/duckdb_tables.cpp +2 -2
  155. package/src/duckdb/src/function/table/system/pragma_metadata_info.cpp +9 -2
  156. package/src/duckdb/src/function/table/system/pragma_table_info.cpp +10 -6
  157. package/src/duckdb/src/function/table/table_scan.cpp +1 -4
  158. package/src/duckdb/src/function/table/version/pragma_version.cpp +3 -3
  159. package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +6 -2
  160. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +1 -1
  161. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp +1 -1
  162. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +1 -1
  163. package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +6 -1
  164. package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +3 -3
  165. package/src/duckdb/src/include/duckdb/catalog/default/default_functions.hpp +3 -3
  166. package/src/duckdb/src/include/duckdb/catalog/dependency.hpp +26 -4
  167. package/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp +39 -6
  168. package/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp +19 -14
  169. package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +1 -1
  170. package/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp +4 -0
  171. package/src/duckdb/src/include/duckdb/common/allocator.hpp +3 -3
  172. package/src/duckdb/src/include/duckdb/common/arrow/arrow_wrapper.hpp +1 -1
  173. package/src/duckdb/src/include/duckdb/common/bit_utils.hpp +1 -1
  174. package/src/duckdb/src/include/duckdb/common/box_renderer.hpp +16 -16
  175. package/src/duckdb/src/include/duckdb/common/crypto/md5.hpp +0 -1
  176. package/src/duckdb/src/include/duckdb/common/enum_util.hpp +32 -0
  177. package/src/duckdb/src/include/duckdb/common/enums/expression_type.hpp +4 -2
  178. package/src/duckdb/src/include/duckdb/common/exception/binder_exception.hpp +14 -10
  179. package/src/duckdb/src/include/duckdb/common/exception/catalog_exception.hpp +4 -4
  180. package/src/duckdb/src/include/duckdb/common/exception/conversion_exception.hpp +6 -6
  181. package/src/duckdb/src/include/duckdb/common/exception/http_exception.hpp +3 -3
  182. package/src/duckdb/src/include/duckdb/common/exception/parser_exception.hpp +4 -4
  183. package/src/duckdb/src/include/duckdb/common/exception/transaction_exception.hpp +2 -2
  184. package/src/duckdb/src/include/duckdb/common/exception.hpp +57 -58
  185. package/src/duckdb/src/include/duckdb/common/exception_format_value.hpp +2 -2
  186. package/src/duckdb/src/include/duckdb/common/extra_type_info.hpp +2 -2
  187. package/src/duckdb/src/include/duckdb/common/file_open_flags.hpp +134 -0
  188. package/src/duckdb/src/include/duckdb/common/file_opener.hpp +9 -6
  189. package/src/duckdb/src/include/duckdb/common/file_system.hpp +35 -36
  190. package/src/duckdb/src/include/duckdb/common/filename_pattern.hpp +4 -6
  191. package/src/duckdb/src/include/duckdb/common/fixed_size_map.hpp +13 -13
  192. package/src/duckdb/src/include/duckdb/common/helper.hpp +42 -47
  193. package/src/duckdb/src/include/duckdb/common/http_state.hpp +1 -1
  194. package/src/duckdb/src/include/duckdb/common/hugeint.hpp +2 -2
  195. package/src/duckdb/src/include/duckdb/common/index_vector.hpp +10 -10
  196. package/src/duckdb/src/include/duckdb/common/local_file_system.hpp +13 -10
  197. package/src/duckdb/src/include/duckdb/common/memory_safety.hpp +3 -3
  198. package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +1 -1
  199. package/src/duckdb/src/include/duckdb/common/opener_file_system.hpp +50 -24
  200. package/src/duckdb/src/include/duckdb/common/operator/abs.hpp +12 -4
  201. package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +5 -5
  202. package/src/duckdb/src/include/duckdb/common/pipe_file_system.hpp +1 -1
  203. package/src/duckdb/src/include/duckdb/common/platform.h +1 -1
  204. package/src/duckdb/src/include/duckdb/common/printer.hpp +5 -5
  205. package/src/duckdb/src/include/duckdb/common/profiler.hpp +2 -2
  206. package/src/duckdb/src/include/duckdb/common/progress_bar/display/terminal_progress_bar_display.hpp +5 -5
  207. package/src/duckdb/src/include/duckdb/common/random_engine.hpp +1 -1
  208. package/src/duckdb/src/include/duckdb/common/re2_regex.hpp +7 -7
  209. package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +3 -0
  210. package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_writer.hpp +2 -2
  211. package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +17 -6
  212. package/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp +12 -0
  213. package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +14 -0
  214. package/src/duckdb/src/include/duckdb/common/serializer/serializer.hpp +16 -0
  215. package/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp +3 -0
  216. package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +2 -0
  217. package/src/duckdb/src/include/duckdb/common/string_util.hpp +4 -4
  218. package/src/duckdb/src/include/duckdb/common/tree_renderer.hpp +24 -25
  219. package/src/duckdb/src/include/duckdb/common/typedefs.hpp +5 -5
  220. package/src/duckdb/src/include/duckdb/common/types/cast_helpers.hpp +1 -2
  221. package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +10 -10
  222. package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection_iterators.hpp +5 -5
  223. package/src/duckdb/src/include/duckdb/common/types/column/partitioned_column_data.hpp +1 -1
  224. package/src/duckdb/src/include/duckdb/common/types/constraint_conflict_info.hpp +1 -2
  225. package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +2 -2
  226. package/src/duckdb/src/include/duckdb/common/types/date.hpp +1 -1
  227. package/src/duckdb/src/include/duckdb/common/types/hash.hpp +5 -5
  228. package/src/duckdb/src/include/duckdb/common/types/hyperloglog.hpp +1 -1
  229. package/src/duckdb/src/include/duckdb/common/types/interval.hpp +4 -4
  230. package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +1 -1
  231. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_layout.hpp +10 -3
  232. package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp +1 -1
  233. package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +12 -12
  234. package/src/duckdb/src/include/duckdb/common/types/string_heap.hpp +1 -1
  235. package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +21 -20
  236. package/src/duckdb/src/include/duckdb/common/types/time.hpp +2 -2
  237. package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +3 -3
  238. package/src/duckdb/src/include/duckdb/common/types/uuid.hpp +2 -2
  239. package/src/duckdb/src/include/duckdb/common/types/value.hpp +2 -2
  240. package/src/duckdb/src/include/duckdb/common/types/vector.hpp +15 -7
  241. package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +1 -1
  242. package/src/duckdb/src/include/duckdb/common/types.hpp +14 -10
  243. package/src/duckdb/src/include/duckdb/common/uhugeint.hpp +2 -2
  244. package/src/duckdb/src/include/duckdb/common/union_by_name.hpp +1 -1
  245. package/src/duckdb/src/include/duckdb/common/unique_ptr.hpp +15 -14
  246. package/src/duckdb/src/include/duckdb/common/vector.hpp +21 -21
  247. package/src/duckdb/src/include/duckdb/common/vector_operations/aggregate_executor.hpp +2 -0
  248. package/src/duckdb/src/include/duckdb/common/vector_operations/general_cast.hpp +2 -1
  249. package/src/duckdb/src/include/duckdb/common/vector_operations/generic_executor.hpp +2 -3
  250. package/src/duckdb/src/include/duckdb/common/vector_operations/unary_executor.hpp +3 -2
  251. package/src/duckdb/src/include/duckdb/common/vector_operations/vector_operations.hpp +50 -32
  252. package/src/duckdb/src/include/duckdb/common/virtual_file_system.hpp +10 -11
  253. package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +1 -1
  254. package/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp +13 -1
  255. package/src/duckdb/src/include/duckdb/core_functions/function_list.hpp +1 -1
  256. package/src/duckdb/src/include/duckdb/core_functions/lambda_functions.hpp +2 -1
  257. package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +1 -1
  258. package/src/duckdb/src/include/duckdb/execution/column_binding_resolver.hpp +1 -1
  259. package/src/duckdb/src/include/duckdb/execution/expression_executor.hpp +1 -1
  260. package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +2 -5
  261. package/src/duckdb/src/include/duckdb/execution/merge_sort_tree.hpp +3 -3
  262. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/aggregate_object.hpp +2 -2
  263. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/distinct_aggregate_data.hpp +1 -1
  264. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp +1 -1
  265. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp +0 -3
  266. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer.hpp +9 -6
  267. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer_manager.hpp +3 -0
  268. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp +40 -22
  269. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_handle.hpp +5 -0
  270. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp +1 -0
  271. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_option.hpp +6 -4
  272. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +24 -10
  273. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state_machine.hpp +4 -0
  274. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/global_csv_state.hpp +3 -1
  275. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/skip_scanner.hpp +0 -3
  276. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +58 -17
  277. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +1 -1
  278. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +1 -1
  279. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_prepare.hpp +3 -3
  280. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +1 -1
  281. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +4 -1
  282. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_rejects_table.hpp +16 -5
  283. package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +6 -6
  284. package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +2 -1
  285. package/src/duckdb/src/include/duckdb/execution/window_executor.hpp +1 -1
  286. package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +1 -1
  287. package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +1 -1
  288. package/src/duckdb/src/include/duckdb/function/cast/cast_function_set.hpp +5 -5
  289. package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +4 -4
  290. package/src/duckdb/src/include/duckdb/function/cast/vector_cast_helpers.hpp +6 -6
  291. package/src/duckdb/src/include/duckdb/function/compression_function.hpp +4 -4
  292. package/src/duckdb/src/include/duckdb/function/copy_function.hpp +10 -13
  293. package/src/duckdb/src/include/duckdb/function/function.hpp +3 -3
  294. package/src/duckdb/src/include/duckdb/function/function_binder.hpp +24 -23
  295. package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +1 -1
  296. package/src/duckdb/src/include/duckdb/function/function_set.hpp +1 -1
  297. package/src/duckdb/src/include/duckdb/function/pragma_function.hpp +1 -1
  298. package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +3 -3
  299. package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +7 -7
  300. package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +3 -3
  301. package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +6 -6
  302. package/src/duckdb/src/include/duckdb/function/table/arrow/arrow_duck_schema.hpp +4 -4
  303. package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +2 -2
  304. package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -3
  305. package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +1 -1
  306. package/src/duckdb/src/include/duckdb/function/table_function.hpp +12 -11
  307. package/src/duckdb/src/include/duckdb/function/udf_function.hpp +66 -60
  308. package/src/duckdb/src/include/duckdb/main/appender.hpp +6 -6
  309. package/src/duckdb/src/include/duckdb/main/attached_database.hpp +3 -1
  310. package/src/duckdb/src/include/duckdb/main/buffered_data/buffered_data.hpp +2 -2
  311. package/src/duckdb/src/include/duckdb/main/buffered_data/simple_buffered_data.hpp +1 -1
  312. package/src/duckdb/src/include/duckdb/main/capi/capi_internal.hpp +2 -2
  313. package/src/duckdb/src/include/duckdb/main/chunk_scan_state/query_result.hpp +2 -2
  314. package/src/duckdb/src/include/duckdb/main/client_context.hpp +1 -1
  315. package/src/duckdb/src/include/duckdb/main/client_context_file_opener.hpp +3 -2
  316. package/src/duckdb/src/include/duckdb/main/client_data.hpp +1 -0
  317. package/src/duckdb/src/include/duckdb/main/client_properties.hpp +2 -1
  318. package/src/duckdb/src/include/duckdb/main/config.hpp +14 -5
  319. package/src/duckdb/src/include/duckdb/main/connection.hpp +27 -26
  320. package/src/duckdb/src/include/duckdb/main/database.hpp +19 -3
  321. package/src/duckdb/src/include/duckdb/main/database_file_opener.hpp +58 -0
  322. package/src/duckdb/src/include/duckdb/main/database_path_and_type.hpp +2 -2
  323. package/src/duckdb/src/include/duckdb/main/error_manager.hpp +6 -6
  324. package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +8 -0
  325. package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +1 -0
  326. package/src/duckdb/src/include/duckdb/main/external_dependencies.hpp +2 -1
  327. package/src/duckdb/src/include/duckdb/main/prepared_statement.hpp +8 -8
  328. package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +2 -59
  329. package/src/duckdb/src/include/duckdb/main/query_result.hpp +3 -3
  330. package/src/duckdb/src/include/duckdb/main/relation/query_relation.hpp +1 -1
  331. package/src/duckdb/src/include/duckdb/main/relation.hpp +1 -1
  332. package/src/duckdb/src/include/duckdb/main/secret/secret.hpp +11 -7
  333. package/src/duckdb/src/include/duckdb/main/secret/secret_manager.hpp +2 -2
  334. package/src/duckdb/src/include/duckdb/main/secret/secret_storage.hpp +4 -4
  335. package/src/duckdb/src/include/duckdb/main/settings.hpp +78 -70
  336. package/src/duckdb/src/include/duckdb/optimizer/column_lifetime_analyzer.hpp +45 -0
  337. package/src/duckdb/src/include/duckdb/optimizer/compressed_materialization.hpp +11 -13
  338. package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +2 -2
  339. package/src/duckdb/src/include/duckdb/optimizer/join_order/cost_model.hpp +1 -1
  340. package/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp +1 -1
  341. package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph.hpp +1 -1
  342. package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp +1 -1
  343. package/src/duckdb/src/include/duckdb/optimizer/join_order/relation_manager.hpp +1 -1
  344. package/src/duckdb/src/include/duckdb/optimizer/matcher/expression_matcher.hpp +7 -7
  345. package/src/duckdb/src/include/duckdb/optimizer/matcher/function_matcher.hpp +7 -7
  346. package/src/duckdb/src/include/duckdb/optimizer/matcher/type_matcher.hpp +1 -1
  347. package/src/duckdb/src/include/duckdb/optimizer/optimizer.hpp +3 -0
  348. package/src/duckdb/src/include/duckdb/optimizer/statistics_propagator.hpp +32 -30
  349. package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +1 -1
  350. package/src/duckdb/src/include/duckdb/parallel/event.hpp +1 -1
  351. package/src/duckdb/src/include/duckdb/parallel/executor_task.hpp +1 -1
  352. package/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +2 -2
  353. package/src/duckdb/src/include/duckdb/parallel/pipeline_event.hpp +1 -1
  354. package/src/duckdb/src/include/duckdb/parser/column_list.hpp +4 -4
  355. package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +49 -8
  356. package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +1 -1
  357. package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +1 -1
  358. package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +1 -1
  359. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_scalar_function_info.hpp +1 -1
  360. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp +1 -1
  361. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +1 -1
  362. package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_database_info.hpp +40 -0
  363. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +2 -1
  364. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +1 -0
  365. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +2 -1
  366. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +1 -1
  367. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_pragma_function_info.hpp +1 -1
  368. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_secret_info.hpp +2 -2
  369. package/src/duckdb/src/include/duckdb/parser/parsed_data/extra_drop_info.hpp +3 -3
  370. package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +3 -2
  371. package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +2 -5
  372. package/src/duckdb/src/include/duckdb/parser/parser.hpp +1 -1
  373. package/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +3 -3
  374. package/src/duckdb/src/include/duckdb/parser/query_error_context.hpp +1 -1
  375. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +3 -5
  376. package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +2 -2
  377. package/src/duckdb/src/include/duckdb/planner/binder.hpp +16 -9
  378. package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +1 -1
  379. package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +1 -1
  380. package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +1 -1
  381. package/src/duckdb/src/include/duckdb/planner/expression/bound_expanded_expression.hpp +34 -0
  382. package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +1 -1
  383. package/src/duckdb/src/include/duckdb/planner/expression.hpp +1 -1
  384. package/src/duckdb/src/include/duckdb/planner/expression_binder/base_select_binder.hpp +5 -8
  385. package/src/duckdb/src/include/duckdb/planner/expression_binder/column_alias_binder.hpp +3 -4
  386. package/src/duckdb/src/include/duckdb/planner/expression_binder/group_binder.hpp +3 -2
  387. package/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp +3 -5
  388. package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +6 -14
  389. package/src/duckdb/src/include/duckdb/planner/expression_binder/qualify_binder.hpp +3 -6
  390. package/src/duckdb/src/include/duckdb/planner/expression_binder/select_bind_state.hpp +52 -0
  391. package/src/duckdb/src/include/duckdb/planner/expression_binder/select_binder.hpp +4 -10
  392. package/src/duckdb/src/include/duckdb/planner/expression_binder/table_function_binder.hpp +5 -2
  393. package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +1 -0
  394. package/src/duckdb/src/include/duckdb/planner/expression_iterator.hpp +2 -0
  395. package/src/duckdb/src/include/duckdb/planner/filter/conjunction_filter.hpp +3 -6
  396. package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +2 -0
  397. package/src/duckdb/src/include/duckdb/planner/logical_tokens.hpp +1 -0
  398. package/src/duckdb/src/include/duckdb/planner/operator/list.hpp +1 -0
  399. package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_database.hpp +4 -12
  400. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_secret.hpp +1 -1
  401. package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +2 -2
  402. package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +1 -1
  403. package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +1 -1
  404. package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +1 -1
  405. package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +2 -2
  406. package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +2 -2
  407. package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +2 -2
  408. package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +2 -2
  409. package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +1 -1
  410. package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +3 -2
  411. package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +3 -3
  412. package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +1 -1
  413. package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +2 -1
  414. package/src/duckdb/src/include/duckdb/planner/operator/logical_vacuum.hpp +52 -0
  415. package/src/duckdb/src/include/duckdb/planner/operator_extension.hpp +1 -1
  416. package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +2 -2
  417. package/src/duckdb/src/include/duckdb/planner/query_node/bound_select_node.hpp +5 -4
  418. package/src/duckdb/src/include/duckdb/planner/subquery/flatten_dependent_join.hpp +2 -2
  419. package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +4 -1
  420. package/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp +1 -1
  421. package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +3 -3
  422. package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +2 -3
  423. package/src/duckdb/src/include/duckdb/storage/checkpoint/string_checkpoint_state.hpp +1 -1
  424. package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +3 -3
  425. package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +5 -5
  426. package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_analyze.hpp +1 -1
  427. package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_compress.hpp +1 -1
  428. package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_fetch.hpp +1 -1
  429. package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_scan.hpp +1 -1
  430. package/src/duckdb/src/include/duckdb/storage/compression/alprd/algorithm/alprd.hpp +3 -3
  431. package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp +2 -2
  432. package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_compress.hpp +1 -1
  433. package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_fetch.hpp +1 -1
  434. package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_scan.hpp +3 -3
  435. package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/flag_buffer.hpp +1 -1
  436. package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/leading_zero_buffer.hpp +3 -3
  437. package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp.hpp +3 -3
  438. package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_analyze.hpp +0 -1
  439. package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_fetch.hpp +1 -1
  440. package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_scan.hpp +4 -4
  441. package/src/duckdb/src/include/duckdb/storage/compression/patas/patas.hpp +4 -4
  442. package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_analyze.hpp +0 -1
  443. package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_fetch.hpp +1 -1
  444. package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_scan.hpp +3 -3
  445. package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +1 -1
  446. package/src/duckdb/src/include/duckdb/storage/index.hpp +1 -1
  447. package/src/duckdb/src/include/duckdb/storage/magic_bytes.hpp +1 -1
  448. package/src/duckdb/src/include/duckdb/storage/object_cache.hpp +3 -3
  449. package/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp +1 -1
  450. package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +1 -1
  451. package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +4 -1
  452. package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +24 -24
  453. package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats_union.hpp +3 -3
  454. package/src/duckdb/src/include/duckdb/storage/statistics/segment_statistics.hpp +2 -2
  455. package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +2 -2
  456. package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +4 -4
  457. package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +9 -6
  458. package/src/duckdb/src/include/duckdb/storage/table/append_state.hpp +1 -1
  459. package/src/duckdb/src/include/duckdb/storage/table/chunk_info.hpp +2 -2
  460. package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +1 -1
  461. package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +10 -1
  462. package/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp +3 -2
  463. package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +1 -1
  464. package/src/duckdb/src/include/duckdb/storage/table/row_group_segment_tree.hpp +1 -1
  465. package/src/duckdb/src/include/duckdb/storage/table/row_version_manager.hpp +2 -1
  466. package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +3 -3
  467. package/src/duckdb/src/include/duckdb/storage/table/segment_lock.hpp +1 -1
  468. package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +4 -4
  469. package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +2 -0
  470. package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +3 -2
  471. package/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp +1 -1
  472. package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +1 -1
  473. package/src/duckdb/src/include/duckdb/storage/table_storage_info.hpp +2 -1
  474. package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +1 -1
  475. package/src/duckdb/src/include/duckdb/transaction/delete_info.hpp +20 -1
  476. package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +1 -1
  477. package/src/duckdb/src/include/duckdb/transaction/transaction_data.hpp +1 -1
  478. package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +1 -1
  479. package/src/duckdb/src/include/duckdb/transaction/update_info.hpp +1 -1
  480. package/src/duckdb/src/main/appender.cpp +1 -1
  481. package/src/duckdb/src/main/attached_database.cpp +11 -3
  482. package/src/duckdb/src/main/capi/arrow-c.cpp +6 -2
  483. package/src/duckdb/src/main/capi/cast/utils-c.cpp +1 -1
  484. package/src/duckdb/src/main/capi/duckdb-c.cpp +1 -1
  485. package/src/duckdb/src/main/capi/pending-c.cpp +1 -1
  486. package/src/duckdb/src/main/capi/prepared-c.cpp +2 -2
  487. package/src/duckdb/src/main/capi/result-c.cpp +4 -4
  488. package/src/duckdb/src/main/client_context.cpp +4 -12
  489. package/src/duckdb/src/main/client_context_file_opener.cpp +15 -3
  490. package/src/duckdb/src/main/client_data.cpp +5 -0
  491. package/src/duckdb/src/main/config.cpp +82 -82
  492. package/src/duckdb/src/main/database.cpp +31 -7
  493. package/src/duckdb/src/main/database_manager.cpp +3 -2
  494. package/src/duckdb/src/main/database_path_and_type.cpp +4 -4
  495. package/src/duckdb/src/main/error_manager.cpp +1 -1
  496. package/src/duckdb/src/main/extension/extension_alias.cpp +9 -9
  497. package/src/duckdb/src/main/extension/extension_helper.cpp +10 -5
  498. package/src/duckdb/src/main/extension/extension_install.cpp +1 -1
  499. package/src/duckdb/src/main/extension/extension_load.cpp +111 -37
  500. package/src/duckdb/src/main/query_profiler.cpp +1 -118
  501. package/src/duckdb/src/main/secret/secret_manager.cpp +1 -2
  502. package/src/duckdb/src/main/secret/secret_storage.cpp +1 -1
  503. package/src/duckdb/src/main/settings/settings.cpp +81 -65
  504. package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +8 -1
  505. package/src/duckdb/src/optimizer/compressed_materialization/compress_aggregate.cpp +3 -0
  506. package/src/duckdb/src/optimizer/compressed_materialization.cpp +26 -28
  507. package/src/duckdb/src/optimizer/cse_optimizer.cpp +5 -5
  508. package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +10 -6
  509. package/src/duckdb/src/optimizer/optimizer.cpp +14 -17
  510. package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +16 -5
  511. package/src/duckdb/src/optimizer/pushdown/pushdown_inner_join.cpp +7 -4
  512. package/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp +2 -2
  513. package/src/duckdb/src/optimizer/remove_unused_columns.cpp +3 -3
  514. package/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp +2 -2
  515. package/src/duckdb/src/optimizer/statistics/expression/propagate_aggregate.cpp +1 -1
  516. package/src/duckdb/src/optimizer/statistics/expression/propagate_between.cpp +8 -8
  517. package/src/duckdb/src/optimizer/statistics/expression/propagate_case.cpp +1 -1
  518. package/src/duckdb/src/optimizer/statistics/expression/propagate_cast.cpp +1 -1
  519. package/src/duckdb/src/optimizer/statistics/expression/propagate_columnref.cpp +1 -1
  520. package/src/duckdb/src/optimizer/statistics/expression/propagate_comparison.cpp +7 -7
  521. package/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp +6 -6
  522. package/src/duckdb/src/optimizer/statistics/expression/propagate_constant.cpp +1 -1
  523. package/src/duckdb/src/optimizer/statistics/expression/propagate_function.cpp +2 -2
  524. package/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp +10 -10
  525. package/src/duckdb/src/optimizer/statistics/operator/propagate_aggregate.cpp +1 -1
  526. package/src/duckdb/src/optimizer/statistics/operator/propagate_cross_product.cpp +1 -1
  527. package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +14 -7
  528. package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +2 -2
  529. package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +9 -9
  530. package/src/duckdb/src/optimizer/statistics/operator/propagate_limit.cpp +1 -1
  531. package/src/duckdb/src/optimizer/statistics/operator/propagate_order.cpp +1 -1
  532. package/src/duckdb/src/optimizer/statistics/operator/propagate_projection.cpp +2 -2
  533. package/src/duckdb/src/optimizer/statistics/operator/propagate_set_operation.cpp +1 -1
  534. package/src/duckdb/src/optimizer/statistics/operator/propagate_window.cpp +1 -1
  535. package/src/duckdb/src/optimizer/statistics_propagator.cpp +39 -18
  536. package/src/duckdb/src/parallel/pipeline_finish_event.cpp +1 -1
  537. package/src/duckdb/src/parallel/task_scheduler.cpp +8 -1
  538. package/src/duckdb/src/parser/constraints/unique_constraint.cpp +4 -2
  539. package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +64 -0
  540. package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +1 -0
  541. package/src/duckdb/src/parser/transform/expression/transform_function.cpp +13 -5
  542. package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +24 -0
  543. package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +1 -8
  544. package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +2 -1
  545. package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +3 -0
  546. package/src/duckdb/src/parser/transform/statement/transform_delete.cpp +2 -6
  547. package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +2 -6
  548. package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +2 -6
  549. package/src/duckdb/src/parser/transform/statement/transform_pragma.cpp +1 -1
  550. package/src/duckdb/src/parser/transform/statement/transform_select.cpp +5 -2
  551. package/src/duckdb/src/parser/transform/statement/transform_select_node.cpp +2 -8
  552. package/src/duckdb/src/parser/transform/statement/transform_update.cpp +1 -6
  553. package/src/duckdb/src/parser/transform/statement/transform_use.cpp +3 -2
  554. package/src/duckdb/src/parser/transformer.cpp +14 -2
  555. package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +40 -17
  556. package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +8 -3
  557. package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +32 -30
  558. package/src/duckdb/src/planner/binder/query_node/bind_cte_node.cpp +28 -17
  559. package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +146 -101
  560. package/src/duckdb/src/planner/binder/query_node/bind_setop_node.cpp +28 -26
  561. package/src/duckdb/src/planner/binder/query_node/plan_cte_node.cpp +29 -0
  562. package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +10 -10
  563. package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +3 -2
  564. package/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp +23 -28
  565. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +11 -12
  566. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +9 -11
  567. package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +10 -13
  568. package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +3 -3
  569. package/src/duckdb/src/planner/binder/statement/bind_set.cpp +3 -0
  570. package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +66 -65
  571. package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +54 -46
  572. package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +3 -0
  573. package/src/duckdb/src/planner/binder/tableref/bind_subqueryref.cpp +1 -1
  574. package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +5 -5
  575. package/src/duckdb/src/planner/binder.cpp +78 -6
  576. package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +11 -3
  577. package/src/duckdb/src/planner/expression/bound_expanded_expression.cpp +22 -0
  578. package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +11 -58
  579. package/src/duckdb/src/planner/expression_binder/column_alias_binder.cpp +5 -8
  580. package/src/duckdb/src/planner/expression_binder/group_binder.cpp +5 -4
  581. package/src/duckdb/src/planner/expression_binder/having_binder.cpp +5 -19
  582. package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +8 -8
  583. package/src/duckdb/src/planner/expression_binder/order_binder.cpp +42 -26
  584. package/src/duckdb/src/planner/expression_binder/qualify_binder.cpp +3 -22
  585. package/src/duckdb/src/planner/expression_binder/select_bind_state.cpp +52 -0
  586. package/src/duckdb/src/planner/expression_binder/select_binder.cpp +43 -5
  587. package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +19 -7
  588. package/src/duckdb/src/planner/logical_operator.cpp +20 -3
  589. package/src/duckdb/src/planner/operator/logical_copy_database.cpp +4 -14
  590. package/src/duckdb/src/planner/operator/logical_delete.cpp +1 -1
  591. package/src/duckdb/src/planner/operator/logical_get.cpp +1 -1
  592. package/src/duckdb/src/planner/operator/logical_insert.cpp +1 -1
  593. package/src/duckdb/src/planner/operator/logical_update.cpp +1 -1
  594. package/src/duckdb/src/planner/operator/logical_vacuum.cpp +65 -0
  595. package/src/duckdb/src/planner/planner.cpp +4 -4
  596. package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +26 -27
  597. package/src/duckdb/src/storage/arena_allocator.cpp +9 -0
  598. package/src/duckdb/src/storage/buffer/buffer_pool_reservation.cpp +1 -1
  599. package/src/duckdb/src/storage/buffer_manager.cpp +2 -10
  600. package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +2 -3
  601. package/src/duckdb/src/storage/checkpoint_manager.cpp +15 -8
  602. package/src/duckdb/src/storage/compression/bitpacking.cpp +6 -1
  603. package/src/duckdb/src/storage/compression/string_uncompressed.cpp +1 -1
  604. package/src/duckdb/src/storage/data_pointer.cpp +1 -1
  605. package/src/duckdb/src/storage/data_table.cpp +18 -7
  606. package/src/duckdb/src/storage/local_storage.cpp +8 -5
  607. package/src/duckdb/src/storage/magic_bytes.cpp +6 -5
  608. package/src/duckdb/src/storage/partial_block_manager.cpp +1 -1
  609. package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +20 -9
  610. package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +12 -10
  611. package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +23 -0
  612. package/src/duckdb/src/storage/single_file_block_manager.cpp +46 -19
  613. package/src/duckdb/src/storage/standard_buffer_manager.cpp +21 -5
  614. package/src/duckdb/src/storage/statistics/array_stats.cpp +1 -1
  615. package/src/duckdb/src/storage/statistics/base_statistics.cpp +2 -3
  616. package/src/duckdb/src/storage/statistics/list_stats.cpp +1 -1
  617. package/src/duckdb/src/storage/statistics/struct_stats.cpp +1 -1
  618. package/src/duckdb/src/storage/storage_info.cpp +19 -19
  619. package/src/duckdb/src/storage/storage_manager.cpp +18 -13
  620. package/src/duckdb/src/storage/table/chunk_info.cpp +11 -3
  621. package/src/duckdb/src/storage/table/column_data.cpp +88 -66
  622. package/src/duckdb/src/storage/table/row_group.cpp +7 -7
  623. package/src/duckdb/src/storage/table/row_version_manager.cpp +2 -2
  624. package/src/duckdb/src/storage/table/standard_column_data.cpp +4 -0
  625. package/src/duckdb/src/storage/table/update_segment.cpp +3 -1
  626. package/src/duckdb/src/storage/table_index_list.cpp +6 -1
  627. package/src/duckdb/src/storage/temporary_file_manager.cpp +1 -1
  628. package/src/duckdb/src/storage/wal_replay.cpp +8 -7
  629. package/src/duckdb/src/storage/write_ahead_log.cpp +3 -4
  630. package/src/duckdb/src/transaction/cleanup_state.cpp +10 -3
  631. package/src/duckdb/src/transaction/commit_state.cpp +11 -4
  632. package/src/duckdb/src/transaction/duck_transaction.cpp +23 -3
  633. package/src/duckdb/src/transaction/rollback_state.cpp +1 -1
  634. package/src/duckdb/src/transaction/transaction_context.cpp +1 -1
  635. package/src/duckdb/src/transaction/undo_buffer.cpp +3 -1
  636. package/src/duckdb/third_party/fmt/include/fmt/core.h +0 -5
  637. package/src/duckdb/third_party/fsst/fsst.h +1 -1
  638. package/src/duckdb/third_party/fsst/libfsst.cpp +1 -140
  639. package/src/duckdb/third_party/fsst/libfsst.hpp +0 -13
  640. package/src/duckdb/third_party/hyperloglog/hyperloglog.hpp +4 -0
  641. package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +8 -1
  642. package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +2 -1
  643. package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +15401 -15354
  644. package/src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp +299 -538
  645. package/src/duckdb/third_party/lz4/lz4.cpp +2605 -0
  646. package/src/duckdb/third_party/lz4/lz4.hpp +843 -0
  647. package/src/duckdb/third_party/parquet/parquet_types.cpp +3 -0
  648. package/src/duckdb/third_party/parquet/parquet_types.h +2 -1
  649. package/src/duckdb/third_party/re2/re2/bitmap256.cc +44 -0
  650. package/src/duckdb/third_party/re2/re2/bitmap256.h +3 -35
  651. package/src/duckdb/third_party/re2/re2/bitstate.cc +31 -24
  652. package/src/duckdb/third_party/re2/re2/compile.cc +146 -164
  653. package/src/duckdb/third_party/re2/re2/dfa.cc +174 -181
  654. package/src/duckdb/third_party/re2/re2/filtered_re2.cc +19 -3
  655. package/src/duckdb/third_party/re2/re2/filtered_re2.h +27 -23
  656. package/src/duckdb/third_party/re2/re2/mimics_pcre.cc +21 -11
  657. package/src/duckdb/third_party/re2/re2/nfa.cc +91 -131
  658. package/src/duckdb/third_party/re2/re2/onepass.cc +11 -10
  659. package/src/duckdb/third_party/re2/re2/parse.cc +171 -154
  660. package/src/duckdb/third_party/re2/re2/perl_groups.cc +35 -35
  661. package/src/duckdb/third_party/re2/re2/pod_array.h +55 -0
  662. package/src/duckdb/third_party/re2/re2/prefilter.cc +40 -40
  663. package/src/duckdb/third_party/re2/re2/prefilter.h +24 -2
  664. package/src/duckdb/third_party/re2/re2/prefilter_tree.cc +70 -84
  665. package/src/duckdb/third_party/re2/re2/prefilter_tree.h +5 -4
  666. package/src/duckdb/third_party/re2/re2/prog.cc +315 -58
  667. package/src/duckdb/third_party/re2/re2/prog.h +77 -44
  668. package/src/duckdb/third_party/re2/re2/re2.cc +333 -221
  669. package/src/duckdb/third_party/re2/re2/re2.h +277 -201
  670. package/src/duckdb/third_party/re2/re2/regexp.cc +137 -105
  671. package/src/duckdb/third_party/re2/re2/regexp.h +45 -40
  672. package/src/duckdb/third_party/re2/re2/set.cc +40 -17
  673. package/src/duckdb/third_party/re2/re2/set.h +11 -6
  674. package/src/duckdb/third_party/re2/re2/simplify.cc +50 -41
  675. package/src/duckdb/third_party/re2/re2/sparse_array.h +392 -0
  676. package/src/duckdb/third_party/re2/re2/sparse_set.h +264 -0
  677. package/src/duckdb/third_party/re2/re2/stringpiece.cc +1 -1
  678. package/src/duckdb/third_party/re2/re2/stringpiece.h +11 -8
  679. package/src/duckdb/third_party/re2/re2/tostring.cc +8 -6
  680. package/src/duckdb/third_party/re2/re2/unicode_casefold.cc +39 -10
  681. package/src/duckdb/third_party/re2/re2/unicode_casefold.h +1 -1
  682. package/src/duckdb/third_party/re2/re2/unicode_groups.cc +5019 -4566
  683. package/src/duckdb/third_party/re2/re2/unicode_groups.h +1 -1
  684. package/src/duckdb/third_party/re2/re2/walker-inl.h +21 -20
  685. package/src/duckdb/third_party/re2/util/logging.h +14 -18
  686. package/src/duckdb/third_party/re2/util/mix.h +4 -4
  687. package/src/duckdb/third_party/re2/util/mutex.h +48 -15
  688. package/src/duckdb/third_party/re2/util/rune.cc +5 -5
  689. package/src/duckdb/third_party/re2/util/strutil.cc +1 -16
  690. package/src/duckdb/third_party/re2/util/strutil.h +1 -3
  691. package/src/duckdb/third_party/re2/util/utf.h +1 -1
  692. package/src/duckdb/third_party/re2/util/util.h +9 -1
  693. package/src/duckdb/third_party/utf8proc/include/utf8proc_wrapper.hpp +2 -0
  694. package/src/duckdb/third_party/utf8proc/utf8proc_wrapper.cpp +36 -1
  695. package/src/duckdb/ub_src_common.cpp +0 -2
  696. package/src/duckdb/ub_src_execution_physical_plan.cpp +2 -0
  697. package/src/duckdb/ub_src_planner_expression.cpp +2 -0
  698. package/src/duckdb/ub_src_planner_expression_binder.cpp +2 -0
  699. package/src/duckdb/ub_src_planner_operator.cpp +2 -0
@@ -30,6 +30,19 @@
30
30
  // "(?i)hello" -- (?i) turns on case-insensitive matching
31
31
  // "/\\*(.*?)\\*/" -- .*? matches . minimum no. of times possible
32
32
  //
33
+ // The double backslashes are needed when writing C++ string literals.
34
+ // However, they should NOT be used when writing C++11 raw string literals:
35
+ //
36
+ // R"(hello (\w+) world)" -- \w matches a "word" character
37
+ // R"(version (\d+))" -- \d matches a digit
38
+ // R"(hello\s+world)" -- \s matches any whitespace character
39
+ // R"(\b(\w+)\b)" -- \b matches non-empty string at word boundary
40
+ // R"((?i)hello)" -- (?i) turns on case-insensitive matching
41
+ // R"(/\*(.*?)\*/)" -- .*? matches . minimum no. of times possible
42
+ //
43
+ // When using UTF-8 encoding, case-insensitive matching will perform
44
+ // simple case folding, not full case folding.
45
+ //
33
46
  // -----------------------------------------------------------------------
34
47
  // MATCHING INTERFACE:
35
48
  //
@@ -53,17 +66,17 @@
53
66
  // CHECK(RE2::FullMatch(latin1_string, RE2(latin1_pattern, RE2::Latin1)));
54
67
  //
55
68
  // -----------------------------------------------------------------------
56
- // MATCHING WITH SUBSTRING EXTRACTION:
69
+ // SUBMATCH EXTRACTION:
57
70
  //
58
- // You can supply extra pointer arguments to extract matched substrings.
71
+ // You can supply extra pointer arguments to extract submatches.
59
72
  // On match failure, none of the pointees will have been modified.
60
- // On match success, the substrings will be converted (as necessary) and
73
+ // On match success, the submatches will be converted (as necessary) and
61
74
  // their values will be assigned to their pointees until all conversions
62
75
  // have succeeded or one conversion has failed.
63
76
  // On conversion failure, the pointees will be in an indeterminate state
64
77
  // because the caller has no way of knowing which conversion failed.
65
78
  // However, conversion cannot fail for types like string and StringPiece
66
- // that do not inspect the substring contents. Hence, in the common case
79
+ // that do not inspect the submatch contents. Hence, in the common case
67
80
  // where all of the pointees are of such types, failure is always due to
68
81
  // match failure and thus none of the pointees will have been modified.
69
82
  //
@@ -87,10 +100,10 @@
87
100
  // Example: integer overflow causes failure
88
101
  // CHECK(!RE2::FullMatch("ruby:1234567891234", "\\w+:(\\d+)", &i));
89
102
  //
90
- // NOTE(rsc): Asking for substrings slows successful matches quite a bit.
103
+ // NOTE(rsc): Asking for submatches slows successful matches quite a bit.
91
104
  // This may get a little faster in the future, but right now is slower
92
105
  // than PCRE. On the other hand, failed matches run *very* fast (faster
93
- // than PCRE), as do matches without substring extraction.
106
+ // than PCRE), as do matches without submatch extraction.
94
107
  //
95
108
  // -----------------------------------------------------------------------
96
109
  // PARTIAL MATCHES
@@ -195,13 +208,19 @@
195
208
  #include <map>
196
209
  #include <mutex>
197
210
  #include <string>
211
+ #include <type_traits>
212
+ #include <vector>
213
+
214
+ #if defined(__APPLE__)
215
+ #include <TargetConditionals.h>
216
+ #endif
198
217
 
199
218
  #include "re2/stringpiece.h"
200
219
 
201
220
  namespace duckdb_re2 {
202
221
  class Prog;
203
222
  class Regexp;
204
- } // namespace duckdb_re2
223
+ } // namespace re2
205
224
 
206
225
  namespace duckdb_re2 {
207
226
 
@@ -229,6 +248,7 @@ class RE2 {
229
248
  ErrorBadCharRange, // bad character class range
230
249
  ErrorMissingBracket, // missing closing ]
231
250
  ErrorMissingParen, // missing closing )
251
+ ErrorUnexpectedParen, // unexpected closing )
232
252
  ErrorTrailingBackslash, // trailing \ at end of regexp
233
253
  ErrorRepeatArgument, // repeat argument missing, e.g. "*"
234
254
  ErrorRepeatSize, // bad repetition argument
@@ -254,21 +274,33 @@ class RE2 {
254
274
  // Need to have the const char* and const std::string& forms for implicit
255
275
  // conversions when passing string literals to FullMatch and PartialMatch.
256
276
  // Otherwise the StringPiece form would be sufficient.
257
- #ifndef SWIG
258
277
  RE2(const char* pattern);
259
278
  RE2(const std::string& pattern);
260
- #endif
261
279
  RE2(const StringPiece& pattern);
262
280
  RE2(const StringPiece& pattern, const Options& options);
263
281
  ~RE2();
264
282
 
283
+ // Not copyable.
284
+ // RE2 objects are expensive. You should probably use std::shared_ptr<RE2>
285
+ // instead. If you really must copy, RE2(first.pattern(), first.options())
286
+ // effectively does so: it produces a second object that mimics the first.
287
+ RE2(const RE2&) = delete;
288
+ RE2& operator=(const RE2&) = delete;
289
+ // Not movable.
290
+ // RE2 objects are thread-safe and logically immutable. You should probably
291
+ // use std::unique_ptr<RE2> instead. Otherwise, consider std::deque<RE2> if
292
+ // direct emplacement into a container is desired. If you really must move,
293
+ // be prepared to submit a design document along with your feature request.
294
+ RE2(RE2&&) = delete;
295
+ RE2& operator=(RE2&&) = delete;
296
+
265
297
  // Returns whether RE2 was created properly.
266
298
  bool ok() const { return error_code() == NoError; }
267
299
 
268
300
  // The string specification for this RE2. E.g.
269
301
  // RE2 re("ab*c?d+");
270
302
  // re.pattern(); // "ab*c?d+"
271
- const std::string& pattern() const { return pattern_; }
303
+ const std::string& pattern() const { return *pattern_; }
272
304
 
273
305
  // If RE2 could not be created properly, returns an error string.
274
306
  // Else returns the empty string.
@@ -280,18 +312,18 @@ class RE2 {
280
312
 
281
313
  // If RE2 could not be created properly, returns the offending
282
314
  // portion of the regexp.
283
- const std::string& error_arg() const { return error_arg_; }
315
+ const std::string& error_arg() const { return *error_arg_; }
284
316
 
285
317
  // Returns the program size, a very approximate measure of a regexp's "cost".
286
318
  // Larger numbers are more expensive than smaller numbers.
287
319
  int ProgramSize() const;
288
320
  int ReverseProgramSize() const;
289
321
 
290
- // EXPERIMENTAL! SUBJECT TO CHANGE!
291
- // Outputs the program fanout as a histogram bucketed by powers of 2.
322
+ // If histogram is not null, outputs the program fanout
323
+ // as a histogram bucketed by powers of 2.
292
324
  // Returns the number of the largest non-empty bucket.
293
- int ProgramFanout(std::map<int, int>* histogram) const;
294
- int ReverseProgramFanout(std::map<int, int>* histogram) const;
325
+ int ProgramFanout(std::vector<int>* histogram) const;
326
+ int ReverseProgramFanout(std::vector<int>* histogram) const;
295
327
 
296
328
  // Returns the underlying Regexp; not for general use.
297
329
  // Returns entire_regexp_ so that callers don't need
@@ -313,7 +345,6 @@ class RE2 {
313
345
  static bool FindAndConsumeN(StringPiece* input, const RE2& re,
314
346
  const Arg* const args[], int n);
315
347
 
316
- #ifndef SWIG
317
348
  private:
318
349
  template <typename F, typename SP>
319
350
  static inline bool Apply(F f, SP sp, const RE2& re) {
@@ -349,12 +380,12 @@ class RE2 {
349
380
  // (void*)NULL (the corresponding matched sub-pattern is not copied)
350
381
  //
351
382
  // Returns true iff all of the following conditions are satisfied:
352
- // a. "text" matches "re" exactly
353
- // b. The number of matched sub-patterns is >= number of supplied pointers
383
+ // a. "text" matches "re" fully - from the beginning to the end of "text".
384
+ // b. The number of matched sub-patterns is >= number of supplied pointers.
354
385
  // c. The "i"th argument has a suitable type for holding the
355
386
  // string captured as the "i"th sub-pattern. If you pass in
356
387
  // NULL for the "i"th argument, or pass fewer arguments than
357
- // number of sub-patterns, "i"th captured sub-pattern is
388
+ // number of sub-patterns, the "i"th captured sub-pattern is
358
389
  // ignored.
359
390
  //
360
391
  // CAVEAT: An optional sub-pattern that does not exist in the
@@ -368,8 +399,17 @@ class RE2 {
368
399
  return Apply(FullMatchN, text, re, Arg(std::forward<A>(a))...);
369
400
  }
370
401
 
371
- // Exactly like FullMatch(), except that "re" is allowed to match
372
- // a substring of "text".
402
+ // Like FullMatch(), except that "re" is allowed to match a substring
403
+ // of "text".
404
+ //
405
+ // Returns true iff all of the following conditions are satisfied:
406
+ // a. "text" matches "re" partially - for some substring of "text".
407
+ // b. The number of matched sub-patterns is >= number of supplied pointers.
408
+ // c. The "i"th argument has a suitable type for holding the
409
+ // string captured as the "i"th sub-pattern. If you pass in
410
+ // NULL for the "i"th argument, or pass fewer arguments than
411
+ // number of sub-patterns, the "i"th captured sub-pattern is
412
+ // ignored.
373
413
  template <typename... A>
374
414
  static bool PartialMatch(const StringPiece& text, const RE2& re, A&&... a) {
375
415
  return Apply(PartialMatchN, text, re, Arg(std::forward<A>(a))...);
@@ -378,7 +418,16 @@ class RE2 {
378
418
  // Like FullMatch() and PartialMatch(), except that "re" has to match
379
419
  // a prefix of the text, and "input" is advanced past the matched
380
420
  // text. Note: "input" is modified iff this routine returns true
381
- // and "re" matched a non-empty substring of "text".
421
+ // and "re" matched a non-empty substring of "input".
422
+ //
423
+ // Returns true iff all of the following conditions are satisfied:
424
+ // a. "input" matches "re" partially - for some prefix of "input".
425
+ // b. The number of matched sub-patterns is >= number of supplied pointers.
426
+ // c. The "i"th argument has a suitable type for holding the
427
+ // string captured as the "i"th sub-pattern. If you pass in
428
+ // NULL for the "i"th argument, or pass fewer arguments than
429
+ // number of sub-patterns, the "i"th captured sub-pattern is
430
+ // ignored.
382
431
  template <typename... A>
383
432
  static bool Consume(StringPiece* input, const RE2& re, A&&... a) {
384
433
  return Apply(ConsumeN, input, re, Arg(std::forward<A>(a))...);
@@ -388,11 +437,19 @@ class RE2 {
388
437
  // the text. That is, "re" need not start its match at the beginning
389
438
  // of "input". For example, "FindAndConsume(s, "(\\w+)", &word)" finds
390
439
  // the next word in "s" and stores it in "word".
440
+ //
441
+ // Returns true iff all of the following conditions are satisfied:
442
+ // a. "input" matches "re" partially - for some substring of "input".
443
+ // b. The number of matched sub-patterns is >= number of supplied pointers.
444
+ // c. The "i"th argument has a suitable type for holding the
445
+ // string captured as the "i"th sub-pattern. If you pass in
446
+ // NULL for the "i"th argument, or pass fewer arguments than
447
+ // number of sub-patterns, the "i"th captured sub-pattern is
448
+ // ignored.
391
449
  template <typename... A>
392
450
  static bool FindAndConsume(StringPiece* input, const RE2& re, A&&... a) {
393
451
  return Apply(FindAndConsumeN, input, re, Arg(std::forward<A>(a))...);
394
452
  }
395
- #endif
396
453
 
397
454
  // Replace the first match of "re" in "str" with "rewrite".
398
455
  // Within "rewrite", backslash-escaped digits (\1 to \9) can be
@@ -443,7 +500,7 @@ class RE2 {
443
500
 
444
501
  // Escapes all potentially meaningful regexp characters in
445
502
  // 'unquoted'. The returned string, used as a regular expression,
446
- // will exactly match the original string. For example,
503
+ // will match exactly the original string. For example,
447
504
  // 1.5-2.0?
448
505
  // may become:
449
506
  // 1\.5\-2\.0\?
@@ -475,8 +532,6 @@ class RE2 {
475
532
  ANCHOR_BOTH // Anchor at start and end
476
533
  };
477
534
 
478
- Anchor Anchored() const;
479
-
480
535
  // Return the number of capturing subpatterns, or -1 if the
481
536
  // regexp wasn't valid on construction. The overall match ($0)
482
537
  // does not count: if the regexp is "(a)(b)", returns 2.
@@ -608,11 +663,11 @@ class RE2 {
608
663
  };
609
664
 
610
665
  Options() :
666
+ max_mem_(kDefaultMaxMem),
611
667
  encoding_(EncodingUTF8),
612
668
  posix_syntax_(false),
613
669
  longest_match_(false),
614
670
  log_errors_(true),
615
- max_mem_(kDefaultMaxMem),
616
671
  literal_(false),
617
672
  never_nl_(false),
618
673
  dot_nl_(false),
@@ -625,20 +680,12 @@ class RE2 {
625
680
 
626
681
  /*implicit*/ Options(CannedOptions);
627
682
 
683
+ int64_t max_mem() const { return max_mem_; }
684
+ void set_max_mem(int64_t m) { max_mem_ = m; }
685
+
628
686
  Encoding encoding() const { return encoding_; }
629
687
  void set_encoding(Encoding encoding) { encoding_ = encoding; }
630
688
 
631
- // Legacy interface to encoding.
632
- // TODO(rsc): Remove once clients have been converted.
633
- bool utf8() const { return encoding_ == EncodingUTF8; }
634
- void set_utf8(bool b) {
635
- if (b) {
636
- encoding_ = EncodingUTF8;
637
- } else {
638
- encoding_ = EncodingLatin1;
639
- }
640
- }
641
-
642
689
  bool posix_syntax() const { return posix_syntax_; }
643
690
  void set_posix_syntax(bool b) { posix_syntax_ = b; }
644
691
 
@@ -648,9 +695,6 @@ class RE2 {
648
695
  bool log_errors() const { return log_errors_; }
649
696
  void set_log_errors(bool b) { log_errors_ = b; }
650
697
 
651
- int64_t max_mem() const { return max_mem_; }
652
- void set_max_mem(int64_t m) { max_mem_ = m; }
653
-
654
698
  bool literal() const { return literal_; }
655
699
  void set_literal(bool b) { literal_ = b; }
656
700
 
@@ -682,11 +726,11 @@ class RE2 {
682
726
  int ParseFlags() const;
683
727
 
684
728
  private:
729
+ int64_t max_mem_;
685
730
  Encoding encoding_;
686
731
  bool posix_syntax_;
687
732
  bool longest_match_;
688
733
  bool log_errors_;
689
- int64_t max_mem_;
690
734
  bool literal_;
691
735
  bool never_nl_;
692
736
  bool dot_nl_;
@@ -701,32 +745,16 @@ class RE2 {
701
745
  const Options& options() const { return options_; }
702
746
 
703
747
  // Argument converters; see below.
704
- static inline Arg CRadix(short* x);
705
- static inline Arg CRadix(unsigned short* x);
706
- static inline Arg CRadix(int* x);
707
- static inline Arg CRadix(unsigned int* x);
708
- static inline Arg CRadix(long* x);
709
- static inline Arg CRadix(unsigned long* x);
710
- static inline Arg CRadix(long long* x);
711
- static inline Arg CRadix(unsigned long long* x);
712
-
713
- static inline Arg Hex(short* x);
714
- static inline Arg Hex(unsigned short* x);
715
- static inline Arg Hex(int* x);
716
- static inline Arg Hex(unsigned int* x);
717
- static inline Arg Hex(long* x);
718
- static inline Arg Hex(unsigned long* x);
719
- static inline Arg Hex(long long* x);
720
- static inline Arg Hex(unsigned long long* x);
721
-
722
- static inline Arg Octal(short* x);
723
- static inline Arg Octal(unsigned short* x);
724
- static inline Arg Octal(int* x);
725
- static inline Arg Octal(unsigned int* x);
726
- static inline Arg Octal(long* x);
727
- static inline Arg Octal(unsigned long* x);
728
- static inline Arg Octal(long long* x);
729
- static inline Arg Octal(unsigned long long* x);
748
+ template <typename T>
749
+ static Arg CRadix(T* ptr);
750
+ template <typename T>
751
+ static Arg Hex(T* ptr);
752
+ template <typename T>
753
+ static Arg Octal(T* ptr);
754
+
755
+ // Controls the maximum count permitted by GlobalReplace(); -1 is unlimited.
756
+ // FOR FUZZING ONLY.
757
+ static void FUZZING_ONLY_set_maximum_global_replace_count(int i);
730
758
 
731
759
  private:
732
760
  void Init(const StringPiece& pattern, const Options& options);
@@ -739,166 +767,167 @@ class RE2 {
739
767
 
740
768
  duckdb_re2::Prog* ReverseProg() const;
741
769
 
742
- std::string pattern_; // string regular expression
743
- Options options_; // option flags
744
- std::string prefix_; // required prefix (before regexp_)
745
- bool prefix_foldcase_; // prefix is ASCII case-insensitive
746
- duckdb_re2::Regexp* entire_regexp_; // parsed regular expression
747
- duckdb_re2::Regexp* suffix_regexp_; // parsed regular expression, prefix removed
748
- duckdb_re2::Prog* prog_; // compiled program for regexp
749
- int num_captures_; // Number of capturing groups
750
- bool is_one_pass_; // can use prog_->SearchOnePass?
751
-
752
- mutable duckdb_re2::Prog* rprog_; // reverse program for regexp
753
- mutable const std::string* error_; // Error indicator
754
- // (or points to empty string)
755
- mutable ErrorCode error_code_; // Error code
756
- mutable std::string error_arg_; // Fragment of regexp showing error
757
-
770
+ // First cache line is relatively cold fields.
771
+ const std::string* pattern_; // string regular expression
772
+ Options options_; // option flags
773
+ duckdb_re2::Regexp* entire_regexp_; // parsed regular expression
774
+ duckdb_re2::Regexp* suffix_regexp_; // parsed regular expression, prefix_ removed
775
+ const std::string* error_; // error indicator (or points to empty string)
776
+ const std::string* error_arg_; // fragment of regexp showing error (or ditto)
777
+
778
+ // Second cache line is relatively hot fields.
779
+ // These are ordered oddly to pack everything.
780
+ int num_captures_; // number of capturing groups
781
+ ErrorCode error_code_ : 29; // error code (29 bits is more than enough)
782
+ bool longest_match_ : 1; // cached copy of options_.longest_match()
783
+ bool is_one_pass_ : 1; // can use prog_->SearchOnePass?
784
+ bool prefix_foldcase_ : 1; // prefix_ is ASCII case-insensitive
785
+ std::string prefix_; // required prefix (before suffix_regexp_)
786
+ duckdb_re2::Prog* prog_; // compiled program for regexp
787
+
788
+ // Reverse Prog for DFA execution only
789
+ mutable duckdb_re2::Prog* rprog_;
758
790
  // Map from capture names to indices
759
791
  mutable const std::map<std::string, int>* named_groups_;
760
-
761
792
  // Map from capture indices to names
762
793
  mutable const std::map<int, std::string>* group_names_;
763
794
 
764
- // Onces for lazy computations.
765
795
  mutable std::once_flag rprog_once_;
766
796
  mutable std::once_flag named_groups_once_;
767
797
  mutable std::once_flag group_names_once_;
768
-
769
- RE2(const RE2&) = delete;
770
- RE2& operator=(const RE2&) = delete;
771
798
  };
772
799
 
773
800
  /***** Implementation details *****/
774
801
 
775
- // Hex/Octal/Binary?
776
-
777
- // Special class for parsing into objects that define a ParseFrom() method
778
- template <class T>
779
- class _RE2_MatchObject {
780
- public:
781
- static inline bool Parse(const char* str, size_t n, void* dest) {
782
- if (dest == NULL) return true;
783
- T* object = reinterpret_cast<T*>(dest);
784
- return object->ParseFrom(str, n);
785
- }
786
- };
802
+ namespace re2_internal {
803
+
804
+ // Types for which the 3-ary Parse() function template has specializations.
805
+ template <typename T> struct Parse3ary : public std::false_type {};
806
+ template <> struct Parse3ary<void> : public std::true_type {};
807
+ template <> struct Parse3ary<std::string> : public std::true_type {};
808
+ template <> struct Parse3ary<StringPiece> : public std::true_type {};
809
+ template <> struct Parse3ary<char> : public std::true_type {};
810
+ template <> struct Parse3ary<signed char> : public std::true_type {};
811
+ template <> struct Parse3ary<unsigned char> : public std::true_type {};
812
+ template <> struct Parse3ary<float> : public std::true_type {};
813
+ template <> struct Parse3ary<double> : public std::true_type {};
814
+
815
+ template <typename T>
816
+ bool Parse(const char* str, size_t n, T* dest);
817
+
818
+ // Types for which the 4-ary Parse() function template has specializations.
819
+ template <typename T> struct Parse4ary : public std::false_type {};
820
+ template <> struct Parse4ary<long> : public std::true_type {};
821
+ template <> struct Parse4ary<unsigned long> : public std::true_type {};
822
+ template <> struct Parse4ary<short> : public std::true_type {};
823
+ template <> struct Parse4ary<unsigned short> : public std::true_type {};
824
+ template <> struct Parse4ary<int> : public std::true_type {};
825
+ template <> struct Parse4ary<unsigned int> : public std::true_type {};
826
+ template <> struct Parse4ary<long long> : public std::true_type {};
827
+ template <> struct Parse4ary<unsigned long long> : public std::true_type {};
828
+
829
+ template <typename T>
830
+ bool Parse(const char* str, size_t n, T* dest, int radix);
831
+
832
+ } // namespace re2_internal
787
833
 
788
834
  class RE2::Arg {
835
+ private:
836
+ template <typename T>
837
+ using CanParse3ary = typename std::enable_if<
838
+ re2_internal::Parse3ary<T>::value,
839
+ int>::type;
840
+
841
+ template <typename T>
842
+ using CanParse4ary = typename std::enable_if<
843
+ re2_internal::Parse4ary<T>::value,
844
+ int>::type;
845
+
846
+ #if !defined(_MSC_VER)
847
+ template <typename T>
848
+ using CanParseFrom = typename std::enable_if<
849
+ std::is_member_function_pointer<
850
+ decltype(static_cast<bool (T::*)(const char*, size_t)>(
851
+ &T::ParseFrom))>::value,
852
+ int>::type;
853
+ #endif
854
+
789
855
  public:
790
- // Empty constructor so we can declare arrays of RE2::Arg
791
- Arg();
856
+ Arg() : Arg(nullptr) {}
857
+ Arg(std::nullptr_t ptr) : arg_(ptr), parser_(DoNothing) {}
792
858
 
793
- // Constructor specially designed for NULL arguments
794
- Arg(void*);
795
- Arg(std::nullptr_t);
859
+ template <typename T, CanParse3ary<T> = 0>
860
+ Arg(T* ptr) : arg_(ptr), parser_(DoParse3ary<T>) {}
796
861
 
797
- typedef bool (*Parser)(const char* str, size_t n, void* dest);
862
+ template <typename T, CanParse4ary<T> = 0>
863
+ Arg(T* ptr) : arg_(ptr), parser_(DoParse4ary<T>) {}
798
864
 
799
- // Type-specific parsers
800
- #define MAKE_PARSER(type, name) \
801
- Arg(type* p) : arg_(p), parser_(name) {} \
802
- Arg(type* p, Parser parser) : arg_(p), parser_(parser) {}
803
-
804
- MAKE_PARSER(char, parse_char)
805
- MAKE_PARSER(signed char, parse_schar)
806
- MAKE_PARSER(unsigned char, parse_uchar)
807
- MAKE_PARSER(float, parse_float)
808
- MAKE_PARSER(double, parse_double)
809
- MAKE_PARSER(std::string, parse_string)
810
- MAKE_PARSER(StringPiece, parse_stringpiece)
811
-
812
- MAKE_PARSER(short, parse_short)
813
- MAKE_PARSER(unsigned short, parse_ushort)
814
- MAKE_PARSER(int, parse_int)
815
- MAKE_PARSER(unsigned int, parse_uint)
816
- MAKE_PARSER(long, parse_long)
817
- MAKE_PARSER(unsigned long, parse_ulong)
818
- MAKE_PARSER(long long, parse_longlong)
819
- MAKE_PARSER(unsigned long long, parse_ulonglong)
820
-
821
- #undef MAKE_PARSER
822
-
823
- // Generic constructor templates
824
- template <class T> Arg(T* p)
825
- : arg_(p), parser_(_RE2_MatchObject<T>::Parse) { }
826
- template <class T> Arg(T* p, Parser parser)
827
- : arg_(p), parser_(parser) { }
828
-
829
- // Parse the data
830
- bool Parse(const char* str, size_t n) const;
865
+ #if !defined(_MSC_VER)
866
+ template <typename T, CanParseFrom<T> = 0>
867
+ Arg(T* ptr) : arg_(ptr), parser_(DoParseFrom<T>) {}
868
+ #endif
831
869
 
832
- private:
833
- void* arg_;
834
- Parser parser_;
870
+ typedef bool (*Parser)(const char* str, size_t n, void* dest);
835
871
 
836
- static bool parse_null (const char* str, size_t n, void* dest);
837
- static bool parse_char (const char* str, size_t n, void* dest);
838
- static bool parse_schar (const char* str, size_t n, void* dest);
839
- static bool parse_uchar (const char* str, size_t n, void* dest);
840
- static bool parse_float (const char* str, size_t n, void* dest);
841
- static bool parse_double (const char* str, size_t n, void* dest);
842
- static bool parse_string (const char* str, size_t n, void* dest);
843
- static bool parse_stringpiece (const char* str, size_t n, void* dest);
844
-
845
- #define DECLARE_INTEGER_PARSER(name) \
846
- private: \
847
- static bool parse_##name(const char* str, size_t n, void* dest); \
848
- static bool parse_##name##_radix(const char* str, size_t n, void* dest, \
849
- int radix); \
850
- \
851
- public: \
852
- static bool parse_##name##_hex(const char* str, size_t n, void* dest); \
853
- static bool parse_##name##_octal(const char* str, size_t n, void* dest); \
854
- static bool parse_##name##_cradix(const char* str, size_t n, void* dest);
855
-
856
- DECLARE_INTEGER_PARSER(short)
857
- DECLARE_INTEGER_PARSER(ushort)
858
- DECLARE_INTEGER_PARSER(int)
859
- DECLARE_INTEGER_PARSER(uint)
860
- DECLARE_INTEGER_PARSER(long)
861
- DECLARE_INTEGER_PARSER(ulong)
862
- DECLARE_INTEGER_PARSER(longlong)
863
- DECLARE_INTEGER_PARSER(ulonglong)
864
-
865
- #undef DECLARE_INTEGER_PARSER
872
+ template <typename T>
873
+ Arg(T* ptr, Parser parser) : arg_(ptr), parser_(parser) {}
866
874
 
867
- };
875
+ bool Parse(const char* str, size_t n) const {
876
+ return (*parser_)(str, n, arg_);
877
+ }
868
878
 
869
- inline RE2::Arg::Arg() : arg_(NULL), parser_(parse_null) { }
870
- inline RE2::Arg::Arg(void* p) : arg_(p), parser_(parse_null) { }
871
- inline RE2::Arg::Arg(std::nullptr_t p) : arg_(p), parser_(parse_null) { }
879
+ private:
880
+ static bool DoNothing(const char* /*str*/, size_t /*n*/, void* /*dest*/) {
881
+ return true;
882
+ }
872
883
 
873
- inline bool RE2::Arg::Parse(const char* str, size_t n) const {
874
- return (*parser_)(str, n, arg_);
875
- }
884
+ template <typename T>
885
+ static bool DoParse3ary(const char* str, size_t n, void* dest) {
886
+ return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest));
887
+ }
876
888
 
877
- // This part of the parser, appropriate only for ints, deals with bases
878
- #define MAKE_INTEGER_PARSER(type, name) \
879
- inline RE2::Arg RE2::Hex(type* ptr) { \
880
- return RE2::Arg(ptr, RE2::Arg::parse_##name##_hex); \
881
- } \
882
- inline RE2::Arg RE2::Octal(type* ptr) { \
883
- return RE2::Arg(ptr, RE2::Arg::parse_##name##_octal); \
884
- } \
885
- inline RE2::Arg RE2::CRadix(type* ptr) { \
886
- return RE2::Arg(ptr, RE2::Arg::parse_##name##_cradix); \
889
+ template <typename T>
890
+ static bool DoParse4ary(const char* str, size_t n, void* dest) {
891
+ return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest), 10);
887
892
  }
888
893
 
889
- MAKE_INTEGER_PARSER(short, short)
890
- MAKE_INTEGER_PARSER(unsigned short, ushort)
891
- MAKE_INTEGER_PARSER(int, int)
892
- MAKE_INTEGER_PARSER(unsigned int, uint)
893
- MAKE_INTEGER_PARSER(long, long)
894
- MAKE_INTEGER_PARSER(unsigned long, ulong)
895
- MAKE_INTEGER_PARSER(long long, longlong)
896
- MAKE_INTEGER_PARSER(unsigned long long, ulonglong)
894
+ #if !defined(_MSC_VER)
895
+ template <typename T>
896
+ static bool DoParseFrom(const char* str, size_t n, void* dest) {
897
+ if (dest == NULL) return true;
898
+ return reinterpret_cast<T*>(dest)->ParseFrom(str, n);
899
+ }
900
+ #endif
897
901
 
898
- #undef MAKE_INTEGER_PARSER
902
+ void* arg_;
903
+ Parser parser_;
904
+ };
905
+
906
+ template <typename T>
907
+ inline RE2::Arg RE2::CRadix(T* ptr) {
908
+ return RE2::Arg(ptr, [](const char* str, size_t n, void* dest) -> bool {
909
+ return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest), 0);
910
+ });
911
+ }
912
+
913
+ template <typename T>
914
+ inline RE2::Arg RE2::Hex(T* ptr) {
915
+ return RE2::Arg(ptr, [](const char* str, size_t n, void* dest) -> bool {
916
+ return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest), 16);
917
+ });
918
+ }
899
919
 
900
- #ifndef SWIG
920
+ template <typename T>
921
+ inline RE2::Arg RE2::Octal(T* ptr) {
922
+ return RE2::Arg(ptr, [](const char* str, size_t n, void* dest) -> bool {
923
+ return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest), 8);
924
+ });
925
+ }
901
926
 
927
+ // Silence warnings about missing initializers for members of LazyRE2.
928
+ #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 6
929
+ #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
930
+ #endif
902
931
 
903
932
  // Helper for writing global or static RE2s safely.
904
933
  // Write
@@ -945,9 +974,56 @@ class LazyRE2 {
945
974
 
946
975
  void operator=(const LazyRE2&); // disallowed
947
976
  };
948
- #endif // SWIG
949
977
 
950
- } // namespace duckdb_re2
978
+ namespace hooks {
979
+
980
+ // Most platforms support thread_local. Older versions of iOS don't support
981
+ // thread_local, but for the sake of brevity, we lump together all versions
982
+ // of Apple platforms that aren't macOS. If an iOS application really needs
983
+ // the context pointee someday, we can get more specific then...
984
+ //
985
+ // As per https://github.com/google/re2/issues/325, thread_local support in
986
+ // MinGW seems to be buggy. (FWIW, Abseil folks also avoid it.)
987
+ #define RE2_HAVE_THREAD_LOCAL
988
+ #if (defined(__APPLE__) && !(defined(TARGET_OS_OSX) && TARGET_OS_OSX)) || defined(__MINGW32__)
989
+ #undef RE2_HAVE_THREAD_LOCAL
990
+ #endif
991
+
992
+ // A hook must not make any assumptions regarding the lifetime of the context
993
+ // pointee beyond the current invocation of the hook. Pointers and references
994
+ // obtained via the context pointee should be considered invalidated when the
995
+ // hook returns. Hence, any data about the context pointee (e.g. its pattern)
996
+ // would have to be copied in order for it to be kept for an indefinite time.
997
+ //
998
+ // A hook must not use RE2 for matching. Control flow reentering RE2::Match()
999
+ // could result in infinite mutual recursion. To discourage that possibility,
1000
+ // RE2 will not maintain the context pointer correctly when used in that way.
1001
+ #ifdef RE2_HAVE_THREAD_LOCAL
1002
+ extern thread_local const RE2* context;
1003
+ #endif
1004
+
1005
+ struct DFAStateCacheReset {
1006
+ int64_t state_budget;
1007
+ size_t state_cache_size;
1008
+ };
1009
+
1010
+ struct DFASearchFailure {
1011
+ // Nothing yet...
1012
+ };
1013
+
1014
+ #define DECLARE_HOOK(type) \
1015
+ using type##Callback = void(const type&); \
1016
+ void Set##type##Hook(type##Callback* cb); \
1017
+ type##Callback* Get##type##Hook();
1018
+
1019
+ DECLARE_HOOK(DFAStateCacheReset)
1020
+ DECLARE_HOOK(DFASearchFailure)
1021
+
1022
+ #undef DECLARE_HOOK
1023
+
1024
+ } // namespace hooks
1025
+
1026
+ } // namespace re2
951
1027
 
952
1028
  using duckdb_re2::RE2;
953
1029
  using duckdb_re2::LazyRE2;