Decouple dynamic_set_t from the table name collector and the serializer - #1561
Merged
Merged
Conversation
dynamic_set_t serializes each assignment as it is pushed back, and collects the tables named on its left-hand side at the same time. It held a table_name_collector for that, and push_back() was defined in the node header, which therefore included table_name_collector.h, forward-declared iterate_ast() and relied on serialize() being found later. - The node keeps only the collected table names, which clear() resets. - push_back() is defined out of class in implementations/dynamic_set_definitions.h, with a local collector, included through the interface_definitions.h manifest. - collect_table_names() of a dynamic SET returns its table names. A test checks that the table names are collected and cleared. TODO.md notes the remaining coupling: the node's type carries the serializer context, and it serializes eagerly. Co-Authored-By: Claude Opus 5.5
trueqbit
marked this pull request as draft
October 3, 2026 19:48
trueqbit
marked this pull request as ready for review
October 3, 2026 20:18
fnc12
approved these changes
Oct 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dynamic_set_t, the SET clause assembled at runtime withdynamic_set(storage), serializes each assignment as it is pushed back, since its assignments are of different types and can't be kept as a tuple. At the same time it collects the tables named on the assignments' left-hand side, which the serializer needs later for the UPDATE. Before this PR:table_name_collectoras a member;push_back()was defined inast/crud/set.h;table_name_collector.h, forward-declarediterate_ast(), and relied onserialize()being found later through ADL.With this PR:
dynamic_set_t::table_names, whichclear()resets.push_back()moves out of class intoimplementations/dynamic_set_definitions.h. It uses a local collector, and that header includes what its body uses:ast_iterator.h,table_name_collector.handstatement_serializer.h. The header is listed in theinterface_definitions.hmanifest, whose comment now mentions AST nodes alongside schema and storage classes.collect_table_names()of a dynamic SET returnsset.table_names.ast/crud/set.hno longer depends on the collector, the AST traversal or the serializer. That leavestable_name_collector.hused only by serialization code, which prepares for grouping the serializer's helpers later.TODO.mdnotes the remaining coupling: the node's type carries the serializer context, and it serializes eagerly. Keeping the assignments type-erased instead would let a dynamic SET be serialized and bound like any other node.Test plan
tests/statement_serializer_tests/ast/set.cppchecks thatpush_back()collects the table names andclear()resets them.tests/statement_serializer_tests/statements/update.cpp(UPDATE with a dynamic SET), andtests/storage_non_crud_tests.cpp.🤖 Generated with Claude Code